当前位置: 首页>>代码示例>>PHP>>正文


PHP Ticket::getUrgencyName方法代码示例

本文整理汇总了PHP中Ticket::getUrgencyName方法的典型用法代码示例。如果您正苦于以下问题:PHP Ticket::getUrgencyName方法的具体用法?PHP Ticket::getUrgencyName怎么用?PHP Ticket::getUrgencyName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Ticket的用法示例。


在下文中一共展示了Ticket::getUrgencyName方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getCriteriaValue

 /**
  * Return a value associated with a pattern associated to a criteria to display it
  *
  * @param $ID        the given criteria
  * @param $condition condition used
  * @param $value     the pattern
  **/
 function getCriteriaValue($ID, $condition, $value)
 {
     if (!in_array($condition, array(self::PATTERN_DOES_NOT_EXISTS, self::PATTERN_EXISTS, self::PATTERN_IS, self::PATTERN_IS_NOT, self::PATTERN_NOT_UNDER, self::PATTERN_UNDER))) {
         $crit = $this->getCriteria($ID);
         if (isset($crit['type'])) {
             switch ($crit['type']) {
                 case "dropdown":
                     $tmp = Dropdown::getDropdownName($crit["table"], $value, false, false);
                     //$tmp = Dropdown::getDropdownName($crit["table"], $value);
                     // return empty string to be able to check if set
                     if ($tmp == ' ') {
                         return '';
                     }
                     return $tmp;
                 case "dropdown_assign":
                 case "dropdown_users":
                     return getUserName($value);
                 case "yesonly":
                 case "yesno":
                     return Dropdown::getYesNo($value);
                 case "dropdown_impact":
                     return Ticket::getImpactName($value);
                 case "dropdown_urgency":
                     return Ticket::getUrgencyName($value);
                 case "dropdown_priority":
                     return Ticket::getPriorityName($value);
             }
         }
     }
     return $value;
 }
开发者ID:pvasener,项目名称:glpi,代码行数:38,代码来源:rule.class.php

