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


PHP Ticket::getAllTypesForHelpdesk方法代码示例

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


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

示例1: __construct

 /**
  * @param $report
  * @param $name            (default 'itemtype')
  * @param $label           (default '')
  * @param $types     array
  * @param $ignored   array
  **/
 function __construct($report, $name = 'itemtype', $label = '', $types = array(), $ignored = array())
 {
     global $CFG_GLPI;
     parent::__construct($report, $name, NOT_AVAILABLE, $label ? $label : __('Item type'));
     if (is_array($types) && count($types)) {
         // $types is an hashtable of itemtype => display name
         $this->types = $types;
     } else {
         if (is_string($types) && isset($CFG_GLPI[$types])) {
             // $types is the name of an configured type hashtable (infocom_types, doc_types, ...)
             foreach ($CFG_GLPI[$types] as $itemtype) {
                 if (($item = getItemForItemtype($itemtype)) && !in_array($itemtype, $ignored)) {
                     $this->types[$itemtype] = $item->getTypeName();
                 }
             }
             $this->types['all'] = __('All');
         } else {
             // No types, use helpdesk_types
             $this->types = Ticket::getAllTypesForHelpdesk();
             $this->types['all'] = __('All');
         }
     }
 }
开发者ID:paisdelconocimiento,项目名称:glpi-smartcities,代码行数:30,代码来源:itemtypecriteria.class.php

示例2: methodListHelpdeskTypes

 /**
  * Change the current entity(ies) of a authenticated user
  *
  * @param $params    array of options
  * @param $protocol        the communication protocol used
  *
  * @return array of hashtable
  **/
 static function methodListHelpdeskTypes($params, $protocol)
 {
     if (isset($params['help'])) {
         return array('help' => 'bool,optional');
     }
     if (!Session::getLoginUserID()) {
         return self::Error($protocol, WEBSERVICES_ERROR_NOTAUTHENTICATED);
     }
     if (!isset($_SESSION["glpiactiveprofile"]["helpdesk_hardware"]) || !$_SESSION["glpiactiveprofile"]["helpdesk_hardware"]) {
         // No right to attach a item to a tickeet
         return self::Error($protocol, WEBSERVICES_ERROR_NOTFOUND);
     }
     $resp[] = array('id' => '', 'name' => __('General'));
     if ($_SESSION["glpiactiveprofile"]["helpdesk_hardware"] & pow(2, Ticket::HELPDESK_MY_HARDWARE)) {
         $resp[] = array('id' => 'my', 'name' => __('My devices'));
     }
     if ($_SESSION["glpiactiveprofile"]["helpdesk_hardware"] & pow(2, Ticket::HELPDESK_ALL_HARDWARE)) {
         $types = Ticket::getAllTypesForHelpdesk();
         foreach ($types as $id => $name) {
             $resp[] = array('id' => $id, 'name' => $name);
         }
     }
     return $resp;
 }
开发者ID:geldarr,项目名称:hack-space,代码行数:32,代码来源:methodhelpdesk.class.php

示例3: getMetaItemtypeAvailable

 /**
  * Get meta types available for search engine
  *
  * @param $itemtype type to display the form
  *
  * @return Array of available itemtype
  **/
 static function getMetaItemtypeAvailable($itemtype)
 {
     // Display meta search items
     $linked = array();
     // Define meta search items to linked
     switch (static::getMetaReferenceItemtype($itemtype)) {
         case 'Computer':
             $linked = array('Monitor', 'Peripheral', 'Phone', 'Printer', 'Software');
             break;
         case 'Ticket':
             if (Session::haveRight("ticket", Ticket::READALL)) {
                 $linked = array_keys(Ticket::getAllTypesForHelpdesk());
             }
             break;
         case 'Problem':
             if (Session::haveRight("problem", Problem::READALL)) {
                 $linked = array_keys(Problem::getAllTypesForHelpdesk());
             }
             break;
         case 'Printer':
         case 'Monitor':
         case "Peripheral":
         case "Software":
         case "Phone":
             $linked = array('Computer');
             break;
     }
     return $linked;
 }
