fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [8661] property: remember session values


From: Sigurd Nes
Subject: [Fmsystem-commits] [8661] property: remember session values
Date: Tue, 24 Jan 2012 10:32:55 +0000

Revision: 8661
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=8661
Author:   sigurdne
Date:     2012-01-24 10:32:55 +0000 (Tue, 24 Jan 2012)
Log Message:
-----------
property: remember session values

Modified Paths:
--------------
    trunk/property/inc/class.boinvoice.inc.php
    trunk/property/inc/class.soinvoice.inc.php
    trunk/property/inc/class.uiinvoice.inc.php

Modified: trunk/property/inc/class.boinvoice.inc.php
===================================================================
--- trunk/property/inc/class.boinvoice.inc.php  2012-01-24 09:55:59 UTC (rev 
8660)
+++ trunk/property/inc/class.boinvoice.inc.php  2012-01-24 10:32:55 UTC (rev 
8661)
@@ -62,16 +62,36 @@
                        $district_id                    = 
phpgw::get_var('district_id', 'int');
                        $b_account                              = 
phpgw::get_var('b_account');
 
-                       $this->start                    = $start ? $start : 0;
+       //              $this->start                    = $start ? $start : 
(int)$this->start;
+
+                       $this->start                    = 
isset($_REQUEST['start'])             ? $start                        : 
$this->start;
+
+                       if(phpgw::get_var('workorder_id', 'int'))
+                       {
+                               $this->start = 0;
+                       }
+
+                       $this->query                    = isset($query) ? 
$query : $query;
+
+                       if(!phpgw::get_var('paid', 'bool'))
+                       {
+                               $voucher_id     = $this->query && 
ctype_digit($this->query) ? $this->query : 0;
+                       }
+
+                       if($voucher_id)
+                       {
+                               $this->start    = 0;
+                       }
+
+
                        $this->b_account                = isset($b_account) ? 
$b_account : $b_account;
                        $this->district_id              = isset($district_id) ? 
$district_id : $district_id;
                        $this->b_account_class  = isset($b_account_class) ? 
$b_account_class : $b_account_class;
-                       $this->query                    = isset($query) ? 
$query : $query;
                        $this->filter                   = isset($filter) ? 
$filter : $filter;
                        $this->sort                             = isset($sort) 
? $sort : $sort;
                        $this->order                    = isset($order) ? 
$order : $order;
                        $this->cat_id                   = isset($cat_id) ? 
$cat_id : $cat_id;
-                       $this->user_lid                 = isset($user_lid) ? 
$user_lid : $user_lid;
+                       $this->user_lid                 = $user_lid ? $user_lid 
: $this->user_lid;
                        $this->allrows                  = isset($allrows) ? 
$allrows : $allrows;
                }
 
@@ -88,7 +108,7 @@
                {
                        $data = 
$GLOBALS['phpgw']->session->appsession('session_data','invoice');
 
-                       //      _debug_array($data);
+//_debug_array($data);
 
                        $this->start                    = 
isset($data['start'])?$data['start']:'';
                        $this->query                    = 
isset($data['query'])?$data['query']:'';
@@ -96,15 +116,20 @@
                        $this->sort                             = 
isset($data['sort'])?$data['sort']:'';
                        $this->order                    = 
isset($data['order'])?$data['order']:'';
                        $this->cat_id                   = 
isset($data['cat_id'])?$data['cat_id']:'';
-                       $this->user_lid                 = 
isset($data['user_lid'])?$data['user_lid']:'';
+                       $this->user_lid                 = 
$data['user_lid']?$data['user_lid']:'';
                        $this->sub                              = 
isset($data['sub'])?$data['sub']:'';
                        $this->allrows                  = 
isset($data['allrows'])?$data['allrows']:'';
                        $this->b_account_class  = 
isset($data['b_account_class'])?$data['b_account_class']:'';
                        $this->district_id              = 
isset($data['district_id'])?$data['district_id']:'';
                }
 
