getAllStatusArray() static public method

get the Ticket status list
static public getAllStatusArray ( $withmetaforsearch = false ) : an
$withmetaforsearch boolean (false by default)
return an array
 /**
  * @param $report
  * @param $name      (default 'status')
  * @param $label     (default '')
  * @param $option    (default 1)
  **/
 function __construct($report, $name = 'status', $label = '', $option = 1)
 {
     if (is_array($option)) {
         foreach ($option as $opt) {
             $tab[$opt] = Ticket::getStatus($opt);
         }
     } else {
         if ($option == 1) {
             $tab = Ticket::getAllStatusArray(true);
         } else {
             $tab = Ticket::getAllStatusArray(false);
         }
     }
     // Parent is PluginReportsArrayCriteria
     parent::__construct($report, $name, $label ? $label : _n('Status', 'Statuses', 1), $tab);
 }
コード例 #2
0
 function __construct($name, $title, $map = array(), $options = array())
 {
     parent::__construct($name, $title, $options);
     if (count($map)) {
         $this->map = $map;
     } else {
         switch ($name) {
             case 'status':
                 $this->map = Ticket::getAllStatusArray();
                 break;
             case 'impact':
                 $this->map = getImpactLabelsArray();
                 break;
             case 'urgency':
                 $this->map = getUrgencyLabelsArray();
                 break;
             case 'priority':
                 $this->map = getPriorityLabelsArray();
                 break;
             default:
                 $this->map = array();
         }
     }
 }
コード例 #3
0
ファイル: profile.class.php プロジェクト: glpi-project/glpi
 /**
  * Display the matrix of the elements lifecycle of the elements
  *
  * @since version 0.85
  *
  * @param $title          the kind of lifecycle
  * @param $html_field     field that is sent to _POST
  * @param $db_field       field inside the DB (to get current state)
  * @param $canedit        can we edit the elements ?
  *
  * @return nothing
  **/
 function displayLifeCycleMatrixTicketHelpdesk($title, $html_field, $db_field, $canedit)
 {
     $columns = array();
     $rows = array();
     $statuses = array();
     $allstatuses = Ticket::getAllStatusArray();
     foreach (array(Ticket::INCOMING, Ticket::SOLVED, Ticket::CLOSED) as $val) {
         $statuses[$val] = $allstatuses[$val];
     }
     $alwaysok = array(Ticket::INCOMING => array(), Ticket::SOLVED => array(Ticket::INCOMING), Ticket::CLOSED => array());
     $allowactions = array(Ticket::INCOMING => array(), Ticket::SOLVED => array(Ticket::CLOSED), Ticket::CLOSED => array(Ticket::CLOSED, Ticket::INCOMING));
     foreach ($statuses as $index_1 => $status_1) {
         $columns[$index_1] = $status_1;
         $row = array('label' => $status_1, 'columns' => array());
         foreach ($statuses as $index_2 => $status_2) {
             $content = array('checked' => true);
             if (isset($this->fields[$db_field][$index_1][$index_2])) {
                 $content['checked'] = $this->fields[$db_field][$index_1][$index_2];
             }
             if (in_array($index_2, $alwaysok[$index_1])) {
                 $content['checked'] = true;
             }
             if ($index_1 == $index_2 || !$canedit || !in_array($index_2, $allowactions[$index_1])) {
                 $content['readonly'] = true;
             }
             $row['columns'][$index_2] = $content;
         }
         $rows[$html_field . "[{$index_1}]"] = $row;
     }
     Html::showCheckboxMatrix($columns, $rows, array('title' => $title, 'first_cell' => '<b>' . __("From \\ To") . '</b>'));
 }
コード例 #4
0
 /**
  * Used to display each status time used for each group/user
  *
  *
  * @param Ticket $ticket
  */
 static function ShowDetail(Ticket $ticket, $type)
 {
     $ptState = new PluginTimelineticketState();
     if ($type == 'group') {
         $ptItem = new PluginTimelineticketAssignGroup();
     } else {
         if ($type == 'user') {
             $ptItem = new PluginTimelineticketAssignUser();
         }
     }
     $a_states = $ptState->find("`tickets_id`='" . $ticket->getField('id') . "'", "`date`");
     $a_state_delays = array();
     $a_state_num = array();
     $delay = 0;
     $list_status = Ticket::getAllStatusArray();
     $status = "new";
     foreach ($a_states as $array) {
         $delay += $array['delay'];
         $a_state_delays[$delay] = $array['old_status'];
         $a_state_num[] = $delay;
     }
     $a_state_num[] = $delay;
     $last_delay = $delay;
     $a_groups = $ptItem->find("`tickets_id`='" . $ticket->getField('id') . "'", "`date`");
     echo "<table class='tab_cadre_fixe' width='100%'>";
     echo "<tr class='tab_bg_1'>";
     echo "<th colspan='" . (count($list_status) + 1) . "'>";
     _e('Result details');
     if ($type == 'group') {
         echo " (" . __('Groups in charge of the ticket', 'timelineticket') . ")";
     } else {
         if ($type == 'user') {
             echo " (" . __('Technicians in charge of the ticket', 'timelineticket') . ")";
         }
     }
     echo "</th>";
     echo "</tr>";
     echo "</tr>";
     echo "<th>";
     echo "</th>";
     foreach ($list_status as $name) {
         echo "<th>";
         echo $name;
         echo "</th>";
     }
     echo "</tr>";
     if ($type == 'group') {
         $a_details = PluginTimelineticketToolbox::getDetails($ticket, 'group', false);
     } else {
         if ($type == 'user') {
             $a_details = PluginTimelineticketToolbox::getDetails($ticket, 'user', false);
         }
     }
     foreach ($a_details as $items_id => $a_detail) {
         $a_status = array();
         foreach ($a_detail as $data) {
             if (!isset($a_status[$data['Status']])) {
                 $a_status[$data['Status']] = 0;
             }
             $a_status[$data['Status']] += $data['End'] - $data['Start'];
         }
         echo "<tr class='tab_bg_1'>";
         if ($type == 'group') {
             echo "<td>" . Dropdown::getDropdownName("glpi_groups", $items_id) . "</td>";
         } else {
             if ($type == 'user') {
                 echo "<td>" . Dropdown::getDropdownName("glpi_users", $items_id) . "</td>";
             }
         }
         foreach ($list_status as $status => $name) {
             echo "<td>";
             if (isset($a_status[$status])) {
                 echo Html::timestampToString($a_status[$status], true);
             }
             echo "</td>";
         }
         echo "</tr>";
     }
     echo "</table>";
 }
