本文整理汇总了PHP中Ticket::dropdownPriority方法的典型用法代码示例。如果您正苦于以下问题:PHP Ticket::dropdownPriority方法的具体用法?PHP Ticket::dropdownPriority怎么用?PHP Ticket::dropdownPriority使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Ticket
的用法示例。
在下文中一共展示了Ticket::dropdownPriority方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: displayCriteria
public function displayCriteria()
{
$this->getReport()->startColumn();
echo $this->getCriteriaLabel() . ' :';
$this->getReport()->endColumn();
$this->getReport()->startColumn();
Ticket::dropdownPriority($this->getName(), $this->getParameterValue(), 1);
$this->getReport()->endColumn();
}
示例2: showForm
function showForm($ID, $options = array())
{
global $CFG_GLPI;
if (!$this->canView()) {
return false;
}
$plugin_projet_projets_id = -1;
if (isset($options['plugin_projet_projets_id'])) {
$plugin_projet_projets_id = $options['plugin_projet_projets_id'];
}
$item = new PluginProjetProjet();
if ($item->getFromDB($plugin_projet_projets_id)) {
$entities_id = $item->fields["entities_id"];
}
if ($ID > 0) {
$this->check($ID, 'r');
$plugin_projet_projets_id = $this->fields["plugin_projet_projets_id"];
} else {
// Create item
$input = array('plugin_projet_projets_id' => $plugin_projet_projets_id, 'entities_id' => $entities_id);
$this->check(-1, 'w', $input);
}
$options["colspan"] = 4;
$this->showTabs($options);
$this->showFormHeader($options);
echo "<input type='hidden' name='plugin_projet_projets_id' value='{$plugin_projet_projets_id}'>";
echo "<tr class='tab_bg_2'>";
echo "<td colspan='2'>" . PluginProjetProjet::getTypeName(2) . "</td><td colspan='2'>";
$link = NOT_AVAILABLE;
if ($item->getFromDB($plugin_projet_projets_id)) {
$link = $item->getLink();
}
echo $link;
echo "</td>";
echo "<td>";
echo __('Parent task', 'projet') . "</td><td>";
PluginProjetTask_Task::displayLinkedProjetTasksTo($ID);
if ($this->canCreate()) {
$rand_linked_projettask = mt_rand();
echo " ";
if (!PluginProjetTask_Task::getParentProjetTasksTo($ID)) {
echo "<img onClick=\"Ext.get('linkedprojettask{$rand_linked_projettask}').setDisplayed('block')\"\n title=\"" . __('Add') . "\" alt=\"" . __('Add') . "\"\n class='pointer' src='" . $CFG_GLPI["root_doc"] . "/pics/add_dropdown.png'>";
}
echo "<div style='display:none' id='linkedprojettask{$rand_linked_projettask}'>";
PluginProjetTask_Task::dropdownLinks('_link[link]', isset($values["_link"]) ? $values["_link"]['link'] : '');
echo " ";
PluginProjetTask_Task::dropdownParent("_link[plugin_projet_tasks_id_2]", isset($values["_link"]) ? $values["_link"]['plugin_projet_tasks_id_2'] : '', array('id' => $this->fields["id"], 'entities_id' => $this->fields["entities_id"], 'plugin_projet_projets_id' => $plugin_projet_projets_id));
echo "<input type='hidden' name='_link[plugin_projet_tasks_id_1]' value='{$ID}'>\n";
echo " ";
echo "</div>";
if (isset($values["_link"]) && !empty($values["_link"]['plugin_projet_tasks_id_2'])) {
echo "<script language='javascript'>Ext.get('linkedprojettask{$rand_linked_projettask}').\n setDisplayed('block');</script>";
}
}
echo "</td>";
echo "<td>";
echo __('Dependent', 'projet') . "</td><td>";
Dropdown::showYesNo("depends", $this->fields["depends"]);
echo " ";
echo " <img alt='' src='" . $CFG_GLPI["root_doc"] . "/pics/aide.png' onmouseout=\"cleanhide('commentsup')\" onmouseover=\"cleandisplay('commentsup')\">";
echo "<span class='over_link' id='commentsup'>" . nl2br(__('Depends on the tasks children', 'projet')) . "</span>";
echo "</td>";
echo "</tr>";
$width_left = $width_right = "50%";
$cols = 60;
$rows = 4;
echo "<tr class='tab_bg_1'>";
echo "<td colspan='2'>";
echo __('Name') . "</td><td colspan='2'>";
Html::autocompletionTextField($this, "name", array('size' => "30"));
echo "<td >";
echo _n('Type', 'Types', 1) . "</td><td>";
Dropdown::show('PluginProjetTaskType', array('value' => $this->fields["plugin_projet_tasktypes_id"]));
echo "</td>";
echo "<td>";
echo __('State') . "</td><td>";
if ($ID > 0) {
$this->dropdownState("plugin_projet_taskstates_id", $this->fields["plugin_projet_taskstates_id"], array('depends' => $this->fields["depends"], 'id' => $this->fields["id"], 'plugin_projet_projets_id' => $plugin_projet_projets_id));
} else {
Dropdown::show('PluginProjetTaskState', array('value' => $this->fields["plugin_projet_taskstates_id"]));
}
echo "</td>";
echo "</tr>";
echo "<tr class='tab_bg_1'>";
echo "<td colspan='2'>";
echo _n('Location', 'Locations', 1) . "</td><td colspan='2'>";
Dropdown::show('Location', array('value' => $this->fields["locations_id"]));
echo "</td>";
echo "<td>";
echo __('Priority') . "</td><td>";
Ticket::dropdownPriority(array('value' => $this->fields["priority"], 'withmajor' => true));
echo "</td>";
echo "<td>" . __('Progress') . "</td><td>";
$advance = floor($this->fields["advance"]);
echo "<select name='advance'>";
if (empty($ID) || $this->fields["depends"] == 0) {
for ($i = 0; $i < 101; $i += 5) {
echo "<option value='{$i}' ";
if ($advance == $i) {
echo "selected";
//.........这里部分代码省略.........
示例3: getCentral
//.........这里部分代码省略.........
if (isset($ticket->users[CommonITILActor::REQUESTER]) && count($ticket->users[CommonITILActor::REQUESTER]) == 1) {
foreach ($ticket->users[CommonITILActor::REQUESTER] as $user_id_single) {
$dev_user_id = $user_id_single['users_id'];
}
}
}
if ($ID) {
echo "<div id='tickethardwareselection{$ID}' style='display:none'>";
}
if ($dev_user_id > 0) {
Ticket::dropdownMyDevices($dev_user_id, $ticket->fields["entities_id"], $dev_itemtype, $dev_items_id);
}
Ticket::dropdownAllDevices("itemtype", $dev_itemtype, $dev_items_id, 1, $dev_user_id, $ticket->fields["entities_id"]);
if ($ID) {
echo "</div>";
}
echo "<span id='item_ticket_selection_information'></span>";
} else {
if ($ID && $ticket->fields['itemtype'] && ($item = getItemForItemtype($ticket->fields['itemtype']))) {
$item->getFromDB($ticket->fields['items_id']);
printf(__('%1$s - %2$s'), $item->getTypeName(), $item->getNameID());
} else {
_e('General');
}
}
echo $tt->getEndHiddenFieldValue('itemtype', $ticket);
echo "</td>";
echo "</tr>";
echo "<tr class='tab_bg_1'>";
echo "<th>" . sprintf(__('%1$s%2$s'), __('Priority'), $tt->getMandatoryMark('priority')) . "</th>";
echo "<td>";
$idajax = 'change_priority_' . mt_rand();
if ($canupdate && $canpriority && !$tt->isHiddenField('priority')) {
$idpriority = Ticket::dropdownPriority(array('value' => $ticket->fields["priority"], 'withmajor' => true));
echo " <span id='{$idajax}' style='display:none'></span>";
} else {
$idpriority = 0;
echo "<span id='{$idajax}'>" . Ticket::getPriorityName($ticket->fields["priority"]) . "</span>";
}
if ($canupdate || $canupdate_descr) {
$params = array('urgency' => '__VALUE0__', 'impact' => '__VALUE1__', 'priority' => $idpriority);
Ajax::updateItemOnSelectEvent(array($idurgency, $idimpact), $idajax, $CFG_GLPI["root_doc"] . "/ajax/priority.php", $params);
}
echo "</td>";
echo "</tr>";
echo "<tr class='tab_bg_1'>";
// Need comment right to add a followup with the actiontime
if (!$ID && Session::haveRight("global_add_followups", "1")) {
echo "<th>" . $tt->getBeginHiddenFieldText('actiontime');
printf(__('%1$s%2$s'), __('Total duration'), $tt->getMandatoryMark('actiontime'));
echo $tt->getEndHiddenFieldText('actiontime') . "</th>";
echo "<td>";
echo $tt->getBeginHiddenFieldValue('actiontime');
Dropdown::showTimeStamp('actiontime', array('value' => $values['actiontime'], 'addfirstminutes' => true));
echo $tt->getEndHiddenFieldValue('actiontime', $ticket);
echo "</td>";
} else {
echo "<th></th><td></td>";
}
echo "<th>" . $tt->getBeginHiddenFieldText('locations_id');
printf(__('%1$s%2$s'), __('Location'), $tt->getMandatoryMark('locations_id'));
echo $tt->getEndHiddenFieldText('locations_id') . "</th>";
echo "<td>";
echo $tt->getBeginHiddenFieldValue('locations_id');
if ($canupdate) {
Location::dropdown(array('value' => $ticket->fields['locations_id'], 'entity' => $ticket->fields['entities_id']));
示例4: showFormHelpdesk
//.........这里部分代码省略.........
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 " -> ";
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> </td>";
}
echo "</tr>";
for ($urgency = 5; $urgency >= 1; $urgency--) {
echo "<tr class='tab_bg_1'>";
echo "<td>" . Ticket::getUrgencyName($urgency) . " </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);
if (isset($CFG_GLPI['priority_matrix'][$urgency][$impact])) {
$pri = $CFG_GLPI['priority_matrix'][$urgency][$impact];
}
if ($isurgency[$urgency] && $isimpact[$impact]) {
$bgcolor = $_SESSION["glpipriority_{$pri}"];
echo "<td class='center' bgcolor='{$bgcolor}'>";
Ticket::dropdownPriority(array('value' => $pri, 'name' => "_matrix_{$urgency}_{$impact}"));
echo "</td>";
} else {
echo "<td><input type='hidden' name='_matrix_{$urgency}_{$impact}' value='{$pri}'>\n </td>";
}
}
echo "</tr>\n";
}
if ($canedit) {
echo "<tr class='tab_bg_2'>";
echo "<td colspan='7' class='center'>";
echo "<input type='submit' name='update' class='submit' value=\"" . _sx('button', 'Save') . "\">";
echo "</td></tr>";
}
echo "</table></div>";
Html::closeForm();
}
示例5: 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));
}
}
示例6: showFormHelpdesk
//.........这里部分代码省略.........
echo "<td>" . $LANG['setup'][612] . " :</td><td>";
Dropdown::showYesNo("is_ticket_category_mandatory", $CFG_GLPI["is_ticket_category_mandatory"]);
echo "</td><td>" . $LANG['setup'][148] . " :</td><td>";
Dropdown::showInteger('time_step', $CFG_GLPI["time_step"], 30, 60, 30, array(5 => 5, 10 => 10, 15 => 15, 20 => 20));
echo " " . $LANG['job'][22];
echo "</td></tr>";
echo "<tr class='tab_bg_2'>";
echo "<td>" . $LANG['setup'][610] . " :</td><td>";
Dropdown::showYesNo("is_ticket_title_mandatory", $CFG_GLPI["is_ticket_title_mandatory"]);
echo "</td><td>" . $LANG['setup'][223] . " :</td><td>";
Dropdown::showHours('planning_begin', $CFG_GLPI["planning_begin"]);
echo " -> ";
Dropdown::showHours('planning_end', $CFG_GLPI["planning_end"]);
echo "</td></tr>";
echo "<tr class='tab_bg_2'>";
echo "<td> " . $LANG['setup'][611] . " :</td><td>";
Dropdown::showYesNo("is_ticket_content_mandatory", $CFG_GLPI["is_ticket_content_mandatory"]);
echo "</td><td>" . $LANG['mailgate'][7] . " (" . $LANG['setup'][46] . ") :</td><td>";
MailCollector::showMaxFilesize('default_mailcollector_filesize_max', $CFG_GLPI["default_mailcollector_filesize_max"]);
echo "</td></tr>";
echo "<tr class='tab_bg_2'>";
echo "<td> " . $LANG['setup'][52] . " :</td><td>";
$autoassign = array(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' => $CFG_GLPI["auto_assign_mode"]));
echo "</td><td>" . $LANG['setup'][409] . " :</td><td>";
Dropdown::show('DocumentCategory', array('value' => $CFG_GLPI["documentcategories_id_forticket"], 'name' => "documentcategories_id_forticket"));
echo "</td></tr>";
echo "<tr class='tab_bg_2'>";
echo "<td>" . $LANG['entity'][18] . " :</td><td>";
Dropdown::showInteger('autoclose_delay', $CFG_GLPI['autoclose_delay'], 0, 99, 1, array(-10 => $LANG['setup'][307]));
echo " " . $LANG['stats'][31] . "</td>";
echo "<td>" . $LANG['setup'][608] . " :</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>" . $LANG['tracking'][37] . " :</td><td>";
Dropdown::showYesNo("keep_tickets_on_delete", $CFG_GLPI["keep_tickets_on_delete"]);
echo "</td><td>" . $LANG['setup'][219] . " :</td><td>";
Dropdown::showYesNo("use_anonymous_helpdesk", $CFG_GLPI["use_anonymous_helpdesk"]);
echo "</td></tr>";
echo "</table><br>";
echo "<table class='tab_cadre_fixe'>";
echo "<tr><th colspan='7'>" . $LANG['help'][1];
echo "<input type='hidden' name='_matrix' value='1'></th></tr>";
echo "<tr class='tab_bg_2'>";
echo "<td class='b right' colspan='2'>" . $LANG['joblist'][30] . " :</td>";
for ($impact = 5, $msg = 47; $impact >= 1; $impact--, $msg++) {
echo "<td>" . $LANG['help'][$msg] . " : ";
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'>" . $LANG['joblist'][29] . " :</td>";
for ($impact = 5, $msg = 47; $impact >= 1; $impact--, $msg++) {
echo "<td> </td>";
}
echo "</tr>";
for ($urgency = 5, $msg = 42; $urgency >= 1; $urgency--, $msg++) {
echo "<tr class='tab_bg_1'>";
echo "<td>" . $LANG['help'][$msg] . " :</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);
if (isset($CFG_GLPI['priority_matrix'][$urgency][$impact])) {
$pri = $CFG_GLPI['priority_matrix'][$urgency][$impact];
}
if ($isurgency[$urgency] && $isimpact[$impact]) {
$bgcolor = $_SESSION["glpipriority_{$pri}"];
echo "<td bgcolor='{$bgcolor}'>";
Ticket::dropdownPriority("_matrix_{$urgency}_{$impact}", $pri);
echo "</td>";
} else {
echo "<td><input type='hidden' name='_matrix_{$urgency}_{$impact}' value='{$pri}'></td>";
}
}
echo "</tr>\n";
}
echo "<tr class='tab_bg_2'>";
echo "<td colspan='7' class='center'>";
echo "<input type='hidden' name='id' value='" . $CFG_GLPI["id"] . "'>";
echo "<input type='submit' name='update' class='submit' value=\"" . $LANG['buttons'][2] . "\">";
echo "</td></tr>";
echo "</table></div>";
echo "</form>";
}
示例7: 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;
//.........这里部分代码省略.........
示例8: 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;
}
}
示例9: switch
break;
case "Ticket.users_id_assign":
User::dropdown(array('name' => $inputname, 'value' => $_REQUEST['value'], 'right' => 'own_ticket', 'all' => 1));
$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.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":
TicketValidation::dropdownStatus($inputname, array('value' => $_REQUEST['value'], 'all' => 1));
$display = true;
break;
case "glpi_users.name":
示例10: plugin_projet_MassiveActionsFieldsDisplay
function plugin_projet_MassiveActionsFieldsDisplay($options = array())
{
$table = $options['options']['table'];
$field = $options['options']['field'];
$linkfield = $options['options']['linkfield'];
if ($table == getTableForItemType($options['itemtype'])) {
// Table fields
switch ($table . "." . $field) {
case "glpi_plugin_projet_projets.advance":
case "glpi_plugin_projet_tasks.advance":
echo "<select name='advance'>";
for ($i = 0; $i < 101; $i += 5) {
echo "<option value='{$i}'>{$i}</option>";
}
echo "</select> ";
echo "<input type='hidden' name='field' value='advance'>";
return true;
break;
case "glpi_plugin_projet_tasks.priority":
Ticket::dropdownPriority($linkfield, $field, false, true);
return true;
break;
}
}
// Need to return false on non display item
return false;
}
示例11: 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");
}
}
}
示例12: array
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
$plugdisplay = false;
if ($plug = isPluginItemType($_POST["itemtype"])) {
$plugdisplay = doOneHook($plug['plugin'], 'MassiveActionsFieldsDisplay', array('itemtype' => $_POST["itemtype"], 'options' => $search));