-               function 
read_invoice($paid='',$start_date='',$end_date='',$vendor_id='',$loc1='',$workorder_id='',$voucher_id='')
+               function 
read_invoice($paid='',$start_date='',$end_date='',$vendor_id='',$loc1='',$workorder_id='',$voucher_id=0)
                {
+                       if(!phpgw::get_var('paid', 'bool'))
+                       {
+                               $voucher_id     = $this->query && 
ctype_digit($this->query) ? $this->query : 0;
+                       }
+
                        $start_date     = 
$this->bocommon->date_to_timestamp($start_date);
                        $end_date       = 
$this->bocommon->date_to_timestamp($end_date);
 

Modified: trunk/property/inc/class.soinvoice.inc.php
===================================================================
--- trunk/property/inc/class.soinvoice.inc.php  2012-01-24 09:55:59 UTC (rev 
8660)
+++ trunk/property/inc/class.soinvoice.inc.php  2012-01-24 10:32:55 UTC (rev 
8661)
@@ -54,7 +54,6 @@
 
                function read_invoice($data)
                {
-
                        $valid_order = array
                                (
                                        'bilagsnr'                      => true,

Modified: trunk/property/inc/class.uiinvoice.inc.php
===================================================================
--- trunk/property/inc/class.uiinvoice.inc.php  2012-01-24 09:55:59 UTC (rev 
8660)
+++ trunk/property/inc/class.uiinvoice.inc.php  2012-01-24 10:32:55 UTC (rev 
8661)
@@ -96,17 +96,17 @@
                function save_sessiondata()
                {
                        $data = array
-                               (
-                                       'start'                 => $this->start,
-                                       'query'                 => $this->query,
-                                       'sort'                  => $this->sort,
-                                       'order'                 => $this->order,
-                                       'filter'                => 
$this->filter,
-                                       'cat_id'                => 
$this->cat_id,
-                                       'user_lid'              => 
$this->user_lid,
-                                       'allrows'               => 
$this->allrows,
-                                       'district_id'           => 
$this->district_id
-                               );
+                       (
+                               'start'                 => $this->start,
+                               'query'                 => $this->query,
+                               'sort'                  => $this->sort,
+                               'order'                 => $this->order,
+                               'filter'                => $this->filter,
+                               'cat_id'                => $this->cat_id,
+                               'user_lid'              => $this->user_lid,
+                               'allrows'               => $this->allrows,
+                               'district_id'   => $this->district_id
+                       );
                        $this->bo->save_sessiondata($data);
                }
 
@@ -211,6 +211,8 @@
                        $voucher_id     = $this->query && 
ctype_digit($this->query) ? $this->query : phpgw::get_var('voucher_id', 'int');
                        $b_account_class= phpgw::get_var('b_account_class', 
'int');
 
+                       $this->save_sessiondata();
+
                        //-- ubica focus del menu derecho
                        if ( $paid )
                        {
@@ -277,7 +279,7 @@
                                                'cat_id'                        
=> $this->cat_id,
                                                'user_lid'                      
=> $this->user_lid,
                                                'sub'                           
=> $this->sub,
-                                               'query'                         
=> $this->query,
+                                       //      'query'                         
=> $this->query,
                                                'paid'                          
=> $paid,
                                                'vendor_id'                     
=> $vendor_id,
                                                'workorder_id'          => 
$workorder_id,
@@ -294,7 +296,7 @@
                                        ."cat_id: '{$this->cat_id}',"
                                        ."user_lid:'{$this->user_lid}',"
                                        ."sub:'{$this->sub}',"
-                                       ."query:'{$this->query}',"
+                               //      ."query:'{$this->query}',"
                                        ."paid:'{$paid}',"
                                        ."vendor_id:'{$vendor_id}',"
                                        ."workorder_id:'{$workorder_id}',"
@@ -628,8 +630,8 @@
                                                                'cat_id'        
                => $this->cat_id,
                                                                'user_lid'      
                => $this->user_lid,
                                                                'sub'           
                => $this->sub,
-                                                               'query'         
                => $this->query,
-                                                               'start'         
                => $this->start,
+                                                       //      'query'         
                => $this->query,
+                                                       //      'start'         
                => $this->start,
                                                                'paid'          
                => $paid,
                                                                'vendor_id'     
                => $vendor_id,
                                                                'workorder_id'  
        => $workorder_id,
@@ -1511,11 +1513,11 @@
                                                'cat_id'                => 
$this->cat_id,
                                                'user_lid'              => 
$this->user_lid,
                                                'sub'                   => 
$this->sub,
-                                               'query'                 => 
$this->query,
-                                               'start'                 => 
$this->start,
+                               //              'query'                 => 
$this->query,
+                               //              'start'                 => 
$this->start,
                                                'paid'                  => 
$paid,
                                                'voucher_id'    => $voucher_id,
-                                               'query'                 => 
$voucher_id
+                               //              'query'                 => 
$voucher_id
                                        ));
                                $datatable['config']['allow_allrows'] = false;
 
@@ -1526,11 +1528,11 @@
                                        ."cat_id: '{$this->cat_id}',"
                                        ."user_lid:'{$this->user_lid}',"
                                        ."sub:'{$this->sub}',"
-                                       ."query:'{$this->query}',"
-                                       ."start:'{$this->start}',"
+                               //      ."query:'{$this->query}',"
+                               //      ."start:'{$this->start}',"
                                        ."paid:'{$paid}',"
-                                       ."voucher_id:'{$voucher_id}',"
-                                       ."query:'{$voucher_id}'";
+                                       ."voucher_id:'{$voucher_id}'";
+                               //      ."query:'{$voucher_id}'";
 
                                $field_invoice = array
                                        (array
@@ -2649,7 +2651,7 @@
                                        (
                                                'menuaction'            => 
'property.uiinvoice.index',
                                                'paid'                          
=> true,
-                                               'user_lid'                      
=> 'all',
+                               //              'user_lid'                      
=> 'all',
                                                'district_id'           => 
$district_id,
                                                'b_account_class'       => 
$b_account_class,
                                                'start_date'            => 
$start_date,




reply via email to

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