fmsystem-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Fmsystem-commits] [10050]


From: Torstein
Subject: [Fmsystem-commits] [10050]
Date: Fri, 28 Sep 2012 07:36:38 +0000

Revision: 10050
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=10050
Author:   vator
Date:     2012-09-28 07:36:36 +0000 (Fri, 28 Sep 2012)
Log Message:
-----------


Modified Paths:
--------------
    trunk/controller/inc/class.uicheck_list.inc.php
    trunk/controller/inc/class.uicontrol_location.inc.php
    trunk/controller/inc/model/class.component.inc.php
    trunk/controller/inc/model/class.control.inc.php

Removed Paths:
-------------
    trunk/controller/inc/helper/class.date_helper.inc.php

Modified: trunk/controller/inc/class.uicheck_list.inc.php
===================================================================
--- trunk/controller/inc/class.uicheck_list.inc.php     2012-09-28 06:40:36 UTC 
(rev 10049)
+++ trunk/controller/inc/class.uicheck_list.inc.php     2012-09-28 07:36:36 UTC 
(rev 10050)
@@ -39,13 +39,13 @@
        phpgw::import_class('phpgwapi.yui');
        phpgw::import_class('phpgwapi.uicommon');
        phpgw::import_class('controller.socheck_list');
+       phpgw::import_class('phpgwapi.datetime');
        
        include_class('controller', 'check_list', 'inc/model/');
        include_class('controller', 'check_item', 'inc/model/');
        include_class('controller', 'date_generator', 'inc/component/');
        include_class('controller', 'check_list_status_updater', 'inc/helper/');
-       include_class('controller', 'date_helper', 'inc/helper/');
-       
+               
        class controller_uicheck_list extends phpgwapi_uicommon
        {
                private $so;
@@ -373,12 +373,11 @@
                        $comment = phpgw::get_var('comment', 'string');
                                        
                        $dateformat = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
-
-                       $deadline_date_ts = 
date_helper::get_timestamp_from_date( $deadline_date, $dateformat );
+                       $deadline_date_ts = 
phpgwapi_datetime::date_to_timestamp( $deadline_date );
                        
                        if($planned_date != '')
                        {
-                               $planned_date_ts = 
date_helper::get_timestamp_from_date( $planned_date, $dateformat );
+                               $planned_date_ts = 
phpgwapi_datetime::date_to_timestamp( $planned_date );
                        }
                        else
                        {
@@ -387,7 +386,7 @@
                        
                        if($completed_date != '')
                        {
-                               $completed_date_ts = 
date_helper::get_timestamp_from_date( $completed_date, $dateformat );
+                               $completed_date_ts = 
phpgwapi_datetime::date_to_timestamp( $completed_date );
                                $status = controller_check_list::STATUS_DONE;
                        }
                        else

Modified: trunk/controller/inc/class.uicontrol_location.inc.php
===================================================================
--- trunk/controller/inc/class.uicontrol_location.inc.php       2012-09-28 
06:40:36 UTC (rev 10049)
+++ trunk/controller/inc/class.uicontrol_location.inc.php       2012-09-28 
07:36:36 UTC (rev 10050)
@@ -41,7 +41,6 @@
        include_class('controller', 'check_list', 'inc/model/');
        include_class('controller', 'date_generator', 'inc/component/');
        include_class('controller', 'check_list_status_updater', 'inc/helper/');
-       include_class('controller', 'date_helper', 'inc/helper/');
                
        class controller_uicontrol_location extends phpgwapi_uicommon
        {

Deleted: trunk/controller/inc/helper/class.date_helper.inc.php
===================================================================
--- trunk/controller/inc/helper/class.date_helper.inc.php       2012-09-28 
06:40:36 UTC (rev 10049)
+++ trunk/controller/inc/helper/class.date_helper.inc.php       2012-09-28 
07:36:36 UTC (rev 10050)
@@ -1,29 +0,0 @@
-<?php
-       class date_helper
-       {
-       
-               public function __construct(){}
-               
-               public static function get_timestamp_from_date( $date_string, 
$format  )
-               {
-                       $dateformat = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
-
-                       if( $format == $dateformat )
-                       {
-                               $pos_day = strpos($date_string, "/"); 
-                               $day = date_helper::substring($date_string, 0, 
$pos_day);
-                       
-                               $pos_month = strpos($date_string, "-");
-                               $month = date_helper::substring($date_string, 
$pos_day+1, $pos_month);
-                       
-                               $year = date_helper::substring($date_string, 
$pos_month+1, strlen($date_string));
-
-                               return mktime(0, 0, 0, $month, $day, $year);
-                       }
-               }
-       
-               public function substring($string, $from, $to)
-               {
-               return substr($string, $from, $to - $from);
-               }
-       }

Modified: trunk/controller/inc/model/class.component.inc.php
===================================================================
--- trunk/controller/inc/model/class.component.inc.php  2012-09-28 06:40:36 UTC 
(rev 10049)
+++ trunk/controller/inc/model/class.component.inc.php  2012-09-28 07:36:36 UTC 
(rev 10050)
@@ -29,7 +29,6 @@
        */
 
        include_class('controller', 'model', 'inc/model/');
-       include_class('controller', 'date_helper', 'inc/helper/');
 
        class controller_component extends controller_model
        {

Modified: trunk/controller/inc/model/class.control.inc.php
===================================================================
--- trunk/controller/inc/model/class.control.inc.php    2012-09-28 06:40:36 UTC 
(rev 10049)
+++ trunk/controller/inc/model/class.control.inc.php    2012-09-28 07:36:36 UTC 
(rev 10050)
@@ -29,7 +29,7 @@
        */
 
        include_class('controller', 'model', 'inc/model/');
-       include_class('controller', 'date_helper', 'inc/helper/');
+       phpgw::import_class('phpgwapi.datetime');
 
        class controller_control extends controller_model
        {
@@ -257,14 +257,14 @@
                                
                                if(phpgw::get_var('start_date','string') != '')
                                {
-                                       $start_date_ts = 
date_helper::get_timestamp_from_date( phpgw::get_var('start_date','string'), 
$dateformat );
+                                       $start_date_ts = 
phpgwapi_datetime::date_to_timestamp( phpgw::get_var('start_date','string') );
                                        $this->set_start_date($start_date_ts);
                                }else
                                        $this->set_start_date(0);
                                                                
                                if( phpgw::get_var('end_date','string') != '')
                                {
-                                       $end_date_ts = 
date_helper::get_timestamp_from_date( phpgw::get_var('end_date','string'), 
$dateformat );
+                                       $end_date_ts = 
phpgwapi_datetime::date_to_timestamp( phpgw::get_var('end_date','string') );
                                        $this->set_end_date( $end_date_ts );
                                }else
                                {




reply via email to

[Prev in Thread] Current Thread [Next in Thread]