Index: openacs-4/packages/cms/tcl/rel-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/tcl/rel-procs.tcl,v diff -u -r1.4 -r1.4.2.1 --- openacs-4/packages/cms/tcl/rel-procs.tcl 15 Aug 2002 03:39:34 -0000 1.4 +++ openacs-4/packages/cms/tcl/rel-procs.tcl 7 Mar 2003 00:26:39 -0000 1.4.2.1 @@ -1,12 +1,8 @@ - # @namespace cms_rel - # Procedures for managing relation items and child items namespace eval cms_rel {} - - ad_proc -public cms_rel::sort_related_item_order { item_id } { @public sort_related_item_order @@ -24,16 +20,13 @@ db_transaction { # grab all related items ordered by order_n, rel_id - set related_items [db_list srio_get_related_items ""] + set related_items [db_list get_related_items ""] # assign each related items a new order_n set i 0 foreach rel_id $related_items { - db_dml " - update cr_item_rels - set order_n = :i - where rel_id = :rel_id" + db_dml reorder {} incr i } @@ -59,16 +52,13 @@ db_transaction { # grab all related items ordered by order_n, rel_id - set child_items [db_list scio_get_child_order ""] + set child_items [db_list get_child_order ""] # assign each related items a new order_n set i 0 foreach rel_id $child_items { - db_dml " - update cr_child_rels - set order_n = :i - where rel_id = :rel_id" + db_dml reorder {} incr i } Index: openacs-4/packages/cms/tcl/rel-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/cms/tcl/rel-procs.xql,v diff -u -r1.1 -r1.1.4.1 --- openacs-4/packages/cms/tcl/rel-procs.xql 11 Aug 2001 17:41:34 -0000 1.1 +++ openacs-4/packages/cms/tcl/rel-procs.xql 7 Mar 2003 00:26:41 -0000 1.1.4.1 @@ -1,7 +1,7 @@ - + select @@ -16,8 +16,17 @@ + + + + update cr_item_rels + set order_n = :i + where rel_id = :rel_id + + + - + select @@ -32,5 +41,12 @@ + + + update cr_child_rels + set order_n = :i + where rel_id = :rel_id + +