开发者ID:jose-martins,项目名称:glpi,代码行数:36,代码来源:search.class.php

示例4: displayCriteriaSelectPattern

 /**
  * Display item used to select a pattern for a criteria
  *
  * @param $name      criteria name
  * @param $ID        the given criteria
  * @param $condition condition used
  * @param $value     the pattern (default '')
  * @param $test      Is to test rule ? (false by default)
  **/
 function displayCriteriaSelectPattern($name, $ID, $condition, $value = "", $test = false)
 {
     $crit = $this->getCriteria($ID);
     $display = false;
     $tested = false;
     if (isset($crit['type']) && ($test || in_array($condition, array(self::PATTERN_IS, self::PATTERN_IS_NOT, self::PATTERN_NOT_UNDER, self::PATTERN_UNDER)))) {
         switch ($crit['type']) {
             case "yesonly":
                 Dropdown::showYesNo($name, $crit['table'], 0);
                 $display = true;
                 break;
             case "yesno":
                 Dropdown::showYesNo($name, $crit['table']);
                 $display = true;
                 break;
             case "dropdown":
                 $param = array('name' => $name, 'value' => $value);
                 if (isset($crit['condition'])) {
                     $param['condition'] = $crit['condition'];
                 }
                 Dropdown::show(getItemTypeForTable($crit['table']), $param);
                 $display = true;
                 break;
             case "dropdown_users":
                 User::dropdown(array('value' => $value, 'name' => $name, 'right' => 'all'));
                 $display = true;
                 break;
             case "dropdown_tracking_itemtype":
                 Dropdown::showItemTypes($name, array_keys(Ticket::getAllTypesForHelpdesk()));
                 $display = true;
                 break;
             case "dropdown_urgency":
                 Ticket::dropdownUrgency(array('name' => $name, 'value' => $value));
                 $display = true;
                 break;
             case "dropdown_impact":
                 Ticket::dropdownImpact(array('name' => $name, 'value' => $value));
                 $display = true;
                 break;
             case "dropdown_priority":
                 Ticket::dropdownPriority(array('name' => $name, 'value' => $value));
                 $display = true;
                 break;
             case "dropdown_status":
                 Ticket::dropdownStatus(array('name' => $name, 'value' => $value));
                 $display = true;
                 break;
             case "dropdown_tickettype":
                 Ticket::dropdownType($name, array('value' => $value));
                 $display = true;
                 break;
         }
         $tested = true;
     }
     //Not a standard condition
     if (!$tested) {
         $display = $this->displayAdditionalRuleCondition($condition, $crit, $name, $value, $test);
     }
     if ($condition == self::PATTERN_EXISTS || $condition == self::PATTERN_DOES_NOT_EXISTS) {
         echo "<input type='hidden' name='{$name}' value='1'>";
         $display = true;
     }
     if (!$display && ($rc = getItemForItemtype($this->rulecriteriaclass))) {
         Html::autocompletionTextField($rc, "pattern", array('name' => $name, 'value' => $value, 'size' => 70));
     }
 }
开发者ID:pvasener,项目名称:glpi,代码行数:75,代码来源:rule.class.php