示例2: showFormHelpdesk

 /**
  * Print the config form for connections
  *
  * @return Nothing (display)
  **/
 function showFormHelpdesk()
 {
     global $DB, $CFG_GLPI;
     if (!self::canView()) {
         return false;
     }
     $canedit = Config::canUpdate();
     if ($canedit) {
         echo "<form name='form' action=\"" . Toolbox::getItemTypeFormURL(__CLASS__) . "\" method='post'>";
     }
     echo "<div class='center spaced' id='tabsbody'>";
     echo "<table class='tab_cadre_fixe'>";
     echo "<tr><th colspan='4'>" . __('Assistance') . "</th></tr>";
     echo "<tr class='tab_bg_2'>";
     echo "<td width='30%'>" . __('Step for the hours (minutes)') . "</td>";
     echo "<td width='20%'>";
     Dropdown::showNumber('time_step', array('value' => $CFG_GLPI["time_step"], 'min' => 30, 'max' => 60, 'step' => 30, 'toadd' => array(1 => 1, 5 => 5, 10 => 10, 15 => 15, 20 => 20)));
     echo "</td>";
     echo "<td width='30%'>" . __('Limit of the schedules for planning') . "</td>";
     echo "<td width='20%'>";
     Dropdown::showHours('planning_begin', array('value' => $CFG_GLPI["planning_begin"]));
     echo "&nbsp;->&nbsp;";
     Dropdown::showHours('planning_end', array('value' => $CFG_GLPI["planning_end"]));
     echo "</td></tr>";
     echo "<tr class='tab_bg_2'>";
     echo "<td>" . __('Default file size limit imported by the mails receiver') . "</td><td>";
     MailCollector::showMaxFilesize('default_mailcollector_filesize_max', $CFG_GLPI["default_mailcollector_filesize_max"]);
     echo "</td>";
     echo "<td>" . __('Use rich text for helpdesk') . "</td><td>";
     $id = 'alert' . mt_rand();
     $param['on_change'] = '$("#' . $id . '").html("");
         if ($(this).val() == 0) {
            $("#' . $id . '").html("<br>' . __('You will lose the formatting of your data') . '");
         }';
     Dropdown::showYesNo("use_rich_text", $CFG_GLPI["use_rich_text"], -1, $param);
     echo "<span class='red' id='" . $id . "'></span>";
     echo "</td></tr>";
     echo "<tr class='tab_bg_2'>";
     echo "<td>" . __('Default heading when adding a document to a ticket') . "</td><td>";
     DocumentCategory::dropdown(array('value' => $CFG_GLPI["documentcategories_id_forticket"], 'name' => "documentcategories_id_forticket"));
     echo "</td>";
     echo "<td>" . __('By default, a software may be linked to a ticket') . "</td><td>";
     Dropdown::showYesNo("default_software_helpdesk_visible", $CFG_GLPI["default_software_helpdesk_visible"]);
     echo "</td></tr>";
     echo "<tr class='tab_bg_2'>";
     echo "<td>" . __('Keep tickets when purging hardware in the inventory') . "</td><td>";
     Dropdown::showYesNo("keep_tickets_on_delete", $CFG_GLPI["keep_tickets_on_delete"]);
     echo "</td><td>" . __('Show personnal information in new ticket form (simplified interface)');
     echo "</td><td>";
     Dropdown::showYesNo('use_check_pref', $CFG_GLPI['use_check_pref']);
     echo "</td></tr>";
     echo "<tr class='tab_bg_2'>";
     echo "<td>" . __('Allow anonymous ticket creation (helpdesk.receiver)') . "</td><td>";
     Dropdown::showYesNo("use_anonymous_helpdesk", $CFG_GLPI["use_anonymous_helpdesk"]);
     echo "</td><td>" . __('Allow anonymous followups (receiver)') . "</td><td>";
     Dropdown::showYesNo("use_anonymous_followups", $CFG_GLPI["use_anonymous_followups"]);
     echo "</td></tr>";
     echo "</table>";
     echo "<table class='tab_cadre_fixe'>";
     echo "<tr><th colspan='7'>" . __('Matrix of calculus for priority');
     echo "<input type='hidden' name='_matrix' value='1'></th></tr>";
     echo "<tr class='tab_bg_2'>";
     echo "<td class='b right' colspan='2'>" . __('Impact') . "</td>";
     for ($impact = 5; $impact >= 1; $impact--) {
         echo "<td class='center'>" . Ticket::getImpactName($impact) . '<br>';
         if ($impact == 3) {
             $isimpact[3] = 1;
             echo "<input type='hidden' name='_impact_3' value='1'>";
         } else {
             $isimpact[$impact] = ($CFG_GLPI['impact_mask'] & 1 << $impact) > 0;
             Dropdown::showYesNo("_impact_{$impact}", $isimpact[$impact]);
         }
         echo "</td>";
     }
     echo "</tr>";
     echo "<tr class='tab_bg_1'>";
     echo "<td class='b' colspan='2'>" . __('Urgency') . "</td>";
     for ($impact = 5; $impact >= 1; $impact--) {
         echo "<td>&nbsp;</td>";
     }
     echo "</tr>";
     for ($urgency = 5; $urgency >= 1; $urgency--) {
         echo "<tr class='tab_bg_1'>";
         echo "<td>" . Ticket::getUrgencyName($urgency) . "&nbsp;</td>";
         echo "<td>";
         if ($urgency == 3) {
             $isurgency[3] = 1;
             echo "<input type='hidden' name='_urgency_3' value='1'>";
         } else {
             $isurgency[$urgency] = ($CFG_GLPI['urgency_mask'] & 1 << $urgency) > 0;
             Dropdown::showYesNo("_urgency_{$urgency}", $isurgency[$urgency]);
         }
         echo "</td>";
         for ($impact = 5; $impact >= 1; $impact--) {
             $pri = round(($urgency + $impact) / 2);
//.........这里部分代码省略.........
开发者ID:UnidadInformaticaSERVIUVI,项目名称:Administrador-de-Inventario,代码行数:101,代码来源:config.class.php

示例3: methodListTickets


//.........这里部分代码省略.........
     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;
 }
开发者ID:geldarr,项目名称:hack-space,代码行数:101,代码来源:methodhelpdesk.class.php

示例4: listSpecialDropdown

 /**
  * 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;
 }
开发者ID:JULIO8,项目名称:respaldo_glpi,代码行数:59,代码来源:methodcommon.class.php

示例5: getVal

 public static function getVal(&$val1, &$val2, &$next, &$prev, &$title)
 {
     global $LANG, $DB;
     $next = 0;
     $prev = 0;
     $title = "";
     $job = new Ticket();
     switch ($_GET["type"]) {
         case "technicien":
             $val1 = $_GET["id"];
             $val2 = "";
             $next = getNextItem("glpi_users", $_GET["id"]);
             $prev = getPreviousItem("glpi_users", $_GET["id"]);
             $title = $LANG['stats'][16] . "&nbsp;: " . Ticket::getAssignName($_GET["id"], 'User', 1);
             break;
         case "technicien_followup":
             $val1 = $_GET["id"];
             $val2 = "";
             $next = getNextItem("glpi_users", $_GET["id"]);
             $prev = getPreviousItem("glpi_users", $_GET["id"]);
             $title = $LANG['stats'][16] . "&nbsp;: " . Ticket::getAssignName($_GET["id"], 'User', 1);
             break;
         case "enterprise":
             $val1 = $_GET["id"];
             $val2 = "";
             $next = getNextItem("glpi_suppliers", $_GET["id"]);
             $prev = getPreviousItem("glpi_suppliers", $_GET["id"]);
             $title = $LANG['stats'][44] . "&nbsp;: " . Ticket::getAssignName($_GET["id"], 'Supplier', 1);
             break;
         case "user":
             $val1 = $_GET["id"];
             $val2 = "";
             $job->fields["users_id"] = $_GET["id"];
             $next = getNextItem("glpi_users", $_GET["id"]);
             $prev = getPreviousItem("glpi_users", $_GET["id"]);
             //$title = $LANG['stats'][20]."&nbsp;: ".$job->getAuthorName();
             //user footer
             $title = $LANG['stats'][20] . "&nbsp;: " . getUserName($_GET["id"]);
             break;
         case "users_id_recipient":
             $val1 = $_GET["id"];
             $val2 = "";
             $job->fields["users_id"] = $_GET["id"];
             $next = getNextItem("glpi_users", $_GET["id"]);
             $prev = getPreviousItem("glpi_users", $_GET["id"]);
             //$title = $LANG['stats'][20]."&nbsp;: ".$job->getAuthorName();
             $title = $LANG['stats'][20] . "&nbsp;: ";
             break;
         case "ticketcategories_id":
             $val1 = $_GET["id"];
             $val2 = "";
             $next = getNextItem("glpi_itilcategories", $_GET["id"], '', 'completename');
             $prev = getPreviousItem("glpi_itilcategories", $_GET["id"], '', 'completename');
             $title = $LANG['common'][36] . "&nbsp;: " . Dropdown::getDropdownName("glpi_itilcategories", $_GET["id"]);
             break;
         case "group":
             $val1 = $_GET["id"];
             $val2 = "";
             $next = getNextItem("glpi_groups", $_GET["id"]);
             $prev = getPreviousItem("glpi_groups", $_GET["id"]);
             $title = $LANG['common'][35] . "&nbsp;: " . Dropdown::getDropdownName("glpi_groups", $_GET["id"]);
             break;
         case "groups_id_assign":
             $val1 = $_GET["id"];
             $val2 = "";
             $next = getNextItem("glpi_groups", $_GET["id"]);
             $prev = getPreviousItem("glpi_groups", $_GET["id"]);
             $title = $LANG['common'][35] . "&nbsp;: " . Dropdown::getDropdownName("glpi_groups", $_GET["id"]);
             break;
         case "priority":
             $val1 = $_GET["id"];
             $val2 = "";
             $next = $prev = 0;
             if ($val1 < 6) {
                 $next = $val1 + 1;
             }
             if ($val1 > 1) {
                 $prev = $val1 - 1;
             }
             $title = $LANG['joblist'][2] . "&nbsp;: " . Ticket::getPriorityName($_GET["id"]);
             break;
         case "urgency":
             $val1 = $_GET["id"];
             $val2 = "";
             $next = $prev = 0;
             if ($val1 < 5) {
                 $next = $val1 + 1;
             }
             if ($val1 > 1) {
                 $prev = $val1 - 1;
             }
             $title = $LANG['joblist'][29] . "&nbsp;: " . Ticket::getUrgencyName($_GET["id"]);
             break;
         case "impact":
             $val1 = $_GET["id"];
             $val2 = "";
             $next = $prev = 0;
             if ($val1 < 5) {
                 $next = $val1 + 1;
             }
//.........这里部分代码省略.........
开发者ID:JULIO8,项目名称:respaldo_glpi,代码行数:101,代码来源:stat.class.php

示例6:

     if ($val1 > 1) {
         $prev = $val1 - 1;
     }
     $title = $LANG['joblist'][2] . "&nbsp;: " . Ticket::getPriorityName($_GET["id"]);
     break;
 case "urgency":
     $val1 = $_GET["id"];
     $val2 = "";
     $next = $prev = 0;
     if ($val1 < 5) {
         $next = $val1 + 1;
     }
     if ($val1 > 1) {
         $prev = $val1 - 1;
     }
     $title = $LANG['joblist'][29] . "&nbsp;: " . Ticket::getUrgencyName($_GET["id"]);
     break;
 case "impact":
     $val1 = $_GET["id"];
     $val2 = "";
     $next = $prev = 0;
     if ($val1 < 5) {
         $next = $val1 + 1;
     }
     if ($val1 > 1) {
         $prev = $val1 - 1;
     }
     $title = $LANG['joblist'][30] . "&nbsp;: " . Ticket::getImpactName($_GET["id"]);
     break;
 case "usertitles_id":
     $val1 = $_GET["id"];
开发者ID:ryukansent,项目名称:Thesis-SideB,代码行数:31,代码来源:stat.graph.php

示例7: constructHistory

 /**
  * Construct  history for an item
  *
  * @param $item CommonDBTM object
  * @param $oldvalues array of old values updated
  * @param $values array of all values of the item
  *
  * @return boolean for success (at least 1 log entry added)
  **/
 static function constructHistory(CommonDBTM $item, &$oldvalues, &$values)
 {
     global $LANG;
     if (!count($oldvalues)) {
         return false;
     }
     // needed to have  $SEARCHOPTION
     if ($item->getType() == 'TicketSatisfaction') {
         $real_type = 'Ticket';
         $real_id = $item->fields['tickets_id'];
     } else {
         if ($item->getType() == 'Infocom') {
             $real_type = $item->fields['itemtype'];
             $real_id = $item->fields['items_id'];
         } else {
             $real_type = $item->getType();
             $real_id = $item->fields['id'];
         }
     }
     $searchopt = Search::getOptions($real_type);
     if (!is_array($searchopt)) {
         return false;
     }
     $result = 0;
     foreach ($oldvalues as $key => $oldval) {
         $changes = array();
         if ($real_type == 'Infocom') {
             // Parsing $SEARCHOPTION to find infocom
             foreach ($searchopt as $key2 => $val2) {
                 if ($val2["field"] == $key && strpos($val2['table'], 'infocoms') || $key == 'budgets_id' && $val2['table'] == 'glpi_budgets' || $key == 'suppliers_id' && $val2['table'] == 'glpi_suppliers') {
                     $id_search_option = $key2;
                     // Give ID of the $SEARCHOPTION
                     if ($val2["table"] == "glpi_infocoms") {
                         // 1st case : text field -> keep datas
                         $changes = array($id_search_option, addslashes($oldval), $values[$key]);
                     } else {
                         if ($val2["table"] == "glpi_suppliers") {
                             // 2nd case ; link field -> get data from glpi_suppliers
                             $changes = array($id_search_option, addslashes(Dropdown::getDropdownName("glpi_suppliers", $oldval)), addslashes(Dropdown::getDropdownName("glpi_suppliers", $values[$key])));
                         } else {
                             // 3rd case ; link field -> get data from dropdown (budget)
                             $changes = array($id_search_option, addslashes(Dropdown::getDropdownName($val2["table"], $oldval)), addslashes(Dropdown::getDropdownName($val2["table"], $values[$key])));
                         }
                     }
                     break;
                     // foreach exit
                 }
             }
         } else {
             // Not an Infocom
             // Parsing $SEARCHOPTION to find changed field
             foreach ($searchopt as $key2 => $val2) {
                 // Linkfield or standard field not massive action enable
                 if ($val2["linkfield"] == $key || $key == $val2["field"] && $val2["table"] == $item->getTable()) {
                     $id_search_option = $key2;
                     // Give ID of the $SEARCHOPTION
                     // 1st case : Ticket specific dropdown case (without table)
                     if ($real_type == 'Ticket' && in_array($key, array('status', 'urgency', 'impact', 'priority', 'global_validation'))) {
                         switch ($key) {
                             case 'global_validation':
                                 $changes = array($id_search_option, addslashes(TicketValidation::getStatus($oldval)), addslashes(TicketValidation::getStatus($values[$key])));
                                 break;
                             case 'status':
                                 $changes = array($id_search_option, addslashes(Ticket::getStatus($oldval)), addslashes(Ticket::getStatus($values[$key])));
                                 break;
                             case 'urgency':
                                 $changes = array($id_search_option, addslashes(Ticket::getUrgencyName($oldval)), addslashes(Ticket::getUrgencyName($values[$key])));
                                 break;
                             case 'impact':
                                 $changes = array($id_search_option, addslashes(Ticket::getImpactName($oldval)), addslashes(Ticket::getImpactName($values[$key])));
                                 break;
                             case 'priority':
                                 $changes = array($id_search_option, addslashes(Ticket::getPriorityName($oldval)), addslashes(Ticket::getPriorityName($values[$key])));
                                 break;
                         }
                     } else {
                         if ($val2["table"] == $item->getTable()) {
                             // 2nd case : text field -> keep datas
                             $changes = array($id_search_option, addslashes($oldval), $values[$key]);
                         } else {
                             //                      if ($val2['table'] == 'glpi_users_validation') {
                             //                         $val2['table'] = 'glpi_users';
                             //                      }
                             // other cases ; link field -> get data from dropdown
                             if ($val2["table"] != 'glpi_complete_entities') {
                                 $changes = array($id_search_option, addslashes(Dropdown::getDropdownName($val2["table"], $oldval)), addslashes(Dropdown::getDropdownName($val2["table"], $values[$key])));
                             }
                         }
                     }
                     break;
                 }
//.........这里部分代码省略.........
开发者ID:ryukansent,项目名称:Thesis-SideB,代码行数:101,代码来源:log.class.php

示例8: showForm

 function showForm(Ticket $ticket)
 {
     global $CFG_GLPI;
     echo "<form method='post' name='' id=''  action=\"" . $CFG_GLPI['root_doc'] . "/plugins/escalation/front/ticketcopy.form.php\">";
     echo "<table width='950' class='tab_cadre_fixe'>";
     echo "<tr>";
     echo "<th colspan='3'>";
     echo "Copie de ticket (Liste des champs à copier)";
     echo "</th>";
     echo "</tr>";
     echo "<tr>";
     echo "<td colspan='3' align='center'>";
     echo "<a href=\"javascript:showHideDiv('listfields','imgcat0','../../pics/folder.png'," . "'../../pics/folder-open.png');\">";
     echo "Voir tous les champs</a>";
     echo "</td>";
     echo "</tr>";
     echo "<tr>";
     echo "<td>";
     echo "</td>";
     echo "<td>";
     echo "Lier au ticket";
     echo "</td>";
     echo "<td>";
     Dropdown::showYesNo('link');
     echo "</td>";
     echo "</tr>";
     $this->displayField(__('Title'), "name", $ticket->fields['name'], '', 'checked');
     $this->displayField(__('Description'), "content", $ticket->fields['content'], '', 'checked');
     echo "</table>";
     echo "<div id='listfields' style='display:none;'>";
     echo "<table width='950' class='tab_cadre_fixe'>";
     $this->displayField(__('Status'), "status", Ticket::getStatus($ticket->fields['status']), $ticket->fields['status']);
     $this->displayField(__('Type'), "type", Ticket::getTicketTypeName($ticket->fields['type']), $ticket->fields['type']);
     $this->displayField(__('Urgency'), "urgency", Ticket::getUrgencyName($ticket->fields['urgency']), $ticket->fields['urgency']);
     $this->displayField(__('Impact'), "impact", Ticket::getImpactName($ticket->fields['impact']), $ticket->fields['impact']);
     $this->displayField(__('Priority'), "priority", Ticket::getPriorityName($ticket->fields['priority']), $ticket->fields['priority']);
     $this->displayField(__('Due date'), "due_date", Html::convDateTime($ticket->fields['due_date']), $ticket->fields['due_date']);
     $this->displayField(__('Category'), "itilcategories_id", Dropdown::getDropdownName('glpi_itilcategories', $ticket->fields['itilcategories_id']), $ticket->fields['itilcategories_id']);
     if ($ticket->fields['items_id'] > 0) {
         $this->displayField(__('Associated element') . ' - ' . __('Type'), "itemtype", call_user_func(array($ticket->fields['itemtype'], 'getTypeName')), $ticket->fields['itemtype']);
         $this->displayField(__('Associated element'), "items_id", Dropdown::getDropdownName(getTableForItemType($ticket->fields['itemtype']), $ticket->fields['items_id']), $ticket->fields['items_id']);
     }
     $this->displayField(__('Request source'), "requesttypes_id", Dropdown::getDropdownName('glpi_requesttypes', $ticket->fields['requesttypes_id']), $ticket->fields['requesttypes_id']);
     $this->displayField(__('SLA'), "slas_id", Dropdown::getDropdownName('glpi_slas', $ticket->fields['slas_id']), $ticket->fields['slas_id']);
     $ticket_User = new Ticket_User();
     $a_ticket_users = $ticket_User->find("`tickets_id`='" . $ticket->getID() . "'\n         AND `type`='1'");
     foreach ($a_ticket_users as $data) {
         $name = '';
         if ($data['users_id'] == 0) {
             $name = $data['alternative_email'];
         } else {
             $name = Dropdown::getDropdownName('glpi_users', $data['users_id']);
         }
         $this->displayField(__('Requester'), "_users_id_requester", $name, $data['id']);
     }
     $group_Ticket = new Group_Ticket();
     $a_group_tickets = $group_Ticket->find("`tickets_id`='" . $ticket->getID() . "'\n         AND `type`='1'");
     foreach ($a_group_tickets as $data) {
         $this->displayField(__('Requester group'), "_groups_id_requester", Dropdown::getDropdownName('glpi_groups', $data['groups_id']), $data['groups_id']);
     }
     // Techs
     $peConfig = new PluginEscalationConfig();
     if ($peConfig->getValue('workflow', $ticket->fields['entities_id']) == '0') {
         $a_ticket_uers = $ticket_User->find("`tickets_id`='" . $ticket->getID() . "'\n            AND `type`='2'");
         foreach ($a_ticket_uers as $data) {
             $name = '';
             if ($data['users_id'] == 0) {
                 $name = $data['alternative_email'];
             } else {
                 $name = Dropdown::getDropdownName('glpi_users', $data['users_id']);
             }
             $this->displayField(__('Technician'), "_users_id_assign", $name, $data['id']);
         }
         $a_group_tickets = $group_Ticket->find("`tickets_id`='" . $ticket->getID() . "'\n            AND `type`='2'");
         foreach ($a_group_tickets as $data) {
             $this->displayField(__('Group in charge of the ticket'), "_groups_id_assign", Dropdown::getDropdownName('glpi_groups', $data['groups_id']), $data['groups_id']);
         }
     }
     $ticketFollowup = new TicketFollowup();
     $followups = $ticketFollowup->find("`tickets_id`='" . $ticket->getID() . "'");
     foreach ($followups as $data) {
         $this->displayField(__('Follow-up'), "followup-" . $data['id'], $data['content'], $data['id']);
     }
     $ticketTask = new TicketTask();
     $tasks = $ticketTask->find("`tickets_id`='" . $ticket->getID() . "'");
     foreach ($tasks as $data) {
         $this->displayField(__('Task'), "task-" . $data['id'], $data['content'], $data['id']);
     }
     // Documents
     //      $document_Item = new Document_Item();
     //      $docs = $document_Item->find("`items_id`='".$ticket->getID()."'
     //         AND `itemtype`='Ticket'");
     //      foreach ($docs as $data) {
     //         $this->displayField($LANG['document'][18], "filename",
     //            Dropdown::getDropdownName("glpi_documents", $data['documents_id']),
     //            $data['documents_id']);
     //      }
     //      // filename[]
     echo "</table>";
     echo "</div>";
//.........这里部分代码省略.........
开发者ID:geldarr,项目名称:hack-space,代码行数:101,代码来源:ticketcopy.class.php

示例9: giveItem


//.........这里部分代码省略.........
         case 'glpi_crontasks.mode':
             return CronTask::getModeName($data[$NAME . $num]);
         case 'glpi_crontasks.itemtype':
             if ($plug = isPluginItemType($data[$NAME . $num])) {
                 return $plug['plugin'];
             }
             return '';
         case 'glpi_tickets.status':
             $status = Ticket::getStatus($data[$NAME . $num]);
             // status Stevenes Donato
             if ($data[$NAME . $num] == "1") {
                 $data[$NAME . $num] = "new";
             }
             if ($data[$NAME . $num] == "2") {
                 $data[$NAME . $num] = "assign";
             }
             if ($data[$NAME . $num] == "3") {
                 $data[$NAME . $num] = "plan";
             }
             if ($data[$NAME . $num] == "4") {
                 $data[$NAME . $num] = "waiting";
             }
             if ($data[$NAME . $num] == "5") {
                 $data[$NAME . $num] = "solved";
             }
             if ($data[$NAME . $num] == "6") {
                 $data[$NAME . $num] = "closed";
             }
             //
             return "<img src=\"" . $CFG_GLPI["root_doc"] . "/pics/" . $data[$NAME . $num] . ".png\"\n                        alt='{$status}' title='{$status}'>&nbsp;{$status}";
         case 'glpi_tickets.priority':
             return Ticket::getPriorityName($data[$NAME . $num]);
         case 'glpi_tickets.urgency':
             return Ticket::getUrgencyName($data[$NAME . $num]);
         case 'glpi_tickets.impact':
             return Ticket::getImpactName($data[$NAME . $num]);
         case 'glpi_tickets.items_id':
             if (!empty($data[$NAME . $num . "_2"]) && class_exists($data[$NAME . $num . "_2"])) {
                 $item = new $data[$NAME . $num . "_2"]();
                 if ($item->getFromDB($data[$NAME . $num])) {
                     return $item->getLink(true);
                 }
             }
             return '&nbsp;';
         case 'glpi_tickets.id':
             $link = getItemTypeFormURLMobile('Ticket');
             $out = "<a id='ticket" . $data[$NAME . $num . "_2"] . "' href=\"" . $link;
             $out .= strstr($link, '?') ? '&amp;' : '?';
             $out .= 'id=' . $data[$NAME . $num];
             //$out .= 'id='.$data[$NAME.$num."_2"];
             $out .= "\" data-back='false'>" . $data[$NAME . $num];
             if ($_SESSION["glpiis_ids_visible"] || empty($data[$NAME . $num])) {
                 //$out .= " (".$data[$NAME.$num."_2"].")";
                 $out .= $data[$NAME . $num . "_2"];
             }
             $out .= "</a>";
             return $out;
         case 'glpi_ticketvalidations.status':
         case "glpi_tickets.global_validation":
             $split = explode("\$\$\$\$", $data[$NAME . $num]);
             $out = '';
             foreach ($split as $val) {
                 $status = TicketValidation::getStatus($val);
                 $bgcolor = TicketValidation::getStatusColor($val);
                 $out .= (empty($out) ? '' : '<br>') . "<div style=\"background-color:" . $bgcolor . ";\">" . $status . '</div>';
             }
开发者ID:paisdelconocimiento,项目名称:glpi-smartcities,代码行数:67,代码来源:search.class.php

示例10: getUrgencyLabelsArray

function getUrgencyLabelsArray()
{
    return array("1" => Ticket::getUrgencyName(1), "2" => Ticket::getUrgencyName(2), "3" => Ticket::getUrgencyName(3), "4" => Ticket::getUrgencyName(4), "5" => Ticket::getUrgencyName(5));
}
开发者ID:paisdelconocimiento,项目名称:glpi-smartcities,代码行数:4,代码来源:function.php

示例11: getCriteriaValue

 /**
  * Return a value associated with a pattern associated to a criteria to display it
  *
  * @param $ID the given criteria
  * @param $condition condition used
  * @param $value the pattern
  **/
 function getCriteriaValue($ID, $condition, $value)
 {
     global $LANG;
     if ($condition != self::PATTERN_IS && $condition != self::PATTERN_IS_NOT) {
         $crit = $this->getCriteria($ID);
         if (isset($crit['type'])) {
             switch ($crit['type']) {
                 case "dropdown":
                     return Dropdown::getDropdownName($crit["table"], $value);
                 case "dropdown_assign":
                 case "dropdown_users":
                     return getUserName($value);
                 case "yesonly":
                 case "yesonly":
                 case "yesno":
                     if ($value) {
                         return $LANG['choice'][1];
                     }
                     return $LANG['choice'][0];
                 case "dropdown_impact":
                     return Ticket::getImpactName($value);
                 case "dropdown_urgency":
                     return Ticket::getUrgencyName($value);
                 case "dropdown_priority":
                     return Ticket::getPriorityName($value);
             }
         }
     }
     return $value;
 }
开发者ID:ryukansent,项目名称:Thesis-SideB,代码行数:37,代码来源:rule.class.php

示例12: giveItem


//.........这里部分代码省略.........
             if (empty($data[$NAME . $num])) {
                 return "<a title=\"" . $LANG['reservation'][22] . "\"\n                        href='" . $CFG_GLPI["root_doc"] . "/front/reservationitem.form.php?id=" . $data["refID"] . "' >" . $LANG['common'][49] . "</a>";
             }
             return "<a title=\"" . $LANG['reservation'][22] . "\"\n                     href='" . $CFG_GLPI["root_doc"] . "/front/reservationitem.form.php?id=" . $data['refID'] . "' >" . resume_text($data[$NAME . $num]) . "</a>";
         case 'glpi_notifications.mode':
             return Notification::getMode($data[$NAME . $num]);
         case 'glpi_notifications.event':
             $item = NotificationTarget::getInstanceByType($data['itemtype']);
             if ($item) {
                 $events = $item->getAllEvents();
                 return $events[$data[$NAME . $num]];
             }
             return '';
         case 'glpi_crontasks.description':
             $tmp = new CronTask();
             return $tmp->getDescription($data['id']);
         case 'glpi_crontasks.state':
             return CronTask::getStateName($data[$NAME . $num]);
         case 'glpi_crontasks.mode':
             return CronTask::getModeName($data[$NAME . $num]);
         case 'glpi_crontasks.itemtype':
             if ($plug = isPluginItemType($data[$NAME . $num])) {
                 return $plug['plugin'];
             }
             return '';
         case 'glpi_tickets.status':
             $status = Ticket::getStatus($data[$NAME . $num]);
             return "<img src=\"" . $CFG_GLPI["root_doc"] . "/pics/" . $data[$NAME . $num] . ".png\"\n                     alt=\"{$status}\" title=\"{$status}\">&nbsp;{$status}";
         case 'glpi_tickets.type':
             return Ticket::getTicketTypeName($data[$NAME . $num]);
         case 'glpi_tickets.priority':
             return Ticket::getPriorityName($data[$NAME . $num]);
         case 'glpi_tickets.urgency':
             return Ticket::getUrgencyName($data[$NAME . $num]);
         case 'glpi_tickets.impact':
             return Ticket::getImpactName($data[$NAME . $num]);
         case 'glpi_tickets.items_id':
             if (!empty($data[$NAME . $num . "_2"]) && class_exists($data[$NAME . $num . "_2"])) {
                 $item = new $data[$NAME . $num . "_2"]();
                 if ($item->getFromDB($data[$NAME . $num])) {
                     return $item->getLink(true);
                 }
             }
             return '&nbsp;';
         case 'glpi_tickets.name':
             $link = getItemTypeFormURL('Ticket');
             $out = "<a id='ticket" . $data[$NAME . $num . "_2"] . "' href=\"" . $link;
             $out .= strstr($link, '?') ? '&amp;' : '?';
             $out .= 'id=' . $data[$NAME . $num . "_2"];
             // Force solution tab if solved
             if ($data[$NAME . $num . "_4"] == 'solved') {
                 $out .= "&amp;forcetab=4";
             }
             $out .= "\">" . $data[$NAME . $num];
             if ($_SESSION["glpiis_ids_visible"] || empty($data[$NAME . $num])) {
                 $out .= " (" . $data[$NAME . $num . "_2"] . ")";
             }
             $out .= "</a>";
             $out .= showToolTip(nl2br($data[$NAME . $num . "_3"]), array('applyto' => 'ticket' . $data[$NAME . $num . "_2"], 'display' => false));
             return $out;
         case "glpi_tickets.due_date":
             // No due date in waiting status
             if ($data[$NAME . $num . '_2'] == 'waiting') {
                 $data[$NAME . $num] = "";
             }
             break;
开发者ID:ryukansent,项目名称:Thesis-SideB,代码行数:67,代码来源:search.class.php

示例13: getDatasForTemplate

 /**
  * Get all data needed for template processing
  **/
 function getDatasForTemplate($event, $options = array())
 {
     global $LANG, $CFG_GLPI;
     //----------- Ticket infos -------------- //
     if ($event != 'alertnotclosed') {
         $fields = array('ticket.title' => 'name', 'ticket.content' => 'content', 'ticket.description' => 'content', 'ticket.costfixed' => 'cost_fixed', 'ticket.costmaterial' => 'cost_material');
         foreach ($fields as $tag => $table_field) {
             $this->datas['##' . $tag . '##'] = $this->obj->getField($table_field);
         }
         $this->datas['##ticket.id##'] = sprintf("%07d", $this->obj->getField("id"));
         $this->datas['##ticket.url##'] = urldecode($CFG_GLPI["url_base"] . "/index.php?redirect=ticket_" . $this->obj->getField("id"));
         $this->datas['##ticket.urlapprove##'] = urldecode($CFG_GLPI["url_base"] . "/index.php?redirect=ticket_" . $this->obj->getField("id") . "_4");
         $this->datas['##ticket.urlvalidation##'] = urldecode($CFG_GLPI["url_base"] . "/index.php?redirect=ticket_" . $this->obj->getField("id") . "_7");
         $this->datas['##ticket.entity##'] = Dropdown::getDropdownName('glpi_entities', $this->getEntity());
         $events = $this->getAllEvents();
         if ($event == 'validation' && isset($options['validation_status'])) {
             $this->datas['##ticket.action##'] = $LANG['validation'][0] . ' - ' . TicketValidation::getStatus($options['validation_status']);
         } else {
             $this->datas['##ticket.action##'] = $events[$event];
         }
         $this->datas['##ticket.storestatus##'] = $this->obj->getField('status');
         $this->datas['##ticket.status##'] = Ticket::getStatus($this->obj->getField('status'));
         $this->datas['##ticket.globalvalidation##'] = TicketValidation::getStatus($this->obj->getField('global_validation'));
         $this->datas['##ticket.type##'] = Ticket::getTicketTypeName($this->obj->getField('type'));
         $this->datas['##ticket.requesttype##'] = Dropdown::getDropdownName('glpi_requesttypes', $this->obj->getField('requesttypes_id'));
         $this->datas['##ticket.urgency##'] = Ticket::getUrgencyName($this->obj->getField('urgency'));
         $this->datas['##ticket.impact##'] = Ticket::getImpactName($this->obj->getField('impact'));
         $this->datas['##ticket.priority##'] = Ticket::getPriorityName($this->obj->getField('priority'));
         $this->datas['##ticket.time##'] = Ticket::getActionTime($this->obj->getField('actiontime'));
         $this->datas['##ticket.costtime##'] = $this->obj->getField('cost_time');
         $this->datas['##ticket.creationdate##'] = convDateTime($this->obj->getField('date'));
         $this->datas['##ticket.closedate##'] = convDateTime($this->obj->getField('closedate'));
         $this->datas['##ticket.solvedate##'] = convDateTime($this->obj->getField('solvedate'));
         $this->datas['##ticket.duedate##'] = convDateTime($this->obj->getField('due_date'));
         $entitydata = new EntityData();
         $autoclose_value = $CFG_GLPI['autoclose_delay'];
         if ($entitydata->getFromDB($this->getEntity())) {
             $autoclose_value = $entitydata->getField('autoclose_delay');
             // Set global config value
             if ($autoclose_value == -1) {
                 $autoclose_value = $CFG_GLPI['autoclose_delay'];
             }
         }
         if ($autoclose_value > 0) {
             $this->datas['##ticket.autoclose##'] = $autoclose_value;
             $this->datas['##lang.ticket.autoclosewarning##'] = $LANG['job'][54] . " " . $autoclose_value . " " . $LANG['stats'][31];
         } else {
             $this->datas['##ticket.autoclose##'] = $LANG['setup'][307];
             $this->datas['##lang.ticket.autoclosewarning##'] = "";
         }
         if ($this->obj->getField('ticketcategories_id')) {
             $this->datas['##ticket.category##'] = Dropdown::getDropdownName('glpi_ticketcategories', $this->obj->getField('ticketcategories_id'));
         } else {
             $this->datas['##ticket.category##'] = '';
         }
         if ($this->obj->getField('slas_id')) {
             $this->datas['##ticket.sla##'] = Dropdown::getDropdownName('glpi_slas', $this->obj->getField('slas_id'));
         } else {
             $this->datas['##ticket.sla##'] = '';
         }
         if ($this->obj->countUsers(Ticket::REQUESTER)) {
             $users = array();
             foreach ($this->obj->getUsers(Ticket::REQUESTER) as $uid => $tmp) {
                 $user_tmp = new User();
                 $user_tmp->getFromDB($uid);
                 $users[$uid] = $user_tmp->getName();
                 $tmp = array();
                 $tmp['##author.id##'] = $uid;
                 $tmp['##author.name##'] = $user_tmp->getName();
                 if ($user_tmp->getField('locations_id')) {
                     $tmp['##author.location##'] = Dropdown::getDropdownName('glpi_locations', $user_tmp->getField('locations_id'));
                 } else {
                     $tmp['##author.location##'] = '';
                 }
                 $tmp['##author.phone##'] = $user_tmp->getField('phone');
                 $tmp['##author.phone2##'] = $user_tmp->getField('phone2');
                 $this->datas['authors'][] = $tmp;
             }
             $this->datas['##ticket.authors##'] = implode(', ', $users);
         } else {
             $this->datas['##ticket.authors##'] = '';
         }
         if ($this->obj->getField('users_id_recipient')) {
             $user_tmp = new User();
             $user_tmp->getFromDB($this->obj->getField('users_id_recipient'));
             $this->datas['##ticket.openbyuser##'] = $user_tmp->getName();
         } else {
             $this->datas['##ticket.openbyuser##'] = '';
         }
         if ($this->obj->countUsers(Ticket::ASSIGN)) {
             $users = array();
             foreach ($this->obj->getUsers(Ticket::ASSIGN) as $uid => $tmp) {
                 $user_tmp = new User();
                 $user_tmp->getFromDB($uid);
                 $users[$uid] = $user_tmp->getName();
             }
             $this->datas['##ticket.assigntousers##'] = implode(', ', $users);
//.........这里部分代码省略.........
开发者ID:ryukansent,项目名称:Thesis-SideB,代码行数:101,代码来源:notificationtargetticket.class.php

示例14: getCentral


//.........这里部分代码省略.........
     if ($canstatus) {
         Ticket::dropdownStatus(array('value' => $ticket->fields["status"], 'showtype' => 'allowed'));
     } else {
         echo Ticket::getStatus($ticket->fields["status"]);
     }
     echo $tt->getEndHiddenFieldValue('status', $ticket);
     echo "</td>";
     echo "<th width='{$colsize3}%'>" . $tt->getBeginHiddenFieldText('requesttypes_id');
     printf(__('%1$s%2$s'), __('Request source'), $tt->getMandatoryMark('requesttypes_id'));
     echo $tt->getEndHiddenFieldText('requesttypes_id') . "</th>";
     echo "<td width='{$colsize4}%'>";
     echo $tt->getBeginHiddenFieldValue('requesttypes_id');
     if ($canupdate) {
         RequestType::dropdown(array('value' => $ticket->fields["requesttypes_id"]));
     } else {
         echo Dropdown::getDropdownName('glpi_requesttypes', $ticket->fields["requesttypes_id"]);
     }
     echo $tt->getEndHiddenFieldValue('requesttypes_id', $ticket);
     echo "</td>";
     echo "</tr>";
     echo "<tr class='tab_bg_1'>";
     echo "<th>" . $tt->getBeginHiddenFieldText('urgency');
     printf(__('%1$s%2$s'), __('Urgency'), $tt->getMandatoryMark('urgency'));
     echo $tt->getEndHiddenFieldText('urgency') . "</th>";
     echo "<td>";
     if ($canupdate && $canpriority || !$ID || $canupdate_descr) {
         // Only change during creation OR when allowed to change priority OR when user is the creator
         echo $tt->getBeginHiddenFieldValue('urgency');
         $idurgency = Ticket::dropdownUrgency(array('value' => $ticket->fields["urgency"]));
         echo $tt->getEndHiddenFieldValue('urgency', $ticket);
     } else {
         $idurgency = "value_urgency" . mt_rand();
         echo "<input id='{$idurgency}' type='hidden' name='urgency' value='" . $ticket->fields["urgency"] . "'>";
         echo Ticket::getUrgencyName($ticket->fields["urgency"]);
     }
     echo "</td>";
     // Display validation state
     echo "<th>";
     if (!$ID) {
         echo $tt->getBeginHiddenFieldText('_add_validation');
         printf(__('%1$s%2$s'), __('Approval request'), $tt->getMandatoryMark('_add_validation'));
         echo $tt->getEndHiddenFieldText('_add_validation');
     } else {
         echo $tt->getBeginHiddenFieldText('global_validation');
         _e('Approval');
         echo $tt->getEndHiddenFieldText('global_validation');
     }
     echo "</th>";
     echo "<td>";
     if (!$ID) {
         echo $tt->getBeginHiddenFieldValue('_add_validation');
         $validation_right = '';
         if ($values['type'] == Ticket::INCIDENT_TYPE && Session::haveRight('create_incident_validation', 1)) {
             $validation_right = 'validate_incident';
         }
         if ($values['type'] == Ticket::DEMAND_TYPE && Session::haveRight('create_request_validation', 1)) {
             $validation_right = 'validate_request';
         }
         if (!empty($validation_right)) {
             User::dropdown(array('name' => "_add_validation", 'entity' => $ticket->fields['entities_id'], 'right' => $validation_right, 'value' => $values['_add_validation']));
         }
         echo $tt->getEndHiddenFieldValue('_add_validation', $ticket);
         if ($tt->isPredefinedField('global_validation')) {
             echo "<input type='hidden' name='global_validation' value='" . $tt->predefined['global_validation'] . "'>";
         }
     } else {
开发者ID:geldarr,项目名称:hack-space,代码行数:67,代码来源:survey.class.php

示例15: showEquals

 public function showEquals($searchopt, $value, $edit = true)
 {
     $inputname = $searchopt['linkfield'];
     switch ($searchopt['table'] . "." . $searchopt['linkfield']) {
         case "glpi_tickets.status":
             if ($edit) {
                 Ticket::dropdownStatus($inputname, $value, 1);
             } else {
                 echo Ticket::getStatus($value);
             }
             break;
         case "glpi_tickets.priority":
             if ($edit) {
                 Ticket::dropdownPriority($inputname, $value, true, true);
             } else {
                 echo Ticket::getPriorityName(trim($value));
             }
             break;
         case "glpi_tickets.impact":
             if ($edit) {
                 Ticket::dropdownImpact($inputname, $value, true);
             } else {
                 echo Ticket::getImpactName($value);
             }
             break;
         case "glpi_tickets.urgency":
             if ($edit) {
                 Ticket::dropdownUrgency($inputname, $value, true);
             } else {
                 echo Ticket::getUrgencyName($value);
             }
             break;
         case "glpi_tickets.global_validation":
             if ($edit) {
                 TicketValidation::dropdownStatus($inputname, array('value' => $value, 'all' => 1));
             } else {
                 TicketValidation::getStatus($value);
             }
             break;
         case "glpi_users.name":
             if ($edit) {
                 User::dropdown(array('name' => $inputname, 'value' => $value, 'comments' => false, 'all' => -1, 'right' => 'all'));
             } else {
                 echo getUserName($value);
             }
             break;
         case "glpi_ticketvalidations.status":
             if ($edit) {
                 TicketValidation::dropdownStatus($inputname, array('value' => $value, 'all' => 1));
             } else {
                 echo TicketValidation::getStatus($value);
             }
             break;
     }
 }
开发者ID:JULIO8,项目名称:respaldo_glpi,代码行数:55,代码来源:item.class.php


注:本文中的Ticket::getUrgencyName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。