bugphpGroupWare - Bugs: bug #7239, subcats past the second level of...


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

bug #7239: subcats past the second level of subcat don't work in person or org list

Submitted by:  Johnson <jecinc>
Submitted on:  Tue 13 Jan 2004 10:06:03 PM UTC  
Item Group: 0.9.16RC2Category: API - phpGroupware API
Severity: 1 - WishPriority: 1 - Later
Status: NonePrivacy: Public
Assigned to: Alejandro Borges (lex) <alexbsa>Open/Closed: Open
Component Version: SVNOperating System: GNU/Linux - Debian
Reproducibility: NonePlanned Release: None
Fixed Release: 

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

Wed 04 Feb 2004 08:04:07 PM UTC, comment #7:

<bjohnson> in contacts_sql:
<bjohnson> function get_sub_cats($cat_id)
<bjohnson> {
<bjohnson> $sql = 'SELECT cat2.cat_id FROM phpgw_categories as cat '
<bjohnson> .'INNER JOIN phpgw_categories as cat2 ON cat.cat_id=cat2.cat_parent '
<bjohnson> .'WHERE '.sql::in('cat.cat_id', $cat_id);
<bjohnson> THAT ^^ only gets one level of sub cats down .. NOT ALL SUB-CATS
<bjohnson> it matches how the categories class does it .. which imo should be modified
<jarg> see more below :P

<bjohnson> yes .. that then goes down one more level correct
<jarg> this function is recursive
<bjohnson> why does ab make it's own function instead of using class.categories?
<jarg> because modify categories is more work :P

<bjohnson> for me, that is picking up 6 cat_id's when it should be 9
<bjohnson> when I select a first level cat that has sub-cats who in turn have sub-cats, only the sub-sub-cats (the third) level is returned
<bjohnson> I haven't checked with more than three levels but I suspect only the last level is returned
<bjohnson> can return even be used this way?

<bjohnson> one other funny thing. I can't find where get_sub_cats is ever called from uiaddressbook

Notice that this has been moved to phpgwapi bug reports.

1. The addressbook should be checked (please give specifics of tests)

2. The categories class should be modified to do recursive sub-cats (I think that is the logic behind it's intent)

3. The addressbook should use the categories class.

Johnson <jecinc>
Wed 04 Feb 2004 06:03:16 PM UTC, comment #6:

Addressbook shouldnt show this problem as it does its OWN subcat management. It works here in addressbook although, as you point out, the api does have some problems with multilevel addressbook.

If you can confirm this (addressbook works, doesnt work elsewere) then lets move this to the api with a note on how to fix (the code for proper checking of subcats is in contacts_sql)

Alejandro Borges (lex) <alexbsa>In charge of this item.
Tue 03 Feb 2004 07:11:55 PM UTC, comment #5:

Don't close this, but it is more than just addressbook.

I think the entire categories class has trouble with anything more than a two level cat system. For instance, the nextmatch category filters will not include the records from a third level (or below) sub cat

It sounds like the entire concept of the category system will be under review within the next year and this items should be addressed in that revision.

I am moving it from addressbook to the phpgwapi and reassigning to who might be working on category code in the near future.

Johnson <jecinc>
Tue 03 Feb 2004 04:51:59 PM UTC, comment #4:

i can close this report?

Jonathan Rivera <jarg>
Tue 20 Jan 2004 10:58:55 PM UTC, comment #3:

mm, this works fine for my, you try with mysql or postgres?

Jonathan Rivera <jarg>
Thu 15 Jan 2004 04:09:48 AM UTC, comment #2:

This report applies to the two main lists/tabs (Persons & Organizations)

I have a cat, a sub-cat, and a sub-sub-cat (a sub-cat of the first sub-cat)

the category filter select box only shows the first two levels of sub-cats

I've tried the default and probusiness templates

Johnson <jecinc>
Thu 15 Jan 2004 02:53:14 AM UTC, comment #1:

Is this in the edit form or in the plain view. If its the later then state the template and test for idots and probiz, cause its working here. If its the former, well then its also weird cause i see it just fine here.

Alejandro Borges (lex) <alexbsa>In charge of this item.
Tue 13 Jan 2004 10:06:03 PM UTC, original submission:

try making a subcat of a subcat and then filter by it in the lists .. it doesn't work

Johnson <jecinc>


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
Tue 03 Feb 2004 07:11:55 PM UTCjecincCategoryaddressbook=>API - phpGroupware API
  Assigned tojarg=>alexbsa
Thu 15 Jan 2004 02:54:53 AM UTCalexbsaAssigned toNone=>jarg

Back to the top

Powered by Savane 3.1-cleanup1