本文整理汇总了PHP中Ticket::dropdownUrgency方法的典型用法代码示例。如果您正苦于以下问题:PHP Ticket::dropdownUrgency方法的具体用法?PHP Ticket::dropdownUrgency怎么用?PHP Ticket::dropdownUrgency使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Ticket
的用法示例。
在下文中一共展示了Ticket::dropdownUrgency方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getHelpdesk
//.........这里部分代码省略.........
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>";
if ($values["_users_id_requester"] == 0) {
$values['_users_id_requester'] = Session::getLoginUserID();
}
$_POST['value'] = $values['_users_id_requester'];
$_POST['field'] = '_users_id_requester_notif';
$_POST['use_notification'] = $values['_users_id_requester_notif']['use_notification'];
include GLPI_ROOT . "/ajax/uemailUpdate.php";
echo "</td></tr>";
}
if ($_SESSION["glpiactiveprofile"]["helpdesk_hardware"] != 0) {
if (!$tt->isHiddenField('itemtype')) {
echo "<tr class='tab_bg_1'>";
echo "<td>" . sprintf(__('%1$s%2$s'), __('Hardware type'), $tt->getMandatoryMark('itemtype')) . "</td>";
echo "<td>";
Ticket::dropdownMyDevices($values['_users_id_requester'], $_SESSION["glpiactive_entity"], $values['itemtype'], $values['items_id']);
Ticket::dropdownAllDevices("itemtype", $values['itemtype'], $values['items_id'], 0, $values['_users_id_requester'], $_SESSION["glpiactive_entity"]);
echo "<span id='item_ticket_selection_information'></span>";
echo "</td></tr>";
}
}
if (!$tt->isHiddenField('locations_id')) {
echo "<tr class='tab_bg_1'><td>";
printf(__('%1$s%2$s'), __('Location'), $tt->getMandatoryMark('locations_id'));
echo "</td><td>";
Location::dropdown(array('value' => $values["locations_id"]));
示例2: 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));
}
}
示例3: printHelpDesk
/**
* Print the helpdesk
*
* @param $ID int : ID of the user who want to display the Helpdesk
* @param $from_helpdesk int : is display from the helpdesk.php ?
*
* @return nothing (print the helpdesk)
**/
function printHelpDesk($ID, $from_helpdesk)
{
global $DB, $CFG_GLPI, $LANG;
if (!haveRight("create_ticket", "1")) {
return false;
}
if (haveRight('validate_ticket', 1)) {
$opt = array();
$opt['reset'] = 'reset';
$opt['field'][0] = 55;
// validation status
$opt['searchtype'][0] = 'equals';
$opt['contains'][0] = 'waiting';
$opt['link'][0] = 'AND';
$opt['field'][1] = 59;
// validation aprobator
$opt['searchtype'][1] = 'equals';
$opt['contains'][1] = getLoginUserID();
$opt['link'][1] = 'AND';
$url_validate = $CFG_GLPI["root_doc"] . "/front/ticket.php?" . append_params($opt, '&');
if (TicketValidation::getNumberTicketsToValidate(getLoginUserID()) > 0) {
echo "<a href='{$url_validate}' title=\"" . $LANG['validation'][15] . "\"\n alt=\"" . $LANG['validation'][15] . "\">" . $LANG['validation'][33] . "</a><br><br>";
}
}
$query = "SELECT `email`, `realname`, `firstname`, `name`\n FROM `glpi_users`\n WHERE `id` = '{$ID}'";
$result = $DB->query($query);
$email = $DB->result($result, 0, "email");
// Get saved data from a back system
$use_email_notification = 1;
if ($email == "") {
$use_email_notification = 0;
}
$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] . " : ";
if (isMultiEntitiesMode()) {
echo " (" . 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] . " : </td>";
echo "<td>";
Ticket::dropdownUrgency("urgency", $urgency);
echo "</td></tr>";
}
if (NotificationTargetTicket::isAuthorMailingActivatedForHelpdesk()) {
echo "<tr class='tab_bg_1'>";
echo "<td>" . $LANG['help'][8] . " : </td>";
echo "<td>";
//.........这里部分代码省略.........
示例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: 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;
//.........这里部分代码省略.........
示例6: switch
// 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":
TicketValidation::dropdownStatus($inputname, array('value' => $_REQUEST['value'], 'all' => 1));
$display = true;
break;
}
示例7: 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");
}
}
}
示例8: show
//.........这里部分代码省略.........
echo "<tr><th colspan='1'>";
if (Session::isMultiEntitiesMode()) {
echo " (" . Dropdown::getDropdownName("glpi_entities", $_SESSION["glpiactive_entity"]) . ")";
}
echo "</th></tr>";
//Requerente
if ($cont != "1" && $profile != "1") {
echo "<tr class='tab_bg_1'>";
echo "<td>" . $LANG['job'][4] . " : </td></tr>";
echo "<tr class='tab_bg_1'>";
echo "<td >";
// Dropdown::show('ITILCategories', array('value' => $user,'condition'=>'is_deleted=0'));
//Dropdown::showFromArray("user_id", $user);
echo "\n\n<script>\nfunction getComboA(sel) {\n var id = sel.options[sel.selectedIndex].value; \n //var name = sel.options[sel.selectedIndex].id;\n //document.getElementById('user').innerHTML = id;\n window.location.assign('" . $CFG_GLPI['root_doc'] . "/plugins/mobile/front/helpdesk.php?id='+id+'&session=" . $IDO . "'); \n}\n</script> ";
echo "<select id='sel_user' onchange='getComboA(this)'>";
echo '<option value=" "> -- Selecione -- </option>';
while ($user = $DB->fetch_array($result_user)) {
echo "<option value=" . $user['id'] . " id= \"" . $user['name'] . " " . $user['sname'] . " \">" . $user['name'] . " " . $user['sname'] . "</option>";
}
echo "</select>";
echo "</td></tr>";
echo "<tr class='tab_bg_1'>";
echo "<td>" . $LANG['job'][4] . " : </td></tr>";
echo "<tr class='center tab_bg_1'>";
echo "<td >" . $user_name . $user_sname . "</td></tr>";
echo "<input type='hidden' name='logged' value='" . $logged . "'>";
}
if ($CFG_GLPI['urgency_mask'] != 1 << 3) {
echo "<tr class='tab_bg_1'>";
echo "<td>" . $LANG['joblist'][29] . " : </td></tr>";
echo "<tr class='tab_bg_1'>";
echo "<td>";
//Ticket::dropdownUrgency("urgency",$urgency);
Ticket::dropdownUrgency(array('value' => $values["urgency"]));
echo "</td></tr>";
}
if (NotificationTargetTicket::isAuthorMailingActivatedForHelpdesk()) {
echo "<tr class='tab_bg_1'>";
echo "<td>" . $LANG['help'][8] . " :</td></tr>";
echo "<tr class='tab_bg_1'>";
echo "<td >";
Dropdown::showYesNo('use_email_notification', $use_email_notification);
echo "</td></tr>";
echo "<tr class='tab_bg_1'>";
echo "<td>" . $LANG['plugin_mobile']["email"] . " :</td></tr>";
echo "<tr class='tab_bg_1'>";
echo "<td ><input type='text' id='user_email' name='user_email' value=\"{$email}\" size='40' onchange=\"use_email_notification.value='1'\">";
echo "</td></tr>";
}
if ($_SESSION["glpiactiveprofile"]["helpdesk_hardware"] != 0) {
echo "<tr class='tab_bg_1'>";
echo "<td>" . $LANG['help'][24] . " : </td></tr>";
echo "<tr class='tab_bg_1'>";
echo "<td >";
Item_Ticket::dropdownMyDevices(Session::getLoginUserID(), $_SESSION["glpiactive_entity"]);
//Ticket::dropdownMyDevices($ID,$_SESSION["glpiactive_entity"]);
echo "</td></tr>";
}
//Stevenes Donato
echo "<tr class='tab_bg_1'>";
echo "<td class='force_left'>" . $LANG['common'][36] . " :</td></tr>";
echo "<tr class='tab_bg_1'><td>";
//Dropdown::show('TicketCategory', array('value' => $itilcategories_id,'condition'=>'`is_helpdeskvisible`=1'));
//Dropdown::show('ITILCategory', array('value' => $itilcategories_id,'condition'=>'`is_helpdeskvisible`=1'));
//Dropdown::getDropdownName("glpi_itilcategories", $this->fields["itilcategories_id"]);
//Dropdown::showFromArray("completename", $itilcategories_id);
示例9: doOneHook
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'])) {
switch ($search['datatype']) {
case "date":
showDateFormItem($search["field"]);
示例10: showFormEdit
function showFormEdit($params, $options = array())
{
global $LANG, $CFG_GLPI;
if ($params['id'] > 0) {
$this->check($params['id'], 'r');
} else {
// Create item
$this->check(-1, 'w');
}
echo "<form method='POST' \n action='" . $CFG_GLPI["root_doc"] . "/plugins/formcreator/front/target.form.php'>";
echo "<input type='hidden' name='plugin_formcreator_forms_id' \n value='" . $this->fields['plugin_formcreator_forms_id'] . "' />";
echo "<input type='hidden' name='id' \n value='" . $this->fields['id'] . "' />";
echo "<div class='spaced' id='tabsbody'>";
echo "<table class='tab_cadre_fixe fix_tab_height'>";
echo "<tr>";
echo "<th colspan='2'>" . $LANG['plugin_formcreator']["target"][5] . "</th>";
echo "<th colspan='2'>" . $LANG['plugin_formcreator']["target"][3] . "</th>";
echo "</tr>";
echo "<tr class='tab_bg_1'>";
echo "<td>" . $LANG['plugin_formcreator']["target"][4] . " :</td>";
echo '<td><input type="text" name="name"
value="' . $this->fields['name'] . '" size="54"/></td>';
echo "</td>";
echo "<td>" . __('Category') . " :</td>";
echo "<td>";
Dropdown::show('ITILCategory', array('value' => $this->fields["itilcategories_id"]));
echo "</td>";
echo "</tr>";
echo "<tr>";
echo "<td rowspan='3'>";
echo __('Description') . " :";
echo "</td><td rowspan='3'>";
echo "<textarea name='content' cols='65' rows='12'>" . $this->fields['content'] . "</textarea>";
echo "</td>";
echo "<td>" . __('Type') . " :</td>";
echo "<td>";
echo '<select name="type">';
if ($this->fields['type'] == 2) {
echo '<option value="2">' . __('Request') . '</option>';
echo '<option value="1">' . __('Incident') . '</option>';
} else {
echo '<option value="2">' . __('Request') . '</option>';
echo '<option value="1" SELECTED>' . __('Incident') . '</option>';
}
echo '</select>';
echo "</td>";
echo "</tr><tr>";
echo "<td>" . __('Urgency') . " :</td>";
echo "<td>";
Ticket::dropdownUrgency(array("urgency", $this->fields["urgency"]));
echo "</td>";
echo "</tr><tr>";
echo "<td rownspan='2'>" . __('Priority') . " :</td>";
echo "<td>";
CommonITILObject::dropdownPriority(array("priority", $this->fields["priority"]));
echo "</td>";
echo "</tr>";
echo "<tr>";
echo "<td class='center' colspan='2'>";
echo "<input class='submit' type='submit' value='" . __('Update') . "' name='update'>";
echo "</td>";
echo "<td class='center' colspan='2'>";
echo "<input class='submit' type='submit' value='" . __('Purge') . "' name='delete'>";
echo "</td>";
echo "</tr>";
echo "</table>";
echo "</div>";
Html::closeForm();
self::popupContent($this->fields['plugin_formcreator_forms_id']);
}