Esempio n. 1
0
 /**
  * @see CommonDBTM::doSpecificMassiveActions()
  **/
 function doSpecificMassiveActions($input = array())
 {
     $res = array('ok' => 0, 'ko' => 0, 'noright' => 0);
     switch ($input['action']) {
         case "connect":
         case "disconnect":
             $ci = new Computer_Item();
             return $ci->doSpecificMassiveActions($input);
         default:
             return parent::doSpecificMassiveActions($input);
     }
     return $res;
 }
Esempio n. 2
0
 /**
  * @see CommonDBTM::doSpecificMassiveActions()
  **/
 function doSpecificMassiveActions($input = array())
 {
     $res = array('ok' => 0, 'ko' => 0, 'noright' => 0);
     switch ($input['action']) {
         case "connect":
             $ci = new Computer_Item();
             return $ci->doSpecificMassiveActions($input);
         case "install":
             if (isset($input['softwareversions_id']) && $input['softwareversions_id'] > 0) {
                 $inst = new Computer_SoftwareVersion();
                 foreach ($input['item'] as $key => $val) {
                     if ($val == 1) {
                         $input2 = array('computers_id' => $key, 'softwareversions_id' => $input['softwareversions_id']);
                         if ($inst->can(-1, 'w', $input2)) {
                             if ($inst->add($input2)) {
                                 $res['ok']++;
                             } else {
                                 $res['ko']++;
                             }
                         } else {
                             $res['noright']++;
                         }
                     }
                 }
             } else {
                 $res['ko']++;
             }
             break;
         default:
             return parent::doSpecificMassiveActions($input);
     }
     return $res;
 }