fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [7507] property: status on receipts for events


From: Sigurd Nes
Subject: [Fmsystem-commits] [7507] property: status on receipts for events
Date: Wed, 17 Aug 2011 09:10:16 +0000

Revision: 7507
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=7507
Author:   sigurdne
Date:     2011-08-17 09:10:14 +0000 (Wed, 17 Aug 2011)
Log Message:
-----------
property: status on receipts for events

Modified Paths:
--------------
    trunk/property/inc/class.boevent.inc.php
    trunk/property/inc/class.soevent.inc.php
    trunk/property/inc/class.uievent.inc.php
    trunk/property/js/yahoo/event.index.js

Modified: trunk/property/inc/class.boevent.inc.php
===================================================================
--- trunk/property/inc/class.boevent.inc.php    2011-08-17 07:21:42 UTC (rev 
7506)
+++ trunk/property/inc/class.boevent.inc.php    2011-08-17 09:10:14 UTC (rev 
7507)
@@ -105,6 +105,7 @@
                        $type                           = 
phpgw::get_var('type');
                        $type_id                        = 
phpgw::get_var('type_id', 'int');
                        $user_id                        = 
phpgw::get_var('user_id', 'int');
+                       $status_id                      = 
phpgw::get_var('status_id');
 
                        $this->start            = $start ? $start : 0;
                        $this->query            = isset($_REQUEST['query']) ? 
$query : $this->query;
@@ -115,6 +116,7 @@
                        $this->location_id      = 
isset($_REQUEST['location_id'])  ? $location_id :  $this->location_id;
                        $this->user_id          = isset($_REQUEST['user_id'])  
? $user_id :  $this->user_id;
                        $this->allrows          = isset($allrows) ? $allrows : 
false;
+                       $this->status_id        = isset($_REQUEST['status_id']) 
 ? $status_id :  $this->status_id;
                }
 
                public function save_sessiondata($data)
@@ -140,12 +142,14 @@
                        $this->allrows          = $data['allrows'];
                        $this->location_id      = $data['location_id'];
                        $this->user_id          = $data['user_id'];
+                       $this->status_id        = $data['status_id'];
                }
 
                public function read($dry_run='')
                {
                        $values = $this->so->read(array('start' => 
$this->start,'query' => $this->query,'sort' => $this->sort,'order' => 
$this->order,
-                               'allrows'=>$this->allrows, 'location_id' => 
$this->location_id, 'user_id' => $this->user_id, 'dry_run'=>$dry_run));
+                               'allrows'=>$this->allrows, 'location_id' => 
$this->location_id, 'user_id' => $this->user_id, 'dry_run'=>$dry_run,
+                               'status_id' => $this->status_id));
 
                        static $locations = array();
                        static $urls = array();

Modified: trunk/property/inc/class.soevent.inc.php
===================================================================
--- trunk/property/inc/class.soevent.inc.php    2011-08-17 07:21:42 UTC (rev 
7506)
+++ trunk/property/inc/class.soevent.inc.php    2011-08-17 09:10:14 UTC (rev 
7507)
@@ -59,6 +59,7 @@
                        $dry_run                        = 
isset($data['dry_run']) ? $data['dry_run'] : '';
                        $location_id            = isset($data['location_id']) 
&& $data['location_id'] ? (int)$data['location_id'] : -1;
                        $user_id                        = 
isset($data['user_id']) && $data['user_id'] ? (int)$data['user_id'] : 0;
+                       $status_id                      = 
isset($data['status_id']) && $data['status_id'] ? $data['status_id'] : 'open';
 
                        if ($order)
                        {
@@ -89,6 +90,23 @@
                                $filtermethod .= " AND fm_event.responsible_id 
=" . (int)$user->person_id ;
                        }
 
+                       switch($status_id)
+                       {
+                               case 'all':
+                                       break;
+                               case 'open':
+                                       $filtermethod .= " AND 
fm_event_receipt.event_id IS NULL AND fm_event_exception.event_id IS NULL";
+                                       break;
+                               case 'closed':
+                                       $filtermethod .= " AND 
fm_event_receipt.event_id IS NOT NULL";
+                                       break;
+                               case 'exception':
+                                       $filtermethod .= " AND 
fm_event_exception.event_id IS NOT NULL";
+                                       break;
+                               default:
+                       }
+
+
                        if($query)
                        {
                                $query = $this->_db->db_addslashes($query);

Modified: trunk/property/inc/class.uievent.inc.php
===================================================================
--- trunk/property/inc/class.uievent.inc.php    2011-08-17 07:21:42 UTC (rev 
7506)
+++ trunk/property/inc/class.uievent.inc.php    2011-08-17 09:10:14 UTC (rev 
7507)
@@ -81,6 +81,7 @@
                        $this->allrows                          = 
$this->bo->allrows;
                        $this->location_id                      = 
$this->bo->location_id;
                        $this->user_id                          = 
$this->bo->user_id;
+                       $this->status_id                        = 
$this->bo->status_id;
                }
 
                function save_sessiondata()
@@ -94,6 +95,7 @@
                                        'allrows'               => 
$this->allrows,
                                        'location_id'   => $this->location_id,
                                        'user_id'               => 
$this->user_id,
+                                       'status_id'             => 
$this->status_id
                                );
                        $this->bo->save_sessiondata($data);
                }
@@ -140,7 +142,8 @@
 
                                $datatable['config']['base_java_url'] = 
"menuaction:'property.uievent.index',"
                                        ."location_id:'{$this->location_id}',"
