本文整理汇总了PHP中CommonDBTM::getSpecificValueToSelect方法的典型用法代码示例。如果您正苦于以下问题:PHP CommonDBTM::getSpecificValueToSelect方法的具体用法?PHP CommonDBTM::getSpecificValueToSelect怎么用?PHP CommonDBTM::getSpecificValueToSelect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CommonDBTM
的用法示例。
在下文中一共展示了CommonDBTM::getSpecificValueToSelect方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getSpecificValueToSelect
/**
* @since version 0.84
*
* @param $field
* @param $name (default '')
* @param $values (default '')
* @param $options array
*
* @return string
**/
static function getSpecificValueToSelect($field, $name = '', $values = '', array $options = array())
{
if (!is_array($values)) {
$values = array($field => $values);
}
$options['display'] = false;
switch ($field) {
case 'priority':
$options['name'] = $name;
$options['value'] = $values[$field];
$options['withmajor'] = 1;
return CommonITILObject::dropdownPriority($options);
case 'visibility':
$options['name'] = $name;
$options['value'] = $values[$field];
return self::dropdownVisibility($options);
case 'state':
return Planning::dropdownState($name, $values[$field], false);
}
return parent::getSpecificValueToSelect($field, $name, $values, $options);
}
示例2: 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())
{
if (!is_array($values)) {
$values = array($field => $values);
}
$options['display'] = false;
switch ($field) {
case 'status':
$options['name'] = $name;
$options['value'] = $values[$field];
return self::dropdownStatus($options);
case 'impact':
$options['name'] = $name;
$options['value'] = $values[$field];
return self::dropdownImpact($options);
case 'urgency':
$options['name'] = $name;
$options['value'] = $values[$field];
return self::dropdownUrgency($options);
case 'priority':
$options['name'] = $name;
$options['value'] = $values[$field];
return self::dropdownPriority($options);
case 'global_validation':
$options['global'] = true;
$options['value'] = $values[$field];
return CommonITILValidation::dropdownStatus($name, $options);
}
return parent::getSpecificValueToSelect($field, $name, $values, $options);
}
示例3: 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())
{
if (!is_array($values)) {
$values = array($field => $values);
}
$options['display'] = false;
switch ($field) {
case 'state':
return Planning::dropdownState($name, $values[$field], false);
}
return parent::getSpecificValueToSelect($field, $name, $values, $options);
}
示例4: 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())
{
if (!is_array($values)) {
$values = array($field => $values);
}
$options['display'] = 0;
switch ($field) {
case 'mode':
$options['value'] = $values[$field];
$tab[self::MODE_INTERNAL] = self::getModeName(self::MODE_INTERNAL);
$tab[self::MODE_EXTERNAL] = self::getModeName(self::MODE_EXTERNAL);
return Dropdown::showFromArray($name, $tab, $options);
case 'state':
return CronTask::dropdownState($name, $values[$field], false);
}
return parent::getSpecificValueToSelect($field, $name, $values, $options);
}
示例5: 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())
{
if (!is_array($values)) {
$values = array($field => $values);
}
$options['display'] = false;
switch ($field) {
case 'alert':
$options['name'] = $name;
$options['value'] = $values[$field];
return self::dropdownAlert($options);
case 'renewal':
$options['name'] = $name;
return self::dropdownContractRenewal($name, $values[$field], false);
}
return parent::getSpecificValueToSelect($field, $name, $values, $options);
}
示例6: 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())
{
if (!is_array($values)) {
$values = array($field => $values);
}
$options['display'] = false;
switch ($field) {
case 'group_search_type':
$options['value'] = $values[$field];
$options['name'] = $name;
return self::dropdownGroupSearchType($options);
}
return parent::getSpecificValueToSelect($field, $name, $values, $options);
}
示例7: getSpecificValueToSelect
/**
* Define how to display search field for a specific type
*
* @since version 0.84
*
* @param String $field Name of the field as define in $this->getSearchOptions()
* @param String $name Name attribute for the field to be posted (default '')
* @param Array $values Array of all values to display in search engine (default '')
* @param Array $options Options (optional)
*
* @return String Html string to be displayed for the form field
**/
public static function getSpecificValueToSelect($field, $name = '', $values = '', array $options = array())
{
if (!is_array($values)) {
$values = array($field => $values);
}
$options['display'] = false;
switch ($field) {
case 'is_active':
$output = "<select name='" . $name . "'>";
$output .= "<option value='0' " . ($values[$field] == 0 ? " selected " : "") . ">" . __('Inactive') . "</option>";
$output .= "<option value='1' " . ($values[$field] == 1 ? " selected " : "") . ">" . __('Active') . "</option>";
$output .= "</select>";
return $output;
break;
case 'access_rights':
$output = '<select name="' . $name . '">';
$output .= '<option value="' . self::ACCESS_PUBLIC . '" ' . ($values[$field] == 0 ? ' selected ' : '') . '>' . __('Public access', 'formcreator') . '</option>';
$output .= '<option value="' . self::ACCESS_PRIVATE . '" ' . ($values[$field] == 1 ? ' selected ' : '') . '>' . __('Private access', 'formcreator') . '</option>';
$output .= '<option value="' . self::ACCESS_RESTRICTED . '" ' . ($values[$field] == 1 ? ' selected ' : '') . '>' . __('Restricted access', 'formcreator') . '</option>';
$output .= '</select>';
return $output;
break;
case 'language':
return Dropdown::showLanguages('language', array('value' => $values[$field], 'display_emptychoice' => true, 'emptylabel' => '--- ' . __('All langages', 'formcreator') . ' ---', 'display' => false));
break;
}
return parent::getSpecificValueToSelect($field, $name, $values, $options);
}
示例8: getSpecificValueToSelect
static function getSpecificValueToSelect($field, $name = '', $values = '', array $options = array())
{
if (!is_array($values)) {
$values = array($field => $values);
}
$options['display'] = false;
switch ($field) {
case 'type':
return self::dropdownGroupType($name, $values[$field]);
default:
break;
}
return parent::getSpecificValueToSelect($field, $name, $values, $options);
}
示例9: 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())
{
if (!is_array($values)) {
$values = array($field => $values);
}
$options['display'] = false;
switch ($field) {
case 'event':
if (isset($values['itemtype']) && !empty($values['itemtype'])) {
$options['value'] = $values[$field];
$options['name'] = $name;
return NotificationEvent::dropdownEvents($values['itemtype'], $options);
}
break;
case 'mode':
$options['value'] = $values[$field];
$options['name'] = $name;
return self::dropdownMode($options);
}
return parent::getSpecificValueToSelect($field, $name, $values, $options);
}
示例10: 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())
{
if (!is_array($values)) {
$values = array($field => $values);
}
$options['display'] = false;
switch ($field) {
case 'type':
$options['value'] = $values[$field];
$typeinquest = array(1 => __('Internal survey'), 2 => __('External survey'));
return Dropdown::showFromArray($name, $typeinquest, $options);
}
return parent::getSpecificValueToSelect($field, $name, $values, $options);
}
示例11: 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())
{
if (!is_array($values)) {
$values = array($field => $values);
}
$options['display'] = false;
switch ($field) {
case 'reason':
$options['value'] = $values[$field];
return Dropdown::showFromArray($name, self::getAllReasons(), $options);
}
return parent::getSpecificValueToSelect($field, $name, $values, $options);
}
示例12: getSpecificValueToSelect
/**
* @since version 2.3.0
*
* @param $field
* @param $name (default '')
* @param $values (defaut '')
* @param $options array
**/
static function getSpecificValueToSelect($field, $name = '', $values = '', array $options = array())
{
if (!is_array($values)) {
$values = array($field => $values);
}
$options['display'] = false;
switch ($field) {
case 'step':
$options['value'] = $values[$field];
return Dropdown::showFromArray($name, PluginDatainjectionDropdown::statusLabels(), $options);
case 'port_unicity':
$options['value'] = $values[$field];
return Dropdown::showFromArray($name, PluginDatainjectionDropdown::portUnicityValues(), $options);
case 'float_format':
$options['value'] = $values[$field];
return Dropdown::showFromArray($name, PluginDatainjectionDropdown::floatFormats(), $options);
case 'date_format':
$options['value'] = $values[$field];
return Dropdown::showFromArray($name, PluginDatainjectionDropdown::dateFormats(), $options);
}
return parent::getSpecificValueToSelect($field, $name, $values, $options);
}
示例13: getSpecificValueToSelect
/**
* Define how to display search field for a specific type
*
* @since version 0.84
*
* @param String $field Name of the field as define in $this->getSearchOptions()
* @param String $name Name attribute for the field to be posted (default '')
* @param Array $values Array of all values to display in search engine (default '')
* @param Array $options Options (optional)
*
* @return String Html string to be displayed for the form field
**/
public static function getSpecificValueToSelect($field, $name = '', $values = '', array $options = array())
{
if (!is_array($values)) {
$values = array($field => $values);
}
$options['display'] = false;
switch ($field) {
case 'is_active':
return Dropdown::showFromArray('criteria[0][value]', array('0' => __('Inactive'), '1' => __('Active')), array('value' => $values[$field], 'display_emptychoice' => true, 'display' => false));
break;
case 'access_rights':
return Dropdown::showFromArray('criteria[0][value]', array(Dropdown::EMPTY_VALUE => '--- ' . __('All langages', 'formcreator') . ' ---', self::ACCESS_PUBLIC => __('Public access', 'formcreator'), self::ACCESS_PRIVATE => __('Private access', 'formcreator'), self::ACCESS_RESTRICTED => __('Restricted access', 'formcreator')), array('value' => $values[$field], 'display_emptychoice' => true, 'display' => false));
break;
case 'language':
return Dropdown::showLanguages('criteria[0][value]', array('value' => $values[$field], 'display_emptychoice' => true, 'emptylabel' => '--- ' . __('All langages', 'formcreator') . ' ---', 'display' => false));
break;
}
return parent::getSpecificValueToSelect($field, $name, $values, $options);
}
示例14: 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())
{
if (!is_array($values)) {
$values = array($field => $values);
}
$options['display'] = false;
switch ($field) {
case 'interface':
$options['value'] = $values[$field];
return Dropdown::showFromArray($name, self::getInterfaces(), $options);
case 'helpdesk_hardware':
$options['value'] = $values[$field];
return Dropdown::showFromArray($name, self::getHelpdeskHardwareTypes(), $options);
case "helpdesk_item_type":
$options['values'] = explode(',', $values[$field]);
$options['name'] = $name;
return self::dropdownHelpdeskItemtypes($options);
}
return parent::getSpecificValueToSelect($field, $name, $values, $options);
}
示例15: getSpecificValueToSelect
/**
* @param $field
* @param $name (default '')
* @param $values (default '')
* @param $options array
**/
static function getSpecificValueToSelect($field, $name = '', $values = '', array $options = array())
{
if (!is_array($values)) {
$values = array($field => $values);
}
$options['display'] = false;
switch ($field) {
case 'match':
if (isset($values['itemtype']) && !empty($values['itemtype'])) {
$options['value'] = $values[$field];
$options['name'] = $name;
$rule = new static();
return $rule->dropdownRulesMatch($options);
}
break;
}
return parent::getSpecificValueToSelect($field, $name, $values, $options);
}