コード例 #5
0
 /**
  * return the content of hardcoded dropdown
  *
  * @param $name of the dropdown
  *
  * @return array (or false if unknown name)
  **/
 private static function listSpecialDropdown($name = '')
 {
     global $CFG_GLPI;
     $resp = array();
     switch (strtolower($name)) {
         case 'ticketstatus':
             $tab = Ticket::getAllStatusArray();
             foreach ($tab as $id => $label) {
                 $resp[] = array('id' => $id, 'name' => $label);
             }
             break;
         case 'ticketurgency':
             for ($i = 1; $i <= 5; $i++) {
                 if ($i == 3 || $CFG_GLPI['urgency_mask'] & 1 << $i) {
                     $resp[] = array('id' => $i, 'name' => Ticket::getUrgencyName($i));
                 }
             }
             break;
         case 'ticketimpact':
             for ($i = 1; $i <= 5; $i++) {
                 if ($i == 3 || $CFG_GLPI['impact_mask'] & 1 << $i) {
                     $resp[] = array('id' => $i, 'name' => Ticket::getImpactName($i));
                 }
             }
             break;
         case 'tickettype':
             foreach (array(Ticket::INCIDENT_TYPE, Ticket::DEMAND_TYPE) as $type) {
                 $resp[] = array('id' => $type, 'name' => Ticket::getTicketTypeName($type));
             }
             break;
         case 'ticketpriority':
             for ($i = 1; $i <= 5; $i++) {
                 $resp[] = array('id' => $i, 'name' => Ticket::getPriorityName($i));
             }
             break;
         case 'ticketglobalvalidation':
             $tab = TicketValidation::getAllStatusArray(false, true);
             foreach ($tab as $id => $label) {
                 $resp[] = array('id' => $id, 'name' => $label);
             }
             break;
         case 'ticketvalidationstatus':
             $tab = TicketValidation::getAllStatusArray();
             foreach ($tab as $id => $label) {
                 $resp[] = array('id' => $id, 'name' => $label);
             }
             break;
         default:
             $resp = false;
     }
     return $resp;
 }
