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


PHP Ticket::dropdownType方法代码示例

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


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

示例1: getSpecificValueToSelect

 /**
  * @since version 0.84
  *
  * @param $field
  * @param $name               (default '')
  * @param $values             (default '')
  * @param $options      array
  **/
 static function getSpecificValueToSelect($field, $name = '', $values = '', array $options = array())
 {
     global $DB;
     if (!is_array($values)) {
         $values = array($field => $values);
     }
     $options['display'] = false;
     switch ($field) {
         case 'use_licenses_alert':
         case 'use_contracts_alert':
         case 'use_infocoms_alert':
             $options['name'] = $name;
             $options['value'] = $values[$field];
             return Alert::dropdownYesNo($options);
         case 'cartridges_alert_repeat':
         case 'consumables_alert_repeat':
             $options['name'] = $name;
             $options['value'] = $values[$field];
             return Alert::dropdown($options);
         case 'send_contracts_alert_before_delay':
         case 'send_infocoms_alert_before_delay':
         case 'send_licenses_alert_before_delay':
             $options['unit'] = 'day';
             $options['never_string'] = __('No');
             return Alert::dropdownIntegerNever($name, $values[$field], $options);
         case 'use_reservations_alert':
             $options['unit'] = 'hour';
             return Alert::dropdownIntegerNever($name, $values[$field], $options);
         case 'notclosed_delay':
             $options['unit'] = 'hour';
             return Alert::dropdownIntegerNever($name, $values[$field], $options);
         case 'auto_assign_mode':
             $options['name'] = $name;
             $options['value'] = $values[$field];
             return self::dropdownAutoAssignMode($options);
         case 'tickettype':
             $options['value'] = $values[$field];
             $options['toadd'] = array(self::CONFIG_PARENT => __('Inheritance of the parent entity'));
             return Ticket::dropdownType($name, $options);
         case 'autofill_buy_date':
         case 'autofill_order_date':
         case 'autofill_delivery_date':
         case 'autofill_use_date':
             $tab[0] = __('No autofill');
             $tab[self::CONFIG_PARENT] = __('Inheritance of the parent entity');
             foreach (getAllDatasFromTable('glpi_states') as $state) {
                 $tab[Infocom::ON_STATUS_CHANGE . '_' . $state['id']] = sprintf(__('Fill when shifting to state %s'), $state['name']);
             }
             $tab[Infocom::COPY_WARRANTY_DATE] = __('Copy the start date of warranty');
             if ($field != 'autofill_buy_date') {
                 $tab[Infocom::COPY_BUY_DATE] = __('Copy the date of purchase');
                 if ($field != 'autofill_order_date') {
                     $tab[Infocom::COPY_ORDER_DATE] = __('Copy the order date');
                     if ($field != 'autofill_delivery_date') {
                         $options[Infocom::COPY_DELIVERY_DATE] = __('Copy the delivery date');
                     }
                 }
             }
             $options['value'] = $values[$field];
             return Dropdown::showFromArray($name, $tab, $options);
         case 'autofill_warranty_date':
             $tab = array(0 => __('No autofill'), Infocom::COPY_BUY_DATE => __('Copy the date of purchase'), Infocom::COPY_ORDER_DATE => __('Copy the order date'), Infocom::COPY_DELIVERY_DATE => __('Copy the delivery date'), self::CONFIG_PARENT => __('Inheritance of the parent entity'));
             $options['value'] = $values[$field];
             return Dropdown::showFromArray($name, $tab, $options);
         case 'inquest_config':
             $typeinquest = array(self::CONFIG_PARENT => __('Inheritance of the parent entity'), 1 => __('Internal survey'), 2 => __('External survey'));
             $options['value'] = $values[$field];
             return Dropdown::showFromArray($name, $typeinquest, $options);
         case 'default_contract_alert':
             $options['name'] = $name;
             $options['value'] = $values[$field];
             return Contract::dropdownAlert($options);
         case 'default_infocom_alert':
             $options['name'] = $name;
             $options['value'] = $values[$field];
             return Infocom::dropdownAlert($options);
         case 'entities_id_software':
             $options['toadd'] = array(self::CONFIG_NEVER => __('No change of entity'));
             // Keep software in PC entity
             $options['toadd'][self::CONFIG_PARENT] = __('Inheritance of the parent entity');
             return self::dropdown($options);
     }
     return parent::getSpecificValueToSelect($field, $name, $values, $options);
 }
开发者ID:korial29,项目名称:glpi,代码行数:92,代码来源:entity.class.php

示例2: getHelpdesk


