Skip to content

Commit b9bebf9

Browse files
committed
Merge branch 'release/2.2.2'
2 parents 26d7087 + 1d9c795 commit b9bebf9

File tree

13 files changed

+223
-357
lines changed

13 files changed

+223
-357
lines changed

composer.lock

Lines changed: 118 additions & 261 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

inc/sccm.class.php

Lines changed: 50 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -47,48 +47,7 @@ function getDevices($where = 0, $limit = 99999999) {
4747
die;
4848
}
4949

50-
$query = "SELECT csd.Description00 as \"CSD-Description\",
51-
csd.Domain00 as \"CSD-Domain\",
52-
csd.Manufacturer00 as \"CSD-Manufacturer\",
53-
csd.Model00 as \"CSD-Model\",
54-
csd.Roles00 as \"CSD-Roles\",
55-
csd.SystemType00 as \"CSD-SystemType\",
56-
csd.UserName00 as \"CSD-UserName\",
57-
csd.MachineID as \"CSD-MachineID\",
58-
csd.TimeKey as \"CSD-TimeKey\",
59-
md.SystemName00 as \"MD-SystemName\",
60-
osd.BuildNumber00 as \"OSD-BuildNumber\",
61-
osd.Caption00 as \"OSD-Caption\",
62-
osd.CSDVersion00 as \"OSD-CSDVersion\",
63-
osd.BootDevice00 as \"OSD-BootDevice\",
64-
osd.InstallDate00 as \"OSD-InstallDate\",
65-
osd.LastBootUpTime00 as \"OSD-LastBootUpTime\",
66-
osd.Manufacturer00 as \"OSD-Manufacturer\",
67-
osd.Name00 as \"OSD-Name\",
68-
osd.Organization00 as \"OSD-Organization\",
69-
osd.RegisteredUser00 as \"OSD-RegisteredUser\",
70-
osd.TotalVirtualMemorySize00 as \"OSD-TotalVirtualMemory\",
71-
osd.TotalVisibleMemorySize00 as \"OSD-TotalVisibleMemory\",
72-
osd.Version00 as \"OSD-Version\",
73-
pbd.SerialNumber00 as \"PBD-SerialNumber\",
74-
pbd.ReleaseDate00 as \"PBD-ReleaseDate\",
75-
pbd.Name00 as \"PBD-Name\",
76-
pbd.SMBIOSBIOSVersion00 as \"PBD-BiosVersion\",
77-
pbd.Version00 as \"PBD-Version\",
78-
pbd.Manufacturer00 as \"PBD-Manufacturer\",
79-
sdi.User_Name0 as \"SDI-UserName\",
80-
sd.SMSID0 as \"SD-UUID\",
81-
sd.SystemRole0 as \"SD-SystemRole\",
82-
VrS.User_Name0 as \"VrS-UserName\"
83-
FROM Computer_System_DATA csd
84-
LEFT JOIN Motherboard_DATA md ON csd.MachineID = md.MachineID
85-
LEFT JOIN Operating_System_DATA osd ON csd.MachineID = osd.MachineID
86-
LEFT JOIN PC_BIOS_DATA pbd ON csd.MachineID = pbd.MachineID
87-
LEFT JOIN System_DISC sdi ON csd.MachineID = sdi.ItemKey
88-
LEFT JOIN System_DATA sd ON csd.MachineID = sd.MachineID
89-
INNER JOIN v_R_System VrS ON csd.MachineID = VrS.ResourceID
90-
WHERE csd.MachineID is not null and csd.MachineID != ''
91-
";
50+
$query = self::getcomputerQuery();
9251

