Index: openacs-4/packages/survey/www/admin/question-add-2.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/survey/www/admin/question-add-2.tcl,v
diff -u -r1.4 -r1.5
--- openacs-4/packages/survey/www/admin/question-add-2.tcl 21 Jan 2005 17:24:28 -0000 1.4
+++ openacs-4/packages/survey/www/admin/question-add-2.tcl 6 Nov 2013 07:33:54 -0000 1.5
@@ -29,8 +29,8 @@
}
set package_id [ad_conn package_id]
-set user_id [ad_get_user_id]
-ad_require_permission $package_id survey_create_question
+set user_id [ad_conn user_id]
+permission::require_permission -object_id $package_id -privilege survey_create_question
set question_id [db_nextval acs_object_id_seq]
get_survey_info -section_id $section_id
@@ -63,12 +63,12 @@
# set exception_count 0
# set exception_text ""
-# if { $type != "general" && $type != "scored" } {
+# if { $type ne "general" && $type ne "scored" } {
# incr exception_count
# append exception_text "
Surveys of type $type are not currently available\n"
# }
-# if { $presentation_type == "upload_file" } {
+# if { $presentation_type eq "upload_file" } {
# # incr exception_count
# # append exception_text "
The presentation type: upload file is not supported at this time."
@@ -81,7 +81,7 @@
# Survey-type specific question settings
-if { $type == "scored" } {
+if { $type eq "scored" } {
db_1row count_variable_names ""
@@ -108,9 +108,9 @@
append response_fields "\n"
set response_type_html ""
set presentation_options_html ""
- set form_var_list [export_form_vars section_id question_id question_text presentation_type after required_p active_p type n_variables variable_id_list]
+ set form_var_list [export_vars -form {section_id question_id question_text presentation_type after required_p active_p type n_variables variable_id_list}]
-} elseif { $type == "general" } {
+} elseif { $type eq "general" } {
# Display presentation options for sizing text input fields and textareas.
@@ -178,6 +178,6 @@
ad_form -extend -name create-question-2 -form {
{presentation_alignment:text(radio) {options {{"[_ survey.Beside_the_question]" beside} {"[_ survey.Below_the_question]" below}}} {value below} {label "[_ survey.lt_Presentation_Alignmen]"}}
}
-set context [list [list "one?[export_url_vars survey_id]" $survey_info(name)] "[_ survey.Add_A_Question]"]
+set context [list [list "one?[export_vars -url {survey_id}]" $survey_info(name)] "[_ survey.Add_A_Question]"]
ad_return_template