Index: openacs-4/packages/assessment/www/asm-admin/catalog-browse.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/catalog-browse.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/packages/assessment/www/asm-admin/catalog-browse.tcl 11 Apr 2005 19:01:49 -0000 1.5 +++ openacs-4/packages/assessment/www/asm-admin/catalog-browse.tcl 21 Apr 2005 09:16:56 -0000 1.6 @@ -21,6 +21,7 @@ {orderby:optional "title,asc"} {page:optional 1} {search_again_url:optional ""} + {size:optional 10} } -properties { title:onevalue context:onevalue @@ -111,8 +112,12 @@ set keyword_where_clause "" if {![empty_string_p $keywords]} { - set keyword_sql "%$keywords%" - set keyword_where_clause [db_map keywords] + set keyword_sql [string tolower "%$keywords%"] + if {[info exists section_id]} { + set keyword_where_clause [db_map item_keywords] + } else { + set keyword_where_clause [db_map section_keywords] + } } @@ -135,17 +140,21 @@ orderby_asc "o.object_type asc, lower(cr.title) asc" orderby_desc "o.object_type desc, lower(cr.title) desc" } + lappend elements field_name { + label "[_ assessment.Field_Name]" + orderby "lower(i.field_name)" + } set key_name as_item_id set page_query item_list } else { set assessment_rev_id $assessment_data(assessment_rev_id) set key_name section_id set page_query section_list + lappend elements name { + label "[_ assessment.Name]" + orderby "lower(ci.name)" + } } -lappend elements name { - label "[_ assessment.Name]" - orderby "lower(ci.name)" -} lappend elements author { label "Author" display_template "@objects.last_name@, @objects.first_names@" @@ -159,7 +168,8 @@ -key $key_name \ -pass_properties { assessment_id section_id after } \ -no_data "[_ assessment.None]" \ - -filters { assessment_id {} section_id {} after {} category_ids { type multival } join_cat {} subtree_p {} keywords {} join_key {} letter {} itype {} search_again_url {} } \ + -filters { + assessment_id {} section_id {} after {} category_ids { type multival } join_cat {} subtree_p {} keywords {} join_key {} letter {} itype {} search_again_url {} } \ -elements $elements \ -bulk_actions $bulk_actions -bulk_action_export_vars { assessment_id section_id after } -page_size 20 -page_flush_p 1 -page_query_name $page_query Index: openacs-4/packages/assessment/www/asm-admin/catalog-browse.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/catalog-browse.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/assessment/www/asm-admin/catalog-browse.xql 1 Feb 2005 22:00:10 -0000 1.1 +++ openacs-4/packages/assessment/www/asm-admin/catalog-browse.xql 21 Apr 2005 09:16:56 -0000 1.2 @@ -35,12 +35,18 @@ - + - and (cr.title like :keyword_sql or cr.description like :keyword_sql or ci.name like :keyword_sql) + and (lower(cr.title) like :keyword_sql or lower(cr.description) like :keyword_sql or lower(i.field_name) like :keyword_sql) + + + and (lower(cr.title) like :keyword_sql or lower(cr.description) like :keyword_sql or lower(ci.name) like :keyword_sql) + + + select v.object_id @@ -99,7 +105,7 @@ where m.section_id = :section_id) and exists (select 1 from as_item_rels ir where item_rev_id = cr.revision_id and ir.rel_type = 'as_item_display_rel') - and ao.object_id = cr.revision_id + and ao.object_id = ci.item_id and p.person_id = ao.creation_user and ir.item_rev_id = cr.revision_id and ir.target_rev_id = o.object_id @@ -116,7 +122,7 @@ - select i.as_item_id, cr.title, ci.name, p.first_names, p.last_name, + select i.as_item_id, cr.title, i.field_name, p.first_names, p.last_name, o.object_type as item_type from cr_items ci, cr_revisions cr, as_items i, acs_objects ao, persons p, as_item_rels ir, acs_objects o $category_table_clause @@ -125,7 +131,7 @@ and i.as_item_id not in (select m.as_item_id from as_item_section_map m where m.section_id = :section_id) - and ao.object_id = cr.revision_id + and ao.object_id = ci.item_id and p.person_id = ao.creation_user and ir.item_rev_id = cr.revision_id and ir.target_rev_id = o.object_id @@ -151,7 +157,7 @@ and i.section_id not in (select m.section_id from as_assessment_section_map m where m.assessment_id = :assessment_rev_id) - and ao.object_id = cr.revision_id + and ao.object_id = ci.item_id and p.person_id = ao.creation_user $category_where_clause $keyword_where_clause @@ -172,7 +178,7 @@ and i.section_id not in (select m.section_id from as_assessment_section_map m where m.assessment_id = :assessment_rev_id) - and ao.object_id = cr.revision_id + and ao.object_id = ci.item_id and p.person_id = ao.creation_user $page_where_clause $category_where_clause