fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [12201] property: add filter for reported by at ticke


From: Sigurd Nes
Subject: [Fmsystem-commits] [12201] property: add filter for reported by at tickets
Date: Fri, 17 Oct 2014 18:17:28 +0000

Revision: 12201
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=12201
Author:   sigurdne
Date:     2014-10-17 18:17:26 +0000 (Fri, 17 Oct 2014)
Log Message:
-----------
property: add filter for reported by at tickets

Modified Paths:
--------------
    trunk/property/inc/class.botts.inc.php
    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.botts.inc.php
===================================================================
--- trunk/property/inc/class.botts.inc.php      2014-10-17 13:27:24 UTC (rev 
12200)
+++ trunk/property/inc/class.botts.inc.php      2014-10-17 18:17:26 UTC (rev 
12201)
@@ -47,6 +47,7 @@
                var $fields_updated = false;
                var $status_id;
                var $user_id;
+               var $reported_by;
                var $part_of_town_id;
                var $district_id;
                public $total_records   = 0;
@@ -119,6 +120,7 @@
                        $order                                  = 
phpgw::get_var('order');
                        $status_id                              = 
phpgw::get_var('status_id', 'string');
                        $user_id                                = 
phpgw::get_var('user_id', 'int');
+                       $reported_by                            = 
phpgw::get_var('reported_by', 'int');
                        $cat_id                                 = 
phpgw::get_var('cat_id', 'int');
                        $part_of_town_id                = 
phpgw::get_var('part_of_town_id', 'int');
                        $district_id                    = 
phpgw::get_var('district_id', 'int');
@@ -140,7 +142,9 @@
                        $this->order                    = 
isset($_REQUEST['order'])             ? $order                        : 
$this->order;
                        $this->cat_id                   = 
isset($_REQUEST['cat_id'])            ? $cat_id                       :  
$this->cat_id;
                        $this->status_id                = 
isset($_REQUEST['status_id'])         ? $status_id            : 
$this->status_id;
-                       $this->user_id                  = 
isset($_REQUEST['user_id'])           ? $user_id                      : 
$this->user_id;;
+                       $this->user_id                  = 
isset($_REQUEST['user_id'])           ? $user_id                      : 
$this->user_id;
+                       $this->reported_by                      = 
isset($_REQUEST['user_id'])   ? $reported_by                  : 
$this->reported_by;
+
                        $this->part_of_town_id  = 
isset($_REQUEST['part_of_town_id'])? $part_of_town_id : $this->part_of_town_id;
                        $this->district_id              = 
isset($_REQUEST['district_id'])       ? $district_id          : 
$this->district_id;
                        $this->allrows                  = isset($allrows) && 
$allrows           ? $allrows                      : '';
@@ -172,6 +176,7 @@
                        $this->start                    = 
isset($data['start'])?$data['start']:'';
                        $this->query                    = 
isset($data['query'])?$data['query']:'';
                        $this->user_id                  = 
isset($data['user_id'])?$data['user_id']:'';
+                       $this->reported_by              = 
isset($data['reported_by'])?$data['reported_by']:'';
                        $this->sort                             = 
isset($data['sort'])?$data['sort']:'';
                        $this->order                    = 
isset($data['order'])?$data['order']:'';
                        $this->status_id                = 
isset($data['status_id'])?$data['status_id']:'';
@@ -499,7 +504,7 @@
                        $tickets = $this->so->read(array('start' => 
$this->start,'query' => $this->query,'sort' => $this->sort,'order' => 
$this->order,
                                'status_id' => $this->status_id,'cat_id' => 
$this->cat_id,'district_id' => $this->district_id,
                                'part_of_town_id' => $this->part_of_town_id, 
'start_date'=>$start_date,'end_date'=>$end_date,
-                               'allrows'=>$this->allrows,'user_id' => 
$this->user_id,'external'=>$external, 'dry_run' => $dry_run,
+                               'allrows'=>$this->allrows,'user_id' => 
$this->user_id,'reported_by' => $this->reported_by, 'external'=>$external, 
'dry_run' => $dry_run,
                                'location_code' => $this->location_code, 
'p_num' => $this->p_num, 'vendor_id' => $this->vendor_id,
                                'ecodimb' => $this->ecodimb, 'b_account' => 
$this->b_account, 'building_part' => $this->building_part,
                                'branch_id' => $this->branch_id ,'order_dim1' 
=> $this->order_dim1));
@@ -1656,4 +1661,16 @@
                        }
                        return $payments;
                }
