Revision c60a37ae
Corrections pour la sup. des logiciels prédéfinis
Change-Id: I393c3ffc20c8ed01602b302e0fad88db45983a62
Reviewed-on: https://vigilo-dev.si.c-s.fr/review/2378
Tested-by: Build system <qa@vigilo-dev.si.c-s.fr>
Reviewed-by: Francois POIROTTE <francois.poirotte@c-s.fr>
src/plugins/vigilo/vigilo_hooks.php | ||
---|---|---|
133 | 133 |
|
134 | 134 |
public function refreshSoftware($software) |
135 | 135 |
{ |
136 |
$softwareVer = new SoftwareVersion(); |
|
137 |
$idSoftwareVersion = $softwareVer->find('softwares_id=' . $software->getID());
|
|
138 |
foreach ($idSoftwareVersion as $idVersion) {
|
|
139 |
if (!$idVersion['id']) {
|
|
136 |
$softwareVer = new SoftwareVersion();
|
|
137 |
$versions = $softwareVer->find('softwares_id=' . $software->getID());
|
|
138 |
foreach ($versions as $version) {
|
|
139 |
if (!$version['id']) {
|
|
140 | 140 |
continue; |
141 | 141 |
} |
142 | 142 |
|
143 |
$computerVer = new Computer_SoftwareVersion(); |
|
144 |
$goodField = 'softwareversions_id=' . $idVersion['id']; |
|
145 |
$updateComp = $computerVer->find($goodField); |
|
146 |
|
|
147 |
foreach ($updateComp as $idComputer) { |
|
148 |
if (-1 === $idComputer['computers_id']) { |
|
143 |
$installations = new Computer_SoftwareVersion(); |
|
144 |
$filter = 'softwareversions_id=' . $version['id']; |
|
145 |
$installations = $installations->find($filter); |
|
146 |
foreach ($installations as $installation) { |
|
147 |
if (-1 === $installation['computers_id']) { |
|
149 | 148 |
continue; |
150 | 149 |
} |
151 | 150 |
|
152 | 151 |
$computer = new Computer(); |
153 |
$computer->getFromDB($idComputer['computers_id']);
|
|
152 |
$computer->getFromDB($installation['computers_id']);
|
|
154 | 153 |
$this->update($computer); |
155 | 154 |
} |
156 | 155 |
} |
Also available in: Unified diff