dropdownState() static public method

Dropdown of state
static public dropdownState ( $name, $value, $display = true ) : nothing
$name select name
$value default value (default 0)
$display display or get string (true by default)
return nothing (display)
コード例 #1
0
ファイル: crontask.class.php プロジェクト: glpi-project/glpi
 /**
  * @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);
 }
コード例 #2
0
         $display = true;
         break;
     case "glpi_users.name":
         User::dropdown(array('name' => $inputname, 'value' => $_REQUEST['value'], 'comments' => false, 'right' => isset($searchopt['filter']) ? $searchopt['filter'] : 'all'));
         $display = true;
         break;
     case "glpi_ticketvalidations.status":
         TicketValidation::dropdownStatus($inputname, array('value' => $_REQUEST['value'], 'all' => 1));
         $display = true;
         break;
     case "glpi_ticketsatisfactions.type":
         Dropdown::showFromArray($inputname, array(1 => $LANG['satisfaction'][9], 2 => $LANG['satisfaction'][10]), array('value' => $_REQUEST['value']));
         $display = true;
         break;
     case "glpi_crontasks.state":
         CronTask::dropdownState($inputname, $_REQUEST['value']);
         $display = true;
         break;
 }
 // Standard datatype usage
 if (!$display && isset($searchopt['datatype'])) {
     switch ($searchopt['datatype']) {
         case "bool":
             Dropdown::showYesNo($inputname, $_REQUEST['value']);
             $display = true;
             break;
         case "right":
             // No access not displayed because empty not take into account for search
             Profile::dropdownNoneReadWrite($inputname, $_REQUEST['value'], 1, 1, 1);
             $display = true;
             break;