Contract::dropdownContractRenewal PHP Method

dropdownContractRenewal() static public method

Print a select named $name with contract renewal options and selected value $value
static public dropdownContractRenewal ( $name, $value, $display = true ) : Nothing
$name string HTML select name
$value integer HTML select selected value (default = 0)
$display boolean get or display string ? (true by default)
return Nothing (display)
    static function dropdownContractRenewal($name, $value = 0, $display = true)
    {
        $tmp[0] = __('Never');
        $tmp[1] = __('Tacit');
        $tmp[2] = __('Express');
        return Dropdown::showFromArray($name, $tmp, array('value' => $value, 'display' => $display));
    }

Usage Example

 /**
  * @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;
     }
 }