function getDatasForTemplate($event, $options = array()) { $this->datas['##consumable.entity##'] = Dropdown::getDropdownName('glpi_entities', $options['entities_id']); $this->datas['##lang.consumable.entity##'] = __('Entity'); $this->datas['##consumable.entity##'] = Dropdown::getDropdownName('glpi_entities', $options['entities_id']); $this->datas['##lang.consumable.entity##'] = __('Entity'); switch ($event) { case self::CONSUMABLE_REQUEST: $this->datas['##consumable.action##'] = __('Consumable request', 'consumables'); break; case self::CONSUMABLE_RESPONSE: $this->datas['##consumable.action##'] = __('Consumable validation', 'consumables'); break; } // Consumable request $this->datas['##lang.consumablerequest.consumable##'] = _n('Consumable', 'Consumables', 1); $this->datas['##lang.consumablerequest.consumabletype##'] = _n('Consumable type', 'Consumable types', 1); $this->datas['##lang.consumablerequest.request_date##'] = __('Request date'); $this->datas['##lang.consumablerequest.requester##'] = __('Requester'); $this->datas['##lang.consumablerequest.status##'] = __('Status'); $this->datas['##lang.consumablerequest.number##'] = __('Number of used consumables'); $this->datas['##lang.consumablerequest.validator##'] = __('Approver'); $this->datas['##lang.consumablerequest.comment##'] = __('Comments'); $consumable = $options['consumablerequest']; $this->datas['##consumablerequest.consumable##'] = Dropdown::getDropdownName(ConsumableItem::getTable(), $consumable['consumables_id']); $this->datas['##consumablerequest.consumabletype##'] = Dropdown::getDropdownName(ConsumableItemType::getTable(), $consumable['consumableitemtypes_id']); $this->datas['##consumablerequest.request_date##'] = Html::convDateTime($consumable['date_mod']); $this->datas['##consumablerequest.end_date##'] = Html::convDateTime($consumable['end_date']); $this->datas['##consumablerequest.requester##'] = Html::clean(getUserName($consumable['requesters_id'])); $this->datas['##consumablerequest.validator##'] = Html::clean(getUserName($consumable['validators_id'])); $this->datas['##consumablerequest.number##'] = $consumable['number']; $this->datas['##consumablerequest.status##'] = CommonITILValidation::getStatus($consumable['status']); if (isset($options['comment'])) { $this->datas['##consumablerequest.comment##'] = Html::clean($options['comment']); } }