Fixes in fields and added protection for not update fields in Webmodel

This commit is contained in:
Antonio de la Rosa 2015-12-29 02:02:06 +01:00
parent 479f449b13
commit f0f8b6c9cd
5 changed files with 40 additions and 54 deletions

View file

@ -3,6 +3,8 @@
namespace PhangoApp\PhaModels\Forms;
use PhangoApp\PhaI18n\I18n;
use PhangoApp\PhaUtils\Utils;
use PhangoApp\PhaTime;
class DateForm extends \PhangoApp\PhaModels\Forms\BaseForm {
@ -14,9 +16,9 @@ class DateForm extends \PhangoApp\PhaModels\Forms\BaseForm {
$value=$this->default_value;
settype($value, 'integer');
settype($value, 'string');
if($value==0)
if($value=='')
{
$day='';
@ -29,15 +31,9 @@ class DateForm extends \PhangoApp\PhaModels\Forms\BaseForm {
}
else
{
list($year, $month, $day, $hour, $minute, $second)=PhaTime\DateTime::format_timedata($value);
//$value+=$user_data['format_time'];
$day=date('j', $value);
$month=date('n', $value);
$year=date('Y', $value);
$hour=date('G', $value);
$minute=date('i', $value);
$second=date('s', $value);
}
//return '<input type="'.$this->type.'" class="'.$this->css.'" name="'.$this->name.'" value="'.$this->setform($this->default_value).'">';