/** * Cron for ticket's automatic close * * @param $task : CronTask object * * @return integer (0 : nothing done - 1 : done) **/ static function cronSlaTicket(CronTask $task) { global $DB; $tot = 0; $query = "SELECT *\n FROM `glpi_slalevels_tickets`\n WHERE `glpi_slalevels_tickets`.`date` < NOW()"; foreach ($DB->request($query) as $data) { $tot++; self::doLevelForTicket($data); } $task->setVolume($tot); return $tot > 0; }
/** * Cron for ticket's automatic close * * @param $task : CronTask object * * @return integer (0 : nothing done - 1 : done) **/ static function cronSlaTicket(CronTask $task) { global $DB; $tot = 0; $query = "SELECT `glpi_slalevels_tickets`.*, `glpi_slts`.`type` as type\n FROM `glpi_slalevels_tickets`\n LEFT JOIN `glpi_slalevels`\n ON (`glpi_slalevels_tickets`.`slalevels_id` = `glpi_slalevels`.`id`)\n LEFT JOIN `glpi_slts` ON (`glpi_slalevels`.`slts_id` = `glpi_slts`.`id`)\n WHERE `glpi_slalevels_tickets`.`date` < NOW()"; foreach ($DB->request($query) as $data) { $tot++; self::doLevelForTicket($data, $data['type']); } $task->setVolume($tot); return $tot > 0; }