當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Contract::getAlertName方法代碼示例

本文整理匯總了PHP中Contract::getAlertName方法的典型用法代碼示例。如果您正苦於以下問題:PHP Contract::getAlertName方法的具體用法?PHP Contract::getAlertName怎麽用?PHP Contract::getAlertName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Contract的用法示例。


在下文中一共展示了Contract::getAlertName方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getSpecificValueToDisplay


//.........這裏部分代碼省略.........
                     return __('Inheritance of the parent entity');
                 case 0:
                     return __('No');
             }
             return sprintf(_n('%d day', '%d days', $values[$field]), $values[$field]);
         case 'cartridges_alert_repeat':
         case 'consumables_alert_repeat':
             switch ($values[$field]) {
                 case self::CONFIG_PARENT:
                     return __('Inheritance of the parent entity');
                 case self::CONFIG_NEVER:
                 case 0:
                     // For compatibility issue
                     return __('Never');
                 case DAY_TIMESTAMP:
                     return __('Each day');
                 case WEEK_TIMESTAMP:
                     return __('Each week');
                 case MONTH_TIMESTAMP:
                     return __('Each month');
                 default:
                     // Display value if not defined
                     return $values[$field];
             }
             break;
         case 'notclosed_delay':
             // 0 means never
             switch ($values[$field]) {
                 case self::CONFIG_PARENT:
                     return __('Inheritance of the parent entity');
                 case 0:
                     return __('Never');
             }
             return sprintf(_n('%d day', '%d days', $values[$field]), $values[$field]);
         case 'auto_assign_mode':
             return self::getAutoAssignMode($values[$field]);
         case 'tickettype':
             if ($values[$field] == self::CONFIG_PARENT) {
                 return __('Inheritance of the parent entity');
             }
             return Ticket::getTicketTypeName($values[$field]);
         case 'autofill_buy_date':
         case 'autofill_order_date':
         case 'autofill_delivery_date':
         case 'autofill_use_date':
         case 'autofill_warranty_date':
             switch ($values[$field]) {
                 case self::CONFIG_PARENT:
                     return __('Inheritance of the parent entity');
                 case Infocom::COPY_WARRANTY_DATE:
                     return __('Copy the start date of warranty');
                 case Infocom::COPY_BUY_DATE:
                     return __('Copy the date of purchase');
                 case Infocom::COPY_ORDER_DATE:
                     return __('Copy the order date');
                 case Infocom::COPY_DELIVERY_DATE:
                     return __('Copy the delivery date');
                 default:
                     if (strstr($values[$field], '_')) {
                         list($type, $sid) = explode('_', $values[$field], 2);
                         if ($type == Infocom::ON_STATUS_CHANGE) {
                             // TRANS %s is the name of the state
                             return sprintf(__('Fill when shifting to state %s'), Dropdown::getDropdownName('glpi_states', $sid));
                         }
                     }
             }
             return __('No autofill');
         case 'inquest_config':
             if ($values[$field] == self::CONFIG_PARENT) {
                 return __('Inheritance of the parent entity');
             }
             return TicketSatisfaction::getTypeInquestName($values[$field]);
         case 'default_contract_alert':
             return Contract::getAlertName($values[$field]);
         case 'default_infocom_alert':
             return Infocom::getAlertName($values[$field]);
         case 'entities_id_software':
             if ($values[$field] == self::CONFIG_NEVER) {
                 return __('No change of entity');
             }
             if ($values[$field] == self::CONFIG_PARENT) {
                 return __('Inheritance of the parent entity');
             }
             return Dropdown::getDropdownName('glpi_entities', $values[$field]);
         case 'tickettemplates_id':
             if ($values[$field] == self::CONFIG_PARENT) {
                 return __('Inheritance of the parent entity');
             }
             return Dropdown::getDropdownName('glpi_tickettemplates', $values[$field]);
         case 'calendars_id':
             switch ($values[$field]) {
                 case self::CONFIG_PARENT:
                     return __('Inheritance of the parent entity');
                 case 0:
                     return __('24/7');
             }
             return Dropdown::getDropdownName('glpi_calendars', $values[$field]);
     }
     return parent::getSpecificValueToDisplay($field, $values, $options);
 }
開發者ID:korial29,項目名稱:glpi,代碼行數:101,代碼來源:entity.class.php


注:本文中的Contract::getAlertName方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。