//.........这里部分代码省略.........
         }
     } else {
         // No template load : reset predefined values
         if (count($values['_predefined_fields'])) {
             foreach ($values['_predefined_fields'] as $predeffield => $predefvalue) {
                 if ($values[$predeffield] == $predefvalue) {
                     $values[$predeffield] = $default_values[$predeffield];
                 }
             }
         }
     }
     if ($CFG_GLPI['urgency_mask'] == 1 << 3 || $tt->isHiddenField('urgency')) {
         // Dont show dropdown if only 1 value enabled or field is hidden
         echo "<input type='hidden' name='urgency' value='" . $values['urgency'] . "'>";
     }
     // Display predefined fields if hidden
     if ($tt->isHiddenField('itemtype')) {
         echo "<input type='hidden' name='itemtype' value='" . $values['itemtype'] . "'>";
         echo "<input type='hidden' name='items_id' value='" . $values['items_id'] . "'>";
     }
     if ($tt->isHiddenField('locations_id')) {
         echo "<input type='hidden' name='locations_id' value='" . $values['locations_id'] . "'>";
     }
     echo "<input type='hidden' name='entities_id' value='" . $_SESSION["glpiactive_entity"] . "'>";
     echo "<div class='center'><table class='tab_cadre_fixe'>";
     echo "<tr><th>" . __('Describe the incident or request') . "</th><th>";
     if (Session::isMultiEntitiesMode()) {
         echo "(" . Dropdown::getDropdownName("glpi_entities", $_SESSION["glpiactive_entity"]) . ")";
     }
     echo "</th></tr>";
     echo "<tr class='tab_bg_1'>";
     echo "<td>" . sprintf(__('%1$s%2$s'), __('Type'), $tt->getMandatoryMark('type')) . "</td>";
     echo "<td>";
     Ticket::dropdownType('type', array('value' => $values['type'], 'on_change' => 'submit()'));
     echo "</td></tr>";
     echo "<tr class='tab_bg_1'>";
     echo "<td>" . sprintf(__('%1$s%2$s'), __('Category'), $tt->getMandatoryMark('itilcategories_id')) . "</td>";
     echo "<td>";
     $condition = "`is_helpdeskvisible`='1'";
     switch ($values['type']) {
         case Ticket::DEMAND_TYPE:
             $condition .= " AND `is_request`='1'";
             break;
         default:
             // Ticket::INCIDENT_TYPE :
             $condition .= " AND `is_incident`='1'";
     }
     $opt = array('value' => $values['itilcategories_id'], 'condition' => $condition, 'on_change' => 'submit()');
     if ($values['itilcategories_id'] && $tt->isMandatoryField("itilcategories_id")) {
         $opt['display_emptychoice'] = false;
     }
     ITILCategory::dropdown($opt);
     echo "</td></tr>";
     if ($CFG_GLPI['urgency_mask'] != 1 << 3) {
         if (!$tt->isHiddenField('urgency')) {
             echo "<tr class='tab_bg_1'>";
             echo "<td>" . sprintf(__('%1$s%2$s'), __('Urgency'), $tt->getMandatoryMark('urgency')) . "</td>";
             echo "<td>";
             Ticket::dropdownUrgency(array('value' => $values["urgency"]));
             echo "</td></tr>";
         }
     }
     if (empty($delegating) && NotificationTargetTicket::isAuthorMailingActivatedForHelpdesk()) {
         echo "<tr class='tab_bg_1'>";
         echo "<td>" . __('Inform me about the actions taken') . "</td>";
         echo "<td>";
开发者ID:geldarr,项目名称:hack-space,代码行数:67,代码来源:survey.class.php

示例3: 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

示例4: printHelpDesk


//.........这里部分代码省略.........
    }
    $itemtype = 0;
    $items_id = "";
    $content = "";
    $title = "";
    $ticketcategories_id = 0;
    $urgency = 3;
    $type = 0;
    if (isset($_SESSION["helpdeskSaved"]['_users_id_requester_notif']) && isset($_SESSION["helpdeskSaved"]['_users_id_requester_notif']['use_notification'])) {
        $use_email_notification = stripslashes($_SESSION["helpdeskSaved"]['_users_id_requester_notif']['use_notification']);
    }
    if (isset($_SESSION["helpdeskSaved"]["email"])) {
        $email = stripslashes($_SESSION["helpdeskSaved"]["user_email"]);
    }
    if (isset($_SESSION["helpdeskSaved"]["itemtype"])) {
        $itemtype = stripslashes($_SESSION["helpdeskSaved"]["itemtype"]);
    }
    if (isset($_SESSION["helpdeskSaved"]["items_id"])) {
        $items_id = stripslashes($_SESSION["helpdeskSaved"]["items_id"]);
    }
    if (isset($_SESSION["helpdeskSaved"]["content"])) {
        $content = cleanPostForTextArea($_SESSION["helpdeskSaved"]["content"]);
    }
    if (isset($_SESSION["helpdeskSaved"]["name"])) {
        $title = stripslashes($_SESSION["helpdeskSaved"]["name"]);
    }
    if (isset($_SESSION["helpdeskSaved"]["ticketcategories_id"])) {
        $ticketcategories_id = stripslashes($_SESSION["helpdeskSaved"]["ticketcategories_id"]);
    }
    if (isset($_SESSION["helpdeskSaved"]["type"])) {
        $type = stripslashes($_SESSION["helpdeskSaved"]["type"]);
    }
    if (isset($_SESSION["helpdeskSaved"]["urgency"])) {
        $urgency = stripslashes($_SESSION["helpdeskSaved"]["urgency"]);
    }
    unset($_SESSION["helpdeskSaved"]);
    echo "<form method='post' name='helpdeskform' action='" . $CFG_GLPI["root_doc"] . "/front/tracking.injector.php' enctype='multipart/form-data'>";
    echo "<input type='hidden' name='_from_helpdesk' value='{$from_helpdesk}'>";
    echo "<input type='hidden' name='requesttypes_id' value='" . RequestType::getDefault('helpdesk') . "'>";
    if ($CFG_GLPI['urgency_mask'] == 1 << 3) {
        // Dont show dropdown if only 1 value enabled
        echo "<input type='hidden' name='urgency' value='3'>";
    }
    echo "<input type='hidden' name='entities_id' value='" . $_SESSION["glpiactive_entity"] . "'>";
    echo "<div class='center'><table class='tab_cadre'>";
    echo "<tr><th colspan='2'>" . $LANG['job'][11] . "&nbsp;:&nbsp;";
    if (isMultiEntitiesMode()) {
        echo "&nbsp;(" . Dropdown::getDropdownName("glpi_entities", $_SESSION["glpiactive_entity"]) . ")";
    }
    echo "</th></tr>";
    if ($CFG_GLPI['urgency_mask'] != 1 << 3) {
        echo "<tr class='tab_bg_1'>";
        echo "<td>" . $LANG['joblist'][29] . "&nbsp;:&nbsp;</td>";
        echo "<td>";
        Ticket::dropdownUrgency("urgency", $urgency);
        echo "</td></tr>";
    }
    if (NotificationTargetTicket::isAuthorMailingActivatedForHelpdesk()) {
        echo "<tr class='tab_bg_1'>";
        echo "<td>" . $LANG['help'][8] . "&nbsp;:&nbsp;</td>";
        echo "<td>";
        $_REQUEST['value'] = getLoginUserID();
        $_REQUEST['field'] = '_users_id_requester_notif';
        $_REQUEST['use_notification'] = $use_email_notification;
        include GLPI_ROOT . "/ajax/uemailUpdate.php";
        echo "</td></tr>";
    }
    if ($_SESSION["glpiactiveprofile"]["helpdesk_hardware"] != 0) {
        echo "<tr class='tab_bg_1'>";
        echo "<td>" . $LANG['help'][24] . "&nbsp;:&nbsp;</td>";
        echo "<td>";
        Ticket::dropdownMyDevices(getLoginUserID(), $_SESSION["glpiactive_entity"]);
        Ticket::dropdownAllDevices("itemtype", $itemtype, $items_id, 0, $_SESSION["glpiactive_entity"]);
        echo "</td></tr>";
    }
    echo "<tr class='tab_bg_1'>";
    echo "<td>" . $LANG['common'][17] . "&nbsp;:&nbsp;</td><td>";
    Ticket::dropdownType('type', $type);
    echo "</td></tr>";
    echo "<tr class='tab_bg_1'>";
    echo "<td>" . $LANG['common'][36] . "&nbsp;:&nbsp;</td><td>";
    Dropdown::show('TicketCategory', array('value' => $ticketcategories_id, 'condition' => '`is_helpdeskvisible`=1'));
    echo "</td></tr>";
    echo "<tr class='tab_bg_1'>";
    echo "<td>" . $LANG['common'][57] . "&nbsp;:&nbsp;</td>";
    echo "<td><input type='text' maxlength='250' size='50' name='name' value='{$title}'></td></tr>";
    echo "<tr class='tab_bg_1'>";
    echo "<td colspan='2'><textarea name='content' cols='78' rows='14'>{$content}</textarea>";
    echo "</td></tr>";
    echo "<tr class='tab_bg_1'>";
    echo "<td>" . $LANG['document'][2] . " (" . Document::getMaxUploadSize() . ")&nbsp;:&nbsp;";
    echo "<img src='" . $CFG_GLPI["root_doc"] . "/pics/aide.png' class='pointer' alt='" . $LANG['central'][7] . "' onclick=\"window.open('" . $CFG_GLPI["root_doc"] . "/front/documenttype.list.php','Help','scrollbars=1,resizable=1,width=1000,height=800')\">";
    echo "</td>";
    echo "<td><input type='file' name='filename' value='' size='25'></td></tr>";
    echo "<tr class='tab_bg_1'>";
    echo "<td colspan='2' class='center'>";
    echo "<input type='submit' value=\"" . $LANG['help'][14] . "\" class='submit'>";
    echo "</td></tr>";
    echo "</table></div></form>";
}
开发者ID:ryukansent,项目名称:Thesis-SideB,代码行数:101,代码来源:display.function.php