コード例 #6
0
 /**
  * List the tickets for an authenticated user
  *
  * @param $params    array of options (author, group, category, status, startdate, enddate, itemtype)
  * @param $protocol        the communication protocol used
  *
  * @return array of hashtable
  **/
 static function methodListTickets($params, $protocol)
 {
     global $DB, $CFG_GLPI;
     if (isset($params['help'])) {
         return array('count' => 'bool,optional', 'start' => 'integer,optional', 'limit' => 'integer,optional', 'user' => 'integer,optional', 'recipient' => 'integer,optional', 'mine' => 'bool,optional', 'group' => 'integer,optional', 'mygroups' => 'bool,optional', 'category' => 'integer,optional', 'status' => 'integer,optional', 'startdate' => 'datetime,optional', 'enddate' => 'datetime,optional', 'itemtype' => 'string,optional', 'item' => 'integer,optional', 'entity' => 'integer,optional', 'satisfaction' => 'integer,optional', 'approval' => 'text,optional', 'approver' => 'integer,optional', 'id2name' => 'bool,optional', 'order' => 'array,optional', 'help' => 'bool,optional');
     }
     if (!Session::getLoginUserID()) {
         return self::Error($protocol, WEBSERVICES_ERROR_NOTAUTHENTICATED);
     }
     $resp = array();
     $start = 0;
     if (isset($params['start']) && is_numeric($params['start'])) {
         $start = $params['start'];
     }
     $limit = $_SESSION['glpilist_limit'];
     if (isset($params['limit']) && is_numeric($params['limit'])) {
         $limit = $params['limit'];
     }
     $where = $join = '';
     // User (victim)
     if (isset($params['user'])) {
         if (!is_numeric($params['user']) || $params['user'] < 0) {
             return self::Error($protocol, WEBSERVICES_ERROR_BADPARAMETER, '', 'user');
         }
         if (Session::haveRight('show_all_ticket', '1') || Session::haveRight('show_group_ticket', '1') || $params['user'] == Session::getLoginUserID()) {
             // restrict to author parameter
             $where = " AND `glpi_tickets_users_request`.`users_id` = '" . $params['user'] . "'";
         } else {
             return self::Error($protocol, WEBSERVICES_ERROR_NOTALLOWED);
         }
     } else {
         if (Session::haveRight('show_all_ticket', '1') || Session::haveRight('show_group_ticket', '1')) {
             $where = '';
             // Restrict will come from group (if needed)
         } else {
             // Only connected user's tickets'
             $where = " AND `glpi_tickets_users_request`.`users_id`\n                           = '" . Session::getLoginUserID() . "'";
         }
     }
     // Group
     if (isset($params['group'])) {
         if (!is_numeric($params['group']) || $params['group'] < 0) {
             return self::Error($protocol, WEBSERVICES_ERROR_BADPARAMETER, '', 'group');
         }
         if (Session::haveRight('show_all_ticket', '1') || Session::haveRight('show_group_ticket', '1') && in_array($params['group'], $_SESSION['glpigroups'])) {
             // restrict to group parameter
             $where = " AND `glpi_groups_tickets_request`.`groups_id` = '" . $params['group'] . "'";
         } else {
             return self::Error($protocol, WEBSERVICES_ERROR_NOTALLOWED);
         }
     } else {
         if (Session::haveRight('show_group_ticket', '1') && !Session::haveRight('show_all_ticket', '1')) {
             // Connected user's group'
             if (count($_SESSION['glpigroups']) > 0) {
                 $where = " AND `glpi_groups_tickets_request`.`groups_id`\n                              IN (" . implode(',', $_SESSION['glpigroups']) . ")";
             } else {
                 $where = " AND `glpi_tickets_users_request`.`users_id`\n                              = '" . Session::getLoginUserID() . "'";
             }
         }
     }
     // Security
     if (empty($where) && !Session::haveRight('show_all_ticket', '1')) {
         return self::Error($protocol, WEBSERVICES_ERROR_NOTALLOWED, '', 'profil');
     }
     // Recipient (person creating the ticket)
     if (isset($params['recipient'])) {
         if (!is_numeric($params['recipient']) || $params['recipient'] < 0) {
             return self::Error($protocol, WEBSERVICES_ERROR_BADPARAMETER, '', 'recipient');
         }
         // restrict to recipient parameter
         $where = " AND `users_id_recipient`='" . $params['recipient'] . "'";
     }
     // Mine (user or recipient for the ticket)
     if (isset($params['mine'])) {
         $where = " AND (`glpi_tickets_users_request`.`users_id` = '" . Session::getLoginUserID() . "'\n                         OR `users_id_recipient` = '" . Session::getLoginUserID() . "')";
     }
     // Mygroups
     if (isset($param['mygroups'])) {
         $where = " AND `glpi_groups_tickets`.`groups_id`\n                        IN (" . implode(',', $_SESSION['glpigroups']) . ")";
     }
     // Entity
     if (isset($params['entity'])) {
         if (!Session::haveAccessToEntity($params['entity'])) {
             return self::Error($protocol, WEBSERVICES_ERROR_NOTALLOWED, '', 'entity');
         }
         $where = getEntitiesRestrictRequest("WHERE", "glpi_tickets", '', $params['entity']) . $where;
     } else {
         $where = getEntitiesRestrictRequest("WHERE", "glpi_tickets") . $where;
     }
     // Category
     if (isset($params['category'])) {
         if (!is_numeric($params['category']) || $params['category'] <= 0) {
             return self::Error($protocol, WEBSERVICES_ERROR_BADPARAMETER, '', 'category');
         }
         $where .= " AND " . getRealQueryForTreeItem("glpi_itilcategories", $params['category'], "glpi_tickets.itilcategories_id");
     }
     if (isset($params['approval']) || isset($params['approver'])) {
         $join .= "INNER JOIN `glpi_ticketvalidations`\n                         ON (`glpi_tickets`.`id` = `glpi_ticketvalidations`.`tickets_id` ) ";
         if (isset($params['approver']) && is_numeric($params['approver'])) {
             $where .= " AND `glpi_ticketvalidations`.`users_id_validate`=" . $params['approver'];
         }
         $tabstatus = TicketValidation::getAllStatusArray();
         if (isset($params['approval']) && isset($tabstatus[$params['approval']])) {
             $where .= " AND `glpi_ticketvalidations`.`status`='" . $params['approval'] . "'";
         }
     }
     if (isset($params['satisfaction'])) {
         $join .= "INNER JOIN `glpi_ticketsatisfactions`\n                        ON (`glpi_tickets`.`id` = `glpi_ticketsatisfactions`.`tickets_id` ) ";
         switch ($params['satisfaction']) {
             case 1:
                 $where .= " AND `glpi_ticketsatisfactions`.`date_answered` IS NULL";
                 break;
             case 2:
                 $where .= " AND `glpi_ticketsatisfactions`.`date_answered` IS NOT NULL";
                 break;
             default:
                 // survey exists (by Inner Join)
         }
         $params['status'] = Ticket::CLOSED;
     }
     // Status
     if (isset($params['status'])) {
         if (!in_array($params['status'], Ticket::getAllowedStatusArray(true))) {
             return self::Error($protocol, WEBSERVICES_ERROR_BADPARAMETER, '', 'status');
         }
         switch ($params['status']) {
             case 'all':
                 // No restriction
                 break;
             case 'notclosed':
                 $status = Ticket::getAllStatusArray();
                 unset($status[CLOSED]);
                 $where .= " AND `glpi_tickets`.`status` IN ('" . implode("','", $status) . "') ";
                 break;
             case 'notold':
                 $status = Ticket::getAllStatusArray();
                 unset($status[SOLVED], $status[CLOSED]);
                 $where .= " AND `glpi_tickets`.`status` IN ('" . implode("','", $status) . "') ";
                 break;
             case 'old':
                 $status = array_merge(Ticket::getSolvedStatusArray(), Ticket::getClosedStatusArray());
                 $where .= " AND `glpi_tickets`.`status` IN ('" . implode("','", $status) . "') ";
                 break;
             case 'process':
                 $status = Ticket::getProcessStatusArray();
                 $where .= " AND `glpi_tickets`.`status` IN ('" . implode("','", $status) . "') ";
                 break;
             default:
                 $where .= " AND `glpi_tickets`.`status` = '" . $params['status'] . "' ";
         }
     }
     // Dates
     if (isset($params["startdate"])) {
         if (preg_match(WEBSERVICES_REGEX_DATETIME, $params["startdate"]) || preg_match(WEBSERVICES_REGEX_DATE, $params["startdate"])) {
             $where .= " AND `glpi_tickets`.`date` >= '" . $params['startdate'] . "' ";
         } else {
             return self::Error($protocol, WEBSERVICES_ERROR_BADPARAMETER, '', 'date');
         }
     }
     if (isset($params["enddate"])) {
         if (preg_match(WEBSERVICES_REGEX_DATETIME, $params["enddate"]) || preg_match(WEBSERVICES_REGEX_DATE, $params["enddate"])) {
             $where .= " AND `glpi_tickets`.`date` <= '" . $params['enddate'] . "' ";
         } else {
             return self::Error($protocol, WEBSERVICES_ERROR_BADPARAMETER, '', 'date');
         }
     }
     if (isset($params['itemtype'])) {
         if (!empty($params['itemtype']) && !class_exists($params['itemtype'])) {
             return self::Error($protocol, WEBSERVICES_ERROR_BADPARAMETER, '', 'itemtype');
         }
         $where .= " AND `glpi_tickets`.`itemtype`='" . $params['itemtype'] . "'";
     }
     if (isset($params['item'])) {
         if (!isset($params['itemtype'])) {
             return self::Error($protocol, WEBSERVICES_ERROR_MISSINGPARAMETER, '', 'itemtype');
         }
         if (!is_numeric($params['item']) || $params['item'] <= 0) {
             return self::Error($protocol, WEBSERVICES_ERROR_BADPARAMETER, '', 'item');
         }
         $where .= " AND `glpi_tickets`.`items_id`='" . $params['item'] . "'";
     }
     $orders = array();
     if (isset($params['order'])) {
         if (is_array($params['order'])) {
             $tab = $params['order'];
         } else {
             $tab = array($params['order'] => 'DESC');
         }
         foreach ($tab as $key => $val) {
             if ($val != 'ASC') {
                 $val = 'DESC';
             }
             $sqlkey = array('id' => '`glpi_tickets`.`id`', 'date' => '`glpi_tickets`.`date`', 'closedate' => '`glpi_tickets`.`closedate`', 'date_mod' => '`glpi_tickets`.`date_mod`', 'status' => '`glpi_tickets`.`status`', 'entities_id' => '`glpi_tickets`.`entities_id`', 'priority' => '`glpi_tickets`.`priority`');
             if (isset($sqlkey[$key])) {
                 $orders[] = $sqlkey[$key] . " {$val}";
             } else {
                 return self::Error($protocol, WEBSERVICES_ERROR_BADPARAMETER, '', 'order=$key');
             }
         }
     }
     if (count($orders)) {
         $order = implode(',', $orders);
     } else {
         $order = "`glpi_tickets`.`date_mod` DESC";
     }
     $resp = array();
     if (isset($params['count'])) {
         $query = "SELECT COUNT(DISTINCT `glpi_tickets`.`id`) AS count\n                   FROM `glpi_tickets`\n                   {$join}\n                   LEFT JOIN `glpi_tickets_users` AS glpi_tickets_users_request\n                        ON (`glpi_tickets`.`id` = `glpi_tickets_users_request`.`tickets_id`\n                            AND `glpi_tickets_users_request`.`type` = 1)\n                   LEFT JOIN `glpi_groups_tickets` AS glpi_groups_tickets_request\n                        ON (`glpi_tickets`.`id` = `glpi_groups_tickets_request`.`tickets_id`\n                            AND `glpi_groups_tickets_request`.`type` = 1 )\n                   {$where}";
         $resp = $DB->request($query)->next();
         //debug $resp['query'] = $query;
     } else {
         $query = "SELECT `glpi_tickets`.*,\n                          GROUP_CONCAT(DISTINCT `glpi_tickets_users_request`.`users_id` SEPARATOR ',')\n                                 AS users_id_request,\n                          GROUP_CONCAT(DISTINCT `glpi_tickets_users_observer`.`users_id` SEPARATOR ',')\n                                 AS users_id_observer,\n                          GROUP_CONCAT(DISTINCT `glpi_tickets_users_assign`.`users_id` SEPARATOR ',')\n                                 AS users_id_assign,\n                          GROUP_CONCAT(DISTINCT `glpi_groups_tickets_request`.`groups_id` SEPARATOR ',')\n                                 AS groups_id_request,\n                          GROUP_CONCAT(DISTINCT `glpi_groups_tickets_observer`.`groups_id` SEPARATOR ',')\n                                 AS groups_id_observer,\n                          GROUP_CONCAT(DISTINCT `glpi_groups_tickets_assign`.`groups_id` SEPARATOR ',')\n                                 AS groups_id_assign\n                   FROM `glpi_tickets`\n                   {$join}\n                   LEFT JOIN `glpi_tickets_users` AS glpi_tickets_users_request\n                        ON (`glpi_tickets`.`id` = `glpi_tickets_users_request`.`tickets_id`\n                            AND `glpi_tickets_users_request`.`type` = 1)\n                   LEFT JOIN `glpi_tickets_users` AS glpi_tickets_users_assign\n                        ON (`glpi_tickets`.`id` = `glpi_tickets_users_assign`.`tickets_id`\n                            AND `glpi_tickets_users_assign`.`type` = 2)\n                   LEFT JOIN `glpi_tickets_users` AS glpi_tickets_users_observer\n                        ON (`glpi_tickets`.`id` = `glpi_tickets_users_observer`.`tickets_id`\n                            AND `glpi_tickets_users_observer`.`type` = 3)\n                   LEFT JOIN `glpi_groups_tickets` AS glpi_groups_tickets_request\n                        ON (`glpi_tickets`.`id` = `glpi_groups_tickets_request`.`tickets_id`\n                            AND `glpi_groups_tickets_request`.`type` = 1)\n                   LEFT JOIN `glpi_groups_tickets` AS glpi_groups_tickets_assign\n                        ON (`glpi_tickets`.`id` = `glpi_groups_tickets_assign`.`tickets_id`\n                            AND `glpi_groups_tickets_assign`.`type` = 2)\n                   LEFT JOIN `glpi_groups_tickets` AS glpi_groups_tickets_observer\n                        ON (`glpi_tickets`.`id` = `glpi_groups_tickets_observer`.`tickets_id`\n                            AND `glpi_groups_tickets_observer`.`type` = 3)\n                   {$where}\n                   GROUP BY `glpi_tickets`.`id`\n                   ORDER BY {$order}\n                   LIMIT {$start},{$limit}";
         foreach ($DB->request($query) as $data) {
             $tmp = explode(',', $data['users_id_request']);
             $data['users']['requester'] = array();
             foreach ($tmp as $id) {
                 $data['users']['requester'][]['id'] = $id;
             }
             $tmp = explode(',', $data['users_id_observer']);
             $data['users']['observer'] = array();
             foreach ($tmp as $id) {
                 $data['users']['observer'][]['id'] = $id;
             }
             $tmp = explode(',', $data['users_id_assign']);
             $data['users']['assign'] = array();
             foreach ($tmp as $id) {
                 $data['users']['assign'][]['id'] = $id;
             }
             $tmp = explode(',', $data['groups_id_request']);
             $data['groups']['requester'] = array();
             foreach ($tmp as $id) {
                 $data['groups']['requester'][]['id'] = $id;
             }
             $tmp = explode(',', $data['groups_id_observer']);
             $data['groups']['observer'] = array();
             foreach ($tmp as $id) {
                 $data['groups']['observer'][]['id'] = $id;
             }
             $tmp = explode(',', $data['groups_id_assign']);
             $data['groups']['assign'] = array();
             foreach ($tmp as $id) {
                 $data['groups']['assign'][]['id'] = $id;
             }
             unset($data['groups_id_request'], $data['groups_id_observer'], $data['groups_id_assign'], $data['users_id_request'], $data['users_id_observer'], $data['users_id_assign']);
             $data['solution'] = Html::clean(Toolbox::unclean_cross_side_scripting_deep($data['solution']));
             if (isset($params['id2name'])) {
                 if ($data['itemtype'] && ($item = getItemForItemtype($data['itemtype']))) {
                     $data['itemtype_name'] = Html::clean($item->getTypeName());
                     if ($item->getFromDB($data['items_id'])) {
                         $data['items_name'] = Html::clean($item->getNameID());
                     } else {
                         $data['items_name'] = NOT_AVAILABLE;
                     }
                 }
                 foreach ($data['groups'] as $type => $tab) {
                     foreach ($tab as $key => $grp) {
                         $data['groups'][$type][$key]['name'] = Html::clean(Dropdown::getDropdownName('glpi_groups', $grp['id']));
                     }
                 }
                 foreach ($data['users'] as $type => $tab) {
                     foreach ($tab as $key => $usr) {
                         $data['users'][$type][$key]['name'] = Html::clean(getUserName($usr['id']));
                     }
                 }
                 $data['status_name'] = Html::clean(Ticket::getStatus($data['status']));
                 $data['urgency_name'] = Ticket::getUrgencyName($data['urgency']);
                 $data['impact_name'] = Ticket::getImpactName($data['impact']);
                 $data['priority_name'] = Ticket::getPriorityName($data['priority']);
                 $data['users_name_recipient'] = Html::clean(getUserName($data['users_id_recipient']));
                 $data['entities_name'] = Html::clean(Dropdown::getDropdownName('glpi_entities', $data['entities_id']));
                 $data['suppliers_name_assign'] = Html::clean(Dropdown::getDropdownName('glpi_suppliers', $data['suppliers_id_assign']));
                 $data['ticketcategories_name'] = Html::clean(Dropdown::getDropdownName('glpi_itilcategories', $data['itilcategories_id']));
                 $data['requesttypes_name'] = Html::clean(Dropdown::getDropdownName('glpi_requesttypes', $data['requesttypes_id']));
                 $data['solutiontypes_name'] = Html::clean(Dropdown::getDropdownName('glpi_solutiontypes', $data['solutiontypes_id']));
                 $data['slas_name'] = Html::clean(Dropdown::getDropdownName('glpi_slas', $data['slas_id']));
                 $data['slalevels_name'] = Html::clean(Dropdown::getDropdownName('glpi_slalevels', $data['slalevels_id']));
             }
             $resp[] = $data;
         }
     }
     return $resp;
 }
