Index: openacs-4/packages/lorsm/templates/lorsm-default.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/templates/lorsm-default.tcl,v diff -u -r1.7.2.1 -r1.7.2.1.2.1 --- openacs-4/packages/lorsm/templates/lorsm-default.tcl 13 Jun 2005 15:10:56 -0000 1.7.2.1 +++ openacs-4/packages/lorsm/templates/lorsm-default.tcl 22 Nov 2006 12:32:56 -0000 1.7.2.1.2.1 @@ -70,28 +70,15 @@ set package_id [ad_conn package_id] set package_url [apm_package_url_from_id $package_id] - set man_id [db_string get_man_id "select man_id from ims_cp_items i, ims_cp_organizations o where i.ims_item_id = :imsitem_id and i.org_id = o.org_id"] + set man_id [db_string get_man_id {}] - set folder_id [db_string get_folder__id "select folder_id from ims_cp_manifests where man_id = :man_id"] + set folder_id [db_string get_folder_id {}] # We display children - db_1row item_info "select item_title, parent_item from ims_cp_items where ims_item_id = :imsitem_id" + db_1row item_info "" # Selected fields are renamed to avoid conflict with existing variables - db_multirow -extend {href} children children { - select - ims_cp_items.ims_item_id as child_item_id, - ims_cp_items.item_title as child_title - from - acs_objects, - ims_cp_items - where - acs_objects.object_id = ims_cp_items.ims_item_id and - parent_item = :imsitem_id - order by - acs_objects.object_id, - acs_objects.tree_sortkey - } { + db_multirow -extend {href} children children {} { # Let record-view display the page set href ${package_url}delivery/record-view @@ -126,30 +113,15 @@ # See if I'm a leaf node first if { [template::multirow size children] == 0 } { # Now see if I'm a lone leaf node - if { [db_string siblings { - select count(*) - from ims_cp_items - where parent_item = :parent_item}] == 1 } { + if { [db_string siblings {}] == 1 } { # I'm a lone leaf, go to grandparent if it exists # Join to resources just to make sure it exists and # get href while we're at it, might be useful - db_0or1row grandparent { - select - ims_cp_items.parent_item as grandparent_item, - ims_cp_resources.href as grandparent_href - from - ims_cp_items, - ims_cp_resources, - ims_cp_items_to_resources - where - ims_cp_items.ims_item_id = :parent_item and - ims_cp_items.parent_item = ims_cp_items_to_resources.ims_item_id and - ims_cp_items_to_resources.res_id = ims_cp_resources.res_id - } + db_0or1row grandparent {} } } - if { [db_0or1row href "select href as parent_href from ims_cp_resources r, ims_cp_items_to_resources ir where ir.ims_item_id = :parent_item and ir.res_id = r.res_id"] || [info exists grandparent_item] } { + if { [db_0or1row href ""] || [info exists grandparent_item] } { # Let record-view render this page so the child items are # shown set parent_href ${package_url}delivery/record-view Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/lorsm/templates/lorsm-default.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/lorsm/templates/lorsm-no-index-oracle.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/lorsm/templates/lorsm-no-index-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/lorsm/templates/lorsm-no-index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lorsm/templates/lorsm-no-index.tcl,v diff -u -r1.4.2.1 -r1.4.2.1.2.1 --- openacs-4/packages/lorsm/templates/lorsm-no-index.tcl 13 Jun 2005 15:10:56 -0000 1.4.2.1 +++ openacs-4/packages/lorsm/templates/lorsm-no-index.tcl 22 Nov 2006 12:32:56 -0000 1.4.2.1.2.1 @@ -30,32 +30,14 @@ if { [string eq $content(mime_type) "text/html"] && [regexp -nocase {} $text match] } { - if { [db_0or1row get_imsitem_id { - select map.item_id as viewed_item_id, o.man_id - from ims_cp_items_to_resources map, ims_cp_files f, ims_cp_organizations o, ims_cp_items i - where f.file_id = :item_id - and f.res_id = map.res_id - and map.item_id = i.item_id - and i.org_id = o.org_id - }] } { + if { [db_0or1row get_imsitem_id {}] } { # record view set item_list [lorsm::get_item_list $man_id $user_id] set litem_list [llength $item_list] if { ![expr $litem_list - [lsearch -exact $item_list $viewed_item_id] -1] } { # last item, it's a special case - set last_item_viewed [db_string select_last_item_viewed { - select item_id - from views v, - ims_cp_items i, - ims_cp_organizations o - where v.viewer_id = :user_id - and v.object_id = i.item_id - and i.org_id = o.org_id - and o.man_id = :man_id - order by v.last_viewed desc - limit 1 - } -default "no item"] + set last_item_viewed [db_string select_last_item_viewed {} -default "no item"] if { !([lsearch -exact [lrange $item_list [expr $litem_list - 2] $litem_list] $last_item_viewed] != -1) && ![string eq $last_item_viewed "no item"] } { set viewed_item_id [lindex $item_list [expr [lsearch -exact $item_list $viewed_item_id] - 1]] } Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/lorsm/templates/lorsm-no-index.xql'. Fisheye: No comparison available. Pass `N' to diff?