本文整理汇总了PHP中Ticket::dropdownImpact方法的典型用法代码示例。如果您正苦于以下问题:PHP Ticket::dropdownImpact方法的具体用法?PHP Ticket::dropdownImpact怎么用?PHP Ticket::dropdownImpact使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Ticket
的用法示例。
在下文中一共展示了Ticket::dropdownImpact方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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));
}
}
示例2: getCentral
//.........这里部分代码省略.........
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 {
echo $tt->getBeginHiddenFieldValue('global_validation');
if ($canupdate) {
TicketValidation::dropdownStatus('global_validation', array('global' => true, 'value' => $ticket->fields['global_validation']));
} else {
echo TicketValidation::getStatus($ticket->fields['global_validation']);
}
echo $tt->getEndHiddenFieldValue('global_validation', $ticket);
}
echo "</td></tr>";
echo "<tr class='tab_bg_1'>";
echo "<th>" . $tt->getBeginHiddenFieldText('impact');
printf(__('%1$s%2$s'), __('Impact'), $tt->getMandatoryMark('impact'));
echo $tt->getEndHiddenFieldText('impact') . "</th>";
echo "<td>";
echo $tt->getBeginHiddenFieldValue('impact');
if ($canupdate) {
$idimpact = Ticket::dropdownImpact(array('value' => $ticket->fields["impact"]));
} else {
$idimpact = "value_impact" . mt_rand();
echo "<input id='{$idimpact}' type='hidden' name='impact' value='" . $ticket->fields["impact"] . "'>";
echo Ticket::getImpactName($ticket->fields["impact"]);
}
echo $tt->getEndHiddenFieldValue('impact', $ticket);
echo "</td>";
echo "<th rowspan='2'>" . $tt->getBeginHiddenFieldText('itemtype');
printf(__('%1$s%2$s'), __('Associated element'), $tt->getMandatoryMark('itemtype'));
if ($ID && $canupdate) {
echo " <img title='" . __s('Update') . "' alt='" . __s('Update') . "'\n onClick=\"Ext.get('tickethardwareselection{$ID}').setDisplayed('block')\"\n class='pointer' src='" . $CFG_GLPI["root_doc"] . "/pics/showselect.png'>";
}
echo $tt->getEndHiddenFieldText('itemtype');
echo "</th>";
echo "<td rowspan='2'>";
echo $tt->getBeginHiddenFieldValue('itemtype');
// Select hardware on creation or if have update right
if ($canupdate || !$ID || $canupdate_descr) {
if ($ID) {
if ($ticket->fields['itemtype'] && ($item = getItemForItemtype($ticket->fields['itemtype'])) && $ticket->fields["items_id"]) {
if ($item->can($ticket->fields["items_id"], 'r')) {
printf(__('%1$s - %2$s'), $item->getTypeName(), $item->getLink(array('comments' => true)));
} else {
printf(__('%1$s - %2$s'), $item->getTypeName(), $item->getNameID());
}
}
}
$dev_user_id = 0;
$dev_itemtype = $ticket->fields["itemtype"];
$dev_items_id = $ticket->fields["items_id"];
if (!$ID) {
$dev_user_id = $values['_users_id_requester'];
示例3: 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;
//.........这里部分代码省略.........
示例4: 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;
}
}
示例5: switch
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":
User::dropdown(array('name' => $inputname, 'value' => $_REQUEST['value'], 'comments' => false, 'all' => -1, 'right' => 'all'));
$display = true;
break;
case "glpi_ticketvalidations.status":
示例6: 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");
}
}
}
示例7: array
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));
}
$already_display = false;
if (isset($search['datatype'])) {