diff --git a/src/CoreFields/DateField.php b/src/CoreFields/DateField.php index 9d6442e..9ed6bfd 100644 --- a/src/CoreFields/DateField.php +++ b/src/CoreFields/DateField.php @@ -70,22 +70,25 @@ class DateField extends PhangoField { } else if(strpos($value, '-')!==false) { - + $arr_time=explode('-',trim($value)); settype($arr_time[0], 'integer'); settype($arr_time[1], 'integer'); settype($arr_time[2], 'integer'); - $final_value=mktime (0, 0, 0, $arr_time[1], $arr_time[0], $arr_time[2] ); - + //$final_value=PhaTime\DateTime::obtain_timestamp(mktime (0, 0, 0, $arr_time[1], $arr_time[0], $arr_time[2] )); + $value=date(PhaTime\DateTime::$sql_format_time, mktime(0, 0, 0, $arr_time[1], $arr_time[2], $arr_time[0])); + + /* if($final_value===false) { $this->error=1; $final_value=PhaTime\DateTime::local_to_gmt(date(PhaTime\DateTime::$sql_format_time)); - } + }*/ } + if(PhaTime\DateTime::obtain_timestamp($value)) { diff --git a/src/CoreFields/NormalizeField.php b/src/CoreFields/NormalizeField.php index 51a5791..752da87 100644 --- a/src/CoreFields/NormalizeField.php +++ b/src/CoreFields/NormalizeField.php @@ -42,7 +42,7 @@ class NormalizeField extends TextField { static public function check_text($value, $separator='-') { - $str_normalize=PhangoApp\PhaUtils\Utils::slugify(strip_tags($value)); + $str_normalize=\PhangoApp\PhaUtils\Utils::slugify(strip_tags($value)); $arr_normalize=explode($separator, $str_normalize); diff --git a/src/CoreFields/PercentField.php b/src/CoreFields/PercentField.php index e23e033..17df2e3 100644 --- a/src/CoreFields/PercentField.php +++ b/src/CoreFields/PercentField.php @@ -2,6 +2,8 @@ namespace PhangoApp\PhaModels\CoreFields; +use PhangoApp\PhaI18n\I18n; + class PercentField extends IntegerField{ @@ -16,7 +18,7 @@ class PercentField extends IntegerField{ if($value>100 || $value<0) { - $this->std_error=i18n_lang('common', 'the_value_can_not_be_greater_than_100', 'The value cannot be greater than 100'); + $this->std_error=I18n::lang('common', 'the_value_can_not_be_greater_than_100', 'The value cannot be greater or minor than 100'); $this->error=1; @@ -28,8 +30,15 @@ class PercentField extends IntegerField{ } + + public function show_formatted($value) + { + + return $value.' %'; + + } } -?> \ No newline at end of file +?> diff --git a/src/Forms/BaseForm.php b/src/Forms/BaseForm.php index 1cdbe9c..bef2fe3 100644 --- a/src/Forms/BaseForm.php +++ b/src/Forms/BaseForm.php @@ -36,12 +36,13 @@ class BaseForm { $this->field=new CharField(); $this->comment_form=''; $this->txt_error = I18n::lang('common', 'error_in_field', 'Error in field'); + $this->extra_param=''; } public function form() { - return ' '.$this->comment_form; + return 'extra_param.'> '.$this->comment_form; } diff --git a/src/Forms/FileForm.php b/src/Forms/FileForm.php index 6485686..f29ab5b 100644 --- a/src/Forms/FileForm.php +++ b/src/Forms/FileForm.php @@ -25,7 +25,7 @@ class FileForm extends BaseForm{ public function form() { - return ' '.Utils::form_text($this->default_value).''; + return ' '.Utils::form_text($this->default_value).''; } @@ -33,4 +33,4 @@ class FileForm extends BaseForm{ } -?> \ No newline at end of file +?> diff --git a/src/Forms/TextAreaForm.php b/src/Forms/TextAreaForm.php index c964081..6899768 100644 --- a/src/Forms/TextAreaForm.php +++ b/src/Forms/TextAreaForm.php @@ -14,10 +14,10 @@ class TextAreaForm extends BaseForm { { ?> -

+ \ No newline at end of file +?>