You are not logged in.
Pages: 1
I would like to create a new ticket rule when I associate ticket category whit task category. How can I do it?!
Offline
It's not possible because ticket rules are played at the creation of the ticket and task category is affected after the creation
CentOS 6.5 - CentOS 7.x
PHP 5.6 - PHP 7.x - MySQL 5.6 - MariaDB 10.2 + APC + oOPcache
GLPI from 0.72 to dev version
Certifiée ITIL (ITV2F, ITILF, ITILOSA)
Offline
Ok, I resolved the problem temporarily but I don't know how's is the correct solution.
Fist I subscribe the method getAdditionalFields from class TaskCategory to create the field "Associated" hows a lang is $LANG['setup'][76]="Associated with";(english) and $LANG['setup'][76]="Associado a"(portuguese).
subscribe method:
function getAdditionalFields() {
global $LANG;
return array(array('name' => 'ticketcategories_id',//receives the category of the ticket;
'label' => $LANG['setup'][76],
'type' => 'dropdownValue',
'list' => true),
array('name' => $this->getForeignKeyField(),
'label' => $LANG['setup'][75],
'type' => 'parent',
'list' => false));
}
Every time hows create a task category I'll have to associate a task category with a ticket category. Makes no sense set a task hows a category is not associated. For example if I have a Catalog category and a user create a Incident task? Thus when I open a new task I listed only the task categories associate a ticket category. For this I modified the structure of the dropdown.
In a method show() of the dropdown.class.php:
//if I have set ticketcategories_id I include in array of parameters;
if(isset ($params["ticketcategories_id"]) && $params["ticketcategories_id"] >= 0) {
$param = array_merge($param, array('ticketcategories_id' => $params["ticketcategories_id"]));
}
$default="<select name='".$params['name']."' id='dropdown_".$params['name'].$params['rand']."'>";
$default.="<option value='".$params['value']."'>$name</option></select>";
ajaxDropdown($use_ajax,"/ajax/dropdownValue.php",$param,$default,$params['rand']);
In method show of TicketTask.class.php when I create a dropdown:
Dropdown::show('TaskCategory', array('ticketcategories_id' => $ticket->fields["ticketcategories_id"]));
In parameter option I step a id of the ticket category;
In dropdwonValue.php I created a new restriction in select to get only task categories associated:
if(isset ($_POST["ticketcategories_id"])) {
$where .="AND ticketcategories_id =".$_POST["ticketcategories_id"];
}
I would like to know if I resolved correctly this problem;
Offline
I forgot! I create a new column ticketcategories_id in the table taskcategories.
Offline
Pages: 1