Ejemplo n.º 1
0
 function build()
 {
     $this->_getValue();
     $output = "";
     rapydlib("jscalendar");
     if (!isset($this->size)) {
         $this->size = 25;
     }
     switch ($this->status) {
         case "show":
             if (!isset($this->value)) {
                 $value = RAPYD_FIELD_SYMBOL_NULL;
             } elseif ($this->value == "") {
                 $value = "";
             } else {
                 $value = dbdate_to_human($this->value, $this->format);
             }
             $output = $value;
             break;
         case "create":
         case "modify":
             $value = "";
             //jscalendar integration
             if ($this->value != "") {
                 if ($this->is_refill) {
                     $value = $this->value;
                 } else {
                     $value = dbdate_to_human($this->value, $this->format);
                 }
             }
             $attributes = array('name' => $this->name, 'id' => $this->name, 'value' => $value, 'size' => $this->size, 'onclick' => $this->onclick, 'onchange' => $this->onchange, 'class' => $this->css_class, 'style' => $this->style);
             if ($this->readonly) {
                 $attributes['readonly'] = 'readonly';
             }
             $output = form_input($attributes);
             //'<div>'.
             $output .= ' <img src="' . RAPYD_LIBRARIES . 'jscalendar/calender_icon.gif" id="' . $this->name . '_button" border="0" style="vertical-align:middle;" />' . $this->extra_output;
             $output .= $this->html->javascriptTag('
      Calendar.setup({
     inputField  : "' . $this->name . '",
     ifFormat    : "' . datestamp_from_format($this->format) . '",
     button      : "' . $this->name . '_button",
     align       : "Bl",
     singleClick : false,
     mondayFirst : true,
     weekNumbers : false
    });');
             break;
         case "disabled":
             //versione encoded
             $output = dbdate_to_human($this->value, $this->format);
             break;
         case "hidden":
             $output = form_hidden($this->name, $this->value);
             break;
         default:
     }
     $this->output = $output;
 }
Ejemplo n.º 2
0
    function build()
    {
        $this->_getValue();
        $output = '';
        rapydlib('jscalendar');
        if (!isset($this->size)) {
            $this->size = 25;
        }
        switch ($this->status) {
            case 'show':
                if (!isset($this->value)) {
                    $value = RAPYD_FIELD_SYMBOL_NULL;
                } elseif ($this->value == '') {
                    $value = '';
                } else {
                    $value = dbdate_to_human($this->value, $this->format);
                }
                $output = $value;
                break;
            case 'create':
            case 'modify':
                $value = '';
                //jscalendar integration
                if ($this->value != '') {
                    if ($this->is_refill) {
                        $value = $this->value;
                    } else {
                        $value = dbdate_to_human($this->value, $this->format);
                    }
                }
                $attributes = array('name' => $this->name, 'id' => $this->name, 'value' => $value, 'size' => $this->size, 'onclick' => $this->onclick, 'onchange' => $this->onchange, 'class' => $this->css_class, 'style' => $this->style);
                if (strlen($this->title) > 0) {
                    $attributes['title'] = $this->title;
                }
                if ($this->readonly) {
                    $attributes['readonly'] = 'readonly';
                }
                if ($this->type == 'inputhidden') {
                    $attributes['type'] = 'hidden';
                    $this->calendar = false;
                }
                $output = form_input($attributes);
                if ($this->type == 'inputhidden') {
                    $output = "<span id='" . $this->name . "_val'>{$value}</span>" . $output;
                }
                if ($this->calendar) {
                    $output .= ' <img src="' . RAPYD_LIBRARIES . 'jscalendar/calender_icon.gif" id="' . $this->name . '_button" border="0" style="vertical-align:middle;" />' . $this->extra_output;
                    $output .= HTML::javascriptTag('
					 Calendar.setup({
					inputField  : "' . $this->name . '",
					ifFormat    : "' . datestamp_from_format($this->format) . '",
					button      : "' . $this->name . '_button",
					align       : "Bl",
					singleClick : false,
					mondayFirst : true,
					weekNumbers : false
				 });');
                }
                break;
            case 'disabled':
                //versione encoded
                $output = dbdate_to_human($this->value, $this->format);
                break;
            case 'hidden':
                $output = form_hidden($this->name, $this->value);
                break;
            default:
        }
        $this->output = $output;
    }