示例5: dropdownAllDevices

 /**
  * Make a select box for Tracking All Devices
  *
  * @param $myname             select name
  * @param $itemtype           preselected value.for item type
  * @param $items_id           preselected value for item ID (default 0)
  * @param $admin              is an admin access ? (default 0)
  * @param $users_id           user ID used to display my devices (default 0
  * @param $entity_restrict    Restrict to a defined entity (default -1)
  * @param $options   array of possible options:
  *    - tickets_id : ID of the ticket
  *    - used       : ID of the requester user
  *    - multiple   : allow multiple choice
  *    - rand       : random number
  *
  * @return nothing (print out an HTML select box)
  **/
 static function dropdownAllDevices($myname, $itemtype, $items_id = 0, $admin = 0, $users_id = 0, $entity_restrict = -1, $options = array())
 {
     global $CFG_GLPI, $DB;
     $params = array('tickets_id' => 0, 'used' => array(), 'multiple' => 0, 'rand' => mt_rand());
     foreach ($options as $key => $val) {
         $params[$key] = $val;
     }
     $rand = $params['rand'];
     if ($_SESSION["glpiactiveprofile"]["helpdesk_hardware"] == 0) {
         echo "<input type='hidden' name='{$myname}' value=''>";
         echo "<input type='hidden' name='items_id' value='0'>";
     } else {
         echo "<div id='tracking_all_devices{$rand}'>";
         if ($_SESSION["glpiactiveprofile"]["helpdesk_hardware"] & pow(2, Ticket::HELPDESK_ALL_HARDWARE)) {
             // Display a message if view my hardware
             if ($users_id && $_SESSION["glpiactiveprofile"]["helpdesk_hardware"] & pow(2, Ticket::HELPDESK_MY_HARDWARE)) {
                 echo __('Or complete search') . "&nbsp;";
             }
             $types = Ticket::getAllTypesForHelpdesk();
             $emptylabel = __('General');
             if ($params['tickets_id'] > 0) {
                 $emptylabel = Dropdown::EMPTY_VALUE;
             }
             Dropdown::showItemTypes($myname, array_keys($types), array('emptylabel' => $emptylabel, 'value' => $itemtype, 'rand' => $rand, 'display_emptychoice' => true));
             $found_type = isset($types[$itemtype]);
             $p = array('itemtype' => '__VALUE__', 'entity_restrict' => $entity_restrict, 'admin' => $admin, 'used' => $params['used'], 'multiple' => $params['multiple'], 'rand' => $rand, 'myname' => "add_items_id");
             Ajax::updateItemOnSelectEvent("dropdown_{$myname}{$rand}", "results_{$myname}{$rand}", $CFG_GLPI["root_doc"] . "/ajax/dropdownTrackingDeviceType.php", $p);
             echo "<span id='results_{$myname}{$rand}'>\n";
             // Display default value if itemtype is displayed
             if ($found_type && $itemtype) {
                 if (($item = getItemForItemtype($itemtype)) && $items_id) {
                     if ($item->getFromDB($items_id)) {
                         Dropdown::showFromArray('items_id', array($items_id => $item->getName()), array('value' => $items_id));
                     }
                 } else {
                     $p['itemtype'] = $itemtype;
                     echo "<script type='text/javascript' >\n";
                     Ajax::updateItemJsCode("results_{$myname}{$rand}", $CFG_GLPI["root_doc"] . "/ajax/dropdownTrackingDeviceType.php", $p);
                     echo '</script>';
                 }
             }
             echo "</span>\n";
         }
         echo "</div>";
     }
     return $rand;
 }
开发者ID:korial29,项目名称:glpi,代码行数:64,代码来源:item_ticket.class.php

示例6: getMetaItemtypeAvailable

 /**
  * Get meta types available for search engine
  *
  * @param $itemtype type to display the form
  *
  * @return Array of available itemtype
  **/
 static function getMetaItemtypeAvailable($itemtype)
 {
     // Display meta search items
     $linked = array();
     // Define meta search items to linked
     switch ($itemtype) {
         case 'Computer':
             $linked = array('Monitor', 'Peripheral', 'Phone', 'Printer', 'Software');
             break;
         case 'Ticket':
             //if (Session::haveRight("show_all_ticket","1")) {
             if (Session::haveRight("ticket", Ticket::READALL)) {
                 $linked = array_keys(Ticket::getAllTypesForHelpdesk());
             }
             break;
         case 'Printer':
         case 'Monitor':
         case 'Peripheral':
         case 'Software':
         case 'Phone':
             $linked = array('Computer');
             break;
     }
     return $linked;
 }
开发者ID:JULIO8,项目名称:respaldo_glpi,代码行数:32,代码来源:searcha.class.php