+
+               public function get_reported_by($selected=0)
+               {
+                       $values = $this->so->get_reported_by();
+
+                       foreach($values as &$entry)
+                       {
+                               $entry['selected']      = $entry['id'] == 
$selected ? 1 : 0;
+                       }
+                       return $values;
+
+               }
        }

Modified: trunk/property/inc/class.sotts.inc.php
===================================================================
--- trunk/property/inc/class.sotts.inc.php      2014-10-17 13:27:24 UTC (rev 
12200)
+++ trunk/property/inc/class.sotts.inc.php      2014-10-17 18:17:26 UTC (rev 
12201)
@@ -122,7 +122,7 @@
                        $start                  = isset($data['start']) && 
$data['start'] ? (int)$data['start']:0;
                        $status_id              = isset($data['status_id']) && 
$data['status_id'] ? $data['status_id']:'O'; //O='Open'
                        $user_id                = isset($data['user_id']) && 
$data['user_id'] ? (int)$data['user_id']: 0;
-                       $owner_id               = 
isset($data['owner_id'])?$data['owner_id']:'';
+                       $reported_by    = isset($data['reported_by']) && 
$data['reported_by'] ? (int)$data['reported_by']: 0;
                        $query                  = 
isset($data['query'])?$data['query']:'';
                        $sort                   = isset($data['sort']) && 
$data['sort'] ? $data['sort']:'DESC';
                        $order                  = 
isset($data['order'])?$data['order']:'';
@@ -372,9 +372,9 @@
                                $where = 'AND';
                        }
 
-                       if ($owner_id > 0)
+                       if ($reported_by > 0)
                        {
-                               $filtermethod .= " $where 
fm_tts_tickets.user_id=" . (int)$owner_id;
+                               $filtermethod .= " $where 
fm_tts_tickets.user_id=" . (int)$reported_by;
                                $where = 'AND';
                        }
 
@@ -1754,4 +1754,22 @@
                        return $values;
                }
 
+               public function get_reported_by()
+               {
+                       $values = array();
+                       $sql = "SELECT DISTINCT user_id as id , 
account_lastname, account_firstname FROM fm_tts_tickets $this->join 
phpgw_accounts ON fm_tts_tickets.user_id = phpgw_accounts.account_id ORDER BY 
account_lastname ASC";
+
+                       $this->db->query($sql, __LINE__,__FILE__);
+
+                       while ($this->db->next_record())
+                       {
+                               $values[] = array
+                               (
+                                       'id'    => $this->db->f('id'),
+                                       'name'  => 
$this->db->f('account_lastname', true) . ', ' . 
$this->db->f('account_firstname', true)
+                               );
+                       }
+
+                       return $values;
+               }
        }

Modified: trunk/property/inc/class.uitts.inc.php
===================================================================
--- trunk/property/inc/class.uitts.inc.php      2014-10-17 13:27:24 UTC (rev 
12200)
+++ trunk/property/inc/class.uitts.inc.php      2014-10-17 18:17:26 UTC (rev 
12201)
@@ -96,6 +96,7 @@
                        $this->order                            = 
$this->bo->order;
                        $this->status_id                        = 
$this->bo->status_id;
                        $this->user_id                          = 
$this->bo->user_id;
+                       $this->reported_by                      = 
$this->bo->reported_by;
                        $this->cat_id                           = 
$this->bo->cat_id;
                        $this->vendor_id                        = 
$this->bo->vendor_id;
                        $this->district_id                      = 
$this->bo->district_id;
@@ -121,6 +122,7 @@
                                        'order'                 => $this->order,
                                        'status_id'             => 
$this->status_id,
                                        'user_id'               => 
$this->user_id,
+                                       'reported_by'   => $this->reported_by,
                                        'cat_id'                => 
