fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [6491] property: date issues on search


From: Sigurd Nes
Subject: [Fmsystem-commits] [6491] property: date issues on search
Date: Wed, 13 Oct 2010 16:57:41 +0000

Revision: 6491
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=6491
Author:   sigurdne
Date:     2010-10-13 16:57:40 +0000 (Wed, 13 Oct 2010)
Log Message:
-----------
property: date issues on search

Modified Paths:
--------------
    trunk/property/inc/class.soproject.inc.php
    trunk/property/inc/class.sotts.inc.php
    trunk/property/inc/class.soworkorder.inc.php

Modified: trunk/property/inc/class.soproject.inc.php
===================================================================
--- trunk/property/inc/class.soproject.inc.php  2010-10-13 12:31:32 UTC (rev 
6490)
+++ trunk/property/inc/class.soproject.inc.php  2010-10-13 16:57:40 UTC (rev 
6491)
@@ -27,6 +27,8 @@
        * @version $Id$
        */
 
+       phpgw::import_class('phpgwapi.datetime');
+
        /**
         * Description
         * @package property
@@ -107,8 +109,8 @@
                        $order = (isset($data['order'])?$data['order']:'');
                        $cat_id = (isset($data['cat_id'])?$data['cat_id']:0);
                        $status_id = 
(isset($data['status_id'])?$data['status_id']:'');
-                       $start_date = 
(isset($data['start_date'])?$data['start_date']:'');
-                       $end_date = 
(isset($data['end_date'])?$data['end_date']:'');
+                       $start_date             = isset($data['start_date']) && 
$data['start_date'] ? (int)$data['start_date'] : 0;
+                       $end_date               = isset($data['end_date']) && 
$data['end_date'] ? (int)$data['end_date'] : 0;
                        $allrows = 
(isset($data['allrows'])?$data['allrows']:'');
                        $wo_hour_cat_id = 
(isset($data['wo_hour_cat_id'])?$data['wo_hour_cat_id']:'');
                        $district_id    = 
(isset($data['district_id'])?$data['district_id']:'');
@@ -384,6 +386,9 @@
 
                        if ($start_date)
                        {
+                               $end_date       = $end_date + 3600 * 16 + 
phpgwapi_datetime::user_timezone();
+                               $start_date     = $start_date - 3600 * 8 + 
phpgwapi_datetime::user_timezone();
+
                                $filtermethod .= " $where fm_project.start_date 
>= $start_date AND fm_project.start_date <= $end_date ";
                                $where= 'AND';
                        }

Modified: trunk/property/inc/class.sotts.inc.php
===================================================================
--- trunk/property/inc/class.sotts.inc.php      2010-10-13 12:31:32 UTC (rev 
6490)
+++ trunk/property/inc/class.sotts.inc.php      2010-10-13 16:57:40 UTC (rev 
6491)
@@ -74,8 +74,8 @@
                        $cat_id                 = isset($data['cat_id']) && 
$data['cat_id'] ? $data['cat_id']:0;
                        $district_id    = isset($data['district_id']) && 
$data['district_id'] ? $data['district_id']:0;
                        $allrows                = 
isset($data['allrows'])?$data['allrows']:'';
-                       $start_date             = 
isset($data['start_date'])?$data['start_date']:'';
-                       $end_date               = 
isset($data['end_date'])?$data['end_date']:'';
+                       $start_date             = isset($data['start_date']) && 
$data['start_date'] ? (int)$data['start_date'] : 0;
+                       $end_date               = isset($data['end_date']) && 
$data['end_date'] ? (int)$data['end_date'] : 0;
                        $external               = 
isset($data['external'])?$data['external']:'';
                        $dry_run                = isset($data['dry_run']) ? 
$data['dry_run'] : '';
                        $new                    = isset($data['new']) ? 
$data['new'] : '';
@@ -278,6 +278,8 @@
 
                        if ($start_date)
                        {
+                               $end_date       = $end_date + 3600 * 16 + 
phpgwapi_datetime::user_timezone();
+                               $start_date     = $start_date - 3600 * 8 + 
phpgwapi_datetime::user_timezone();
                                $filtermethod .= " $where 
fm_tts_tickets.entry_date >= $start_date AND fm_tts_tickets.entry_date <= 
$end_date ";
                                $where= 'AND';
                        }
@@ -491,7 +493,7 @@
                        if (! $this->db->f('cnt'))
                        {
                                $this->db->query("INSERT INTO fm_tts_views 
(id,account_id,time) values ({$id},'"
-                                       . 
$GLOBALS['phpgw_info']['user']['account_id'] . "','" . 
phpgwapi_datetime::user_localtime() . "')",__LINE__,__FILE__);
+                                       . 
$GLOBALS['phpgw_info']['user']['account_id'] . "','" . time() . 
"')",__LINE__,__FILE__);
                        }
                }
 
@@ -552,7 +554,7 @@
                                $this->db->db_addslashes($ticket['details']),
                                $ticket['location_code'],
                                $address,
-                               phpgwapi_datetime::user_localtime(),
+                               time(),
                                $ticket['finnish_date'],
                                $ticket['contact_id'],
                                1
@@ -592,7 +594,7 @@
 
                        if($this->db->transaction_commit())
                        {
-                               $this->historylog->add('O',$id, 
phpgwapi_datetime::user_localtime(),'');
+                               $this->historylog->add('O',$id, time(),'');
                                if($ticket['finnish_date'])
                                {
                                        
$this->historylog->add('IF',$id,$ticket['finnish_date'],'');

Modified: trunk/property/inc/class.soworkorder.inc.php
===================================================================
--- trunk/property/inc/class.soworkorder.inc.php        2010-10-13 12:31:32 UTC 
(rev 6490)
+++ trunk/property/inc/class.soworkorder.inc.php        2010-10-13 16:57:40 UTC 
(rev 6491)
@@ -27,6 +27,8 @@
        * @version $Id$
        */
 
+       phpgw::import_class('phpgwapi.datetime');
+
        /**
         * Description
         * @package property
@@ -130,8 +132,8 @@
                        $order                  = isset($data['order']) ? 
$data['order'] : '';
                        $cat_id                 = isset($data['cat_id']) && 
$data['cat_id'] ? $data['cat_id'] : 0;
                        $status_id              = isset($data['status_id']) && 
$data['status_id'] ? $data['status_id'] : 0;
-                       $start_date             = isset($data['start_date']) ? 
$data['start_date'] : '';
-                       $end_date               = isset($data['end_date']) ? 
$data['end_date'] : '';
+                       $start_date             = isset($data['start_date']) && 
$data['start_date'] ? (int)$data['start_date'] : 0;
+                       $end_date               = isset($data['end_date']) && 
$data['end_date'] ? (int)$data['end_date'] : 0;
                        $allrows                = isset($data['allrows']) ? 
$data['allrows'] : '';
                        $wo_hour_cat_id = isset($data['wo_hour_cat_id']) ? 
$data['wo_hour_cat_id'] : '';
                        $b_group                = isset($data['b_group']) ? 
$data['b_group'] : '';
@@ -429,6 +431,9 @@
 
                        if ($start_date)
                        {
+                               $end_date       = $end_date + 3600 * 16 + 
phpgwapi_datetime::user_timezone();
+                               $start_date     = $start_date - 3600 * 8 + 
phpgwapi_datetime::user_timezone();
+
                                $filtermethod .= " $where 
fm_workorder.start_date >= $start_date AND fm_workorder.start_date <= $end_date 
";
                                $where= 'AND';
                        }




reply via email to

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