/** * Get all data needed for template processing * * @param $event * @param $options array **/ function getDatasForTemplate($event, $options = array()) { $events = $this->getAllEvents(); $this->datas['##crontask.action##'] = $events[$event]; $cron = new Crontask(); foreach ($options['items'] as $id => $crontask) { $tmp = array(); $tmp['##crontask.name##'] = ''; if ($isplug = isPluginItemType($crontask["itemtype"])) { $tmp['##crontask.name##'] = $isplug["plugin"] . " - "; } $tmp['##crontask.name##'] .= $crontask['name']; $tmp['##crontask.description##'] = $cron->getDescription($id); $tmp['##crontask.url##'] = $this->formatURL($options['additionnaloption']['usertype'], "Crontask_" . $id); $this->datas['crontasks'][] = $tmp; } $this->getTags(); foreach ($this->tag_descriptions[NotificationTarget::TAG_LANGUAGE] as $tag => $values) { if (!isset($this->datas[$tag])) { $this->datas[$tag] = $values['label']; } } }
/** * Get all data needed for template processing * * @param $event * @param $options array **/ function getDatasForTemplate($event, $options = array()) { global $CFG_GLPI; $events = $this->getAllEvents(); $this->datas['##crontask.action##'] = $events[$event]; $cron = new Crontask(); foreach ($options['items'] as $id => $crontask) { $tmp = array(); $tmp['##crontask.name##'] = ''; if ($isplug = isPluginItemType($crontask["itemtype"])) { $tmp['##crontask.name##'] = $isplug["plugin"] . " - "; } $tmp['##crontask.name##'] .= $crontask['name']; $tmp['##crontask.description##'] = $cron->getDescription($id); $tmp['##crontask.url##'] = urldecode($CFG_GLPI["url_base"] . "/index.php?redirect=crontask_" . $id); $this->datas['crontasks'][] = $tmp; } $this->getTags(); foreach ($this->tag_descriptions[NotificationTarget::TAG_LANGUAGE] as $tag => $values) { if (!isset($this->datas[$tag])) { $this->datas[$tag] = $values['label']; } } }