function getTags()
{
$itemtype = $this->obj->getType();
$objettype = strtolower($itemtype);
//Locales
$tags = array($objettype . '.id' => __('ID'), $objettype . '.title' => __('Title'), $objettype . '.url' => __('URL'), $objettype . '.category' => __('Category'), $objettype . '.content' => __('Description'), $objettype . '.description' => sprintf(__('%1$s: %2$s'), __('Ticket'), __('Description')), $objettype . '.status' => __('Status'), $objettype . '.urgency' => __('Urgency'), $objettype . '.impact' => __('Impact'), $objettype . '.priority' => __('Priority'), $objettype . '.time' => __('Total duration'), $objettype . '.creationdate' => __('Opening date'), $objettype . '.closedate' => __('Closing date'), $objettype . '.solvedate' => __('Date of solving'), $objettype . '.duedate' => __('Time to resolve'), $objettype . '.authors' => _n('Requester', 'Requesters', Session::getPluralNumber()), 'author.id' => __('Requester ID'), 'author.name' => __('Requester'), 'author.location' => __('Requester location'), 'author.mobile' => __('Mobile phone'), 'author.phone' => __('Phone'), 'author.phone2' => __('Phone 2'), 'author.email' => _n('Email', 'Emails', 1), 'author.title' => _x('person', 'Title'), 'author.category' => __('Category'), $objettype . '.openbyuser' => __('Writer'), $objettype . '.lastupdater' => __('Last updater'), $objettype . '.assigntousers' => __('Assigned to technicians'), $objettype . '.assigntosupplier' => __('Assigned to a supplier'), $objettype . '.groups' => _n('Requester group', 'Requester groups', Session::getPluralNumber()), $objettype . '.observergroups' => _n('Watcher group', 'Watcher groups', Session::getPluralNumber()), $objettype . '.assigntogroups' => __('Assigned to groups'), $objettype . '.solution.type' => __('Solution type'), $objettype . '.solution.description' => _n('Solution', 'Solutions', 1), $objettype . '.observerusers' => _n('Watcher', 'Watchers', Session::getPluralNumber()), $objettype . '.action' => _n('Event', 'Events', 1), $objettype . '.numberofunresolved' => __('Number of unresolved items'), $objettype . '.numberofdocuments' => _x('quantity', 'Number of documents'), $objettype . '.costtime' => __('Time cost'), $objettype . '.costfixed' => __('Fixed cost'), $objettype . '.costmaterial' => __('Material cost'), $objettype . '.totalcost' => __('Total cost'), $objettype . '.numberofcosts' => __('Number of costs'), 'cost.name' => sprintf(__('%1$s: %2$s'), __('Cost'), __('Name')), 'cost.comment' => sprintf(__('%1$s: %2$s'), __('Cost'), __('Comments')), 'cost.datebegin' => sprintf(__('%1$s: %2$s'), __('Cost'), __('Begin date')), 'cost.dateend' => sprintf(__('%1$s: %2$s'), __('Cost'), __('End date')), 'cost.time' => sprintf(__('%1$s: %2$s'), __('Cost'), __('Duration')), 'cost.costtime' => sprintf(__('%1$s: %2$s'), __('Cost'), __('Time cost')), 'cost.costfixed' => sprintf(__('%1$s: %2$s'), __('Cost'), __('Fixed cost')), 'cost.costmaterial' => sprintf(__('%1$s: %2$s'), __('Cost'), __('Material cost')), 'cost.totalcost' => sprintf(__('%1$s: %2$s'), __('Cost'), __('Total cost')), 'cost.budget' => sprintf(__('%1$s: %2$s'), __('Cost'), __('Budget')), 'task.author' => __('Writer'), 'task.isprivate' => __('Private'), 'task.date' => __('Opening date'), 'task.description' => __('Description'), 'task.categoryid' => __('Category id'), 'task.category' => __('Category'), 'task.categorycomment' => __('Category comment'), 'task.time' => __('Total duration'), 'task.user' => __('User assigned to task'), 'task.group' => __('Group assigned to task'), 'task.begin' => __('Start date'), 'task.end' => __('End date'), 'task.status' => __('Status'), $objettype . '.numberoftasks' => _x('quantity', 'Number of tasks'));
foreach ($tags as $tag => $label) {
$this->addTagToList(array('tag' => $tag, 'label' => $label, 'value' => true, 'events' => parent::TAG_FOR_ALL_EVENTS));
}
//Foreach global tags
$tags = array('log' => __('Historical'), 'tasks' => _n('Task', 'Tasks', Session::getPluralNumber()), 'costs' => _n('Cost', 'Costs', Session::getPluralNumber()), 'authors' => _n('Requester', 'Requesters', Session::getPluralNumber()));
foreach ($tags as $tag => $label) {
$this->addTagToList(array('tag' => $tag, 'label' => $label, 'value' => false, 'foreach' => true));
}
//Tags with just lang
$tags = array($objettype . '.days' => _n('Day', 'Days', Session::getPluralNumber()), $objettype . '.attribution' => __('Assigned to'), $objettype . '.entity' => __('Entity'), $objettype . '.nocategoryassigned' => __('No defined category'), $objettype . '.log' => __('Historical'), $objettype . '.tasks' => _n('Task', 'Tasks', Session::getPluralNumber()), $objettype . '.costs' => _n('Cost', 'Costs', Session::getPluralNumber()));
foreach ($tags as $tag => $label) {
$this->addTagToList(array('tag' => $tag, 'label' => $label, 'value' => false, 'lang' => true));
}
//Tags without lang
$tags = array($objettype . '.urlapprove' => __('Web link to approval the solution'), $objettype . '.entity' => sprintf(__('%1$s (%2$s)'), __('Entity'), __('Complete name')), $objettype . '.shortentity' => sprintf(__('%1$s (%2$s)'), __('Entity'), __('Name')), $objettype . '.numberoflogs' => sprintf(__('%1$s: %2$s'), __('Historical'), _x('quantity', 'Number of items')), $objettype . '.log.date' => sprintf(__('%1$s: %2$s'), __('Historical'), __('Date')), $objettype . '.log.user' => sprintf(__('%1$s: %2$s'), __('Historical'), __('User')), $objettype . '.log.field' => sprintf(__('%1$s: %2$s'), __('Historical'), __('Field')), $objettype . '.log.content' => sprintf(__('%1$s: %2$s'), __('Historical'), _x('name', 'Update')), 'document.url' => sprintf(__('%1$s: %2$s'), __('Document'), __('URL')), 'document.downloadurl' => sprintf(__('%1$s: %2$s'), __('Document'), __('Download URL')), 'document.heading' => sprintf(__('%1$s: %2$s'), __('Document'), __('Heading')), 'document.id' => sprintf(__('%1$s: %2$s'), __('Document'), __('ID')), 'document.filename' => sprintf(__('%1$s: %2$s'), __('Document'), __('File')), 'document.weblink' => sprintf(__('%1$s: %2$s'), __('Document'), __('Web Link')), 'document.name' => sprintf(__('%1$s: %2$s'), __('Document'), __('Name')), $objettype . '.urldocument' => sprintf(__('%1$s: %2$s'), _n('Document', 'Documents', Session::getPluralNumber()), __('URL')));
foreach ($tags as $tag => $label) {
$this->addTagToList(array('tag' => $tag, 'label' => $label, 'value' => true, 'lang' => false));
}
//Tickets with a fixed set of values
$status = $this->obj->getAllStatusArray(false);
$allowed_ticket = array();
foreach ($status as $key => $value) {
$allowed_ticket[] = $key;
}
$tags = array($objettype . '.storestatus' => array('text' => __('Status value in database'), 'allowed_values' => $allowed_ticket));
foreach ($tags as $tag => $label) {
$this->addTagToList(array('tag' => $tag, 'label' => $label['text'], 'value' => true, 'lang' => false, 'allowed_values' => $label['allowed_values']));
}
}