fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [8263] Paginator


From: Sigurd Nes
Subject: [Fmsystem-commits] [8263] Paginator
Date: Fri, 09 Dec 2011 14:57:49 +0000

Revision: 8263
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=8263
Author:   sigurdne
Date:     2011-12-09 14:57:49 +0000 (Fri, 09 Dec 2011)
Log Message:
-----------
Paginator

Modified Paths:
--------------
    trunk/controller/inc/class.uicheck_list_for_location.inc.php
    trunk/property/inc/class.bolocation.inc.php
    trunk/property/inc/class.solocation.inc.php

Modified: trunk/controller/inc/class.uicheck_list_for_location.inc.php
===================================================================
--- trunk/controller/inc/class.uicheck_list_for_location.inc.php        
2011-12-09 14:18:52 UTC (rev 8262)
+++ trunk/controller/inc/class.uicheck_list_for_location.inc.php        
2011-12-09 14:57:49 UTC (rev 8263)
@@ -252,31 +252,27 @@
                        
self::render_template_xsl(array('control_location_tabs', 'common', 
'add_location_to_control'), $data);          
                }
                
-               public function query(){
-                                       
+               public function query()
+               {
+                       $type_id = phpgw::get_var('type_id', 'int');
+                       $return_results = phpgw::get_var('results', 'int', 
'REQUEST', 0);
+
+                       $type_id = $type_id ? $type_id : 1;
                        
-                       $type_id = phpgw::get_var('type_id');
-                       
-                       if( empty($type_id) | $type_id == "" ){
-                               $type_id = 1;
-                       }
-                       
                        $location_list = array();
 
                        $this->bo->sort = "ASC";
                        $this->bo->start = phpgw::get_var('startIndex');
                        
                        $location_list = $this->bo->read(array('user_id' => 
$user_id, 'role_id' =>$role_id, 
'type_id'=>$type_id,'lookup_tenant'=>$lookup_tenant,
-                                                                               
                   'lookup'=>$lookup,'allrows'=>$this->allrows,'dry_run' 
=>$dry_run));
+                                                                               
                   'lookup'=>$lookup,'allrows'=>$this->allrows,'dry_run' 
=>$dry_run,'results' => $return_results));
 
-                       $rows_total = $this->bo->read(array('type_id' => 
$type_id, 'allrows' => true));
-                       
                        foreach($location_list as $location)
                        {
                                $results['results'][]= $location;       
                        }
                        
-                       $results['total_records'] = count($rows_total);
+                       $results['total_records'] = $this->bo->total_records;
                        $results['start'] = $this->start;
                        $results['sort'] = 'location_code';
                        $results['dir'] = "ASC";
@@ -302,4 +298,4 @@
                        $value['actions'][] = 
html_entity_decode(self::link(array('menuaction' => 
'controller.uicontrol.add_location_to_control', 'location_code' => 
$value['location_code'])));
                        $value['labels'][] = lang('add_location');
                }
-       }
\ No newline at end of file
+       }

Modified: trunk/property/inc/class.bolocation.inc.php
===================================================================
--- trunk/property/inc/class.bolocation.inc.php 2011-12-09 14:18:52 UTC (rev 
8262)
+++ trunk/property/inc/class.bolocation.inc.php 2011-12-09 14:57:49 UTC (rev 
8263)
@@ -674,12 +674,14 @@
 
                function read($data = array())
                {
+//_debug_array($data);
                        $locations = $this->so->read(array('start' => 
$this->start,'query' => $this->query,'sort' => $this->sort,'order' => 
$this->order,
                                'filter' => $this->filter,'cat_id' => 
$this->cat_id,'type_id' => $data['type_id'],
                                
'lookup_tenant'=>$data['lookup_tenant'],'lookup'=>$data['lookup'],
                                
'district_id'=>$this->district_id,'allrows'=>$data['allrows'],
                                
'status'=>$this->status,'part_of_town_id'=>$this->part_of_town_id,'dry_run'=>$data['dry_run'],
-                               'location_code' => $this->location_code, 
'filter_role_on_contact' => $data['filter_role_on_contact'], 'role_id' => 
$data['role_id']));
+                               'location_code' => $this->location_code, 
'filter_role_on_contact' => $data['filter_role_on_contact'], 'role_id' => 
$data['role_id'],
+                               'results' => $data['results']));
 
                        $this->total_records = $this->so->total_records;
                        $this->uicols = $this->so->uicols;

Modified: trunk/property/inc/class.solocation.inc.php
===================================================================
--- trunk/property/inc/class.solocation.inc.php 2011-12-09 14:18:52 UTC (rev 
8262)
+++ trunk/property/inc/class.solocation.inc.php 2011-12-09 14:57:49 UTC (rev 
8263)
@@ -278,6 +278,7 @@
                        $location_code                  = 
isset($data['location_code']) ? $data['location_code'] : '';
                        $filter_role_on_contact = 
$data['filter_role_on_contact'] ? (int)$data['filter_role_on_contact'] : 0;
                        $role_id                                = 
$data['role_id'] ? (int)$data['role_id'] : 0;
+                       $results                                = 
$data['results'] ? (int)$data['results'] : 0;
 
                        if (!$type_id)
                        {
@@ -895,7 +896,7 @@
 
                        if(!$allrows)
                        {
-                               $this->db->limit_query($sql . 
$ordermethod,$start,__LINE__,__FILE__);
+                               $this->db->limit_query($sql . 
$ordermethod,$start,__LINE__,__FILE__,$results);
                        }
                        else
                        {




reply via email to

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