Tue 01 Oct 2002 03:10:43 AM UTC, original submission:
When there are more categories than $GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'] only maxmatch categories are shown without any indication of the remaining categories.
The problem is that the member variable total_records of the phpgwapi categories class gives the number of records of the limited query which is never more than maxmatch.
The same problem applies to the admin module.
The following patches solve the problem, but it might be cleaner to change the categories class in the API so that total_records always gives the total number of records.
--- class.uicategories.inc.php.orig Sat Sep 28 23:08:23 2002
+++ class.uicategories.inc.php Mon Sep 30 23:00:44 2002
@@ -134,16 +134,18 @@
}
$this->bo->cats->app_name = $cats_app;
+ $cats = $this->bo->get_list_unlimited($global_cats);
+ $total_records = $this->bo->cats->total_records;
$cats = $this->bo->get_list($global_cats);
//--------------------------------- nextmatch --------------------------------------------
- $left = $this->nextmatchs->left('/index.php',$this->start,$this->bo->cats->total_records,$link_data);
- $right = $this->nextmatchs->right('/index.php',$this->start,$this->bo->cats->total_records,$link_data);
+ $left = $this->nextmatchs->left('/index.php',$this->start,$total_records,$link_data);
+ $right = $this->nextmatchs->right('/index.php',$this->start,$total_records,$link_data);
$this->t->set_var('left',$left);
$this->t->set_var('right',$right);
- $this->t->set_var('lang_showing',$this->nextmatchs->show_hits($this->bo->cats->total_records,$this->start));
+ $this->t->set_var('lang_showing',$this->nextmatchs->show_hits($total_records,$this->start));
// ------------------------------ end nextmatch ------------------------------------------
--- class.bocategories.inc.php.orig Sat Sep 28 23:15:04 2002
+++ class.bocategories.inc.php Sat Sep 28 23:26:24 2002
@@ -68,6 +68,12 @@
$this->order = $data['order'];
}
+
+ function get_list_unlimited($global_cats)
+ {
+ return $this->cats->return_sorted_array($this->start,False,$this->query,$this->sort,$this->order,$global_cats);
+ }
+
function get_list($global_cats)
{
return $this->cats->return_sorted_array($this->start,True,$this->query,$this->sort,$this->order,$global_cats);
|