-                                       ."user_id:'{$this->user_id}'";
+                                       ."user_id:'{$this->user_id}',"
+                                       ."status_id:'{$this->status_id}'";      
                                
 
                                $values_combo_box = array();
 
@@ -154,6 +157,12 @@
                                $default_value = 
array('id'=>'','name'=>lang('no user'));
                                array_unshift 
($values_combo_box[1],$default_value);
 
+                               $values_combo_box[2]  = array();
+                               array_unshift ($values_combo_box[2],array 
('id'=>'exception','name'=> lang('exception')));
+                               array_unshift ($values_combo_box[2],array 
('id'=>'closed','name'=> lang('closed')));
+                               array_unshift ($values_combo_box[2],array 
('id'=>'all','name'=> lang('all')));
+                               array_unshift ($values_combo_box[2],array 
('id'=>'open','name'=> lang('open')));
+
                                $datatable['config']['allow_allrows'] = true;
 
                                $datatable['actions']['form'] = array
@@ -191,6 +200,15 @@
                                                                        
'tab_index' => 2
                                                                ),
                                                                array
+                                                               ( //boton       
STATUS
+                                                                       'id' => 
'btn_status_id',
+                                                                       'name' 
=> 'status_id',
+                                                                       'value' 
=> lang('Status'),
+                                                                       'type' 
=> 'button',
+                                                                       'style' 
=> 'filter',
+                                                                       
'tab_index' => 3
+                                                               ),
+                                                               array
                                                                ( // boton SAVE
                                                                        'id'    
=> 'btn_save',
                                                                        
//'name' => 'save',
@@ -224,7 +242,7 @@
                                                                                
'menuaction' => 'property.uiproject.date_search')
                                                                        
)."','','width=350,height=250')",
                                                                        'value' 
=> lang('Date search'),
-                                                                       
'tab_index' => 5
+                                                                       
'tab_index' => 6
                                                                ),
                                                                array
                                                                ( //button     
SEARCH
@@ -232,7 +250,7 @@
                                                                        'name' 
=> 'search',
                                                                        'value' 
   => lang('search'),
                                                                        'type' 
=> 'button',
-                                                                       
'tab_index' => 4
+                                                                       
'tab_index' => 5
                                                                ),
                                                                array
                                                                ( // TEXT INPUT
@@ -242,7 +260,7 @@
                                                                        'type' 
=> 'text',
                                                                        
'onkeypress' => 'return pulsar(event)',
                                                                        'size'  
  => 28,
-                                                                       
'tab_index' => 3
+                                                                       
'tab_index' => 4
                                                                ),
                                                                array
                                                                ( //place 
holder for selected events
@@ -262,6 +280,11 @@
                                                                ( //div values  
combo_box_1
                                                                        'id' => 
'values_combo_box_1',
                                                                        'value' 
=> $this->bocommon->select2String($values_combo_box[1])
+                                                               ),
+                                                               array
+                                                               ( //div values  
combo_box_2
+                                                                       'id' => 
'values_combo_box_2',
+                                                                       'value' 
=> $this->bocommon->select2String($values_combo_box[2])
                                                                )
                                                        )
                                                )

Modified: trunk/property/js/yahoo/event.index.js
===================================================================
--- trunk/property/js/yahoo/event.index.js      2011-08-17 07:21:42 UTC (rev 
7506)
+++ trunk/property/js/yahoo/event.index.js      2011-08-17 09:10:14 UTC (rev 
7507)
@@ -2,11 +2,11 @@
 // Declaration of event.index vars
 //--------------------------------------------------------
        //define SelectButton
-       var oMenuButton_0, oMenuButton_1;//, oMenuButton_2, oMenuButton_3;
+       var oMenuButton_0, oMenuButton_1, oMenuButton_2;//, oMenuButton_3;
        var selectsButtons = [
        {order:0, 
var_URL:'location_id',name:'btn_location_id',style:'locationbutton',dependiente:''},
-       {order:1, var_URL:'user_id', 
name:'btn_user_id',style:'ownerIdbutton',dependiente:''}
-//     {order:3, 
var_URL:'status_id',name:'btn_status_id',style:'partOFTownbutton',dependiente:''},
+       {order:1, var_URL:'user_id', 
name:'btn_user_id',style:'ownerIdbutton',dependiente:''},
+       {order:2, 
var_URL:'status_id',name:'btn_status_id',style:'statusIdbutton',dependiente:''}
        ];
 
        // define buttons
@@ -114,6 +114,14 @@
                        {
                                oMenuButton_1.set("label", ("<em>" + 
array_options[1][index][1] + "</em>"));
                        }
+
+                       //status
+                       index = 
locate_in_array_options(2,"value",path_values.status_id);
+                       if(index)
+                       {
+                               oMenuButton_2.set("label", ("<em>" + 
array_options[2][index][1] + "</em>"));
+                       }
+
 /*
                        //district
                        index = 
locate_in_array_options(1,"value",path_values.district_id);
@@ -121,12 +129,6 @@
                        {
                                oMenuButton_1.set("label", ("<em>" + 
array_options[1][index][1] + "</em>"));
                        }
-                       //status
-                       index = 
locate_in_array_options(2,"value",path_values.status_id);
-                       if(index)
-                       {
-                               oMenuButton_2.set("label", ("<em>" + 
array_options[2][index][1] + "</em>"));
-                       }
                        //user
                        index = 
locate_in_array_options(3,"value",path_values.user_id);
                        if(index)




reply via email to

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