Project

General

Profile

Revision c60a37ae

IDc60a37aea7f8e4850850b4d56464b3cc662eed9c
Parent cdde5484
Child ad931b2e

Added by Francois POIROTTE about 7 years ago

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 <>
Reviewed-by: Francois POIROTTE <>

View differences:

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