Skip to content

Commit

Permalink
Merge pull request #1020 from OCSInventory-NG/release2.8
Browse files Browse the repository at this point in the history
Fix bug for release 2.8
  • Loading branch information
gillesdubois committed Sep 11, 2020
2 parents 1a8d19c + 56b56b2 commit 5670986
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 26 deletions.
4 changes: 2 additions & 2 deletions config/main_menu.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
<label>g(2)</label>
<url>ms_all_computers</url>
</menu-elem>
<menu-elem id="inventory">
<menu-elem id="ms_inventory">
<label>g(728)</label>
<url>ms_all_computers</url>
<url>ms_inventory</url>
<submenu>
<menu-elem id="ms_multi_search">
<label>g(9)</label>
Expand Down
4 changes: 4 additions & 0 deletions config/urls.xml
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,10 @@
<value>qrcode</value>
<directory>ms_computer</directory>
</url>
<url key="ms_inventory">
<value>inventory</value>
<directory>ms_inventory</directory>
</url>
<url key="ms_extension">
<value>extension</value>
<directory>ms_extension</directory>
Expand Down
1 change: 0 additions & 1 deletion files/update/7030.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

-- Create software_name table
CREATE TABLE IF NOT EXISTS `software_name` (
`ID` INTEGER NOT NULL AUTO_INCREMENT,
Expand Down
2 changes: 0 additions & 2 deletions files/update/7037.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

-- migrate software name
INSERT IGNORE INTO `software_name` (`NAME`)
SELECT DISTINCT `NAME`
Expand Down Expand Up @@ -39,4 +38,3 @@ DROP TABLE `softwares`;
-- add missing primary keys
ALTER TABLE `deleted_equiv` ADD `ID` INT NOT NULL AUTO_INCREMENT FIRST, ADD PRIMARY KEY (`ID`);
ALTER TABLE `devices` ADD `ID` INT NOT NULL AUTO_INCREMENT FIRST, ADD PRIMARY KEY (`ID`);

2 changes: 1 addition & 1 deletion plugins/computer_detail/cd_saas/cd_saas.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
}

$default_fields = array($l->g(49) => $l->g(49), $l->g(8104) => $l->g(8104), $l->g(8105) => $l->g(8105));
$queryDetails = "SELECT ";
$queryDetails = "SELECT DISTINCT ";
foreach ($list_fields as $lbl => $value) {
$queryDetails .= $value . ",";
}
Expand Down
38 changes: 19 additions & 19 deletions plugins/main_sections/ms_teledeploy/ms_tele_stats.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@
echo "</br></br></br>";

//count max values for stats
$sql_count = "SELECT COUNT(id) as nb
$sql_count = "SELECT COUNT(d.id) as nb
FROM devices d, download_enable e
WHERE e.fileid='%s'
AND e.id=d.ivalue
AND name='DOWNLOAD'
AND hardware_id NOT IN (SELECT id FROM hardware WHERE deviceid='_SYSTEMGROUP_' or deviceid='_DOWNLOADGROUP_')";
AND d.name='DOWNLOAD'
AND d.hardware_id NOT IN (SELECT id FROM hardware WHERE deviceid='_SYSTEMGROUP_' or deviceid='_DOWNLOADGROUP_')";
$arg = $protectedGet["stat"];
$rescount = mysql2_query_secure($sql_count, $_SESSION['OCS']["readServer"], $arg);
$row = mysqli_fetch_object($rescount);
Expand All @@ -70,33 +70,33 @@
require_once(FOOTER_HTML);
die();
}
$sqlStats = "SELECT COUNT(id) as nb, tvalue as txt
$sqlStats = "SELECT COUNT(d.id) as nb, d.tvalue as txt
FROM devices d, download_enable e
WHERE e.fileid='%s'
AND e.id=d.ivalue
AND name='DOWNLOAD'
AND hardware_id NOT IN (SELECT id FROM hardware WHERE deviceid='_SYSTEMGROUP_' or deviceid='_DOWNLOADGROUP_')
and tvalue not like '%s'
and tvalue not like '%s'
and tvalue is not null
group by tvalue
AND d.name='DOWNLOAD'
AND d.hardware_id NOT IN (SELECT id FROM hardware WHERE deviceid='_SYSTEMGROUP_' or deviceid='_DOWNLOADGROUP_')
and d.tvalue not like '%s'
and d.tvalue not like '%s'
and d.tvalue is not null
group by d.tvalue
union
SELECT COUNT(id) as nb, '%s'
SELECT COUNT(d.id) as nb, '%s'
FROM devices d, download_enable e
WHERE e.fileid='%s'
AND e.id=d.ivalue
AND name='DOWNLOAD'
AND hardware_id NOT IN (SELECT id FROM hardware WHERE deviceid='_SYSTEMGROUP_' or deviceid='_DOWNLOADGROUP_')
and (tvalue like '%s'
or tvalue like '%s')
AND d.name='DOWNLOAD'
AND d.hardware_id NOT IN (SELECT id FROM hardware WHERE deviceid='_SYSTEMGROUP_' or deviceid='_DOWNLOADGROUP_')
and (d.tvalue like '%s'
or d.tvalue like '%s')
union
SELECT COUNT(id) as nb, '%s'
SELECT COUNT(d.id) as nb, '%s'
FROM devices d, download_enable e
WHERE e.fileid='%s'
AND e.id=d.ivalue
AND name='DOWNLOAD'
AND hardware_id NOT IN (SELECT id FROM hardware WHERE deviceid='_SYSTEMGROUP_' or deviceid='_DOWNLOADGROUP_')
and tvalue is null";
AND d.name='DOWNLOAD'
AND d.hardware_id NOT IN (SELECT id FROM hardware WHERE deviceid='_SYSTEMGROUP_' or deviceid='_DOWNLOADGROUP_')
and d.tvalue is null";

$arg = array($arg, 'EXIT_CODE%', 'ERR%', 'ERRORS', $arg, 'EXIT_CODE%', 'ERR%', 'WAITING', $arg);
$resStats = mysql2_query_secure($sqlStats . " ORDER BY nb DESC", $_SESSION['OCS']["readServer"], $arg);
Expand Down
2 changes: 1 addition & 1 deletion var.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
/**
* GUI Version
*/
define('GUI_VER_SHOW', '2.7');
define('GUI_VER_SHOW', '2.8');
/**
* Default GUI language
*/
Expand Down

0 comments on commit 5670986

Please sign in to comment.