Index: openacs-4/contrib/packages/survey/www/admin/survey-create.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/survey/www/admin/Attic/survey-create.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/contrib/packages/survey/www/admin/survey-create.tcl 15 Feb 2004 13:56:12 -0000 1.2 +++ openacs-4/contrib/packages/survey/www/admin/survey-create.tcl 13 Jan 2005 13:54:40 -0000 1.3 @@ -17,6 +17,7 @@ {description:html ""} {variable_names ""} {type "general"} + {category_id 0} } set package_id [ad_conn package_id] @@ -34,14 +35,30 @@ survey_id:key {display_type:text(hidden) {value $display_type}} {name:text(text) {label "[_ survey.Survey_Name_1]"} {html {size 55}}} - {description:text(textarea) {label "[_ survey.Description_1]"} {html {rows 10 cols 40}}} + {description:text(textarea) {label "[_ survey.Description_1]"} {html {rows 10 cols 40}} + {help_text "This is used as introductory text before the questions"} {value $description} + } {desc_html:text(radio) {label "[_ survey.lt_The_Above_Description]"} {options {{"[_ survey.Preformatted_Text]" "pre"} {"[_ survey.HTML]" "html"} {"[_ survey.Plain_Text]" "plain"}}} {value "plain"} } {public_p:text(radio) {label "[_ survey.Public]"} {options {{Yes t} {No f}}} {value t}} -} -validate { +} + +if {$category_id} { + set category_name [category::get_name $category_id] + ad_form -extend -name create_survey -form { + {category:text(inform) {label "Associate with element type"} {value $category_name}} + } +} + +ad_form -extend -name create_survey -form { + {category_id:text(hidden) {value $category_id}} +} + +ad_form -extend -name create_survey \ + -validate { {name {[string length $name] <= 4000} "[_ survey.lt_Survey_Name_must_be_4]" } {name {[string length $name] > 0} @@ -85,6 +102,11 @@ # section_id is null to create a new section # we might want to specify a section_id later for # multiple section surveys + # DEDS: look for a category + if {$category_id} { + category::map_object -remove_old -object_id $survey_id [list $category_id] + } + set section_id "" set section_id [db_exec_plsql create_section ""] }