fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [15481] property: customize date-search in tickets


From: sigurdne
Subject: [Fmsystem-commits] [15481] property: customize date-search in tickets
Date: Wed, 17 Aug 2016 11:19:34 +0000 (UTC)

Revision: 15481
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=15481
Author:   sigurdne
Date:     2016-08-17 11:19:34 +0000 (Wed, 17 Aug 2016)
Log Message:
-----------
property: customize date-search in tickets

Modified Paths:
--------------
    trunk/property/inc/class.sotts.inc.php
    trunk/property/inc/class.uitts.inc.php
    trunk/property/setup/phpgw_no.lang

Modified: trunk/property/inc/class.sotts.inc.php
===================================================================
--- trunk/property/inc/class.sotts.inc.php      2016-08-17 11:18:15 UTC (rev 
15480)
+++ trunk/property/inc/class.sotts.inc.php      2016-08-17 11:19:34 UTC (rev 
15481)
@@ -138,6 +138,7 @@
                        $branch_id = isset($data['branch_id']) && 
$data['branch_id'] ? (int)$data['branch_id'] : 0;
                        $order_dim1 = isset($data['order_dim1']) && 
$data['order_dim1'] ? (int)$data['order_dim1'] : 0;
                        $custom_filtermethod = 
isset($data['custom_filtermethod']) && $data['custom_filtermethod'] ? 
(array)$data['custom_filtermethod'] : array();
+                       $check_date_type = isset($data['check_date_type']) && 
$data['check_date_type'] ? (int)$data['check_date_type'] : 1;
 
 
                        $result_order_field = array();
@@ -413,7 +414,14 @@
                                $order_edit = 
$GLOBALS['phpgw']->acl->check('.ticket.order', PHPGW_ACL_EDIT, 'property');
                                $_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.modified_date >= $_start_date AND fm_tts_tickets.modified_date 
<= $_end_date ";
+                               if($check_date_type == 1)
+                               {
+                                       $filtermethod .= " $where 
fm_tts_tickets.modified_date >= $_start_date AND fm_tts_tickets.modified_date 
<= $_end_date ";
+                               }
+                               else if($check_date_type == 2)
+                               {
+                                       $filtermethod .= " $where 
fm_tts_tickets.entry_date >= $_start_date AND fm_tts_tickets.entry_date <= 
$_end_date ";
+                               }
 
                                if ($order_add || $order_edit)
                                {

Modified: trunk/property/inc/class.uitts.inc.php
===================================================================
--- trunk/property/inc/class.uitts.inc.php      2016-08-17 11:18:15 UTC (rev 
15480)
+++ trunk/property/inc/class.uitts.inc.php      2016-08-17 11:19:34 UTC (rev 
15481)
@@ -155,6 +155,7 @@
                                'ecodimb' => $this->bo->ecodimb,
                                'branch_id' => phpgw::get_var('branch_id'),
                                'order_dim1' => phpgw::get_var('order_dim1'),
+                               'check_date_type' => 
phpgw::get_var('check_date_type', 'int'),
                        );
 
                        $values = $this->bo->read($params);
@@ -619,9 +620,37 @@
 
                private function _get_filters()
                {
+                       $order_read = $this->acl->check('.ticket.order', 
PHPGW_ACL_READ, 'property');
+
                        $values_combo_box = array();
                        $combos = array();
 
+                       $check_date_type =      array('type' => 'filter',
+                               'name' => 'check_date_type',
+                               'extra' => '',
+                               'text' => lang('check date type'),
+                               'list' => array(
+                                       array(
+                                               'id'    => 1,
+                                               'name'  => lang('modified date')
+                                       ),
+                                       array(
+                                               'id'    => 2,
+                                               'name'  => lang('entry date')
+                                       )
+                               )
+                       );
+               
+                       if($order_read)
+                       {
+                               $check_date_type['list'][] = array(
+                                       'id'    => 3,
+                                       'name'  => lang('no date')
+                               );
+                       }
+
+                       $combos[] = $check_date_type;
+
                        $values_combo_box[3] = $this->bo->filter(array('format' 
=> $group_filters, 'filter' => $this->status_id,
                                'default' => 'O'));
 
@@ -728,8 +757,6 @@
                                );
                        }
 
-                       $order_read = $this->acl->check('.ticket.order', 
PHPGW_ACL_READ, 'property');
-
                        if($order_read)
                        {
                                $combos[] = array('type' => 'filter',
@@ -862,13 +889,6 @@
                                'form' => array(
                                        'toolbar' => array(
                                                'item' => array(
-                                                       array(
-                                                               'type' => 
'link',
-                                                               'value' => 
lang('columns'),
-                                                               'href' => '#',
-                                                               'class' => '',
-                                                               'onclick' => 
"JqueryPortico.openPopup({menuaction:'property.uitts.columns'}, 
{closeAction:'reload'})"
-                                                       ),
                                                        array
                                                                (
                                                                'type' => 
'date-picker',
@@ -884,9 +904,16 @@
                                                                'name' => 
'end_date',
                                                                'value' => 
$end_date,
                                                                'text' => 
lang('to')
-                                                       )
-                                               ),
-                                       ),
+                                                       ),
+                                                       array(
+                                                               'type' => 
'link',
+                                                               'value' => 
lang('columns'),
+                                                               'href' => '#',
+                                                               'class' => '',
+                                                               'onclick' => 
"JqueryPortico.openPopup({menuaction:'property.uitts.columns'}, 
{closeAction:'reload'})"
+                                                       ),
+                                               )
+                                       )
                                ),
                                'datatable' => array(
                                        'source' => 
self::link(array('menuaction' => 'property.uitts.index',

Modified: trunk/property/setup/phpgw_no.lang
===================================================================
--- trunk/property/setup/phpgw_no.lang  2016-08-17 11:18:15 UTC (rev 15480)
+++ trunk/property/setup/phpgw_no.lang  2016-08-17 11:19:34 UTC (rev 15481)
@@ -2059,4 +2059,6 @@
 external project       property        no      Eksternt prosjekt
 unspsc code    common  no      UNSPSC-kode
 order received property        no      Varemottak
-receive order  property        no      Motta vare
\ No newline at end of file
+receive order  property        no      Motta vare
+check date type        property        no      Dato filter type
+no date        property        no      Ingen dato
\ No newline at end of file




reply via email to

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