Index: openacs-4/packages/glossar-portlet/lib/glossar-portlet-list.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/glossar-portlet/lib/glossar-portlet-list.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/glossar-portlet/lib/glossar-portlet-list.xql 23 Aug 2005 19:39:16 -0000 1.1 +++ openacs-4/packages/glossar-portlet/lib/glossar-portlet-list.xql 21 Oct 2005 18:33:12 -0000 1.2 @@ -1,31 +1,68 @@ - - - - - - - - - - SELECT cr.item_id as glossar_id , crr.title , crr.description , gl.source_category_id , gl.target_category_id , gl.owner_id, org.name , 1 as query_number , -case when gl.target_category_id is null then 0 else 1 end as sort_key - FROM gl_glossars gl, cr_items cr, cr_revisions crr , organizations org - WHERE cr.latest_revision = crr.revision_id - AND crr.revision_id = gl.glossar_id - AND gl.owner_id = org.organization_id - AND org.organization_id = :customer_id - UNION - SELECT cr.item_id as glossar_id , crr.title , crr.description , gl.source_category_id , gl.target_category_id , gl.owner_id, org.name , 2 as query_number , -case when gl.target_category_id is null then 0 else 1 end as sort_key - FROM gl_glossars gl, cr_items cr, cr_revisions crr, organizations org - WHERE cr.latest_revision = crr.revision_id - AND crr.revision_id = gl.glossar_id - AND gl.owner_id = org.organization_id - AND org.organization_id IN ('$where_etat_ids') - ORDER BY query_number asc , + + + SELECT + cr.item_id as glossar_id, + crr.title, + crr.description, + gl.source_category_id, + gl.target_category_id, + gl.owner_id, + org.name, + 1 as query_number, + case + when gl.target_category_id is null + then 0 + else 1 end as sort_key + FROM + gl_glossars gl, + cr_items cr, + cr_revisions crr, + organizations org + WHERE + cr.latest_revision = crr.revision_id + AND crr.revision_id = gl.glossar_id + AND gl.owner_id = org.organization_id + AND org.organization_id = :customer_id + UNION + SELECT + cr.item_id as glossar_id, + crr.title, + crr.description, + gl.source_category_id, + gl.target_category_id, + gl.owner_id, + org.name, + 2 as query_number, + case + when gl.target_category_id is null + then 0 + else 1 end as sort_key + FROM + gl_glossars gl, + cr_items cr, + cr_revisions crr, + organizations org + WHERE + cr.latest_revision = crr.revision_id + AND crr.revision_id = gl.glossar_id + AND gl.owner_id = org.organization_id + AND org.organization_id IN ('$where_etat_ids') + ORDER BY query_number asc + + + + select + count(ci.item_id) + from + cr_items ci + where + ci.parent_id = :glossar_id + + + \ No newline at end of file