コード例 #7
0
 function getTags()
 {
     global $LANG;
     //Locales
     $tags = array('ticket.id' => $LANG['common'][2], 'ticket.title' => $LANG['common'][16], 'ticket.url' => $LANG['common'][94], 'ticket.entity' => $LANG['entity'][0], 'ticket.category' => $LANG['common'][36], 'ticket.content' => $LANG['joblist'][6], 'ticket.description' => $LANG['mailing'][5], 'ticket.status' => $LANG['joblist'][0], 'ticket.type' => $LANG['common'][17], 'ticket.creationdate' => $LANG['reports'][60], 'ticket.closedate' => $LANG['reports'][61], 'ticket.solvedate' => $LANG['reports'][64], 'ticket.sla' => $LANG['sla'][1], 'ticket.duedate' => $LANG['sla'][5], 'ticket.requesttype' => $LANG['job'][44], 'ticket.authors' => $LANG['job'][18], 'author.id' => $LANG['common'][2] . ' ' . $LANG['job'][4], 'author.name' => $LANG['job'][4], 'author.location' => $LANG['common'][15], 'author.phone' => $LANG['help'][35], 'author.phone2' => $LANG['help'][35] . ' 2', 'ticket.openbyuser' => $LANG['common'][37], 'ticket.groups' => $LANG['common'][53] . " : " . $LANG['common'][35], 'ticket.assigntousers' => $LANG['job'][5] . " - " . $LANG['job'][3], 'ticket.assigntogroups' => $LANG['job'][5] . " - " . $LANG['Menu'][36], 'ticket.assigntosupplier' => $LANG['job'][5] . " - " . $LANG['financial'][26], 'ticket.observergroups' => $LANG['common'][104] . " - " . $LANG['Menu'][36], 'ticket.observerusers' => $LANG['common'][104] . " - " . $LANG['Menu'][14], 'ticket.itemtype' => $LANG['reports'][12], 'ticket.item.name' => $LANG['financial'][104], 'ticket.item.serial' => $LANG['common'][19], 'ticket.item.otherserial' => $LANG['common'][20], 'ticket.item.location' => $LANG['common'][15], 'ticket.item.model' => $LANG['common'][22], 'ticket.item.contact' => $LANG['common'][18], 'ticket.item.contactnumber' => $LANG['common'][21], 'ticket.item.user' => $LANG['common'][34], 'ticket.item.group' => $LANG['common'][35], 'ticket.urgency' => $LANG['joblist'][29], 'ticket.impact' => $LANG['joblist'][30], 'ticket.priority' => $LANG['joblist'][2], 'ticket.time' => $LANG['job'][20], 'ticket.costtime' => $LANG['job'][40], 'ticket.costfixed' => $LANG['job'][41], 'ticket.costmaterial' => $LANG['job'][42], 'ticket.solution.type' => $LANG['job'][48], 'ticket.solution.description' => $LANG['jobresolution'][1], 'task.author' => $LANG['common'][37], 'task.isprivate' => $LANG['common'][77], 'task.date' => $LANG['reports'][60], 'task.description' => $LANG['joblist'][6], 'task.category' => $LANG['common'][36], 'task.time' => $LANG['job'][20], 'task.planning.user' => $LANG['common'][95], 'task.planning.begin' => $LANG['search'][8], 'task.planning.end' => $LANG['search'][9], 'task.planning.status' => $LANG['joblist'][0], 'followup.date' => $LANG['reports'][60], 'followup.isprivate' => $LANG['common'][77], 'followup.author' => $LANG['common'][37], 'followup.description' => $LANG['joblist'][6], 'followup.requesttype' => $LANG['job'][44], 'ticket.numberoffollowups' => $LANG['mailing'][4], 'ticket.numberoftasks' => $LANG['mailing'][122], 'ticket.numberoflinkedtickets' => $LANG['job'][55] . " - " . $LANG['tracking'][29], 'ticket.action' => $LANG['mailing'][119], 'ticket.autoclose' => $LANG['entity'][18], 'ticket.globalvalidation' => $LANG['validation'][25]);
     foreach ($tags as $tag => $label) {
         $this->addTagToList(array('tag' => $tag, 'label' => $label, 'value' => true, 'events' => NotificationTarget::TAG_FOR_ALL_EVENTS));
     }
     //Events specific for validation
     $tags = array('validation.author' => $LANG['job'][4], 'validation.status' => $LANG['validation'][28], 'validation.submissiondate' => $LANG['validation'][3], 'validation.commentsubmission' => $LANG['validation'][5], 'validation.validationdate' => $LANG['validation'][4], 'validation.validator' => $LANG['validation'][21], 'validation.commentvalidation' => $LANG['validation'][6]);
     foreach ($tags as $tag => $label) {
         $this->addTagToList(array('tag' => $tag, 'label' => $label, 'value' => true, 'events' => array('validation')));
     }
     //Tags without lang for validation
     $tags = array('validation.submission.title' => $LANG['validation'][27], 'validation.answer.title' => $LANG['validation'][32]);
     foreach ($tags as $tag => $label) {
         $this->addTagToList(array('tag' => $tag, 'label' => $label, 'value' => true, 'lang' => false, 'events' => array('validation')));
     }
     // Events for ticket satisfaction
     $tags = array('satisfaction.datebegin' => $LANG['satisfaction'][6], 'satisfaction.dateanswered' => $LANG['satisfaction'][4], 'satisfaction.satisfactionlevel' => $LANG['satisfaction'][7], 'satisfaction.satisfactioncomment' => $LANG['satisfaction'][8]);
     foreach ($tags as $tag => $label) {
         $this->addTagToList(array('tag' => $tag, 'label' => $label, 'value' => true, 'events' => array('satisfaction')));
     }
     $tags = array('satisfaction.type' => $LANG['satisfaction'][9] . " - " . $LANG['satisfaction'][10]);
     foreach ($tags as $tag => $label) {
         $this->addTagToList(array('tag' => $tag, 'label' => $label, 'value' => true, 'lang' => false, 'events' => array('satisfaction')));
     }
     $tags = array('satisfaction.text' => $LANG['satisfaction'][12]);
     foreach ($tags as $tag => $label) {
         $this->addTagToList(array('tag' => $tag, 'label' => $label, 'value' => false, 'lang' => true, 'events' => array('satisfaction')));
     }
     //Foreach global tags
     $tags = array('followups' => $LANG['mailing'][141], 'tasks' => $LANG['mailing'][142], 'log' => $LANG['mailing'][144], 'validations' => $LANG['mailing'][143], 'linkedtickets' => $LANG['job'][55], 'authors' => $LANG['job'][18]);
     foreach ($tags as $tag => $label) {
         $this->addTagToList(array('tag' => $tag, 'label' => $label, 'value' => false, 'foreach' => true));
     }
     //Tags with just lang
     $tags = array('ticket.days' => $LANG['stats'][31], 'ticket.linkedtickets' => $LANG['job'][55], 'ticket.autoclosewarning' => $LANG['job'][54] . " ? " . $LANG['stats'][31], 'ticket.attribution' => $LANG['job'][5], 'ticket.nocategoryassigned' => $LANG['mailing'][100]);
     foreach ($tags as $tag => $label) {
         $this->addTagToList(array('tag' => $tag, 'label' => $label, 'value' => false, 'lang' => true));
     }
     //Foreach tag for alertnotclosed
     $this->addTagToList(array('tag' => 'tickets', 'label' => $LANG['crontask'][15], 'value' => false, 'foreach' => true, 'events' => array('alertnotclosed')));
     //Tags without lang
     $tags = array('ticket.log.date' => $LANG['mailing'][144] . ' : ' . $LANG['common'][26], 'ticket.log.user' => $LANG['mailing'][144] . ' : ' . $LANG['common'][34], 'ticket.log.field' => $LANG['mailing'][144] . ' : ' . $LANG['event'][18], 'ticket.log.content' => $LANG['mailing'][144] . ' : ' . $LANG['event'][19], 'ticket.urlapprove' => $LANG['document'][33] . ' ' . $LANG['job'][51], 'ticket.urlvalidation' => $LANG['document'][33] . ' ' . $LANG['validation'][26], 'ticket.urlsatisfaction' => $LANG['document'][33] . ' ' . $LANG['satisfaction'][0], 'linkedticket.id' => $LANG['job'][55] . " - " . $LANG['common'][2], 'linkedticket.link' => $LANG['job'][55] . " - " . $LANG['setup'][620], 'linkedticket.url' => $LANG['job'][55] . " - " . $LANG['common'][94], 'linkedticket.title' => $LANG['job'][55] . " - " . $LANG['common'][16], 'linkedticket.content' => $LANG['job'][55] . " - " . $LANG['joblist'][6]);
     foreach ($tags as $tag => $label) {
         $this->addTagToList(array('tag' => $tag, 'label' => $label, 'value' => true, 'lang' => false));
     }
     //Tickets with a fixed set of values
     $status = Ticket::getAllStatusArray(false);
     $allowed_ticket = $allowed_validation = array();
     foreach ($status as $key => $value) {
         $allowed_ticket[] = $key;
     }
     $status = TicketValidation::getAllStatusArray(false, true);
     foreach ($status as $key => $value) {
         $allowed_validation[] = $key;
     }
     $tags = array('ticket.storestatus' => array('text' => $LANG['joblist'][36], 'allowed_values' => $allowed_ticket), 'validation.validationstatus' => array('text' => $LANG['joblist'][36], 'allowed_values' => $allowed_validation));
     foreach ($tags as $tag => $label) {
         $this->addTagToList(array('tag' => $tag, 'label' => $label['text'], 'value' => true, 'lang' => false, 'allowed_values' => $label['allowed_values']));
     }
     asort($this->tag_descriptions);
 }