示例7: dropdownAllDevices

 /**
  * Make a select box for Tracking All Devices
  *
  * @param $myname             select name
  * @param $itemtype           preselected value.for item type
  * @param $items_id           preselected value for item ID (default 0)
  * @param $admin              is an admin access ? (default 0)
  * @param $users_id           user ID used to display my devices (default 0
  * @param $entity_restrict    Restrict to a defined entity (default -1)
  * @param $tickets_id         Id of the ticket
  *
  * @return nothing (print out an HTML select box)
  **/
 static function dropdownAllDevices($myname, $itemtype, $items_id = 0, $admin = 0, $users_id = 0, $entity_restrict = -1, $tickets_id = 0)
 {
     global $CFG_GLPI, $DB;
     $rand = mt_rand();
     if ($_SESSION["glpiactiveprofile"]["helpdesk_hardware"] == 0) {
         echo "<input type='hidden' name='{$myname}' value=''>";
         echo "<input type='hidden' name='items_id' value='0'>";
     } else {
         $rand = mt_rand();
         echo "<span id='tracking_all_devices{$rand}'>";
         if ($_SESSION["glpiactiveprofile"]["helpdesk_hardware"] & pow(2, Ticket::HELPDESK_ALL_HARDWARE)) {
             if ($users_id && $_SESSION["glpiactiveprofile"]["helpdesk_hardware"] & pow(2, Ticket::HELPDESK_MY_HARDWARE)) {
                 echo __('Or complete search') . "&nbsp;";
             }
             $types = Ticket::getAllTypesForHelpdesk();
             $emptylabel = Dropdown::EMPTY_VALUE;
             $rand = Dropdown::showItemTypes($myname, array_keys($types), array('emptylabel' => $emptylabel, 'value' => $itemtype, 'width' => 200));
             $found_type = isset($types[$itemtype]);
             $width = 250;
             $params = array('itemtype' => '__VALUE__', 'entity_restrict' => $entity_restrict, 'admin' => $admin, 'width' => $width, 'myname' => "items_id");
             Ajax::updateItemOnSelectEvent("dropdown_{$myname}{$rand}", "results_{$myname}{$rand}", $CFG_GLPI["root_doc"] . "/plugins/shellcommands/ajax/dropdownTrackingDeviceType.php", $params);
             echo "<span id='results_{$myname}{$rand}'>\n";
             // Display default value if itemtype is displayed
             if ($found_type && $itemtype) {
                 if (($item = getItemForItemtype($itemtype)) && $items_id) {
                     if ($item->getFromDB($items_id)) {
                         Dropdown::showFromArray('items_id', array($items_id => $item->getName()), array('value' => $items_id, 'width' => $width));
                     }
                 } else {
                     $params['itemtype'] = $itemtype;
                     echo "<script type='text/javascript' >\n";
                     Ajax::updateItemJsCode("results_{$myname}{$rand}", $CFG_GLPI["root_doc"] . "/plugins/shellcommands/ajax/dropdownTrackingDeviceType.php", $params);
                     echo '</script>';
                 }
             }
             echo "</span>\n";
         }
         echo "</span>";
     }
     return $rand;
 }
开发者ID:paisdelconocimiento,项目名称:glpi-smartcities,代码行数:54,代码来源:advanced_execution.class.php

示例8: showGenericSearch


