/**
  * Do the specific massive actions
  *
  * @since version 0.84
  *
  * @param $input array of input datas
  *
  * @return an array of results (nbok, nbko, nbnoright counts)
  **/
 function doSpecificMassiveActions($input = array())
 {
     $res = array('ok' => 0, 'ko' => 0, 'noright' => 0);
     $criteria = new PluginTypologyTypologyCriteria();
     switch ($input['action']) {
         case "deleteAll":
             if ($input['itemtype'] == 'PluginTypologyTypologyCriteria') {
                 foreach ($input["item"] as $key => $val) {
                     if ($val == 1) {
                         if ($criteria->can($key, 'w')) {
                             if ($criteria->delete(array('id' => $key))) {
                                 $res['ok']++;
                             } else {
                                 $res['ko']++;
                             }
                         }
                     }
                 }
             }
             break;
         case "updateAll":
             if ($input['itemtype'] == 'PluginTypologyTypologyCriteria') {
                 foreach ($input["item"] as $key => $val) {
                     if ($val == 1) {
                         $values = array('id' => $key, 'is_active' => $input['is_active']);
                         if ($criteria->update($values)) {
                             $res['ok']++;
                         } else {
                             $res['ko']++;
                         }
                     }
                 }
             }
             break;
         default:
             return parent::doSpecificMassiveActions($input);
     }
     return $res;
 }