本文整理汇总了PHP中Contract::dropdownAlert方法的典型用法代码示例。如果您正苦于以下问题:PHP Contract::dropdownAlert方法的具体用法?PHP Contract::dropdownAlert怎么用?PHP Contract::dropdownAlert使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Contract
的用法示例。
在下文中一共展示了Contract::dropdownAlert方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
示例2: showAdditionalInformation
/**
* @param $info array
* @param $option array
**/
function showAdditionalInformation($info = array(), $option = array())
{
$name = "info[" . $option['linkfield'] . "]";
switch ($option['displaytype']) {
case 'alert':
Contract::dropdownAlert(array('name' => $name));
break;
case 'renewal':
Contract::dropdownContractRenewal($name);
break;
case 'billing':
Dropdown::showNumber($name, array('value' => 0, 'min' => 12, 'max' => 60, 'step' => 12, 'toadd' => array(0 => Dropdown::EMPTY_VALUE, 1 => sprintf(_n('%d month', '%d months', 1), 1), 2 => sprintf(_n('%d month', '%d months', 2), 2), 3 => sprintf(_n('%d month', '%d months', 3), 3), 6 => sprintf(_n('%d month', '%d months', 6), 6))), array('unit' => 'month'));
break;
default:
break;
}
}
示例3: showFormAlerts
function showFormAlerts()
{
global $LANG, $CFG_GLPI;
echo "<form action='" . getItemTypeFormURL(__CLASS__) . "' method='post'>";
echo "<input type='hidden' name='id' value='1'>";
echo "<table class='tab_cadre_fixe'>";
echo "<tr class='tab_bg_1'><th colspan='4'>" . $LANG['common'][41] . "</th></tr>";
echo "<tr class='tab_bg_2'>";
echo "<td >" . $LANG['setup'][246] . " :</td><td>";
Alert::dropdownYesNo(array('name' => "use_contracts_alert", 'value' => $CFG_GLPI["use_contracts_alert"]));
echo "</td>";
echo "<td>" . $LANG['setup'][46] . " :</td><td>";
Contract::dropdownAlert("default_contract_alert", $CFG_GLPI["default_contract_alert"]);
echo "</td></tr>";
echo "<tr class='tab_bg_2'><td >" . $LANG['setup'][247] . " :</td><td>";
Alert::dropdownYesNo(array('name' => "use_infocoms_alert", 'value' => $CFG_GLPI["use_infocoms_alert"]));
echo "</td>";
echo "<td>" . $LANG['setup'][46] . " :</td><td>";
Alert::dropdownInfocomAlert($CFG_GLPI["default_infocom_alert"]);
echo "</td></tr>";
echo "<tr class='tab_bg_2'><td >" . $LANG['setup'][264] . " :</td><td>";
Alert::dropdownYesNo(array('name' => "use_licenses_alert", 'value' => $CFG_GLPI["use_licenses_alert"]));
echo "</td>";
echo "<td colspan='2'></td></tr>";
echo "<tr class='tab_bg_2'>";
echo "<td >" . $LANG['setup'][707] . " :</td><td>";
Alert::dropdownIntegerNever('use_reservations_alert', $CFG_GLPI["use_reservations_alert"], array('max' => 99));
echo " " . $LANG['job'][21] . "</td>";
echo "<td colspan='2'></td></tr>";
echo "<tr class='tab_bg_2'><td >" . $LANG['setup'][708] . " :</td><td>";
Alert::dropdownIntegerNever('notclosed_delay', $CFG_GLPI["notclosed_delay"], array('max' => 99));
echo " " . $LANG['stats'][31] . "</td>";
echo "<td colspan='2'></td></tr>";
echo "<tr class='tab_bg_2'>";
echo "<td>" . $LANG['setup'][245] . " : " . $LANG['setup'][244] . " :</td><td>";
Alert::dropdown(array('name' => 'cartridges_alert_repeat', 'value' => $CFG_GLPI["cartridges_alert_repeat"]));
echo "</td>";
echo "<td>" . $LANG['setup'][115] . " :</td><td>";
Dropdown::showInteger('default_alarm_threshold', $CFG_GLPI["default_alarm_threshold"], -1, 100);
echo "</td></tr>";
echo "<tr class='tab_bg_2'>";
echo "<td >" . $LANG['setup'][245] . " : " . $LANG['setup'][243] . " :</td><td>";
Alert::dropdown(array('name' => 'consumables_alert_repeat', 'value' => $CFG_GLPI["consumables_alert_repeat"]));
echo "</td><td colspan='2'>";
echo "</td></tr>";
echo "<tr class='tab_bg_2'><td class='center' colspan='4'>";
echo "<input class='submit' type='submit' name='update' value=\"" . $LANG['buttons'][2] . "\">";
echo "</td></tr>";
echo "</table></form>";
}
示例4: switch
// field type
switch ($search["table"] . "." . $search["linkfield"]) {
case "glpi_cartridgeitems.alarm_threshold":
case "glpi_consumableitems.alarm_threshold":
Dropdown::showInteger($search["linkfield"], 0, -1, 100);
break;
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"]);