grthtrhthjhtyjytjytkergtrhtrjytjerhrfh4:24 29/09/2026. -------------------------------------------------------------------------- */ /** @file * @brief */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access this file directly"); } /** * NotificationTargetInfocom Class **/ class NotificationTargetInfocom extends NotificationTarget { function getEvents() { return array('alert' => __('Alarms on financial and administrative information')); } /** * Get all data needed for template processing * * @param $event * @param $options array **/ function getDatasForTemplate($event, $options=array()) { $events = $this->getAllEvents(); $this->datas['##infocom.entity##'] = Dropdown::getDropdownName('glpi_entities', $options['entities_id']); $this->datas['##infocom.action##'] = $events[$event]; foreach ($options['items'] as $id => $item) { $tmp = array(); if ($obj = getItemForItemtype($item['itemtype'])) { $tmp['##infocom.itemtype##'] = $obj->getTypeName(1); $tmp['##infocom.item##'] = $item['item_name']; $tmp['##infocom.expirationdate##'] = $item['warrantyexpiration']; $tmp['##infocom.url##'] = $this->formatURL($options['additionnaloption']['usertype'], $item['itemtype']."_". $item['items_id']."_Infocom"); } $this->datas['infocoms'][] = $tmp; } $this->getTags(); foreach ($this->tag_descriptions[NotificationTarget::TAG_LANGUAGE] as $tag => $values) { if (!isset($this->datas[$tag])) { $this->datas[$tag] = $values['label']; } } } function getTags() { $tags = array('infocom.action' => _n('Event', 'Events', 1), 'infocom.itemtype' => __('Item type'), 'infocom.item' => __('Associated item'), 'infocom.expirationdate' => __('Expiration date'), 'infocom.entity' => __('Entity')); foreach ($tags as $tag => $label) { $this->addTagToList(array('tag' => $tag, 'label' => $label, 'value' => true)); } $this->addTagToList(array('tag' => 'items', 'label' => __('Device list'), 'value' => false, 'foreach' => true)); asort($this->tag_descriptions); } } ?>