Index: openacs-4/contrib/packages/survey/www/admin/question-swap.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/survey/www/admin/Attic/question-swap.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/contrib/packages/survey/www/admin/question-swap.tcl 19 Sep 2003 16:48:04 -0000 1.1 +++ openacs-4/contrib/packages/survey/www/admin/question-swap.tcl 5 Aug 2005 14:24:06 -0000 1.2 @@ -19,12 +19,13 @@ ad_require_permission $section_id admin +db_transaction { + if { $direction=="up" } { - set next_sort_order [expr { $sort_order - 1 }] + set next_sort_order [db_string next_sort_order_up {}] } else { - set next_sort_order [expr { $sort_order + 1 }] + set next_sort_order [db_string next_sort_order_down {}] } -db_transaction { db_dml swap_sort_orders "" } on_error { Index: openacs-4/contrib/packages/survey/www/admin/question-swap.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/survey/www/admin/Attic/question-swap.xql,v diff -u -r1.2 -r1.3 --- openacs-4/contrib/packages/survey/www/admin/question-swap.xql 13 Jan 2005 13:54:40 -0000 1.2 +++ openacs-4/contrib/packages/survey/www/admin/question-swap.xql 5 Aug 2005 14:24:06 -0000 1.3 @@ -10,5 +10,21 @@ + + +select max(sort_order) +from survey_questions +where section_id = :section_id +and sort_order < :sort_order + + + + + +select min(sort_order) +from survey_questionswhere section_id = :section_id +and sort_order > :sort_order + +