//.........这里部分代码省略.........
                         echo "selected";
                         $selected = $key;
                     }
                     echo ">" . Toolbox::substr($val["name"], 0, 28) . "</option>";
                 }
             }
         }
         if (!$first_group) {
             echo "</optgroup>";
         }
         echo "<option value='all' ";
         if (is_array($p['field']) && isset($p['field'][$i]) && $p['field'][$i] == "all") {
             echo "selected";
         }
         echo ">" . $LANG['common'][66] . "</option>";
         echo "</select>";
         echo "<span id='SearchSpan{$itemtype}{$i}'>\n";
         $_POST['itemtype'] = $itemtype;
         $_POST['num'] = $i;
         $_POST['field'] = $selected;
         //$_POST['meta']="type='search'";
         $_POST['searchtype'] = is_array($p['searchtype']) && isset($p['searchtype'][$i]) ? $p['searchtype'][$i] : "";
         $_POST['value'] = is_array($p['contains']) && isset($p['contains'][$i]) ? stripslashes($p['contains'][$i]) : "";
         include GLPI_ROOT . "/plugins/mobile/inc/ajax.function.php";
         include GLPI_ROOT . "/plugins/mobile/ajax/searchoption.php";
         echo "</span>\n";
         $params = array('field' => '__VALUE__', 'itemtype' => $itemtype, 'num' => $i, 'value' => $_POST["value"], 'searchtype' => $_POST["searchtype"]);
         mobileAjaxUpdateItemOnSelectEvent("Search{$itemtype}{$i}", "SearchSpan{$itemtype}{$i}", $CFG_GLPI["root_doc"] . "/plugins/mobile/ajax/searchoption.php", $params, false);
     }
     // Display meta search items
     $linked = array();
     if ($_SESSION["glpisearchcount2"][$itemtype] > 0) {
         // Define meta search items to linked
         switch ($itemtype) {
             case 'Computer':
                 $linked = array('Printer', 'Monitor', 'Peripheral', 'Software', 'Phone');
                 break;
             case 'Ticket':
                 if (Session::haveRight("ticket", CREATE)) {
                     $linked = array_keys(Ticket::getAllTypesForHelpdesk());
                 }
                 break;
             case 'Printer':
             case 'Monitor':
             case 'Peripheral':
             case 'Software':
             case 'Phone':
                 $linked = array('Computer');
                 break;
         }
     }
     $metanames = array();
     if (is_array($linked) && count($linked) > 0) {
         for ($i = 0; $i < $_SESSION["glpisearchcount2"][$itemtype]; $i++) {
             $rand = mt_rand();
             // Display link item (not for the first item)
             echo "<select name='link2[{$i}]'>";
             echo "<option value='AND' ";
             if (is_array($p['link2']) && isset($p['link2'][$i]) && $p['link2'][$i] == "AND") {
                 echo "selected";
             }
             echo ">AND</option>";
             echo "<option value='OR' ";
             if (is_array($p['link2']) && isset($p['link2'][$i]) && $p['link2'][$i] == "OR") {
                 echo "selected";
             }
             echo ">OR</option>";
             echo "<option value='AND NOT' ";
             if (is_array($p['link2']) && isset($p['link2'][$i]) && $p['link2'][$i] == "AND NOT") {
                 echo "selected";
             }
             echo ">AND NOT</option>";
             echo "<option value='OR NOT' ";
             if (is_array($p['link2']) && isset($p['link2'][$i]) && $p['link2'][$i] == "OR NOT") {
                 echo "selected";
             }
             echo ">OR NOT</option>";
             echo "</select>";
             // Display select of the linked item type available
             echo "<select name='itemtype2[{$i}]' id='itemtype2_" . $itemtype . "_" . $i . "_{$rand}'>";
             echo "<option value=''>" . DROPDOWN_EMPTY_VALUE . "</option>";
             foreach ($linked as $key) {
                 if (!isset($metanames[$key])) {
                     $linkitem = new $key();
                     $metanames[$key] = $linkitem->getTypeName();
                 }
                 echo "<option value='{$key}'>" . Toolbox::substr($metanames[$key], 0, 20) . "</option>\n";
             }
             echo "</select>";
         }
     }
     // Display submit button
     echo "<br /><input type='submit' value=\"" . $LANG['buttons'][0] . "\" class='submit' data-theme='a' data-inline='true'>";
     // For dropdown
     echo "<input type='hidden' name='itemtype' value='{$itemtype}'>";
     // Reset to start when submit new search
     echo "<input type='hidden' name='start' value='0'>";
     //echo "</form>";
     Html::closeForm();
 }
开发者ID:paisdelconocimiento,项目名称:glpi-smartcities,代码行数:101,代码来源:search.class.php


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