fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [12224] modify read function


From: Sigurd Nes
Subject: [Fmsystem-commits] [12224] modify read function
Date: Thu, 23 Oct 2014 08:21:10 +0000

Revision: 12224
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=12224
Author:   sigurdne
Date:     2014-10-23 08:21:09 +0000 (Thu, 23 Oct 2014)
Log Message:
-----------
modify read function

Modified Paths:
--------------
    branches/dev-syncromind/property/inc/class.bogeneric.inc.php
    branches/dev-syncromind/property/inc/class.sogeneric.inc.php
    branches/dev-syncromind/property/inc/class.uigeneric.inc.php

Modified: branches/dev-syncromind/property/inc/class.bogeneric.inc.php
===================================================================
--- branches/dev-syncromind/property/inc/class.bogeneric.inc.php        
2014-10-23 08:19:50 UTC (rev 12223)
+++ branches/dev-syncromind/property/inc/class.bogeneric.inc.php        
2014-10-23 08:21:09 UTC (rev 12224)
@@ -136,24 +136,13 @@
                        return $column_list;
                }
 
-               public function read($filter = array())
+               public function read($data = array())
                {
-                       if (! $filter )
-                       {
-                               foreach ( $this->location_info['fields'] as 
$field )
-                               {
-                                       if (isset($field['filter']) && 
$field['filter'])
-                                       {
-                                               $filter[$field['name']] = 
phpgw::get_var($field['name']);
-                                       }
-                               }
-                       }
 
                        /*$values = $this->so->read(array('start' => 
$this->start,'query' => $this->query,'sort' => $this->sort,'order' => 
$this->order,
                                'allrows'=>$this->allrows),$filter);*/
 
-                       $values = $this->so->read(array('start' => 
$this->start,'query' => $this->query,'sort' => $this->sort,
-                               'allrows'=>$this->allrows),$filter);
+                       $values = $this->so->read($data);
                        
                        foreach ( $this->location_info['fields'] as $field )
                        {

Modified: branches/dev-syncromind/property/inc/class.sogeneric.inc.php
===================================================================
--- branches/dev-syncromind/property/inc/class.sogeneric.inc.php        
2014-10-23 08:19:50 UTC (rev 12223)
+++ branches/dev-syncromind/property/inc/class.sogeneric.inc.php        
2014-10-23 08:21:09 UTC (rev 12224)
@@ -57,7 +57,7 @@
                        
                }
 
-               function read($data, $filter = array())
+               function read($data)
                {
                        $start                          = isset($data['start']) 
&& $data['start'] ? $data['start'] : 0;
                        $query                          = isset($data['query']) 
? $data['query']:'';
@@ -65,6 +65,7 @@
                        $order                          = isset($data['order']) 
? $data['order'] : '';
                        $allrows                        = 
isset($data['allrows']) ? $data['allrows'] : '';
                        $custom_criteria        = 
isset($data['custom_criteria']) && $data['custom_criteria'] ? 
$data['custom_criteria'] : array();
+                       $filter                         = 
isset($data['filter']) && $data['filter'] ? $data['filter'] : array();
 
                        $values = array();
                        if (!isset($this->location_info['table']) || !$table = 
$this->location_info['table'])

Modified: branches/dev-syncromind/property/inc/class.uigeneric.inc.php
===================================================================
--- branches/dev-syncromind/property/inc/class.uigeneric.inc.php        
2014-10-23 08:19:50 UTC (rev 12223)
+++ branches/dev-syncromind/property/inc/class.uigeneric.inc.php        
2014-10-23 08:21:09 UTC (rev 12224)
@@ -404,7 +404,11 @@
                                                        array(
                                                                'type' => 
'link',
                                                                'value' => 
$_SESSION['allrows'] ? lang('Show only active') : lang('Show all'),
-                                                               'href' => 
self::link(array('menuaction' => 'property.uicondition_survey.index', 'allrows' 
=> true))
+                                                               'href' => 
self::link(array('menuaction' => 'property.uigeneric.index',
+                                                                       
'appname'    => $this->appname,
+                                                                       'type'  
     => $this->type,
+                                                                       
'type_id'    => $this->type_id,
+                                                                       
'allrows' => true))
                                                        ),
                                                ),
                                        ),
@@ -547,23 +551,30 @@
                 */
                public function query()
                {
-                       
                        $search = phpgw::get_var('search');
                        $order = phpgw::get_var('order');
                        $draw = phpgw::get_var('draw', 'int');
-                       
+                       $columns = phpgw::get_var('columns');
 
                        $params = array(
                                'start' => phpgw::get_var('start', 'int', 
'REQUEST', 0),
                                'results' => phpgw::get_var('length', 'int', 
'REQUEST', 0),
-                               'query' => $search,
-                               'order' => '',
-                               'sort' => phpgw::get_var('sort'),
-                               'dir' => phpgw::get_var('dir'),
+                               'query' => $search['value'],
+                               'order' => 
$columns[$order[0]['column']]['data'],
+                               'sort' => $order[0]['dir'],
+                               'dir' => $order[0]['dir'],
                                'cat_id' => phpgw::get_var('cat_id', 'int', 
'REQUEST', 0),
                                'allrows' => phpgw::get_var('allrows', 'bool')
                        );
 
+                       foreach ( $this->location_info['fields'] as $field )
+                       {
+                               if (isset($field['filter']) && $field['filter'])
+                               {
+                                       $params['filter'][$field['name']] = 
phpgw::get_var($field['name']);
+                               }
+                       }
+
                        $result_objects = array();
                        $result_count = 0;
 




reply via email to

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