9352
if ($where!=0) {
9453
$query.= " WHERE csd.MachineID = '" . $where . "'";
@@ -563,6 +522,50 @@ static function executeCollect($task) {
563522
return $retcode;
564523
}
565524

525+
static function getcomputerQuery() {
526+
return "SELECT csd.Description00 as \"CSD-Description\",
527+
csd.Domain00 as \"CSD-Domain\",
528+
csd.Manufacturer00 as \"CSD-Manufacturer\",
529+
csd.Model00 as \"CSD-Model\",
530+
csd.Roles00 as \"CSD-Roles\",
531+
csd.SystemType00 as \"CSD-SystemType\",
532+
csd.UserName00 as \"CSD-UserName\",
533+
csd.MachineID as \"CSD-MachineID\",
534+
csd.TimeKey as \"CSD-TimeKey\",
535+
md.SystemName00 as \"MD-SystemName\",
536+
osd.BuildNumber00 as \"OSD-BuildNumber\",
537+
osd.Caption00 as \"OSD-Caption\",
538+
osd.CSDVersion00 as \"OSD-CSDVersion\",
539+
osd.BootDevice00 as \"OSD-BootDevice\",
540+
osd.InstallDate00 as \"OSD-InstallDate\",
541+
osd.LastBootUpTime00 as \"OSD-LastBootUpTime\",
542+
osd.Manufacturer00 as \"OSD-Manufacturer\",
543+
osd.Name00 as \"OSD-Name\",
544+
osd.Organization00 as \"OSD-Organization\",
545+
osd.RegisteredUser00 as \"OSD-RegisteredUser\",
546+
osd.TotalVirtualMemorySize00 as \"OSD-TotalVirtualMemory\",
547+
osd.TotalVisibleMemorySize00 as \"OSD-TotalVisibleMemory\",
548+
osd.Version00 as \"OSD-Version\",
549+
pbd.SerialNumber00 as \"PBD-SerialNumber\",
550+
pbd.ReleaseDate00 as \"PBD-ReleaseDate\",
551+
pbd.Name00 as \"PBD-Name\",
552+
pbd.SMBIOSBIOSVersion00 as \"PBD-BiosVersion\",
553+
pbd.Version00 as \"PBD-Version\",
554+
pbd.Manufacturer00 as \"PBD-Manufacturer\",
555+
sdi.User_Name0 as \"SDI-UserName\",
556+
sd.SMSID0 as \"SD-UUID\",
557+
sd.SystemRole0 as \"SD-SystemRole\",
558+
VrS.User_Name0 as \"VrS-UserName\"
559+
FROM Computer_System_DATA csd
560+
LEFT JOIN Motherboard_DATA md ON csd.MachineID = md.MachineID
561+
LEFT JOIN Operating_System_DATA osd ON csd.MachineID = osd.MachineID
562+
LEFT JOIN PC_BIOS_DATA pbd ON csd.MachineID = pbd.MachineID
563+
LEFT JOIN System_DISC sdi ON csd.MachineID = sdi.ItemKey
564+
LEFT JOIN System_DATA sd ON csd.MachineID = sd.MachineID
565+
INNER JOIN v_R_System VrS ON csd.MachineID = VrS.ResourceID
566+
WHERE csd.MachineID is not null and csd.MachineID != ''";
567+
}
568+
566569

567570
static function executePush($task) {
568571

@@ -574,14 +577,15 @@ static function executePush($task) {
574577

575578
if ($PluginSccmConfig->getField('active_sync') == 1) {
576579
if ($res) {
577-
$query = "SELECT MachineID FROM Computer_System_DATA WHERE MachineID is not null and MachineID != ''";
580+
581+
$query = self::getcomputerQuery();
578582
$result = $PluginSccmSccmdb->exec_query($query);
579583

580584
$tab = [];
581585

582586
while ($tab = sqlsrv_fetch_array($result, SQLSRV_FETCH_ASSOC)) {
583587

584-
$REP_XML = realpath(GLPI_PLUGIN_DOC_DIR.'/sccm/xml/'.$tab['MachineID'].'.ocs');
588+
$REP_XML = realpath(GLPI_PLUGIN_DOC_DIR.'/sccm/xml/'.$tab['CSD-MachineID'].'.ocs');
585589

586590
if ($REP_XML === false) {
587591
Toolbox::logInFile('sccm', "There is a problem with the path, realpath function return false.\nPath : ".$REP_XML."\n", true);
@@ -627,11 +631,11 @@ static function executePush($task) {
627631
$header_size = curl_getinfo($ch, CURLINFO_HEADER_SIZE);
628632
$body = substr($ch_result, $header_size);
629633

630-
Toolbox::logInFile('sccm', "Push KO - ".$tab['MachineID']." -> STATUS CODE : ".$httpcode." \n", true);
634+
Toolbox::logInFile('sccm', "Push KO - ".$tab['CSD-MachineID']." -> STATUS CODE : ".$httpcode." \n", true);
631635
Toolbox::logInFile('sccm', "ERROR RETURNED : ".$body." \n", true);
632636
} else {
633637
$task->addVolume(1);
634-
Toolbox::logInFile('sccm', "Push OK - ".$tab['MachineID']." \n", true);
638+
Toolbox::logInFile('sccm', "Push OK - ".$tab['CSD-MachineID']." \n", true);
635639
}
636640

637641
}

locales/cs_CZ.po

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ msgid ""
1111
msgstr ""
1212
"Project-Id-Version: PACKAGE VERSION\n"
1313
"Report-Msgid-Bugs-To: \n"
14-
"POT-Creation-Date: 2020-08-24 08:50+0000\n"
14+
"POT-Creation-Date: 2020-10-27 15:27+0000\n"
1515
"PO-Revision-Date: 2018-08-21 14:04+0000\n"
1616
"Last-Translator: Pavel Borecki <pavel.borecki@gmail.com>, 2018\n"
1717
"Language-Team: Czech (Czech Republic) (https://www.transifex.com/teclib/teams/28042/cs_CZ/)\n"
@@ -41,27 +41,27 @@ msgstr "SCCM"
4141
msgid "Please, read the documentation before using that."
4242
msgstr "Před použitím si přečtete dokumentaci."
4343

44-
#: inc/sccm.class.php:504
44+
#: inc/sccm.class.php:463
4545
msgid "Interface - SCCMCollect"
4646
msgstr "Rozhraní – SCCMCollect"
4747

48-
#: inc/sccm.class.php:507
48+
#: inc/sccm.class.php:466
4949
msgid "Interface - SCCMPush"
5050
msgstr "Rozhraní – SCCMPush"
5151

52-
#: inc/sccm.class.php:560
52+
#: inc/sccm.class.php:519
5353
msgid "Collect is disabled by configuration."
5454
msgstr "Shromažďování je vypnuté nastavením."
5555

56-
#: inc/sccm.class.php:648
56+
#: inc/sccm.class.php:652
5757
msgid "Push is disabled by configuration."
5858
msgstr "Odesílání je vypnuté nastavením."
5959

6060
#: inc/menu.class.php:29 inc/menu.class.php:33
6161
msgid "SCCM Connector"
6262
msgstr "Napojení na SCCM"
6363

64-
#: inc/config.class.php:51 setup.php:58
64+
#: inc/config.class.php:51 setup.php:61
6565
msgid "Interface - SCCM"
6666
msgstr "Rozhraní – SCCM"
6767

locales/en_GB.mo

0 Bytes
Binary file not shown.

locales/en_GB.po

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ msgid ""
77
msgstr ""
88
"Project-Id-Version: PACKAGE VERSION\n"
99
"Report-Msgid-Bugs-To: \n"
10-
"POT-Creation-Date: 2020-08-24 08:50+0000\n"
11-
"PO-Revision-Date: 2020-08-24 08:50+0000\n"
10+
"POT-Creation-Date: 2020-10-27 15:27+0000\n"
11+
"PO-Revision-Date: 2020-10-27 15:27+0000\n"
1212
"Last-Translator: Automatically generated\n"
1313
"Language-Team: none\n"
1414
"Language: en_GB\n"
@@ -37,27 +37,27 @@ msgstr "SCCM"
3737
msgid "Please, read the documentation before using that."
3838
msgstr "Please, read the documentation before using that."
3939

40-
#: inc/sccm.class.php:504
40+
#: inc/sccm.class.php:463
4141
msgid "Interface - SCCMCollect"
4242
msgstr "Interface - SCCMCollect"
4343

44-
#: inc/sccm.class.php:507
44+
#: inc/sccm.class.php:466
4545
msgid "Interface - SCCMPush"
4646
msgstr "Interface - SCCMPush"
4747

48-
#: inc/sccm.class.php:560
48+
#: inc/sccm.class.php:519
4949
msgid "Collect is disabled by configuration."
5050
msgstr "Collect is disabled by configuration."
5151

52-
#: inc/sccm.class.php:648
52+
#: inc/sccm.class.php:652
5353
msgid "Push is disabled by configuration."
5454
msgstr "Push is disabled by configuration."
5555

5656
#: inc/menu.class.php:29 inc/menu.class.php:33
5757
msgid "SCCM Connector"
5858
msgstr "SCCM Connector"
5959

60-
#: inc/config.class.php:51 setup.php:58
60+
#: inc/config.class.php:51 setup.php:61
6161
msgid "Interface - SCCM"
6262
msgstr "Interface - SCCM"
6363

locales/fi_FI.po

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ msgid ""
1111
msgstr ""
1212
"Project-Id-Version: PACKAGE VERSION\n"
1313
"Report-Msgid-Bugs-To: \n"
14-
"POT-Creation-Date: 2020-08-24 08:50+0000\n"
14+
"POT-Creation-Date: 2020-10-27 15:27+0000\n"
1515
"PO-Revision-Date: 2018-08-21 14:04+0000\n"
1616
"Last-Translator: Markku Vepsä, 2018\n"
1717
"Language-Team: Finnish (Finland) (https://www.transifex.com/teclib/teams/28042/fi_FI/)\n"
@@ -41,27 +41,27 @@ msgstr "SCCM"
4141
msgid "Please, read the documentation before using that."
4242
msgstr "Lue käyttöohjeet ennen käyttöä."
4343

44-
#: inc/sccm.class.php:504
44+
#: inc/sccm.class.php:463
4545
msgid "Interface - SCCMCollect"
4646
msgstr "Liitäntä - SCCMCollect"
4747

48-
#: inc/sccm.class.php:507
48+
#: inc/sccm.class.php:466
4949
msgid "Interface - SCCMPush"
5050
msgstr "Liitäntä - SCCMPush"
5151

52-
#: inc/sccm.class.php:560
52+
#: inc/sccm.class.php:519
5353
msgid "Collect is disabled by configuration."
5454
msgstr "\"Collect\" on poistettu käytöstä asetusten perusteella."
5555

56-
#: inc/sccm.class.php:648
56+
#: inc/sccm.class.php:652
5757
msgid "Push is disabled by configuration."
5858
msgstr "\"Push\" on poistettu käytöstä asetusten perusteella."
5959

6060
#: inc/menu.class.php:29 inc/menu.class.php:33
6161
msgid "SCCM Connector"
6262
msgstr "SCCM-liitin"
6363

64-
#: inc/config.class.php:51 setup.php:58
64+
#: inc/config.class.php:51 setup.php:61
6565
msgid "Interface - SCCM"
6666
msgstr "Liitäntä - SCCM"
6767

locales/fr_FR.po

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ msgid ""
1111
msgstr ""
1212
"Project-Id-Version: PACKAGE VERSION\n"
1313
"Report-Msgid-Bugs-To: \n"
14-
"POT-Creation-Date: 2020-08-24 08:50+0000\n"
14+
"POT-Creation-Date: 2020-10-27 15:27+0000\n"
1515
"PO-Revision-Date: 2018-08-21 14:04+0000\n"
1616
"Last-Translator: Cédric Anne, 2018\n"
1717
"Language-Team: French (France) (https://www.transifex.com/teclib/teams/28042/fr_FR/)\n"
@@ -41,27 +41,27 @@ msgstr "SCCM"
4141
msgid "Please, read the documentation before using that."
4242
msgstr "Merci de lire la documentation avant d'utiliser cette URL."
4343

44-
#: inc/sccm.class.php:504
44+
#: inc/sccm.class.php:463
4545
msgid "Interface - SCCMCollect"
4646
msgstr "Interface - SCCMCollect"
4747

48-
#: inc/sccm.class.php:507
48+
#: inc/sccm.class.php:466
4949
msgid "Interface - SCCMPush"
5050
msgstr "Interface - SCCMPush"
5151

52-
#: inc/sccm.class.php:560
52+
#: inc/sccm.class.php:519
5353
msgid "Collect is disabled by configuration."
5454
msgstr "La collecte est désactivé par la configuration"
5555

56-
#: inc/sccm.class.php:648
56+
#: inc/sccm.class.php:652
5757
msgid "Push is disabled by configuration."
5858
msgstr "L'implantation est désactivé par la configuration"
5959

6060
#: inc/menu.class.php:29 inc/menu.class.php:33
6161
msgid "SCCM Connector"
6262
msgstr "Connecteur SCCM"
6363

64-
#: inc/config.class.php:51 setup.php:58
64+
#: inc/config.class.php:51 setup.php:61
6565
msgid "Interface - SCCM"
6666
msgstr "Interface - SCCM"
6767

locales/hr_HR.po

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ msgid ""
1111
msgstr ""
1212
"Project-Id-Version: PACKAGE VERSION\n"
1313
"Report-Msgid-Bugs-To: \n"
14-
"POT-Creation-Date: 2020-08-24 08:50+0000\n"
14+
"POT-Creation-Date: 2020-10-27 15:27+0000\n"
1515
"PO-Revision-Date: 2018-08-21 14:04+0000\n"
1616
"Last-Translator: milotype <mail@milotype.de>, 2020\n"
1717
"Language-Team: Croatian (Croatia) (https://www.transifex.com/teclib/teams/28042/hr_HR/)\n"
@@ -41,27 +41,27 @@ msgstr "SCCM"
4141
msgid "Please, read the documentation before using that."
4242
msgstr "Prije upotrebe pročitaj dokumentaciju."
4343

44-
#: inc/sccm.class.php:504
44+
#: inc/sccm.class.php:463
4545
msgid "Interface - SCCMCollect"
4646
msgstr "Sučelje – SCCMCollect (upit)"
4747

48-
#: inc/sccm.class.php:507
48+
#: inc/sccm.class.php:466
4949
msgid "Interface - SCCMPush"
5050
msgstr "Sučelje – SCCMPush (umetanje datoteka)"
5151

52-
#: inc/sccm.class.php:560
52+
#: inc/sccm.class.php:519
5353
msgid "Collect is disabled by configuration."
5454
msgstr "Slanje upita (collect) je deaktivirano u konfiguraciji."
5555

56-
#: inc/sccm.class.php:648
56+
#: inc/sccm.class.php:652
5757
msgid "Push is disabled by configuration."
5858
msgstr "Umetanje datoteka (push) je deaktivirano u konfiguraciji."
5959

6060
#: inc/menu.class.php:29 inc/menu.class.php:33
6161
msgid "SCCM Connector"
6262
msgstr "SCCM konektor"
6363

64-
#: inc/config.class.php:51 setup.php:58
64+
#: inc/config.class.php:51 setup.php:61
6565
msgid "Interface - SCCM"
6666
msgstr "Sučelje – SCCM"
6767

locales/it_IT.po

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ msgid ""
1111
msgstr ""
1212
"Project-Id-Version: PACKAGE VERSION\n"
1313
"Report-Msgid-Bugs-To: \n"
14-
"POT-Creation-Date: 2020-08-24 08:50+0000\n"
14+
"POT-Creation-Date: 2020-10-27 15:27+0000\n"
1515
"PO-Revision-Date: 2018-08-21 14:04+0000\n"
1616
"Last-Translator: Cédric Anne, 2019\n"
1717
"Language-Team: Italian (Italy) (https://www.transifex.com/teclib/teams/28042/it_IT/)\n"
@@ -41,27 +41,27 @@ msgstr "SCCM"
4141
msgid "Please, read the documentation before using that."
4242
msgstr "Per favore, leggi la documentazione prima di usarla."
4343

44-
#: inc/sccm.class.php:504
44+
#: inc/sccm.class.php:463
4545
msgid "Interface - SCCMCollect"
4646
msgstr "Interfaccia: SCCMCollect"
4747

48-
#: inc/sccm.class.php:507
48+
#: inc/sccm.class.php:466
4949
msgid "Interface - SCCMPush"
5050
msgstr "Interfaccia: SCCMPush"
5151

52-
#: inc/sccm.class.php:560
52+
#: inc/sccm.class.php:519
5353
msgid "Collect is disabled by configuration."
5454
msgstr "La raccolta è disabilitata dalla configurazione."
5555

56-
#: inc/sccm.class.php:648
56+
#: inc/sccm.class.php:652
5757
msgid "Push is disabled by configuration."
5858
msgstr "Push è disabilitato dalla configurazione."
5959

6060
#: inc/menu.class.php:29 inc/menu.class.php:33
6161
msgid "SCCM Connector"
6262
msgstr "Connettore SCCM"
6363

64-
#: inc/config.class.php:51 setup.php:58
64+
#: inc/config.class.php:51 setup.php:61
6565
msgid "Interface - SCCM"
6666
msgstr "Interfaccia - SCCM"
6767

0 commit comments

Comments
 (0)