bugphpGroupWare - Bugs: bug #1308, only maxmatch categories show up...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #1308: only maxmatch categories show up in the "Edit Categories" page

Submitted by:  Michael Totschnig <totschnig>
Submitted on:  Tue 01 Oct 2002 03:10:43 AM UTC  
 
Item Group: NoneCategory: API - Preferences
Severity: 3 - NormalPriority: 5 - Normal
Status: NonePrivacy: Public
Assigned to: Bettina Gille <ceb>Open/Closed: Closed
Component Version: NoneOperating System: None
Reproducibility: NonePlanned Release: None
Fixed Release: 

(Jump to the original submission Jump to the original submission)

Tue 15 Oct 2002 09:45:54 PM UTC, comment #6:

commented out the limit_query for the subs.

Bettina Gille <ceb>
Project AdministratorIn charge of this item.
Tue 15 Oct 2002 01:59:17 AM UTC, comment #5:

I tested the patch commited to CVS. All top level categories are shown, but if one category has more than maxmatch subcategories, these are still invisible.
Michael

Anonymous
Tue 15 Oct 2002 12:22:48 AM UTC, comment #4:

now it should show all of the cats.
thanks. ceb

Bettina Gille <ceb>
Project AdministratorIn charge of this item.
Thu 10 Oct 2002 05:14:19 PM UTC, comment #3:

I looked somethin further into this issue, and I think I got a hold on the problem, but for working out the right solution, I'd need help of somebody familiar with the categories class in the API:
The problem is twofold:
- the categories class limits queries on the main categories and on the subcategories to maxmatch,
- the uicategories classes in admin and preferences set the total parameter of the nextmatch class to the number of records in the limited queries.
The only solution I see in the current framework, is to
- change the categories class in the API so that the return_sorted_array function limits the main categories, but gets the unlimited subcategories.
- change the admin and preferences module so that total_records is set to the unlimited number of main categories.

This could make the categories list in the UI work correctly with the nextmatch class. The user only sees maxmatch main categories, but all the subcategories.

Michael Totschnig <totschnig>
Thu 10 Oct 2002 03:05:55 PM UTC, comment #2:

Hello,

I should have said that I discovered that the patch I posted is far from a real solution since it does not deal at all with the problem of categories and subcategories:
When there are 10 top level categories and 10 subcategories and the user's maxmatch preference is 10, then without my patch the user only sees half of the categories without any access to the rest. with my patch, the user sees all 10 top level categories + the 10 subcategories, and the arrows of the nextmatch class give bogus indications. I am not sure how the nextmatch class can be used in this situation of a hierarchical tree.

Michael Totschnig <totschnig>
Thu 10 Oct 2002 03:50:23 AM UTC, comment #1:

Thanks Michael,

Will test this one.

Cheers

Dave Hall <skwashd>
Project Administrator
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);

Michael Totschnig <totschnig>

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

Do you think this task is very important?
If so, you can click here to add your encouragement to it.
This task has 0 encouragements so far.

Only logged-in users can vote.

 

Please enter the title of George Orwell's famous dystopian book (it's a date):

 

 

Follow 3 latest changes.

Date Changed By Updated Field Previous Value => Replaced By
Wed 30 Oct 2002 09:39:27 PM UTCcebOpen/ClosedOpen=>(Error - Not Found)
Tue 15 Oct 2002 12:23:20 AM UTCcebAssigned toskwashd=>NA
Thu 10 Oct 2002 03:50:23 AM UTCskwashdAssigned toNone=>NA

Back to the top


Powered by Savane 3.1-cleanup1