コード例 #8
0
ファイル: profile.class.php プロジェクト: gaforeror/glpi
 /**
  * Print the Life Cycles form for the current profile
  *
  * @param $openform   boolean  open the form (true by default)
  * @param $closeform  boolean  close the form (true by default)
  **/
 function showFormLifeCycle($openform = true, $closeform = true)
 {
     if (!Session::haveRight("profile", "r")) {
         return false;
     }
     if (($canedit = Session::haveRight("profile", "w")) && $openform) {
         echo "<form method='post' action='" . $this->getFormURL() . "'>";
     }
     echo "<div class='spaced'>";
     echo "<table class='tab_cadre_fixe'>";
     $tabstatus = Ticket::getAllStatusArray();
     echo "<th colspan='" . (count($tabstatus) + 1) . "'>" . __('Life cycle of tickets') . "</th>";
     //TRANS: \ to split row heading (From) and colums headin (To) for life cycles
     echo "<tr class='tab_bg_1'><td class='b center'>" . __("From \\ To");
     echo "<input type='hidden' name='_cycles_ticket' value='1'</td>";
     foreach ($tabstatus as $label) {
         echo "<td class='center'>{$label}</td>";
     }
     echo "</tr>\n";
     foreach ($tabstatus as $from => $label) {
         echo "<tr class='tab_bg_2'><td class='tab_bg_1'>{$label}</td>";
         foreach ($tabstatus as $dest => $label) {
             echo "<td class='center'>";
             if ($dest == $from) {
                 echo Dropdown::getYesNo(1);
             } else {
                 Dropdown::showYesNo("_cycle_ticket[{$from}][{$dest}]", !isset($this->fields['ticket_status'][$from][$dest]) || $this->fields['ticket_status'][$from][$dest]);
             }
             echo "</td>";
         }
         echo "</tr>\n";
     }
     echo "</table>";
     echo "<table class='tab_cadre_fixe'>";
     $tabstatus = Problem::getAllStatusArray();
     echo "<th colspan='" . (count($tabstatus) + 1) . "'>" . __('Life cycle of problems') . "</th>";
     echo "<tr class='tab_bg_1'><td class='b center'>" . __('From \\ To');
     echo "<input type='hidden' name='_cycles_problem' value='1'</td>";
     foreach ($tabstatus as $label) {
         echo "<td class='center'>{$label}</td>";
     }
     echo "</tr>\n";
     foreach ($tabstatus as $from => $label) {
         echo "<tr class='tab_bg_2'><td class='tab_bg_1'>{$label}</td>";
         foreach ($tabstatus as $dest => $label) {
             echo "<td class='center'>";
             if ($dest == $from) {
                 echo Dropdown::getYesNo(1);
             } else {
                 Dropdown::showYesNo("_cycle_problem[{$from}][{$dest}]", !isset($this->fields['problem_status'][$from][$dest]) || $this->fields['problem_status'][$from][$dest]);
             }
             echo "</td>";
         }
         echo "</tr>\n";
     }
     echo "</table>";
     echo "<table class='tab_cadre_fixe'>";
     $tabstatus = Change::getAllStatusArray();
     //       echo "<th colspan='".(count($tabstatus)+1)."'>".__('Life cycle of changes')."</th>";
     //       echo "<tr class='tab_bg_1'><td class='b center'>".__('From \ To');
     //       echo "<input type='hidden' name='_cycles_change' value='1'</td>";
     //       foreach ($tabstatus as $label) {
     //          echo "<td class='center'>$label</td>";
     //       }
     //       echo "</tr>\n";
     //
     //       foreach ($tabstatus as $from => $label) {
     //          echo "<tr class='tab_bg_2'><td class='tab_bg_1'>$label</td>";
     //          foreach ($tabstatus as $dest => $label) {
     //             echo "<td class='center'>";
     //             if ($dest == $from) {
     //                echo Dropdown::getYesNo(1);
     //             } else {
     //                Dropdown::showYesNo("_cycle_change[$from][$dest]",
     //                                    (!isset($this->fields['change_status'][$from][$dest])
     //                                     || $this->fields['change_status'][$from][$dest]));
     //             }
     //             echo "</td>";
     //          }
     //          echo "</tr>\n";
     //       }
     if ($canedit && $closeform) {
         echo "<tr class='tab_bg_1'>";
         echo "<td colspan='" . (count($tabstatus) + 1) . "' class='center'>";
         echo "<input type='hidden' name='id' value='" . $this->fields['id'] . "'>";
         echo "<input type='submit' name='update' value=\"" . _sx('button', 'Save') . "\" class='submit'>";
         echo "</td></tr>\n";
         echo "</table>\n";
         Html::closeForm();
     } else {
         echo "</table>\n";
     }
     echo "</div>";
 }