示例5: showHelpdeskOptions

 static function showHelpdeskOptions(Entity $entity)
 {
     global $LANG, $CFG_GLPI;
     $ID = $entity->getField('id');
     if (!$entity->can($ID, 'r') || !haveRight('entity_helpdesk', 'r')) {
         return false;
     }
     $canedit = haveRight('entity_helpdesk', 'w') && haveAccessToEntity($ID);
     // Get data
     $entdata = new EntityData();
     if (!$entdata->getFromDB($ID)) {
         $entdata->getEmpty();
     }
     echo "<div class='spaced'>";
     if ($canedit) {
         echo "<form method='post' name=form action='" . getItemTypeFormURL(__CLASS__) . "'>";
     }
     echo "<table class='tab_cadre_fixe'>";
     echo "<tr class='tab_bg_1'><td colspan='2'>" . $LANG['buttons'][15] . "&nbsp;:&nbsp;</td>";
     echo "<td colspan='2'>";
     $options = array('value' => $entdata->fields["calendars_id"], 'emptylabel' => $LANG['common'][102]);
     if ($ID == 0) {
         $options['emptylabel'] = $LANG['sla'][10];
     }
     Dropdown::show('Calendar', $options);
     if ($entdata->fields["calendars_id"] == 0) {
         $calendar = new Calendar();
         if ($calendar->getFromDB(self::getUsedConfig('calendars_id', $ID))) {
             echo " - " . $calendar->getLink();
         }
     }
     echo "</td></tr>";
     echo "<tr class='tab_bg_1'><td colspan='2'>" . $LANG['entity'][28] . "&nbsp;:&nbsp;</td>";
     echo "<td colspan='2'>";
     $toadd = array();
     if ($ID != 0) {
         $toadd = array(0 => $LANG['common'][102]);
     }
     Ticket::dropdownType('tickettype', $entdata->fields["tickettype"], $toadd);
     if ($entdata->fields["calendars_id"] == 0) {
         $calendar = new Calendar();
         if ($calendar->getFromDB(self::getUsedConfig('calendars_id', $ID))) {
             echo " - " . $calendar->getLink();
         }
     }
     echo "</td></tr>";
     echo "<tr class='tab_bg_1'><td  colspan='2'>" . $LANG['setup'][52] . "&nbsp;:&nbsp;</td>";
     echo "<td colspan='2'>";
     $autoassign = array(-1 => $LANG['setup'][731], NO_AUTO_ASSIGN => $LANG['choice'][0], AUTO_ASSIGN_HARDWARE_CATEGORY => $LANG['setup'][51], AUTO_ASSIGN_CATEGORY_HARDWARE => $LANG['setup'][50]);
     Dropdown::showFromArray('auto_assign_mode', $autoassign, array('value' => $entdata->fields["auto_assign_mode"]));
     echo "</td></tr>";
     echo "<tr><th colspan='4'>" . $LANG['entity'][17] . "</th></tr>";
     echo "<tr class='tab_bg_1'><td colspan='2'>" . $LANG['entity'][18] . "&nbsp;:&nbsp;</td>";
     echo "<td colspan='2'>";
     Dropdown::showInteger('autoclose_delay', $entdata->fields['autoclose_delay'], 0, 99, 1, array(-1 => $LANG['setup'][731], -10 => $LANG['setup'][307]));
     /*
           Alert::dropdownIntegerNever('autoclose_delay', $entdata->fields['autoclose_delay'],
                                       array('max'            => 99,
                                             'inherit_global' => 1,
                                             'never_value'    => -10,));
     */
     echo "&nbsp;" . $LANG['stats'][31] . "</td></tr>";
     echo "<tr><th colspan='4'>" . $LANG['entity'][19] . "</th></tr>";
     echo "<tr class='tab_bg_1'><td colspan='2'>" . $LANG['entity'][19] . "&nbsp;:&nbsp;</td>";
     echo "<td colspan='2'>";
     /// no inquest case = rate 0
     $typeinquest = array(0 => $LANG['common'][102], 1 => $LANG['satisfaction'][9], 2 => $LANG['satisfaction'][10]);
     // No inherit from parent for root entity
     if ($entdata->fields['entities_id'] == 0) {
         unset($typeinquest[0]);
         if ($entdata->fields['inquest_config'] == 0) {
             $entdata->fields['inquest_config'] = 1;
         }
     }
     $rand = Dropdown::showFromArray('inquest_config', $typeinquest, $options = array('value' => $entdata->fields['inquest_config']));
     echo "</td></tr>\n";
     // Do not display for root entity in inherit case
     if ($entdata->fields['inquest_config'] == 0 && $entdata->fields['entities_id'] != 0) {
         $inquestconfig = self::getUsedConfig('inquest_config', $entdata->fields['entities_id']);
         $inquestrate = self::getUsedConfig('inquest_config', $entdata->fields['entities_id'], 'inquest_rate');
         echo "<tr><td colspan='4' class='green center'>" . $LANG['common'][102] . "&nbsp;:&nbsp;";
         if ($inquestrate == 0) {
             echo $LANG['crontask'][31];
         } else {
             echo $typeinquest[$inquestconfig];
             echo " - " . self::getUsedConfig('inquest_config', $entdata->fields['entities_id'], 'inquest_delay');
             echo "&nbsp;" . $LANG['stats'][31] . " - ";
             echo $inquestrate . "%";
             if ($inquestconfig == 2) {
                 echo " - " . self::getUsedConfig('inquest_config', $entdata->fields['entities_id'], 'inquest_URL');
             }
         }
         echo "</td></tr>\n";
     }
     echo "<tr class='tab_bg_1'><td colspan='4'>";
     $_REQUEST = array('inquest_config' => $entdata->fields['inquest_config'], 'entities_id' => $ID);
     $params = array('inquest_config' => '__VALUE__', 'entities_id' => $ID);
     echo "<div id='inquestconfig'>";
     include GLPI_ROOT . '/ajax/ticketsatisfaction.php';
     echo "</div>\n";
//.........这里部分代码省略.........
开发者ID:ryukansent,项目名称:Thesis-SideB,代码行数:101,代码来源:entitydata.class.php

示例6: displayActionSelectPattern

 /**
  * @param $options   array
  **/
 function displayActionSelectPattern($options = array())
 {
     $display = false;
     $param['value'] = '';
     if (isset($options['value'])) {
         $param['value'] = $options['value'];
     }
     switch ($options["action_type"]) {
         //If a regex value is used, then always display an autocompletiontextfield
         case "regex_result":
         case "append_regex_result":
             Html::autocompletionTextField($this, "value", $param);
             break;
         case 'fromuser':
         case 'fromitem':
             Dropdown::showYesNo("value", $param['value'], 0);
             $display = true;
             break;
         default:
             $actions = Rule::getActionsByType($options["sub_type"]);
             if (isset($actions[$options["field"]]['type'])) {
                 switch ($actions[$options["field"]]['type']) {
                     case "dropdown":
                         $table = $actions[$options["field"]]['table'];
                         $param['name'] = "value";
                         if (isset($actions[$options["field"]]['condition'])) {
                             $param['condition'] = $actions[$options["field"]]['condition'];
                         }
                         Dropdown::show(getItemTypeForTable($table), $param);
                         $display = true;
                         break;
                     case "dropdown_tickettype":
                         Ticket::dropdownType('value', $param);
                         $display = true;
                         break;
                     case "dropdown_assign":
                         $param['name'] = 'value';
                         $param['right'] = 'own_ticket';
                         User::dropdown($param);
                         $display = true;
                         break;
                     case "dropdown_users":
                         $param['name'] = 'value';
                         $param['right'] = 'all';
                         User::dropdown($param);
                         $display = true;
                         break;
                     case "dropdown_urgency":
                         $param['name'] = 'value';
                         Ticket::dropdownUrgency($param);
                         $display = true;
                         break;
                     case "dropdown_impact":
                         $param['name'] = 'value';
                         Ticket::dropdownImpact($param);
                         $display = true;
                         break;
                     case "dropdown_priority":
                         if ($_POST["action_type"] != 'compute') {
                             $param['name'] = 'value';
                             Ticket::dropdownPriority($param);
                         }
                         $display = true;
                         break;
                     case "dropdown_status":
                         $param['name'] = 'value';
                         Ticket::dropdownStatus($param);
                         $display = true;
                         break;
                     case "yesonly":
                         Dropdown::showYesNo("value", $param['value'], 0);
                         $display = true;
                         break;
                     case "yesno":
                         Dropdown::showYesNo("value", $param['value']);
                         $display = true;
                         break;
                     case "dropdown_management":
                         $param['name'] = 'value';
                         $param['management_restrict'] = 2;
                         $param['withtemplate'] = false;
                         Dropdown::showGlobalSwitch(0, $param);
                         $display = true;
                         break;
                     case "dropdown_users_validate":
                         $used = array();
                         if ($item = getItemForItemtype($options["sub_type"])) {
                             $rule_data = getAllDatasFromTable('glpi_ruleactions', "`action_type` = 'add_validation'\n                                                           AND `field` = 'users_id_validate'\n                                                           AND `" . $item->getRuleIdField() . "`\n                                                            = '" . $options[$item->getRuleIdField()] . "'");
                             foreach ($rule_data as $data) {
                                 $used[] = $data['value'];
                             }
                         }
                         $param['name'] = 'value';
                         $param['right'] = array('validate_incident', 'validate_request');
                         $param['used'] = $used;
                         User::dropdown($param);
                         $display = true;
//.........这里部分代码省略.........
开发者ID:stweil,项目名称:glpi,代码行数:101,代码来源:ruleaction.class.php

示例7: showTicketTemplate

 function showTicketTemplate($items_id)
 {
     global $CFG_GLPI;
     $ticketTemplate = new TicketTemplate();
     echo "<form method='post' name='form_addquestion' action='" . $CFG_GLPI['root_doc'] . "/plugins/surveyticket/front/tickettemplate.form.php'>";
     echo "<table class='tab_cadre' width='700'>";
     echo "<tr class='tab_bg_1'>";
     echo "<td>" . __('Ticket template') . "&nbsp;:</td>";
     echo "<td>";
     $a_used = array();
     Dropdown::show("TicketTemplate", array("name" => "tickettemplates_id", "used" => $a_used));
     echo "</td>";
     echo "<td>" . __('Type') . "&nbsp;:</td>";
     echo "<td>";
     Ticket::dropdownType("type");
     echo "</td>";
     echo "</tr>";
     echo "<tr class='tab_bg_1'>";
     echo "<td>" . __('Simplified interface') . "&nbsp;:</td>";
     echo "<td>";
     Dropdown::showYesNo("is_helpdesk");
     echo "</td>";
     echo "<td>" . __('Standard interface') . "&nbsp;:</td>";
     echo "<td>";
     Dropdown::showYesNo("is_central");
     echo "</td>";
     echo "</tr>";
     echo "<tr>";
     echo "<td class='tab_bg_2 top' colspan='4'>";
     echo "<input type='hidden' name='plugin_surveyticket_surveys_id' value='" . $items_id . "'>";
     echo "<div class='center'>";
     echo "<input type='submit' name='add' value=\"" . __('Add') . "\" class='submit'>";
     echo "</div></td></tr>";
     echo "</table>";
     Html::closeForm();
     // list templates
     echo "<table class='tab_cadre_fixe'>";
     echo "<tr class='tab_bg_1'>";
     echo "<th>";
     echo __('Ticket template');
     echo "</th>";
     echo "<th>";
     echo __('Type');
     echo "</th>";
     echo "<th>";
     echo __('Simplified interface');
     echo "</th>";
     echo "<th>";
     echo __('Standard interface');
     echo "</th>";
     echo "<th>";
     echo "</th>";
     echo "</tr>";
     $_tickettempaltes = $this->find("`plugin_surveyticket_surveys_id`='" . $items_id . "'");
     foreach ($_tickettempaltes as $data) {
         echo "<tr class='tab_bg_1'>";
         echo "<td>";
         $ticketTemplate->getFromDB($data['tickettemplates_id']);
         echo $ticketTemplate->getLink(1);
         echo "</td>";
         echo "<td>";
         echo Ticket::getTicketTypeName($data['type']);
         echo "</td>";
         echo "<td>";
         echo Dropdown::getYesNo($data['is_helpdesk']);
         echo "</td>";
         echo "<td>";
         echo Dropdown::getYesNo($data['is_central']);
         echo "</td>";
         echo "<td align='center'>";
         echo "<form method='post' name='form_delettickettemplate' action='" . $CFG_GLPI['root_doc'] . "/plugins/surveyticket/front/tickettemplate.form.php'>";
         echo "<input type='hidden' name='id' value='" . $data['id'] . "'>";
         echo "<input type='submit' name='delete' value=\"" . _sx('button', 'Delete permanently') . "\" class='submit'>";
         Html::closeForm();
         echo "</td>";
         echo "</tr>";
     }
     echo "</table>";
 }
开发者ID:geldarr,项目名称:hack-space,代码行数:79,代码来源:tickettemplate.class.php

示例8: displayActionSelectPattern

 /**
  * @param $options   array
  **/
 function displayActionSelectPattern($options = array())
 {
     $display = false;
     switch ($_POST["action_type"]) {
         //If a regex value is used, then always display an autocompletiontextfield
         case "regex_result":
         case "append_regex_result":
             Html::autocompletionTextField($this, "value");
             break;
         case 'fromuser':
         case 'fromitem':
             Dropdown::showYesNo("value", 0, 0);
             $display = true;
             break;
         default:
             $actions = Rule::getActionsByType($options["sub_type"]);
             if (isset($actions[$options["field"]]['type'])) {
                 switch ($actions[$options["field"]]['type']) {
                     case "dropdown":
                         $table = $actions[$options["field"]]['table'];
                         $param = array('name' => "value");
                         if (isset($actions[$options["field"]]['condition'])) {
                             $param['condition'] = $actions[$options["field"]]['condition'];
                         }
                         Dropdown::show(getItemTypeForTable($table), $param);
                         $display = true;
                         break;
                     case "dropdown_tickettype":
                         Ticket::dropdownType('value');
                         $display = true;
                         break;
                     case "dropdown_assign":
                         User::dropdown(array('name' => 'value', 'right' => 'own_ticket'));
                         $display = true;
                         break;
                     case "dropdown_users":
                         User::dropdown(array('name' => 'value', 'right' => 'all'));
                         $display = true;
                         break;
                     case "dropdown_urgency":
                         Ticket::dropdownUrgency(array('name' => 'value'));
                         $display = true;
                         break;
                     case "dropdown_impact":
                         Ticket::dropdownImpact(array('name' => 'value'));
                         $display = true;
                         break;
                     case "dropdown_priority":
                         if ($_POST["action_type"] != 'compute') {
                             Ticket::dropdownPriority(array('name' => 'value'));
                         }
                         $display = true;
                         break;
                     case "dropdown_status":
                         Ticket::dropdownStatus(array('name' => "value"));
                         $display = true;
                         break;
                     case "yesonly":
                         Dropdown::showYesNo("value", 0, 0);
                         $display = true;
                         break;
                     case "yesno":
                         Dropdown::showYesNo("value");
                         $display = true;
                         break;
                     case "dropdown_management":
                         Dropdown::showGlobalSwitch(0, array('name' => 'value', 'management_restrict' => 2, 'withtemplate' => false));
                         $display = true;
                         break;
                     case "dropdown_users_validate":
                         User::dropdown(array('name' => "value", 'right' => array('validate_incident', 'validate_request')));
                         $display = true;
                         break;
                     default:
                         if ($rule = getItemForItemtype($options["sub_type"])) {
                             $display = $rule->displayAdditionalRuleAction($actions[$options["field"]]);
                         }
                         break;
                 }
             }
             if (!$display) {
                 Html::autocompletionTextField($this, "value");
             }
     }
 }
开发者ID:gaforeror,项目名称:glpi,代码行数:88,代码来源:ruleaction.class.php

示例9: switch

 // //                   User::dropdown(array('name'  => $inputname,
 // //                                        'value' => $_REQUEST['value'],
 // //                                        'right' => 'own_ticket'));
 // //                   $display = true;
 // //                   break;
 //             }
 //         }
 if (!$display && isset($searchopt['field'])) {
     // Specific cases
     switch ($searchopt['table'] . "." . $searchopt['field']) {
         case "glpi_tickets.status":
             Ticket::dropdownStatus($inputname, $_REQUEST['value'], 1);
             $display = true;
             break;
         case "glpi_tickets.type":
             Ticket::dropdownType($inputname, $_REQUEST['value']);
             $display = true;
             break;
         case "glpi_tickets.priority":
             Ticket::dropdownPriority($inputname, $_REQUEST['value'], true, true);
             $display = true;
             break;
         case "glpi_tickets.impact":
             Ticket::dropdownImpact($inputname, $_REQUEST['value'], true);
             $display = true;
             break;
         case "glpi_tickets.urgency":
             Ticket::dropdownUrgency($inputname, $_REQUEST['value'], true);
             $display = true;
             break;
         case "glpi_tickets.global_validation":
开发者ID:ryukansent,项目名称:Thesis-SideB,代码行数:31,代码来源:searchoptionvalue.php

示例10: array

 case "glpi_contracts.duration":
 case "glpi_contracts.notice":
     Dropdown::showInteger($search["field"], 0, 0, 120);
     echo " " . $LANG['financial'][57];
     break;
 case "glpi_softwarelicenses.number":
     Dropdown::showInteger($search["linkfield"], 0, 1, 1000, 1, array(-1 => $LANG['software'][4]));
     break;
 case "glpi_contracts.alert":
     Contract::dropdownAlert($search["linkfield"], 0);
     break;
 case "glpi_tickets.status":
     Ticket::dropdownStatus($search["linkfield"]);
     break;
 case "glpi_tickets.type":
     Ticket::dropdownType($search["linkfield"]);
     break;
 case "glpi_tickets.priority":
     Ticket::dropdownPriority($search["linkfield"]);
     break;
 case "glpi_tickets.impact":
     Ticket::dropdownImpact($search["linkfield"]);
     break;
 case "glpi_tickets.urgency":
     Ticket::dropdownUrgency($search["linkfield"]);
     break;
 case "glpi_tickets.global_validation":
     TicketValidation::dropdownStatus($search["linkfield"]);
     break;
 default:
     // Specific plugin Type case
开发者ID:ryukansent,项目名称:Thesis-SideB,代码行数:31,代码来源:dropdownMassiveActionField.php

示例11: showForm


//.........这里部分代码省略.........
     echo $this->getUsername();
     echo "</td>";
     echo "<td>" . __('Expired ?', 'monitoring') . "</td>";
     echo "<td>";
     echo Dropdown::getYesNo($this->fields['expired']);
     echo "</td>";
     echo "</tr>";
     if (Ticket::canView()) {
         echo "<tr class='tab_bg_1'>";
         echo "<td colspan='4'>&nbsp;</td>";
         echo "</tr>";
         if ($this->isAssociatedTicket()) {
             echo "<tr class='tab_bg_3'>";
             echo "<td colspan='4'>" . __('Downtime associated ticket', 'monitoring') . "</td>";
             echo "</tr>";
             // Find ticket in DB ...
             $track = new Ticket();
             $track->getFromDB($this->getField("tickets_id"));
             // Display ticket id, name and tracking ...
             $bgcolor = $_SESSION["glpipriority_" . $track->fields["priority"]];
             echo "<tr class='tab_bg_2'>";
             echo "<td class='center' bgcolor='{$bgcolor}'>" . sprintf(__('%1$s: %2$s'), __('ID'), $track->fields["id"]) . "</td>";
             echo "<td class='center'>";
             $showprivate = Session::haveRight("show_full_ticket", 1);
             $link = "<a id='ticket" . $track->fields["id"] . "' href='" . $CFG_GLPI["root_doc"] . "/front/ticket.form.php?id=" . $track->fields["id"];
             $link .= "'>";
             $link .= "<span class='b'>" . $track->getNameID() . "</span></a>";
             $link = sprintf(__('%1$s (%2$s)'), $link, sprintf(__('%1$s - %2$s'), $track->numberOfFollowups($showprivate), $track->numberOfTasks($showprivate)));
             $link = printf(__('%1$s %2$s'), $link, Html::showToolTip($track->fields['content'], array('applyto' => 'ticket' . $track->fields["id"], 'display' => false)));
             echo "</td>";
             echo "</tr>";
         } else {
             if ($createDowntime && Ticket::canCreate()) {
                 echo "<tr class='tab_bg_3'>";
                 echo "<td colspan='4'>" . __('Associated ticket (no declared category implies no ticket created):', 'monitoring') . "</td>";
                 echo "</tr>";
                 echo "<input type='hidden' name='redirect' value='" . $CFG_GLPI["root_doc"] . "/front/ticket.form.php' />";
                 echo "<input type='hidden' name='itemtype' value='" . $pmHost->getField("itemtype") . "' />";
                 echo "<input type='hidden' name='items_id' value='" . $pmHost->getField("items_id") . "' />";
                 echo '<input type="hidden" name="entities_id" value="' . $item->fields['entities_id'] . '" />';
                 $item = new $itemtype();
                 $item->getFromDB($pmHost->getField("items_id"));
                 echo "<input type='hidden' name='locations_id' value='" . $item->getField("locations_id") . "' />";
                 /*
                             // Find SLA ...
                             $sla = new Sla();
                             $slas = current($sla->find("`name` LIKE '%proactive%' LIMIT 1"));
                             $sla_id = isset($slas['id']) ? $slas['id'] : 0;
                 
                             echo "<tr class='tab_bg_3'>";
                             echo "<td>".__('Ticket SLA:', 'monitoring')."</td>";
                             echo "<td colspan='3'>";
                             Sla::dropdown(array('value'  => $sla_id));
                             echo "</td>";
                             echo "</tr>";
                 */
                 // Ticket type ...
                 echo "<tr class='tab_bg_3'>";
                 echo "<td>" . __('Ticket type:', 'monitoring') . "</td>";
                 echo "<td colspan='3'>";
                 Ticket::dropdownType("type", array('value' => Ticket::INCIDENT_TYPE));
                 echo "</td>";
                 echo "</tr>";
                 // Find category ...
                 $category = new ITILCategory();
                 $categories = current($category->find("`name` LIKE '%incident%' LIMIT 1"));
                 $category_id = isset($categories['id']) ? $categories['id'] : 0;
                 /*
                             echo "
                             <script>
                             function changeCategory() {
                                alert(document.getElementById('dropdown_itilcategories_idcategory'));
                                alert($('#dropdown_itilcategories_idcategory').val());
                             }
                             </script>
                             ";
                 */
                 echo "<tr class='tab_bg_3'>";
                 echo "<td>" . __('Ticket category:', 'monitoring') . "</td>";
                 echo "<td colspan='3'>";
                 ITILCategory::dropdown(array('value' => $category_id));
                 /*
                             ITILCategory::dropdown(array(
                                'value'     => $category_id,
                                'rand'      => 'category',
                                'on_change' => 'changeCategory();'
                             ));
                 */
                 echo "</td>";
                 echo "</tr>";
             } else {
                 echo "<tr class='tab_bg_3'>";
                 echo "<td colspan='4'>" . __('No associated ticket for this downtime', 'monitoring') . "</td>";
                 echo "</tr>";
             }
         }
     }
     $this->showFormButtons(array('canedit' => $createDowntime));
     return true;
 }
开发者ID:paisdelconocimiento,项目名称:glpi-smartcities,代码行数:101,代码来源:downtime.class.php


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