function getDatasForTemplate($event, $options = array())
{
global $CFG_GLPI;
$events = $this->getAllEvents();
$objettype = strtolower($this->obj->getType());
// Get datas from ITIL objects
if ($event != 'alertnotclosed') {
$this->datas = $this->getDatasForObject($this->obj, $options);
} else {
if (isset($options['entities_id']) && isset($options['items'])) {
$entity = new Entity();
if ($entity->getFromDB($options['entities_id'])) {
$this->datas["##{$objettype}.entity##"] = $entity->getField('completename');
$this->datas["##{$objettype}.shortentity##"] = $entity->getField('name');
}
if ($item = getItemForItemtype($objettype)) {
$objettypes = Toolbox::strtolower(getPlural($objettype));
$items = array();
foreach ($options['items'] as $object) {
$item->getFromDB($object['id']);
$tmp = $this->getDatasForObject($item, $options, true);
$this->datas[$objettypes][] = $tmp;
}
}
}
}
if ($event == 'validation' && isset($options['validation_status'])) {
$this->datas["##{$objettype}.action##"] = sprintf(__('%1$s - %2$s'), __('Approval'), TicketValidation::getStatus($options['validation_status']));
} else {
$this->datas["##{$objettype}.action##"] = $events[$event];
}
$this->getTags();
foreach ($this->tag_descriptions[parent::TAG_LANGUAGE] as $tag => $values) {
if (!isset($this->datas[$tag])) {
$this->datas[$tag] = $values['label'];
}
}
}