コード例 #9
0
ファイル: helpdesk.class.php プロジェクト: geldarr/hack-space
 /**
  * Show the selector for tickets status (new, open, solved, closed...)
  */
 static function selectorAllstates()
 {
     global $LANG;
     echo "<b>" . $LANG['plugin_mreporting']['selector']["status"] . " : </b><br />";
     $default = array('1', '2', '3', '4');
     foreach (Ticket::getAllStatusArray() as $value => $name) {
         echo '<label>';
         echo '<input type="hidden" name="status_' . $value . '" value="0" /> ';
         echo '<input type="checkbox" name="status_' . $value . '" value="1"';
         if (isset($_REQUEST['status_' . $value]) && $_REQUEST['status_' . $value] == '1' || !isset($_REQUEST['status_' . $value]) && in_array($value, $default)) {
             echo ' checked="checked"';
         }
         echo ' /> ';
         echo $name;
         echo '</label>';
     }
 }
コード例 #10
0
 /**
  * Print the Tracking right form for the current profile
  *
  * @param $target of the form
  * @param $openform boolean open the form
  * @param $closeform boolean close the form
  **/
 function showFormTracking($target, $openform = true, $closeform = true)
 {
     global $LANG, $CFG_GLPI;
     $ID = $this->fields['id'];
     if (!haveRight("profile", "r")) {
         return false;
     }
     if (($canedit = haveRight("profile", "w")) && $openform) {
         echo "<form method='post' action='{$target}'>";
     }
     echo "<div class='spaced'>";
     echo "<table class='tab_cadre_fixe'>";
     // Assistance / Tracking-helpdesk
     echo "<tr class='tab_bg_1'><th colspan='6'>" . $LANG['title'][24] . "</th></tr>\n";
     echo "<tr class='tab_bg_5'><th colspan='6'>" . $LANG['profiles'][41] . "</th>";
     echo "</tr>\n";
     echo "<tr class='tab_bg_2'>";
     echo "<td>" . $LANG['profiles'][5] . "&nbsp;:</td><td>";
     Dropdown::showYesNo("create_ticket", $this->fields["create_ticket"]);
     echo "</td>";
     echo "<td>" . $LANG['profiles'][6] . "&nbsp;:</td><td>";
     Dropdown::showYesNo("add_followups", $this->fields["add_followups"]);
     echo "</td>";
     echo "<td>" . $LANG['profiles'][15] . "&nbsp;:</td><td>";
     Dropdown::showYesNo("global_add_followups", $this->fields["global_add_followups"]);
     echo "</td></tr>\n";
     echo "<tr class='tab_bg_2'>";
     echo "<td colspan='2'>&nbsp;</td>";
     echo "<td>" . $LANG['profiles'][4] . "&nbsp;:</td><td>";
     Dropdown::showYesNo("group_add_followups", $this->fields["group_add_followups"]);
     echo "</td>";
     echo "<td>" . $LANG['profiles'][45] . "&nbsp;:</td><td>";
     Dropdown::showYesNo("global_add_tasks", $this->fields["global_add_tasks"]);
     echo "</td></tr>\n";
     echo "<tr class='tab_bg_5'><th colspan='6'>" . $LANG['profiles'][40] . "</th>";
     echo "</tr>\n";
     echo "<tr class='tab_bg_2'>";
     echo "<td>" . $LANG['profiles'][18] . "&nbsp;:</td><td>";
     Dropdown::showYesNo("update_ticket", $this->fields["update_ticket"]);
     echo "</td>";
     echo "<td>" . $LANG['profiles'][44] . "&nbsp;:</td><td>";
     Dropdown::showYesNo("update_priority", $this->fields["update_priority"]);
     echo "</td>";
     echo "<td>" . $LANG['profiles'][46] . "&nbsp;:</td><td>";
     Dropdown::showYesNo("update_tasks", $this->fields["update_tasks"]);
     echo "</td></tr>\n";
     echo "<tr class='tab_bg_2'>";
     echo "<td>" . $LANG['profiles'][50] . "&nbsp;:</td><td>";
     Dropdown::showYesNo("update_own_followups", $this->fields["update_own_followups"]);
     echo "</td>";
     echo "<td>" . $LANG['profiles'][35] . "&nbsp;:</td><td>";
     Dropdown::showYesNo("update_followups", $this->fields["update_followups"]);
     echo "</td>\n";
     echo "<td colspan='2'></td></tr>\n";
     echo "<tr class='tab_bg_5'><th colspan='6'>" . $LANG['ocsconfig'][50] . "</th><";
     echo "/tr>\n";
     echo "<tr class='tab_bg_2'>";
     echo "<td>" . $LANG['profiles'][14] . "&nbsp;:</td><td>";
     Dropdown::showYesNo("delete_ticket", $this->fields["delete_ticket"]);
     echo "</td>";
     echo "<td>" . $LANG['profiles'][51] . "&nbsp;:</td><td>";
     Dropdown::showYesNo("delete_followups", $this->fields["delete_followups"]);
     echo "</td>\n";
     echo "<td colspan='2'></td></tr>\n";
     echo "<tr class='tab_bg_5'><th colspan='6'>" . $LANG['validation'][0] . "</th><";
     echo "/tr>\n";
     echo "<tr class='tab_bg_2'>";
     echo "<td>" . $LANG['profiles'][48] . "&nbsp;:</td><td>";
     Dropdown::showYesNo("create_validation", $this->fields["create_validation"]);
     echo "<td>" . $LANG['profiles'][49] . "&nbsp;:</td><td>";
     Dropdown::showYesNo("validate_ticket", $this->fields["validate_ticket"]);
     echo "</td>";
     echo "<td colspan='2'></td></tr>\n";
     echo "<tr class='tab_bg_5'><th colspan='6'>" . $LANG['profiles'][39] . "</th>";
     echo "</tr>\n";
     echo "<tr class='tab_bg_2'>";
     echo "<td>" . $LANG['profiles'][16] . "&nbsp;:</td><td>";
     Dropdown::showYesNo("own_ticket", $this->fields["own_ticket"]);
     echo "<td>" . $LANG['profiles'][17] . "&nbsp;:</td><td>";
     Dropdown::showYesNo("steal_ticket", $this->fields["steal_ticket"]);
     echo "</td>";
     echo "<td>" . $LANG['profiles'][19] . "&nbsp;:</td><td>";
     Dropdown::showYesNo("assign_ticket", $this->fields["assign_ticket"]);
     echo "</td></tr>\n";
     echo "<tr class='tab_bg_5'><th colspan='6'>" . $LANG['profiles'][42] . "</th>";
     echo "</tr>\n";
     echo "<tr class='tab_bg_2'>";
     echo "<td>" . $LANG['profiles'][27] . "&nbsp;:</td><td>";
     Dropdown::showYesNo("show_group_hardware", $this->fields["show_group_hardware"]);
     echo "</td>";
     echo "<td>" . $LANG['setup'][350] . "&nbsp;:</td>";
     echo "\n<td><select name='helpdesk_hardware'>";
     echo "<option value='0' " . ($this->fields["helpdesk_hardware"] == 0 ? "selected" : "") . " >" . DROPDOWN_EMPTY_VALUE . "</option>\n";
     echo "<option value=\"" . pow(2, HELPDESK_MY_HARDWARE) . "\" " . ($this->fields["helpdesk_hardware"] == pow(2, HELPDESK_MY_HARDWARE) ? "selected" : "") . " >" . $LANG['tracking'][1] . "</option>\n";
     echo "<option value=\"" . pow(2, HELPDESK_ALL_HARDWARE) . "\" " . ($this->fields["helpdesk_hardware"] == pow(2, HELPDESK_ALL_HARDWARE) ? "selected" : "") . " >" . $LANG['setup'][351] . "</option>\n";
     echo "<option value=\"" . (pow(2, HELPDESK_MY_HARDWARE) + pow(2, HELPDESK_ALL_HARDWARE)) . "\" " . ($this->fields["helpdesk_hardware"] == pow(2, HELPDESK_MY_HARDWARE) + pow(2, HELPDESK_ALL_HARDWARE) ? "selected" : "") . " >" . $LANG['tracking'][1] . " + " . $LANG['setup'][351] . "</option>";
     echo "</select></td>\n";
     echo "<td>" . $LANG['setup'][352] . "&nbsp;:</td>";
     echo "<td><input type='hidden' name='_helpdesk_item_types' value='1'>";
     echo "<select name='helpdesk_item_type[]' multiple size='3'>";
     foreach ($CFG_GLPI["ticket_types"] as $key => $itemtype) {
         if (class_exists($itemtype)) {
             if (!isPluginItemType($itemtype)) {
                 // No Plugin for the moment
                 $item = new $itemtype();
                 echo "<option value='" . $itemtype . "' " . (in_array($itemtype, $this->fields["helpdesk_item_type"]) ? " selected" : "") . ">" . $item->getTypeName() . "</option>\n";
             }
         } else {
             unset($CFG_GLPI["ticket_types"][$key]);
         }
     }
     echo "</select></td>";
     echo "</tr>\n";
     echo "<tr class='tab_bg_5'><th colspan='6'>" . $LANG['profiles'][38] . "</th>";
     echo "</tr>\n";
     echo "<tr class='tab_bg_2'>";
     echo "<td>" . $LANG['profiles'][32] . "&nbsp;:</td><td>";
     Dropdown::showYesNo("show_assign_ticket", $this->fields["show_assign_ticket"]);
     echo "</td>";
     echo "<td>" . $LANG['profiles'][26] . "&nbsp;:</td><td>";
     Dropdown::showYesNo("show_group_ticket", $this->fields["show_group_ticket"]);
     echo "</td>";
     echo "<td>" . $LANG['profiles'][7] . "&nbsp;:</td><td>";
     Dropdown::showYesNo("show_all_ticket", $this->fields["show_all_ticket"]);
     echo "</td></tr>\n";
     echo "<tr class='tab_bg_2'>";
     echo "<td>" . $LANG['profiles'][9] . "&nbsp;:</td><td>";
     Dropdown::showYesNo("observe_ticket", $this->fields["observe_ticket"]);
     echo "</td>";
     echo "<td>" . $LANG['profiles'][8] . "&nbsp;:</td><td>";
     Dropdown::showYesNo("show_full_ticket", $this->fields["show_full_ticket"]);
     echo "</td>";
     echo "<td>" . $LANG['Menu'][13] . "&nbsp;:</td><td>";
     Dropdown::showYesNo("statistic", $this->fields["statistic"]);
     echo "</td></tr>\n";
     echo "<tr class='tab_bg_2'>";
     echo "<td>" . $LANG['profiles'][20] . "&nbsp;:</td><td>";
     Dropdown::showYesNo("show_planning", $this->fields["show_planning"]);
     echo "</td>";
     echo "<td>" . $LANG['profiles'][36] . "&nbsp;:</td><td>";
     Dropdown::showYesNo("show_group_planning", $this->fields["show_group_planning"]);
     echo "</td>";
     echo "<td>" . $LANG['profiles'][21] . "&nbsp;:</td><td>";
     Dropdown::showYesNo("show_all_planning", $this->fields["show_all_planning"]);
     echo "</td></tr>\n";
     echo "</table><br><table class='tab_cadre_fixe'>";
     $tabstatus = Ticket::getAllStatusArray();
     echo "<th colspan='" . (count($tabstatus) + 1) . "'>" . $LANG['setup'][615] . "</th>";
     echo "<tr class='tab_bg_1'><td class='b center'>" . $LANG['setup'][616];
     echo "<input type='hidden' name='_cycles' value='1'</td>";
     foreach ($tabstatus as $label) {
         echo "<td class='center'>{$label}</td>";
     }
     echo "</tr>\n";
     foreach ($tabstatus as $from => $label) {
         echo "<tr class='tab_bg_2'><td class='tab_bg_1'>{$label}</td>";
         foreach ($tabstatus as $dest => $label) {
             echo "<td class='center'>";
             if ($dest == $from) {
                 echo Dropdown::getYesNo(1);
             } else {
                 Dropdown::showYesNo("_cycle[{$from}][{$dest}]", !isset($this->fields['helpdesk_status'][$from][$dest]) || $this->fields['helpdesk_status'][$from][$dest]);
             }
             echo "</td>";
         }
         echo "</tr>\n";
     }
     if ($canedit && $closeform) {
         echo "<tr class='tab_bg_1'>";
         echo "<td colspan='" . (count($tabstatus) + 1) . "' class='center'>";
         echo "<input type='hidden' name='id' value={$ID}>";
         echo "<input type='submit' name='update' value=\"" . $LANG['buttons'][7] . "\" class='submit'>";
         echo "</td></tr>\n";
         echo "</table></form>\n";
     } else {
         echo "</table>\n";
     }
     echo "</div>";
 }