$this->cat_id,
                                        'vendor_id'             => 
$this->vendor_id,
                                        'district_id'   => $this->district_id,
@@ -477,6 +479,7 @@
                                        ."cat_id:'{$this->cat_id}',"
                                        ."vendor_id:'{$this->vendor_id}',"
                                        ."status_id: '{$this->status_id}',"
+                                       ."reported_by: '{$this->reported_by}',"
                                        ."user_id: '{$this->user_id}',"
                                        ."query: '{$this->query}',"
                                        ."p_num: '{$this->p_num}',"
@@ -497,6 +500,7 @@
                                                'vendor_id'                     
=> $this->vendor_id,
                                                'status_id'                     
=> $this->status_id,
                                                'user_id'                       
=> $this->user_id,
+                                               'reported_by'           => 
$this->reported_by,
                                                'query'                         
=> $this->query,
                                                'district_id'           => 
$this->district_id,
                                                'part_of_town_id'   => 
$this->part_of_town_id,
@@ -537,6 +541,7 @@
                                        array_unshift 
($values_combo_box[4],array('id'=>$GLOBALS['phpgw_info']['user']['account_id'],'name'=>lang('my
 assigned tickets')));
                                        $_my_negative_self = (-1 * 
$GLOBALS['phpgw_info']['user']['account_id']);
        
+/*
                                        $default_value = array
                                        (
                                                'id'            => 
$_my_negative_self,
@@ -545,10 +550,15 @@
                                        );
                                        unset($_my_negative_self);
                                        array_unshift 
($values_combo_box[4],$default_value);
-
-                                       $default_value = 
array('id'=>'','name'=>lang('no user'));
+*/
+                                       $default_value = 
array('id'=>'','name'=>lang('assigned to'));
                                        array_unshift 
($values_combo_box[4],$default_value);
 
+                                       $values_combo_box[5]  = 
$this->bo->get_reported_by($this->reported_by);
+                                       array_unshift 
($values_combo_box[5],array('id'=>$GLOBALS['phpgw_info']['user']['account_id'],'name'=>lang('my
 submitted tickets')));
+                                       array_unshift 
($values_combo_box[5],array('id'=>'','name'=>lang('reported by')));
+
+
                                        $datatable['actions']['form'] = array
                                                (
                                                        array
@@ -618,58 +628,70 @@
                                                                                
'tab_index' => 5
                                                                        ),
                                                                        array
+                                                                       ( 
//boton       USER
+                                                                               
//      'id' => 'btn_user_id',
+                                                                               
'id' => 'sel_reported_by', // testing traditional listbox for long list
+                                                                               
'name' => 'reported_by',
+                                                                               
'value' => lang('reported by'),
+                                                                               
'type' => 'select',
+                                                                               
'style' => 'filter',
+                                                                               
'values' => $values_combo_box[5],
+                                                                               
'onchange'=> 'onChangeSelect("reported_by");',
+                                                                               
'tab_index' => 6
+                                                                       ),
+                                                                       array
                                                                        (//for 
link "columns", next to Export button
                                                                                
'type' => 'link',
                                                                                
'id' => 'btn_columns',
                                                                                
'url' => "Javascript:window.open('".$GLOBALS['phpgw']->link('/index.php',
-                                                                               
array
-                                                                               
(
-                                                                               
        'menuaction' => 'property.uitts.columns'
-                                                                               
)
-                                                                       
)."','','width=300,height=600,scrollbars=1')",
-                                                                       'value' 
=> lang('columns'),
-                                                                       
'tab_index' => 11
-                                                               ),
-                                                               array
-                                                               (
-                                                                       'type'  
=> 'button',
-                                                                       'id'    
=> 'btn_export',
-                                                                       'value' 
=> lang('download'),
-                                                                       
'tab_index' => 10
-                                                               ),
-                                                               array
-                                                               (
-                                                                       'type'  
=> 'button',
-                                                                       'id'    
=> 'btn_new',
-                                                                       'value' 
=> lang('add'),
-                                                                       
'tab_index' => 9
-                                                               ),
-                                                               array
-                                                               ( //hidden 
start_date
-                                                                       'type' 
=> 'hidden',
-                                                                       'id' => 
'start_date',
-                                                                       'value' 
=> $start_date
-                                                               ),
-                                                               array
-                                                               ( //hidden 
end_date
-                                                                       'type' 
=> 'hidden',
-                                                                       'id' => 
'end_date',
-                                                                       'value' 
=> $end_date
-                                                               ),
-                                                               array
-                                                               (//for link 
"None",
-                                                                       
'type'=> 'label_date'
-                                                               ),
-                                                               array
-                                                               (//for link 
"Date search",
-                                                                       
'type'=> 'link',
-                                                                       'id'  
=> 'btn_data_search',
-                                                                       'url' 
=> "Javascript:window.open('".$GLOBALS['phpgw']->link('/index.php',
+                                                                               
        array
+                                                                               
        (
+                                                                               
                'menuaction' => 'property.uitts.columns'
+                                                                               
        )
+                                                                               
)."','','width=300,height=600,scrollbars=1')",
+                                                                               
'value' => lang('columns'),
+                                                                               
'tab_index' => 12
+                                                                       ),
                                                                        array
                                                                        (
+                                                                               
'type'  => 'button',
+                                                                               
'id'    => 'btn_export',
+                                                                               
'value' => lang('download'),
+                                                                               
'tab_index' => 11
+                                                                       ),
+                                                                       array
+                                                                       (
+                                                                               
'type'  => 'button',
+                                                                               
'id'    => 'btn_new',
+                                                                               
'value' => lang('add'),
+                                                                               
'tab_index' => 10
+                                                                       ),
+                                                                       array
+                                                                       ( 
//hidden start_date
+                                                                               
'type' => 'hidden',
+                                                                               
'id' => 'start_date',
+                                                                               
'value' => $start_date
+                                                                       ),
+                                                                       array
+                                                                       ( 
//hidden end_date
+                                                                               
'type' => 'hidden',
+                                                                               
'id' => 'end_date',
+                                                                               
'value' => $end_date
+                                                                       ),
+                                                                       array
+                                                                       (//for 
link "None",
+                                                                               
'type'=> 'label_date'
+                                                                       ),
+                                                                       array
+                                                                       (//for 
link "Date search",
+                                                                               
'type'=> 'link',
+                                                                               
'id'  => 'btn_data_search',
+                                                                               
'url' => "Javascript:window.open('".$GLOBALS['phpgw']->link('/index.php',
+                                                                       array
+                                                                       (
                                                                                
'menuaction' => 
'property.uiproject.date_search'))."','','width=350,height=250')",
                                                                                
'value' => lang('Date search'),
-                                                                               
'tab_index' => 8
+                                                                               
'tab_index' => 9
                                                                        ),
                                                                        array
                                                                        ( 
//boton     SEARCH
@@ -677,7 +699,7 @@
                                                                                
'name' => 'search',
                                                                                
'value'    => lang('search'),
                                                                                
'type' => 'button',
-                                                                               
'tab_index' => 7
+                                                                               
'tab_index' => 8
                                                                        ),
                                                                        array
                                                                        ( // 
TEXT INPUT
@@ -687,7 +709,7 @@
                                                                                
'type' => 'text',
                                                                                
'onkeypress' => 'return pulsar(event)',
                                                                                
'size'    => 28,
-                                                                               
'tab_index' => 6
+                                                                               
'tab_index' => 7
                                                                        )
                                                                ),
                                                                'hidden_value' 
=> array

Modified: trunk/property/setup/phpgw_no.lang
===================================================================
--- trunk/property/setup/phpgw_no.lang  2014-10-17 13:27:24 UTC (rev 12200)
+++ trunk/property/setup/phpgw_no.lang  2014-10-17 18:17:26 UTC (rev 12201)
@@ -193,6 +193,7 @@
 assigned from  property        no      Tildelt fra
 assignedto     property        no      Tildelt til
 assigned to    property        no      Tildelt til
+reported by    property        no      Innmeldt av
 assign to      property        no      Til
 async  property        no      async
 asynchronous timed services    property        no      Planlagte oppgaver




reply via email to

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