Index: openacs-4/packages/acs-developer-support/lib/toolbar.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-developer-support/lib/toolbar.adp,v diff -u -N -r1.17 -r1.18 --- openacs-4/packages/acs-developer-support/lib/toolbar.adp 10 Sep 2007 08:31:17 -0000 1.17 +++ openacs-4/packages/acs-developer-support/lib/toolbar.adp 7 Oct 2007 22:36:53 -0000 1.18 @@ -19,23 +19,23 @@ |
  • Shell |
  • -
  • APM +
  • APM |
  • -
  • Site Map +
  • Site Map |
  • -
  • Changed +
  • Changed |
  • Flush |
  • Test |
  • -
  • Users +
  • Users |
  • -
  • I18n +
  • I18n |
  • -
  • Docs +
  • Docs |
  • -
  • API doc +
  • API doc |
  • Requests
  • @@ -45,7 +45,7 @@ -
    + Index: openacs-4/packages/acs-developer-support/lib/toolbar.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-developer-support/lib/toolbar.tcl,v diff -u -N -r1.10 -r1.11 --- openacs-4/packages/acs-developer-support/lib/toolbar.tcl 5 Oct 2007 12:02:38 -0000 1.10 +++ openacs-4/packages/acs-developer-support/lib/toolbar.tcl 7 Oct 2007 22:36:53 -0000 1.11 @@ -8,6 +8,7 @@ if { $show_p } { set ds_url [ds_support_url] + set base_url [ad_url] set num_comments [llength [ds_get_comments]] multirow create ds_buttons label title toggle_url state @@ -34,7 +35,7 @@ multirow append ds_buttons TRN \ "Toggle translation mode" \ - [export_vars -base "/acs-lang/admin/translator-mode-toggle" { { return_url [ad_return_url] } }] \ + [export_vars -base "[ad_url]/acs-lang/admin/translator-mode-toggle" { { return_url [ad_return_url] } }] \ [ad_decode [lang::util::translator_mode_p] 1 "on" "off"] multirow append ds_buttons ADP \ @@ -61,7 +62,7 @@ set db_num_cmds [lindex $db_info 0] set db_num_ms [lc_numeric [lindex $db_info 1]] - set flush_url [export_vars -base "/acs-admin/cache/flush-cache" { { suffix util_memoize } { return_url [ad_return_url] } }] + set flush_url [export_vars -base "[ad_url]/acs-admin/cache/flush-cache" { { suffix util_memoize } { return_url [ad_return_url] } }] if { [empty_string_p $page_ms] } { set request_info_label "Request info" @@ -99,7 +100,7 @@ set rm_package_id [apm_package_id_from_key xotcl-request-monitor] if {$rm_package_id > 0} { - set rm_url [apm_package_url_from_id $rm_package_id] + set rm_url "${base_url}[apm_package_url_from_id $rm_package_id]" } else { set rm_url "" } Index: openacs-4/packages/acs-developer-support/tcl/acs-developer-support-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-developer-support/tcl/acs-developer-support-procs.tcl,v diff -u -N -r1.45 -r1.46 --- openacs-4/packages/acs-developer-support/tcl/acs-developer-support-procs.tcl 8 Aug 2006 21:26:12 -0000 1.45 +++ openacs-4/packages/acs-developer-support/tcl/acs-developer-support-procs.tcl 7 Oct 2007 22:36:53 -0000 1.46 @@ -155,7 +155,7 @@ @return A link to the first instance of the developer-support information available in the site node, \ the empty_string if none are available. } { - return [apm_package_url_from_key "acs-developer-support"] + return "[ad_url][apm_package_url_from_key "acs-developer-support"]" } ad_proc ds_link {} { Index: openacs-4/packages/assessment/lib/assessment.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/lib/assessment.tcl,v diff -u -N -r1.19 -r1.20 --- openacs-4/packages/assessment/lib/assessment.tcl 15 May 2007 20:14:15 -0000 1.19 +++ openacs-4/packages/assessment/lib/assessment.tcl 7 Oct 2007 22:36:53 -0000 1.20 @@ -1,5 +1,5 @@ ad_page_contract { -e + This page allows to display an assessment with sections and items @author Eduardo PĂ©rez Ureta (eperez@it.uc3m.es) @@ -34,7 +34,6 @@ if { [info exists return_url] } { set url $return_url -# ns_log notice "$return_url" } set return_url "$url" @@ -66,10 +65,11 @@ db_transaction { if {[empty_string_p $session_id]} { - + # Check if there is an unfinished session lying around set session_id [db_string unfinished_session_id {}] - if {[empty_string_p $session_id]} { + } + if {[empty_string_p $session_id]} { # start new session set session_id [as::session::new -assessment_id $assessment_rev_id -subject_id $user_id -package_id $assessment_package_id] if {[empty_string_p $assessment_data(consent_page)]} { @@ -80,27 +80,25 @@ } } else { # pick up old session - db_1row unfinished_section_order {} - if {[empty_string_p $section_order]} { -# set consent_url [export_vars -base assessment-consent {assessment_id session_id password return_url next_asm single_section_id}] - } else { - db_1row unfinished_section_id {} - db_1row unfinished_item_order {} - if {[empty_string_p $item_order]} { - db_1row unfinished_last_item {} - } - incr section_order -1 - if {$item_order eq ""} { - set item_order 0 + if {$section_order eq ""} { + db_1row unfinished_section_order {} + if {[empty_string_p $section_order]} { + # set consent_url [export_vars -base assessment-consent {assessment_id session_id password return_url next_asm single_section_id}] } else { - incr item_order -1 + db_1row unfinished_section_id {} + db_1row unfinished_item_order {} + if {![empty_string_p $item_order]} { + incr section_order -1 + if {$item_order eq ""} { + set item_order 0 + } else { + incr item_order -1 + } } + } + } } - } else { - # set time the subject initiated the assessment, if not already done - db_dml session_start {} - } if {![info exists consent_url]} { db_1row session_time {} @@ -149,7 +147,6 @@ } as::section_data::new -section_id $section_id -session_id $session_id -subject_id $user_id -package_id $assessment_package_id -# ns_log notice "Assessment section_id='${section_id}' session_id='${session_id}' assessnent='${assessment_rev_id}'" db_1row section_data {} -column_array section set display_type_id $section(display_type_id) if {![empty_string_p $display_type_id]} { @@ -192,7 +189,6 @@ if { ![exists_and_not_null item_order] } { set item_order 0 } # add 1 because we want to compare the 1 indexed display number # to the current page -# ns_log notice "page_display_per_page = '${page_display_per_page}'" set current_page [expr {$item_order == 0 ? 0 : $item_order / $page_display_per_page + 1}] # strip away items on previous section pages @@ -356,17 +352,14 @@ set default_value "" set submitted_p f -# ns_log notice "ASSESSMENT.TCL display(submit_answer_p)='${display(submit_answer_p)}'" if {$display(submit_answer_p) != "t"} { -# ns_log notice "ASSESSMENT.TCL NO seperate submit" # no seperate submit of each item if {$assessment_data(reuse_responses_p) == "t"} { set default_value [as::item_data::get -subject_id $user_id -as_item_id $as_item_id] } set presentation_type [as::item_form::add_item_to_form -name show_item_form -session_id $session_id -section_id $section_id -item_id $as_item_id -default_value $default_value -required_p $required_p -random_p $assessment_data(random_p)] } else { -# ns_log notice "ASSESSMENT.TCL YES seperate submit" # submit each item seperately set default_value [as::item_data::get -subject_id $user_id -as_item_id $as_item_id -session_id $session_id] if {![empty_string_p $default_value]} { @@ -397,7 +390,6 @@ set on_submit "{ db_transaction { db_dml session_updated {} - # save answer set response_item_id \$item_id @@ -477,8 +469,11 @@ set on_submit "{ db_transaction { - db_dml session_updated {} + \# check if we already submitted this section! + if {\[db_string count_submitted_session \"select count(*) from as_section_data where session_id = :session_id and section_id = :section_id and completed_datetime is not null\" -default 0\] == 0} { +\# ad_return_complaint 1 \"Double click detected\" + db_dml session_updated {} # save answers foreach one_response \$item_list { util_unlist \$one_response response_item_id @@ -504,6 +499,7 @@ as::item_type_\$item_type\\::process -type_id \$item_type_id -session_id \$session_id -as_item_id \$response_item_id -section_id \$section_id -subject_id \$user_id -response \$response -max_points \$points -allow_overwrite_p \$display(back_button_p) -package_id \$assessment_package_id } + } if {\$section_order != \$new_section_order} { # calculate section points at end of section as::section::calculate -section_id \$section_id -assessment_id \$assessment_rev_id -session_id \$session_id @@ -520,7 +516,10 @@ }" set after_submit "{ - if {!\[empty_string_p \$new_section_order\]} { +\# NOTE the code just incrementes section order so when the section order +\# is greate than the number of items in the list of sections +\# we know we are done and should finish the assessment + if {!\[empty_string_p \$new_section_order\] && \$new_section_order <= \[llength \$section_list\]} { # go to next section if { \$section_to != \"\"} { set section_order \$section_to @@ -529,7 +528,7 @@ } set item_order \$new_item_order \# ad_returnredirect \[export_vars -base assessment {assessment_id session_id section_order item_order password return_url next_asm section_id item_id_list:multiple single_section_id}\] - ad_returnredirect \[export_vars -base feedback {assessment_id session_id section_order item_order password return_url next_asm section_id item_id_list:multiple nxt_url total_pages current_page}\] + ad_returnredirect \[export_vars -base feedback {assessment_id session_id section_order item_order password return_url next_asm section_id item_id_list:multiple next_url total_pages current_page}\] ad_script_abort } else { # calculate session points at end of session @@ -614,5 +613,6 @@ set form_is_submit [template::form::is_submission show_item_form] set form_is_valid [template::form::is_valid show_item_form] + ad_return_template $template Index: openacs-4/packages/assessment/lib/session-items.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/lib/session-items.adp,v diff -u -N -r1.13 -r1.14 --- openacs-4/packages/assessment/lib/session-items.adp 15 May 2007 20:14:16 -0000 1.13 +++ openacs-4/packages/assessment/lib/session-items.adp 7 Oct 2007 22:36:53 -0000 1.14 @@ -12,7 +12,6 @@ -
    Index: openacs-4/packages/assessment/www/asm-admin/item-add.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/item-add.tcl,v diff -u -N -r1.14 -r1.15 --- openacs-4/packages/assessment/www/asm-admin/item-add.tcl 15 May 2007 20:14:17 -0000 1.14 +++ openacs-4/packages/assessment/www/asm-admin/item-add.tcl 7 Oct 2007 22:36:54 -0000 1.15 @@ -21,6 +21,7 @@ # Get the assessment data as::assessment::data -assessment_id $assessment_id +set folder_id [as::assessment::folder_id -package_id $package_id] if {![info exists assessment_data(assessment_id)]} { ad_return_complaint 1 "[_ assessment.Requested_assess_does]" ad_script_abort @@ -39,12 +40,7 @@ #} set item_types [as_item_type::get_item_types] -ns_log notice " -DB -------------------------------------------------------------------------------- -DB DAVE debugging /var/lib/aolserver/openacs-5-3/packages/assessment/www/asm-admin/item-add.tcl -DB -------------------------------------------------------------------------------- -DB item_types = '${item_types}' -DB --------------------------------------------------------------------------------" + ad_form -name item-add -action item-add -export { assessment_id section_id after type } -html {enctype multipart/form-data} -form { {as_item_id:key} {question_text:richtext,nospell {label "[_ assessment.item_Question]"} {html {rows 12 cols 80 style {width: 99%}}} {help_text "[_ assessment.item_Question_help]"}} @@ -116,12 +112,24 @@ ############################################################################## # Multiple Choice Section ############################################################################## +set choice_sets [db_list_of_lists existing_choice_sets {}] +if {[llength $choice_sets]} { + set choice_sets [concat [list [list "--" ""]] $choice_sets] + ad_form -extend -name item-add -form { + {add_existing_mc_id:text(select),optional {label "[_ assessment.Choice_Sets]"} {options $choice_sets} {help_text "[_ assessment.Choice_Sets_help]"}} + } +} else { + ad_form -extend -name item-add -form { + {add_existing_mc_id:text(hidden),optional} + } +} ad_form -extend -name item-add -form { - {add_another_choice:text(submit) {label "[_ assessment.Add_another_choice]"}} + {save_answer_set:text(checkbox),optional {label "[_ assessment.Save_this_set_of_answers_for_reuse_later]"} {options {{"" t}}}} + {formbutton_add_another_choice:text(submit) {label "[_ assessment.Add_another_choice]"}} } if {[template::form::is_submission item-add] \ - && [template::element::get_value item-add add_another_choice] \ + && [template::element::get_value item-add formbutton_add_another_choice] \ eq [_ assessment.Add_another_choice]} { set num_choices [element::get_value item-add num_choices] incr num_choices @@ -156,7 +164,7 @@ } ad_form -extend -name item-add -validate { - {item_type {$item_type ne "mc" || [array size choice] > [llength [lsearch -all -exact [array get choice] ""]]} "Please enter at least one choice for multiple choice question."} + {item_type {$item_type ne "mc" || [exists_and_not_null add_existing_mc_id] || [array size choice] > [llength [lsearch -all -exact [array get choice] ""]]} "Please enter at least one choice for multiple choice question."} } ad_form -extend -name item-add -new_request { set name "" @@ -177,7 +185,6 @@ set points 0 } - if {![exists_and_not_null formbutton_add_another_choice]} { # map display types to data types switch -exact $item_type { @@ -263,24 +270,42 @@ return } - set folder_id [as::assessment::folder_id -package_id $package_id] set content_rev_id [cr_import_content -title $filename $folder_id $tmp_filename $n_bytes $file_mimetype [as::item::generate_unique_name]] as::item_rels::new -item_rev_id $as_item_id -target_rev_id $content_rev_id -type as_item_content_rel } # check question type set title [string range $question_text 0 999] switch -exact $item_type { mc { - as::item_type_mc::add_to_assessment \ - -assessment_id $assessment_id \ - -section_id $section_id \ - -as_item_id $as_item_id \ - -choices [array get choice] \ - -correct_choices [array get correct] \ - -after $after \ - -title $title\ - -display_type $display_type - } + # title for MC is the name of a saved answer set + # always set to empty on a new question and + # ask for the title seperately in save-answer-set page + set new_mc_id [as::item_type_mc::add_to_assessment \ + -assessment_id $assessment_id \ + -section_id $section_id \ + -as_item_id $as_item_id \ + -choices [array get choice] \ + -correct_choices [array get correct] \ + -after $after \ + -title "" \ + -display_type $display_type] + + if {[info exists add_existing_mc_id] && $add_existing_mc_id ne ""} { + set add_existing_mc_id [as::item_type_mc::copy -type_id $add_existing_mc_id -copy_correct_answer_p "f" -new_title ""] + if {![db_0or1row item_type {}] || $object_type != "as_item_type_mc"} { + if {![info exists object_type]} { + # first item type mapped + as::item_rels::new -item_rev_id $as_item_id -target_rev_id $add_existing_mc_id -type as_item_type_rel + } else { + # old item type existing + db_dml update_item_type {} + } + } else { + # old mc item type existing + db_dml update_item_type {} + } + } + } oq { as::item_type_oq::add_to_assessment \ -assessment_id $assessment_id \ @@ -311,13 +336,18 @@ } -after_submit { if {![exists_and_not_null formbutton_add_another_question] \ && ![exists_and_not_null formbutton_add_another_choice]} { - ad_returnredirect "[export_vars -base questions {assessment_id}]\&#Q$as_item_id" - - ad_script_abort + set return_url "[export_vars -base questions {assessment_id}]\&#Q$as_item_id" } elseif {[exists_and_not_null formbutton_add_another_question]} { set after [expr {$after + 1}] - ad_returnredirect "[export_vars -base item-add {after assessment_id section_id}]\#Q$as_item_id" + set return_url "[export_vars -base item-add {after assessment_id section_id}]\#Q$as_item_id" } + if {[info exists return_url] && $return_url ne ""} { + if {[info exists save_answer_set] && $save_answer_set eq "on" && (![info exists add_existing_mc_id] || $add_existing_mc_id eq "")} { + set return_url [export_vars -base save-answer-set {assessment_id as_item_id return_url {mc_id $new_mc_id}}] + } + ad_returnredirect $return_url + ad_script_abort + } } Index: openacs-4/packages/assessment/www/asm-admin/item-add.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/item-add.xql,v diff -u -N -r1.2 -r1.3 --- openacs-4/packages/assessment/www/asm-admin/item-add.xql 15 Apr 2005 17:26:46 -0000 1.2 +++ openacs-4/packages/assessment/www/asm-admin/item-add.xql 7 Oct 2007 22:36:54 -0000 1.3 @@ -30,4 +30,40 @@ + + + + select distinct title, revision_id from (select substr(title,1,50) as title, revision_id + from cr_items i, cr_revisions r + where + i.parent_id = :folder_id + and r.title is not NULL + and r.revision_id = i.latest_revision + and i.content_type = 'as_item_type_mc') c + + + + + + + select r.target_rev_id as as_item_type_id, o.object_type + from as_item_rels r, acs_objects o + where r.item_rev_id = :as_item_id + and r.rel_type = 'as_item_type_rel' + and o.object_id = r.target_rev_id + + + + + + + + update as_item_rels + set target_rev_id = :add_existing_mc_id + where item_rev_id = :as_item_id + and rel_type = 'as_item_type_rel' + + + + Index: openacs-4/packages/assessment/www/asm-admin/item-edit-general.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/item-edit-general.adp,v diff -u -N -r1.3 -r1.4 --- openacs-4/packages/assessment/www/asm-admin/item-edit-general.adp 15 May 2007 20:14:18 -0000 1.3 +++ openacs-4/packages/assessment/www/asm-admin/item-edit-general.adp 7 Oct 2007 22:36:54 -0000 1.4 @@ -41,9 +41,7 @@ - -
    - + @@ -193,8 +191,28 @@ -
    +
    + + +
    +
    + + + + + + + + + @formerror.data_type;noquote@ + + +

    + + + + @@ -218,11 +236,15 @@
    - +
    +
    +

    #assessment.OrUseChoices#
    + +

    Index: openacs-4/packages/assessment/www/asm-admin/item-edit-general.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/item-edit-general.tcl,v diff -u -N -r1.16 -r1.17 --- openacs-4/packages/assessment/www/asm-admin/item-edit-general.tcl 15 May 2007 20:14:18 -0000 1.16 +++ openacs-4/packages/assessment/www/asm-admin/item-edit-general.tcl 7 Oct 2007 22:36:54 -0000 1.17 @@ -36,21 +36,33 @@ set boolean_options [list [list "[_ assessment.yes]" t] [list "[_ assessment.no]" f]] set type $assessment_data(type) +ad_form -name item_edit_general -action item-edit-general -export { assessment_id section_id } -html {enctype multipart/form-data} -form { + {as_item_id:key} + {question_text:richtext,nospell {label "[_ assessment.Question]"} {html {rows 12 cols 80 style {width: 95%}}} {help_text "[_ assessment.item_Question_help]"}} + {required_p:text(select) {label "[_ assessment.Required]"} {options $boolean_options} {help_text "[_ assessment.item_Required_help]"}} +} + set item_type [string range [db_string get_item_type {}] end-1 end] set display_type [string range [db_string get_display_type {}] end-1 end] +if { $item_type == "mc" } { + ad_form -extend -name item_edit_general -form { + {display_type:text(radio),optional + {label "[_ assessment.singleanswermultipleanswer]"} + {options {{"[_ assessment.item_type_mc]" "rb"} {"[_ assessment.item_type_ms]" "cb"}}} + } + } +} else { + ad_form -extend -name item_edit_general -form { + {display_type:text(hidden),optional} + } +} + set display_types [list] foreach display_type [db_list display_types {}] { lappend display_types [list "[_ assessment.item_display_$display_type]" $display_type] } - -ad_form -name item_edit_general -action item-edit-general -export { assessment_id section_id } -html {enctype multipart/form-data} -form { - {as_item_id:key} - {question_text:richtext,nospell {label "[_ assessment.Question]"} {html {rows 12 cols 80 style {width: 95%}}} {help_text "[_ assessment.item_Question_help]"}} - {required_p:text(select) {label "[_ assessment.Required]"} {options $boolean_options} {help_text "[_ assessment.item_Required_help]"}} -} - if { $type ne "survey"} { ad_form -extend -name item_edit_general -form { {points:integer,optional,nospell {label "[_ assessment.points_item]"} {html {size 10 maxlength 10}} {help_text "[_ assessment.points_item_help]"}} @@ -73,22 +85,36 @@ {field_code:text(hidden),optional} {validate_block:text(hidden),optional} {data_type:text(hidden),optional} - {display_type:text(hidden),optional} {max_time_to_complete:text(hidden),optional} {formbutton_ok:text(submit) {label "[_ assessment.Save_and_finish]"}} } switch -- $item_type { "mc" { + set folder_id [as::assessment::folder_id -package_id $package_id] + set choice_sets [list [list "--" ""]] +db_foreach existing_choice_sets {} { + set set_title [string trim [regsub {\[.*?\]} [ad_html_to_text $title] {}]] + lappend choice_sets [list [expr {$set_title eq "" ? $section_title : $set_title}] $revision_id] +} +if {[llength $choice_sets]} { ad_form -extend -name item_edit_general -form { + {add_existing_mc_id:text(select),optional {label "[_ assessment.Choice_Sets]"} {options $choice_sets} {help_text "[_ assessment.Choice_Sets_help]"}} + } +} else { + ad_form -extend -name item_edit_general -form { + {add_existing_mc_id:text(hidden),optional} + } +} + ad_form -extend -name item_edit_general -form { {num_choices:text(hidden)} + {save_answer_set:text(checkbox),optional {label "[_ assessment.Save_this_set_of_answers_for_reuse_later]"} {options {{"" t}}}} {add_another_choice:text(submit) {label "[_ assessment.Add_another_choice]"}} } -ns_log notice "Add Another = '[template::element::get_value item_edit_general add_another_choice]'" +ns_log notice "Add Another = '[template::element::get_value item_edit_general add_another_choice]' == '[_ assessment.Add_another_choice]'" if {[template::form::is_submission item_edit_general] \ - && [template::element::get_value item_edit_general add_another_choice] \ - eq [_ assessment.Add_another_choice]} { + && [template::element::get_value item_edit_general add_another_choice] eq [_ assessment.Add_another_choice]} { set num_choices [element::get_value item_edit_general num_choices] incr num_choices element::set_value item_edit_general num_choices $num_choices @@ -150,7 +176,10 @@ set existing_choices [as::item_type_mc::existing_choices $as_item_id] - + if {[llength $existing_choices] && ![info exists num_choices]} { + set num_choices [llength $existing_choices] + template::element::set_value item_edit_general num_choices $num_choices + } if {![template::form::is_submission item_edit_general] \ && ![info exists num_choices]} { set num_choices 5 @@ -206,7 +235,8 @@ set feedback_right [template::util::richtext::create $feedback_right $mime_type] set feedback_wrong [template::util::richtext::create $feedback_wrong $mime_type] # FIXME fill in reference answer - +} -on_request { + set display_type [string range [db_string get_display_type {}] end-1 end] } -on_submit { set category_ids [category::ad_form::get_categories -container_object_id $package_id] if {[empty_string_p $points]} { @@ -290,63 +320,95 @@ -old_section_id $section_id \ -new_section_id $new_section_id \ -new_assessment_rev_id $new_assessment_rev_id + + ns_log notice "HAM : $old_display_type : $display_type **********" + if { ![string match $old_display_type $display_type] } { + as::item_display_${display_type}::set_item_display_type -assessment_id $assessment_id \ + -section_id $section_id \ + -as_item_id $as_item_id + } set title [string range $question_text 0 999] db_dml update_item_in_section {} switch -- $item_type { mc { - set num_answers 0 - set num_correct_answers 0 - foreach c [array names choice] { - if {$choice($c) ne ""} { - incr num_answers - } - } - foreach c [array names correct] { - if {$correct($c) eq "t"} { - incr num_correct_answers - } - } - set new_item_type_id [as::item_type_mc::edit \ - -as_item_type_id $as_item_type_id \ - -title $title \ - -increasing_p f \ - -allow_negative_p f \ - -num_correct_answers $num_correct_answers \ - -num_answers $num_answers] - db_dml update_item_type {} - # edit existing choices - set count 0 - foreach i [lsort [array names choice]] { - if {[string range $i 0 0] != "_" && ![empty_string_p $choice($i)]} { - incr count - set new_choice_id [as::item_choice::new_revision -choice_id $i -mc_id $new_item_type_id] - set title $choice($i) - set correct_answer_p [ad_decode [info exists correct($i)] 0 f t] - db_dml update_title {} - db_dml update_correct_and_sort_order {} - } - } + if {[info exists add_existing_mc_id] && $add_existing_mc_id ne ""} { + set new_item_type_id [as::item_type_mc::copy -type_id $add_existing_mc_id -copy_correct_answer_p "f" -new_title ""] + if {![db_0or1row get_item_type {}] || $object_type != "as_item_type_mc"} { + if {![info exists object_type]} { + # first item type mapped + as::item_rels::new -item_rev_id $as_item_id -target_rev_id $add_existing_mc_id -type as_item_type_rel + } else { + # old item type existing + db_dml update_item_type {} + } + } else { + # old mc item type existing + db_dml update_item_type {} + } + } else { - # add new choices - foreach i [lsort [array names choice]] { - - if {[string range $i 0 0] == "_" && ![empty_string_p $choice($i)]} { - incr count - set new_choice_id [as::item_choice::new -mc_id $new_item_type_id \ - -title $choice($i) \ - -numeric_value "" \ - -text_value "" \ - -content_value "" \ - -feedback_text "" \ - -selected_p "" \ - -correct_answer_p [ad_decode [info exists correct($i)] 0 f t] \ - -sort_order $count \ - -percent_score ""] - } - } + set num_answers 0 + set num_correct_answers 0 + foreach c [array names choice] { + if {$choice($c) ne ""} { + incr num_answers + } + } + foreach c [array names correct] { + if {$correct($c) eq "t"} { + incr num_correct_answers + } + } + # set title to blank for mc answer set + # if they unchecked save for reuse + # we don't ask for a title, if they did check it + # we set it on save-answer-set + # with each revision of the mc we decide if its + # reusable or not + + set new_item_type_id [as::item_type_mc::edit \ + -as_item_type_id $as_item_type_id \ + -title "" \ + -increasing_p f \ + -allow_negative_p f \ + -num_correct_answers $num_correct_answers \ + -num_answers $num_answers] + db_dml update_item_type {} + # edit existing choices + set count 0 + foreach i [lsort [array names choice]] { + if {[string range $i 0 0] != "_" && ![empty_string_p $choice($i)]} { + incr count + set new_choice_id [as::item_choice::new_revision -choice_id $i -mc_id $new_item_type_id] + set title $choice($i) + set correct_answer_p [ad_decode [info exists correct($i)] 0 f t] + + db_dml update_title {} + db_dml update_correct_and_sort_order {} + } + } + + # add new choices + foreach i [lsort [array names choice]] { + + if {[string range $i 0 0] == "_" && ![empty_string_p $choice($i)]} { + incr count + set new_choice_id [as::item_choice::new -mc_id $new_item_type_id \ + -title $choice($i) \ + -numeric_value "" \ + -text_value "" \ + -content_value "" \ + -feedback_text "" \ + -selected_p "" \ + -correct_answer_p [ad_decode [info exists correct($i)] 0 f t] \ + -sort_order $count \ + -percent_score ""] + } + } + } } "oq" { set new_item_type_id [as::item_type_oq::edit \ @@ -386,7 +448,11 @@ } } -after_submit { if {[exists_and_not_null formbutton_ok]} { - ad_returnredirect [export_vars -base "questions" {assessment_id section_id }]&\#${as_item_id} + set return_url [export_vars -base "questions" {assessment_id section_id }]&\#${as_item_id} + if {[info exists save_answer_set] && $save_answer_set eq "on" && (![info exists add_existing_mc_id] || $add_existing_mc_id eq "")} { + set return_url [export_vars -base save-answer-set {assessment_id as_item_id return_url {mc_id $new_item_type_id}}] + } + ad_returnredirect $return_url ad_script_abort } } Index: openacs-4/packages/assessment/www/asm-admin/item-edit-general.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/item-edit-general.xql,v diff -u -N -r1.5 -r1.6 --- openacs-4/packages/assessment/www/asm-admin/item-edit-general.xql 15 May 2007 20:14:18 -0000 1.5 +++ openacs-4/packages/assessment/www/asm-admin/item-edit-general.xql 7 Oct 2007 22:36:54 -0000 1.6 @@ -151,4 +151,41 @@ select sort_order from as_item_choices where choice_id=:n + + + + + select substring(title from 1 for 50) as title, revision_id from (select r.title, r.revision_id, case when m.target_rev_id is not null then 0 else 1 end as sort_key + from cr_items i, cr_revisions r + left join + (select r1.target_rev_id from + as_item_section_map m1, as_item_rels r1, as_assessment_section_map m2, + cr_items i2, cr_items i3, cr_items i4 + where m1.as_item_id = r1.item_rev_id and r1.rel_type = 'as_item_type_rel' + and m1.section_id = m2.section_id + and m2.assessment_id = i2.latest_revision + and m1.as_item_id = i3.latest_revision + and m1.section_id = i4.latest_revision + and i2.item_id = :assessment_id) m + on m.target_rev_id = r.revision_id + where + i.parent_id = :folder_id + and r.revision_id = i.latest_revision + and i.content_type like 'as_item_type_mc') q order by sort_key + + + + + + + select distinct title, revision_id from (select substr(title,1,50) as title, revision_id + from cr_items i, cr_revisions r + where + i.parent_id = :folder_id + and r.title is not NULL + and r.revision_id = i.latest_revision + and i.content_type = 'as_item_type_mc') c + + + Index: openacs-4/packages/assessment/www/asm-admin/item-edit-mc.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/item-edit-mc.tcl,v diff -u -N -r1.10 -r1.11 --- openacs-4/packages/assessment/www/asm-admin/item-edit-mc.tcl 15 May 2007 20:14:18 -0000 1.10 +++ openacs-4/packages/assessment/www/asm-admin/item-edit-mc.tcl 7 Oct 2007 22:36:54 -0000 1.11 @@ -42,7 +42,7 @@ ad_form -name item_edit_mc -action item-edit-mc -export { assessment_id section_id num_choices } -form { {as_item_id:key} - {title:text {label "[_ assessment.Title]"} {html {size 80 maxlength 1000}} {help_text "[_ assessment.mc_Title_help]"}} + {title:text,optional {label "[_ assessment.Title]"} {html {size 80 maxlength 1000}} {help_text "[_ assessment.mc_Title_help]"}} } if {$type > 1} { @@ -142,9 +142,9 @@ as::assessment::check::copy_item_checks -assessment_id \$assessment_id -section_id \$new_section_id -as_item_id \$as_item_id -new_item_id \$new_item_id as::section::update_section_in_assessment\ - -old_section_id $section_id \ - -new_section_id $new_section_id \ - -new_assessment_rev_id $new_assessment_rev_id + -old_section_id \$section_id \ + -new_section_id \$new_section_id \ + -new_assessment_rev_id \$new_assessment_rev_id db_dml update_item_in_section {} db_dml update_item_type {} Index: openacs-4/packages/assessment/www/asm-admin/one-a.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/one-a.adp,v diff -u -N -r1.18 -r1.19 --- openacs-4/packages/assessment/www/asm-admin/one-a.adp 15 May 2007 20:14:18 -0000 1.18 +++ openacs-4/packages/assessment/www/asm-admin/one-a.adp 7 Oct 2007 22:36:54 -0000 1.19 @@ -124,9 +124,3 @@ - - -

    -#assessment.add_section_first# -

    -
    Index: openacs-4/packages/assessment/www/asm-admin/one-a.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/one-a.tcl,v diff -u -N -r1.12 -r1.13 --- openacs-4/packages/assessment/www/asm-admin/one-a.tcl 15 May 2007 20:14:18 -0000 1.12 +++ openacs-4/packages/assessment/www/asm-admin/one-a.tcl 7 Oct 2007 22:36:54 -0000 1.13 @@ -81,7 +81,7 @@ -type assessment_response_notif \ -object_id $assessment_id \ -pretty_name $title \ - -url [export_vars -base one-a {assessment_id reg_p}] ] + -url [ad_return_url] ] db_multirow -extend { section_url } sections assessment_sections {} { if {[empty_string_p $points]} { Index: openacs-4/packages/assessment/www/asm-admin/results-session.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/results-session.adp,v diff -u -N -r1.7 -r1.8 --- openacs-4/packages/assessment/www/asm-admin/results-session.adp 15 May 2007 20:14:18 -0000 1.7 +++ openacs-4/packages/assessment/www/asm-admin/results-session.adp 7 Oct 2007 22:36:54 -0000 1.8 @@ -9,7 +9,7 @@

    @assessment_data.title@

    #acs-subsite.Name#: @first_names@ @last_name@#assessment.anonymous_name# #assessment.Attempt#: @session_attempt@ / @assessment_data.number_tries@ (#assessment.Delete_Attempts#) - #assessment.Percent_Score#: @assessment_score@ + #assessment.Percent_Score#: @percent_score@% #assessment.Started#: @session_start@ #assessment.Finished#: @session_finish@ #assessment.Time_spent#: @session_time@ Index: openacs-4/packages/assessment/www/asm-admin/results-users-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/results-users-oracle.xql,v diff -u -N -r1.1 -r1.2 --- openacs-4/packages/assessment/www/asm-admin/results-users-oracle.xql 6 Dec 2005 14:24:34 -0000 1.1 +++ openacs-4/packages/assessment/www/asm-admin/results-users-oracle.xql 7 Oct 2007 22:36:54 -0000 1.2 @@ -1,21 +1,55 @@ -oracle8.1.6 - - + + + select a.title, + a.user_id, a.first_names, a.last_name, + to_char(cs.completed_datetime, :format) as completed_datetime, + to_char(coalesce(cs.last_mod_datetime, ns.last_mod_datetime), :format) as last_mod_datetime, + coalesce(cs.subject_id, ns.subject_id) as subject_id, + coalesce(cs.session_id, ns.session_id) as session_id, + cs.percent_score, + a.last_name || ', ' || a.first_names as subject_name + + from (select a.assessment_id, cr.title, cr.item_id, cr.revision_id, + u.user_id, u.first_names, u.last_name + + from as_assessments a, cr_revisions cr, cr_items ci, acs_users_all u + where a.assessment_id = cr.revision_id + and cr.revision_id = ci.latest_revision + and ci.parent_id = :folder_id + and u.user_id <> 0 + and exists ( + select 1 from acs_object_party_privilege_map + where object_id = :assessment_id + and party_id = u.user_id + and privilege = 'read')) a + left join (select as_sessions.*, cr.item_id + from as_sessions, cr_revisions cr + where session_id in (select max(session_id) + from as_sessions, acs_objects o + where not completed_datetime is null + and o.object_id = session_id + and o.package_id = :package_id + group by subject_id, assessment_id ) + and revision_id=assessment_id) cs + on (a.user_id = cs.subject_id and a.item_id = cs.item_id) - and s.completed_datetime >= $start_time + left join (select * + from as_sessions + where session_id in (select max(session_id) + from as_sessions, acs_objects o + where completed_datetime is null + and o.object_id = session_id + and o.package_id = :package_id + group by subject_id, assessment_id)) ns + on (a.user_id = ns.subject_id and a.assessment_id = ns.assessment_id) - - + where 1=1 + [list::filter_where_clauses -and -name "results"] - - - - and trunc(s.completed_datetime) <= $end_time - - - - + order by lower(a.title), lower(a.last_name), lower(a.first_names) + + Index: openacs-4/packages/assessment/www/asm-admin/results-users-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/results-users-postgresql.xql,v diff -u -N -r1.2 -r1.3 --- openacs-4/packages/assessment/www/asm-admin/results-users-postgresql.xql 15 May 2007 20:14:18 -0000 1.2 +++ openacs-4/packages/assessment/www/asm-admin/results-users-postgresql.xql 7 Oct 2007 22:36:54 -0000 1.3 @@ -1,22 +1,56 @@ -postgresql7.1 - - + + + select a.title, + a.user_id, a.first_names, a.last_name, + to_char(cs.completed_datetime, :format) as completed_datetime, + to_char(coalesce(cs.last_mod_datetime, ns.last_mod_datetime), :format) as last_mod_datetime, + coalesce(cs.subject_id, ns.subject_id) as subject_id, + coalesce(cs.session_id, ns.session_id) as session_id, + cs.percent_score, + a.last_name || ', ' || a.first_names as subject_name + + from (select a.assessment_id, cr.title, cr.item_id, cr.revision_id, + u.user_id, u.first_names, u.last_name + + from as_assessments a, cr_revisions cr, cr_items ci, acs_users_all u + where a.assessment_id = cr.revision_id + and cr.revision_id = ci.latest_revision + and ci.parent_id = :folder_id + and u.user_id <> 0 + and exists ( + select 1 from acs_object_party_privilege_map + where object_id = :assessment_id + and party_id = u.user_id + and privilege = 'read')) a + left join (select as_sessions.*, cr.item_id + from as_sessions, cr_revisions cr + where session_id in (select max(session_id) + from as_sessions, acs_objects o + where not completed_datetime is null + and o.object_id = session_id + and o.package_id = :package_id + group by subject_id, assessment_id ) + and revision_id=assessment_id) cs + on (a.user_id = cs.subject_id and a.item_id = cs.item_id) - and (s.completed_datetime >= $start_time - or s.completed_datetime is null) - - + left join (select * + from as_sessions + where session_id in (select max(session_id) + from as_sessions, acs_objects o + where completed_datetime is null + and o.object_id = session_id + and o.package_id = :package_id + group by subject_id, assessment_id)) ns + on (a.user_id = ns.subject_id and a.assessment_id = ns.assessment_id) - - + where true - and (date_trunc('day', s.completed_datetime) <= $end_time - or $end_time > now ()) + [list::filter_where_clauses -and -name "results"] - - - + order by lower(a.title), lower(a.last_name), lower(a.first_names) + + Index: openacs-4/packages/assessment/www/asm-admin/results-users.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/results-users.adp,v diff -u -N -r1.5 -r1.6 --- openacs-4/packages/assessment/www/asm-admin/results-users.adp 15 May 2007 20:14:18 -0000 1.5 +++ openacs-4/packages/assessment/www/asm-admin/results-users.adp 7 Oct 2007 22:36:54 -0000 1.6 @@ -4,9 +4,11 @@

    @count_all_users@ users in community, @count_complete@ complete responses, @count_incomplete@ incomplete responses

    +

    #assessment.Responding_Users#

    + Index: openacs-4/packages/assessment/www/asm-admin/results-users.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/results-users.tcl,v diff -u -N -r1.10 -r1.11 --- openacs-4/packages/assessment/www/asm-admin/results-users.tcl 15 May 2007 20:14:18 -0000 1.10 +++ openacs-4/packages/assessment/www/asm-admin/results-users.tcl 7 Oct 2007 22:36:54 -0000 1.11 @@ -8,6 +8,7 @@ assessment_id {start_time:optional ""} {end_time:optional ""} + status:optional,notnull } -properties { context:onevalue page_title:onevalue @@ -21,13 +22,15 @@ # Get the assessment data as::assessment::data -assessment_id $assessment_id +set package_id [ad_conn package_id] +set folder_id [as::assessment::folder_id -package_id $package_id] if {![info exists assessment_data(assessment_id)]} { ad_return_complaint 1 "[_ assessment.Requested_assess_does]" ad_script_abort } set user_id [ad_conn user_id] -set assessment_rev_id $assessment_data(assessment_rev_id) + set page_title "[_ assessment.Results_by_user]" set context [list [list index [_ assessment.admin]] [list [export_vars -base one-a {assessment_id}] $assessment_data(title)] $page_title] set format "[lc_get formbuilder_date_format], [lc_get formbuilder_time_format]" @@ -53,19 +56,31 @@ regsub -all -- {to_date} $end_time {to_timestamp} end_time } + if {![empty_string_p $start_time]} { set start_date_sql [db_map restrict_start_date] } if {![empty_string_p $end_time]} { set end_date_sql [db_map restrict_end_date] } - #ad_returnredirect [export_vars -base results-users {assessment_id start_time end_time}] } +if { [exists_and_not_null status] } { + if { $status == "complete" } { + set whereclause "cs.completed_datetime is not null" + } elseif { $status == "incomplete" } { + set whereclause "cs.completed_datetime is null and ns.session_id is not null" + } else { + set whereclause "cs.completed_datetime is null and ns.session_id is null" + } +} else { + set whereclause "cs.completed_datetime is null and ns.session_id is null" +} + template::list::create \ -name results \ -multirow results \ - -key sessions_id \ + -key session_id \ -elements { session_id { label {[_ assessment.View_Results]} @@ -75,7 +90,7 @@ label {[_ assessment.Name]} } status { - label {#assessment.Status#} + label {\#assessment.Status\#} } completed_datetime { label {[_ assessment.Finish_Time]} @@ -86,19 +101,30 @@ html {align right nowrap} display_template {@results.percent_score@} } - delete { - label {} - display_template {[_ assessment.Delete_Attempts]} - } - } -main_class { - narrow - } + } -filters { + assessment_id { + where_clause { + a.item_id = :assessment_id + } + } + subject_id { + where_clause { + cs.subject_id = :subject_id + } + } + status { + values {{"[_ assessment.Complete]" complete} {"[_ assessment.Incomplete]" incomplete} {"[_ assessment.Not_Taken]" nottaken}} + where_clause { + $whereclause + } + } + } -bulk_actions {"#assessment.Send_Email#" send-mail "#assessment.Send_an_email_to_the_selected users#"} \ + -bulk_action_export_vars {assessment_id} template::multirow create subjects subject_id subject_url subject_name -db_multirow -extend { result_url subject_url status delete_url } results assessment_results { -} { +db_multirow -extend { result_url subject_url status delete_url } results assessment_results {} { # to display list of users who answered the assessment if anonymous template::multirow append subjects $subject_id [acs_community_member_url -user_id $subject_id] $subject_name @@ -133,15 +159,13 @@ } } -# FIXME -set dotlrn_installed_p [apm_package_installed_p dotlrn] -if {$dotlrn_installed_p} { - set count_all_users [llength [dotlrn_community::list_users [dotlrn_community::get_community_id]]] -} else { - # TODO get count from subsite - set count_all_users 0 -} - +set count_all_users [db_string q "select count(*) from users u + where u.user_id <> 0 + and exists (select 1 + from acs_object_party_privilege_map + where party_id = u.user_id + and object_id = :assessment_id + and privilege = 'read')" -default 0] set count_complete [template::multirow size subjects] set count_incomplete [expr {$count_all_users - $count_complete}] ad_return_template Index: openacs-4/packages/assessment/www/asm-admin/results-users.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/results-users.xql,v diff -u -N -r1.3 -r1.4 --- openacs-4/packages/assessment/www/asm-admin/results-users.xql 15 May 2007 20:14:18 -0000 1.3 +++ openacs-4/packages/assessment/www/asm-admin/results-users.xql 7 Oct 2007 22:36:54 -0000 1.4 @@ -1,7 +1,7 @@ - + select s.session_id, s.subject_id, s.percent_score, to_char(s.completed_datetime, :format) as completed_datetime, @@ -21,4 +21,5 @@ order by s.completed_datetime + Index: openacs-4/packages/assessment/www/asm-admin/save-answer-set.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/save-answer-set.adp,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/assessment/www/asm-admin/save-answer-set.adp 7 Oct 2007 22:36:54 -0000 1.2 @@ -0,0 +1,4 @@ + +@page_title;noquote@ +@context;noquote@ + \ No newline at end of file Index: openacs-4/packages/assessment/www/asm-admin/save-answer-set.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/save-answer-set.tcl,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/assessment/www/asm-admin/save-answer-set.tcl 7 Oct 2007 22:36:54 -0000 1.2 @@ -0,0 +1,48 @@ +ad_page_contract { + Form to add the choice data of a multiple choice item. + + @author Timo Hentschel (timo@timohentschel.de) + @cvs-id $Id: +} { + assessment_id:integer + as_item_id:integer + mc_id:integer + return_url +} -properties { + context:onevalue + page_title:onevalue +} + +set package_id [ad_conn package_id] +permission::require_permission -object_id $package_id -privilege create +permission::require_permission -object_id $assessment_id -privilege admin + +# Get the assessment data +as::assessment::data -assessment_id $assessment_id + +if {![info exists assessment_data(assessment_id)]} { + ad_return_complaint 1 "[_ assessment.Requested_assess_does]" + ad_script_abort +} + +set package_id [ad_conn package_id] +set type $assessment_data(type) +set page_title [_ assessment.Save_answer_set] +set context [list [list index [_ assessment.admin]] [list [export_vars -base one-a {assessment_id}] $assessment_data(title)] $page_title] + + + +set selected_options [list [list "[_ assessment.yes]" t]] + +ad_form -name save-answer-set -export { assessment_id as_item_id mc_id return_url } -form { + {answer_set_title:text {label "[_ assessment.Title]"} {help_text "[_ assessment.answer_set_title_help_text]"} {html {size 60}}} +} -on_submit { + # update mc title + db_dml update_mc_title "" +} -after_submit { + # now go to display-type specific form (i.e. textbox) + ad_returnredirect $return_url + ad_script_abort +} + +ad_return_template Index: openacs-4/packages/assessment/www/asm-admin/save-answer-set.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/save-answer-set.xql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/assessment/www/asm-admin/save-answer-set.xql 7 Oct 2007 22:36:54 -0000 1.2 @@ -0,0 +1,9 @@ + + + + + + update cr_revisions set title=:answer_set_title where revision_id = :mc_id + + + \ No newline at end of file Index: openacs-4/packages/assessment/www/asm-admin/section-form.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/section-form.tcl,v diff -u -N -r1.7 -r1.8 --- openacs-4/packages/assessment/www/asm-admin/section-form.tcl 15 May 2007 20:14:18 -0000 1.7 +++ openacs-4/packages/assessment/www/asm-admin/section-form.tcl 7 Oct 2007 22:36:54 -0000 1.8 @@ -124,7 +124,7 @@ } } } -after_submit { - ad_returnredirect [export_vars -base questions {assessment_id}] + ad_returnredirect [export_vars -base questions {assessment_id}]&\#S${new_section_id} ad_script_abort } Index: openacs-4/packages/assessment/www/asm-admin/send-mail-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/send-mail-oracle.xql,v diff -u -N -r1.1 -r1.2 --- openacs-4/packages/assessment/www/asm-admin/send-mail-oracle.xql 1 Feb 2005 22:00:10 -0000 1.1 +++ openacs-4/packages/assessment/www/asm-admin/send-mail-oracle.xql 7 Oct 2007 22:36:54 -0000 1.2 @@ -2,45 +2,51 @@ oracle8.1.6 - + + select '[db_quote $sender_email]' as from_addr, '[db_quote $sender_first_names]' as sender_first_names, '[db_quote $sender_last_name]' as sender_last_name, parties.email, - decode(acs_objects.object_type, - 'user', - (select first_names - from persons - where person_id = parties.party_id), - 'group', - (select group_name - from groups - where group_id = parties.party_id), - 'rel_segment', - (select segment_name - from rel_segments - where segment_id = parties.party_id), - '') as first_names, - decode(acs_objects.object_type, - 'user', - (select last_name - from persons - where person_id = parties.party_id), - '') as last_name, - '[db_quote $community_name]' as community_name, - '[db_quote $community_url]' as community_url - from party_approved_member_map, + decode(acs_objects.object_type, + 'user', + (select first_names + from persons + where person_id = parties.party_id), + 'group', + (select group_name + from groups + where group_id = parties.party_id), + 'rel_segment', + (select segment_name + from rel_segments + where segment_id = parties.party_id), + '') as first_names, + decode(acs_objects.object_type, + 'user', + (select last_name + from persons + where person_id = parties.party_id), + '') as last_name + from parties, - acs_objects - where party_approved_member_map.party_id = $segment_id - and party_approved_member_map.member_id <> $segment_id - and party_approved_member_map.member_id = parties.party_id + acs_objects, + users + where + parties.party_id <> 0 + and parties.party_id = users.user_id and parties.party_id = acs_objects.object_id + and exists (select 1 from acs_object_party_privilege_map m + where m.object_id = $assessment_id + and m.party_id = parties.party_id + and m.privilege = 'read') + + - + select '[db_quote $sender_email]' as from_addr, '[db_quote $sender_first_names]' as sender_first_names, @@ -65,15 +71,13 @@ (select last_name from persons where person_id = parties.party_id), - '') as last_name, - '[db_quote $community_name]' as community_name, - '[db-quote $community_url]' as community_url - from party_approved_member_map, + '') as last_name + from parties, - acs_objects - where party_approved_member_map.party_id = $segment_id - and party_approved_member_map.member_id <> $segment_id - and party_approved_member_map.member_id = parties.party_id + acs_objects, + users + where + parties.party_id = users.user_id and parties.party_id = acs_objects.object_id and parties.party_id in ( select s.subject_id @@ -84,7 +88,7 @@ - + select '[db_quote $sender_email]' as from_addr, '[db_quote $sender_first_names]' as sender_first_names, @@ -109,22 +113,25 @@ (select last_name from persons where person_id = parties.party_id), - '') as last_name, - '[db_quote $community_name]' as community_name, - '[db_quote $community_url]' as community_url - from party_approved_member_map, + '') as last_name + from parties, - acs_objects - where party_approved_member_map.party_id = $segment_id - and party_approved_member_map.member_id <> $segment_id - and party_approved_member_map.member_id = parties.party_id + acs_objects, + users + where + parties.party_id <> 0 + and parties.party_id = users.user_id and parties.party_id = acs_objects.object_id and parties.party_id not in ( select s.subject_id from as_sessions s, cr_revisions r where s.assessment_id = r.revision_id and s.completed_datetime is not null and r.item_id = $assessment_id) + and exists (select 1 from acs_object_party_privilege_map m + where m.object_id = $assessment_id + and m.party_id = parties.party_id + and m.privilege = 'read') @@ -133,10 +140,10 @@ select '[db_quote $sender_email]' as from_addr, '[db_quote $sender_first_names]' as sender_first_names, '[db_quote $sender_last_name]' as sender_last_name, - parties.email, + parties.email from parties - where parties.party_id = acs_objects.object_id - and parties.party_id in ( + where + parties.party_id in ( select s.subject_id from as_sessions s, cr_revisions r where s.assessment_id = r.revision_id @@ -145,4 +152,15 @@ - \ No newline at end of file + + + select '[db_quote $sender_email]' as from_addr, + '[db_quote $sender_first_names]' as sender_first_names, + '[db_quote $sender_last_name]' as sender_last_name, + parties.email + from parties + where + parties.party_id in ([template::util::tcl_to_sql_list $user_ids]) + + + Index: openacs-4/packages/assessment/www/asm-admin/send-mail-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/send-mail-postgresql.xql,v diff -u -N -r1.1 -r1.2 --- openacs-4/packages/assessment/www/asm-admin/send-mail-postgresql.xql 1 Feb 2005 22:00:10 -0000 1.1 +++ openacs-4/packages/assessment/www/asm-admin/send-mail-postgresql.xql 7 Oct 2007 22:36:54 -0000 1.2 @@ -3,7 +3,7 @@ postgresql7.1 - + select '[db_quote $sender_email]' as from_addr, '[db_quote $sender_first_names]' as sender_first_names, @@ -28,20 +28,23 @@ (select last_name from persons where person_id = parties.party_id) - else '' end) as last_name, - '[db_quote $community_name]' as community_name, - '[db_quote $community_url]' as community_url - from party_approved_member_map, + else '' end) as last_name + from parties, - acs_objects - where party_approved_member_map.party_id = $segment_id - and party_approved_member_map.member_id <> $segment_id - and party_approved_member_map.member_id = parties.party_id + acs_objects, + users + where + parties.party_id <> 0 + and parties.party_id = users.user_id and parties.party_id = acs_objects.object_id + and exists (select 1 from acs_object_party_privilege_map m + where m.object_id = $assessment_id + and m.party_id = parties.party_id + and m.privilege = 'read') - + select '[db_quote $sender_email]' as from_addr, '[db_quote $sender_first_names]' as sender_first_names, @@ -66,15 +69,13 @@ (select last_name from persons where person_id = parties.party_id) - else '' end) as last_name, - '[db_quote $community_name]' as community_name, - '[db_quote $community_url]' as community_url - from party_approved_member_map, + else '' end) as last_name + from parties, - acs_objects - where party_approved_member_map.party_id = $segment_id - and party_approved_member_map.member_id <> $segment_id - and party_approved_member_map.member_id = parties.party_id + acs_objects, + users + where + parties.party_id = users.user_id and parties.party_id = acs_objects.object_id and parties.party_id in ( select s.subject_id @@ -85,7 +86,7 @@ - + select '[db_quote $sender_email]' as from_addr, '[db_quote $sender_first_names]' as sender_first_names, @@ -113,19 +114,24 @@ else '' end) as last_name, '[db_quote $community_name]' as community_name, '[db_quote $community_url]' as community_url - from party_approved_member_map, + from parties, - acs_objects - where party_approved_member_map.party_id = $segment_id - and party_approved_member_map.member_id <> $segment_id - and party_approved_member_map.member_id = parties.party_id + acs_objects, + users + where + parties.party_id <> 0 + and parties.party_id = users.user_id and parties.party_id = acs_objects.object_id and parties.party_id not in ( select s.subject_id from as_sessions s, cr_revisions r where s.assessment_id = r.revision_id and s.completed_datetime is not null and r.item_id = $assessment_id) + and exists (select 1 from acs_object_party_privilege_map m + where m.object_id = $assessment_id + and m.party_id = parties.party_id + and m.privilege = 'read') @@ -136,7 +142,8 @@ '[db_quote $sender_last_name]' as sender_last_name, parties.email from parties - where parties.party_id in ( + where + parties.party_id in ( select s.subject_id from as_sessions s, cr_revisions r where s.assessment_id = r.revision_id @@ -145,4 +152,16 @@ + + + select '[db_quote $sender_email]' as from_addr, + '[db_quote $sender_first_names]' as sender_first_names, + '[db_quote $sender_last_name]' as sender_last_name, + parties.email + from parties + where + parties.party_id in ([template::util::tcl_to_sql_list $user_ids]) + + + Index: openacs-4/packages/assessment/www/asm-admin/send-mail.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/send-mail.tcl,v diff -u -N -r1.3 -r1.4 --- openacs-4/packages/assessment/www/asm-admin/send-mail.tcl 8 Apr 2005 00:50:40 -0000 1.3 +++ openacs-4/packages/assessment/www/asm-admin/send-mail.tcl 7 Oct 2007 22:36:54 -0000 1.4 @@ -1,115 +1,123 @@ -ad_page_contract { +# packages/assessment/www/asm-admin/send-mail-to.tcl - this page offers options for sending email regarding - an assessment to various groups - - @param assessment_id +ad_page_contract { - @author dave@thedesignexperience.org - @date July 29, 2002 - @cvs-id $Id: -} { - assessment_id:integer,notnull - {to "responded"} + Choose who to send mail to + + @author Dave Bauer (dave@thedesignexperience.org) + @creation-date 2007-07-06 + @cvs-id $Id$ + +} -query { + {assessment_id ""} + {session_id:multiple ""} + {return_url ""} } -properties { context:onevalue page_title:onevalue } set package_id [ad_conn package_id] set user_id [ad_conn user_id] -set sender_id [ad_conn user_id] -permission::require_permission -object_id $package_id -privilege create -permission::require_permission -object_id $assessment_id -privilege admin +permission::require_permission \ + -privilege "admin" \ + -party_id $user_id \ + -object_id $package_id -# Get the assessment data as::assessment::data -assessment_id $assessment_id - -if {![info exists assessment_data(assessment_id)]} { - ad_return_complaint 1 "[_ assessment.Requested_assess_does]" - ad_script_abort -} - set page_title "[_ assessment.Send_Mail]" set assessment_name $assessment_data(title) set context [list [list index [_ assessment.admin]] [list [export_vars -base one-a {assessment_id}] $assessment_data(title)] $page_title] -db_1row select_sender_info {} -set dotlrn_installed_p [apm_package_installed_p dotlrn] -if {$dotlrn_installed_p} { - set rel_type "dotlrn_member_rel" - set community_id [dotlrn_community::get_community_id] - set segment_id [db_string select_rel_segment_id {}] - set community_name [dotlrn_community::get_community_name $community_id] - set community_url "[ad_parameter -package_id [ad_acs_kernel_id] SystemURL][dotlrn_community::get_community_url $community_id]" +ad_form -name send-mail -has_submit 1 -form { + {subject:text(text) {value $assessment_name} {label "[_ assessment.Message_Subject]"} {html {size 50}}} + {message:text(textarea) {label "[_ assessment.Enter_Message]"} {html {rows 15 cols 60}}} + {assessment_id:text(hidden) {value $assessment_id}} + {formbutton_ok:text(submit) {label "[_ acs-templating.OK]"}} +} +if {[llength $session_id]} { + if {[llength $session_id] == 1} { + set session_id [split [lindex $session_id 0]] + } + set options [db_list_of_lists get_session_user_options "select u.last_name || ', ' || u.first_names,user_id from acs_users_all u, as_sessions s where s.session_id in ([template::util::tcl_to_sql_list $session_id]) and u.user_id = s.subject_id"] + ad_form -extend -name send-mail -form { + {user_ids:text(checkbox) {label "[_ assessment.Send_mail_to_the_selected_users]"} {options $options}} + {session_id:text(hidden) {value $session_id}} + } +} else { set n_responses [db_string n_responses {}] + if {$n_responses > 0} { - ad_form -name send-mail -form { - {to:text(radio) {options { - {"[_ assessment.lt_Everyone_eligible_to_]" "all"} - {"[_ assessment.lt_Everyone_who_has_alre]" "responded"} - {"[_ assessment.lt_Everyone_who_has_not_]" "not_responded"}}} - {label "[_ assessment.Send_mail_to]"} - {value $to} - } - } + ad_form -extend -name send-mail -form { + {to:text(radio) {options { + {"[_ assessment.lt_Everyone_eligible_to_]" "all"} + {"[_ assessment.lt_Everyone_who_has_alre]" "responded"} + {"[_ assessment.lt_Everyone_who_has_not_]" "not_responded"}}} + {label "[_ assessment.Send_mail_to]"} + } + } } else { - ad_form -name send-mail -form { - {to:text(radio) {options { - {"[_ assessment.lt_Everyone_eligible_to_]" "all"} - {"[_ assessment.lt_Everyone_who_has_not_]" "not_responded"}}} - {label "[_ assessment.Send_mail_to]"} - {value $to} - } - } + ad_form -extend -name send-mail -form { + {to:text(radio) {options { + {"[_ assessment.lt_Everyone_eligible_to_]" "all"} + {"[_ assessment.lt_Everyone_who_has_not_]" "not_responded"}}} + {label "[_ assessment.Send_mail_to]"} + {value $to} + } + } } -} else { - ad_form -name send-mail -form { - {to:text(radio) {options { - {"[_ assessment.lt_Everyone_who_has_alre]" "responded"}}} - {label "[_ assessment.Send_mail_to]"} - {value ""} - } - } } -ad_form -extend -name send-mail -form { - {subject:text(text) {value $assessment_name} {label "[_ assessment.Message_Subject]"} {html {size 50}}} - {message:text(textarea) {label "[_ assessment.Enter_Message]"} {html {rows 15 cols 60}}} - {assessment_id:text(hidden) {value $assessment_id}} +ad_form -extend -name send-mail -on_request { + if {[info exists options]} { + set user_ids [list] + foreach elm $options { + lappend user_ids [lindex $elm 1] + } + } } -on_submit { + acs_user::get -user_id $user_id -array sender + set sender_email $sender(email) + set sender_first_names $sender(first_names) + set sender_last_name $sender(last_name) set query "" - if {$dotlrn_installed_p} { + if {[info exists to] && $to ne ""} { switch $to { all { - set query [db_map dotlrn_all] + set query [db_map all] } responded { - set query [db_map dotlrn_responded] + set query [db_map responded] } not_responded { - set query [db_map dotlrn_not_responded] + set query [db_map not_responded] } } + } elseif {[info exists user_ids] && [llength $user_ids]} { + set query [db_map list_of_user_ids] } else { set query [db_map responded] } - + bulk_mail::new \ -package_id $package_id \ -from_addr $sender_email \ -subject $subject \ -message $message \ -query $query - ad_returnredirect [export_vars -base one-a {assessment_id}] + if {$return_url eq ""} { + set return_url [export_vars -base one-a {assessment_id}] + } + set redirect_message "[_ assessment.Mail_subject_sent]" + ad_returnredirect -message $redirect_message $return_url ad_script_abort -} -ad_return_template + +} \ No newline at end of file Index: openacs-4/packages/assessment/www/asm-admin/send-mail.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/send-mail.xql,v diff -u -N -r1.1 -r1.2 --- openacs-4/packages/assessment/www/asm-admin/send-mail.xql 1 Feb 2005 22:00:10 -0000 1.1 +++ openacs-4/packages/assessment/www/asm-admin/send-mail.xql 7 Oct 2007 22:36:54 -0000 1.2 @@ -14,15 +14,6 @@ - - - select rel_segments.segment_id - from rel_segments - where rel_segments.group_id = :community_id - and rel_segments.rel_type = :rel_type - - - select count(*) Index: openacs-4/packages/assessment/www/asm-admin/session-delete.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/session-delete.tcl,v diff -u -N -r1.5 -r1.6 --- openacs-4/packages/assessment/www/asm-admin/session-delete.tcl 15 May 2007 20:14:18 -0000 1.5 +++ openacs-4/packages/assessment/www/asm-admin/session-delete.tcl 7 Oct 2007 22:36:54 -0000 1.6 @@ -9,7 +9,7 @@ permission::require_permission \ -party_id [ad_conn user_id] \ - -object_id [ad_conn package_id] \ + -object_id $assessment_id \ -privilege admin as::assessment::data -assessment_id $assessment_id set assessment_name $assessment_data(name) Index: openacs-4/packages/assessment/www/asm-admin/sessions.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/sessions.adp,v diff -u -N -r1.2 -r1.3 --- openacs-4/packages/assessment/www/asm-admin/sessions.adp 26 Sep 2006 00:22:46 -0000 1.2 +++ openacs-4/packages/assessment/www/asm-admin/sessions.adp 7 Oct 2007 22:36:54 -0000 1.3 @@ -1,5 +1,6 @@ - #assessment.All_Users# + @page_title@ + @context@

    #assessment.lt_Responses_for_assessm#

    #assessment.lt_Responses_of_user_per#

    Index: openacs-4/packages/assessment/www/asm-admin/sessions.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/sessions.tcl,v diff -u -N -r1.3 -r1.4 --- openacs-4/packages/assessment/www/asm-admin/sessions.tcl 15 May 2007 20:14:18 -0000 1.3 +++ openacs-4/packages/assessment/www/asm-admin/sessions.tcl 7 Oct 2007 22:36:54 -0000 1.4 @@ -6,6 +6,7 @@ @author Roel Canicula (roel@solutiongrove.com) @creation-date 2006-06-05 + @arch-tag: cdb2d596-15fc-45ba-9ce1-d648a49a20b7 @cvs-id $Id$ } { @@ -21,16 +22,16 @@ permission::require_permission -object_id $package_id -privilege create set folder_id [as::assessment::folder_id -package_id $package_id] set user_id [ad_conn user_id] - -# hack for dotlrn ideally ad_conn subsite_id would pretend dotlrn was a subsite -if {![apm_package_installed_p dotlrn] \ - || [set members_party_id [dotlrn_community::get_community_id]] eq ""} { - set members_party_id [application_group::group_id_from_package_id \ - -package_id [ad_conn subsite_id]] -} - +set context_object_id $package_id set form [rp_getform] ns_set delkey $form status +set page_title [_ assessment.All_Users] +if {[info exists assessment_id]} { + as::assessment::data -assessment_id $assessment_id + set context [list [list index [_ assessment.admin]] [list [export_vars -base one-a {assessment_id}] $assessment_data(title)] $page_title] +} else { + set context [list [list index [_ assessment.admin]] $page_title] +} set base_url [ad_return_url] set actions [list] @@ -48,11 +49,23 @@ if { [info exists assessment_id] } { as::assessment::data -assessment_id $assessment_id - + set context_object_id $assessment_id set actions [linsert $actions 0 "[_ assessment.All_Assessments]" ? "[_ assessment.All_Assessments]"] lappend actions "[_ assessment.Summary]" [export_vars -base item-stats { assessment_id {return_url [ad_return_url]} }] "[_ assessment.Summary]" } +if { [exists_and_not_null status] } { + if { $status == "complete" } { + set whereclause "cs.completed_datetime is not null" + } elseif { $status == "incomplete" } { + set whereclause "cs.completed_datetime is null and ns.session_id is not null" + } else { + set whereclause "cs.completed_datetime is null and ns.session_id is null" + } +} else { + set whereclause "cs.completed_datetime is null and ns.session_id is null" +} + # Check membership template::list::create \ @@ -120,67 +133,9 @@ status { values {{"[_ assessment.Complete]" complete} {"[_ assessment.Incomplete]" incomplete} {"[_ assessment.Not_Taken]" nottaken}} where_clause { - (case when :status = 'complete' - then not cs.completed_datetime is null - when :status = 'incomplete' - then cs.completed_datetime is null and not ns.session_id is null - else cs.completed_datetime is null and ns.session_id is null end) + $whereclause } } } -db_multirow sessions get_sessions [subst { - select a.*, - to_char(cs.completed_datetime, 'YYYY-MM-DD HH24:MI:SS') as completed_datetime, - to_char(coalesce(cs.last_mod_datetime, ns.last_mod_datetime), 'YYYY-MM-DD HH24:MI:SS') as last_mod_datetime, - coalesce(cs.subject_id, ns.subject_id) as subject_id, - coalesce(cs.session_id, ns.session_id) as session_id, - cs.percent_score - - from (select a.assessment_id, cr.title, cr.item_id, cr.revision_id, - u.user_id, u.first_names, u.last_name - - from as_assessments a, cr_revisions cr, cr_items ci, acs_users_all u, - group_member_map g - - where a.assessment_id = cr.revision_id - and cr.revision_id = ci.latest_revision - and ci.parent_id = :folder_id - - and g.group_id = :members_party_id - and g.member_id = u.user_id - and acs_permission__permission_p(cr.item_id, u.user_id, 'read')) a - - left join (select as_sessions.*, cr.item_id - from as_sessions, cr_revisions cr - where session_id in (select max(session_id) - from as_sessions, acs_objects o - where not completed_datetime is null - and o.object_id = session_id - and o.package_id = :package_id - group by subject_id, assessment_id ) - and revision_id=assessment_id) cs - on (a.user_id = cs.subject_id and a.item_id = cs.item_id) - - left join (select * - from as_sessions - where session_id in (select max(session_id) - from as_sessions, acs_objects o - where completed_datetime is null - and o.object_id = session_id - and o.package_id = :package_id - group by subject_id, assessment_id)) ns - on (a.user_id = ns.subject_id and a.assessment_id = ns.assessment_id) - - where true - [list::filter_where_clauses -and -name "sessions"] - - order by lower(a.title), lower(a.last_name), lower(a.first_names) -}] - - - - - - - +db_multirow sessions get_sessions "" Index: openacs-4/packages/assessment/www/asm-admin/sessions.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/sessions.xql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/assessment/www/asm-admin/sessions.xql 7 Oct 2007 22:36:54 -0000 1.2 @@ -0,0 +1,57 @@ + + + + + + + + + + select a.*, + to_char(cs.completed_datetime, 'YYYY-MM-DD HH24:MI:SS') as completed_datetime, + to_char(coalesce(cs.last_mod_datetime, ns.last_mod_datetime), 'YYYY-MM-DD HH24:MI:SS') as last_mod_datetime, + coalesce(cs.subject_id, ns.subject_id) as subject_id, + coalesce(cs.session_id, ns.session_id) as session_id, + cs.percent_score + + from (select a.assessment_id, cr.title, cr.item_id, cr.revision_id, + u.user_id, u.first_names, u.last_name + + from as_assessments a, cr_revisions cr, cr_items ci, acs_users_all u + where a.assessment_id = cr.revision_id + and cr.revision_id = ci.latest_revision + and ci.parent_id = :folder_id + and u.user_id <> 0 + and exists ( + select 1 from acs_object_party_privilege_map + where object_id = :context_object_id + and party_id = u.user_id + and privilege = 'read')) a + left join (select as_sessions.*, cr.item_id + from as_sessions, cr_revisions cr + where session_id in (select max(session_id) + from as_sessions, acs_objects o + where not completed_datetime is null + and o.object_id = session_id + and o.package_id = :package_id + group by subject_id, assessment_id ) + and revision_id=assessment_id) cs + on (a.user_id = cs.subject_id and a.item_id = cs.item_id) + + left join (select * + from as_sessions + where session_id in (select max(session_id) + from as_sessions, acs_objects o + where completed_datetime is null + and o.object_id = session_id + and o.package_id = :package_id + group by subject_id, assessment_id)) ns + on (a.user_id = ns.subject_id and a.assessment_id = ns.assessment_id) + + where 1=1 + [list::filter_where_clauses -and -name "sessions"] + + order by lower(a.title), lower(a.last_name), lower(a.first_names) + + + \ No newline at end of file Index: openacs-4/packages/assessment/www/asm-admin/toggle-publish.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/toggle-publish.tcl,v diff -u -N -r1.2 -r1.3 --- openacs-4/packages/assessment/www/asm-admin/toggle-publish.tcl 15 May 2007 20:14:18 -0000 1.2 +++ openacs-4/packages/assessment/www/asm-admin/toggle-publish.tcl 7 Oct 2007 22:36:54 -0000 1.3 @@ -2,6 +2,7 @@ Publish or unpublish an assessment } { assessment_id:integer,notnull + {return_url ""} } permission::require_permission \ @@ -26,4 +27,7 @@ set message "Publish failed. Following section(s) have no questions: ${empty_sections}" } -ad_returnredirect -message $message [export_vars -base one-a {assessment_id}] +if {$return_url eq ""} { + set return_url [export_vars -base one-a {assessment_id}] +} +ad_returnredirect -message $message $return_url Index: openacs-4/packages/assessment/www/asm-admin/unzip-file.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/unzip-file.tcl,v diff -u -N -r1.2 -r1.3 --- openacs-4/packages/assessment/www/asm-admin/unzip-file.tcl 26 Sep 2006 00:22:46 -0000 1.2 +++ openacs-4/packages/assessment/www/asm-admin/unzip-file.tcl 7 Oct 2007 22:36:54 -0000 1.3 @@ -12,7 +12,7 @@ permission::require_permission \ -object_id [ad_conn package_id] \ -party_id [ad_conn user_id] \ - -privilege "admin" + -privilege "create" set context [list "[_ assessment.Import_Results]"] Index: openacs-4/packages/assessment/www/asm-admin/export/index.vuh =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/export/index.vuh,v diff -u -N -r1.9 -r1.10 --- openacs-4/packages/assessment/www/asm-admin/export/index.vuh 12 Jun 2006 02:49:52 -0000 1.9 +++ openacs-4/packages/assessment/www/asm-admin/export/index.vuh 7 Oct 2007 22:36:54 -0000 1.10 @@ -384,12 +384,12 @@ $presentation appendChild $response_str #get rows and cols for painting a textarea (in abs_size is stored as "rows value cols value", we need to add the symbol =) db_0or1row html_rows_cols "SELECT html_display_options FROM as_item_display_ta WHERE as_item_display_id=:item_display_id" - if {![empty_string_p $html_display_options]} { - set rows "[lindex $html_display_options 3]" - set columns "[lindex $html_display_options 1]" + if {![catch {array set html_array $html_display_options} errMsg] && [info exists html_array(rows)] && [info exists html_array(cols)]} { + set rows $html_array(rows) + set columns $html_array(cols) } else { - set rows 5 - set columns 25 + set rows 15 + set columns 55 } # set render_fib [$doc createElement render_fib] @@ -473,7 +473,7 @@ # set or [$doc createElement or] $conditionvar appendChild $or - set list_choice_title $choice_title + set list_choice_title [list $choice_title] for {set j 0} {$j < [llength $list_choice_title]} {incr j 1} { # set varequal [$doc createElement varequal] @@ -564,7 +564,8 @@ # set or [$doc createElement or] $and appendChild $or - set list_choice_title $choice_title + set list_choice_title [list $choice_title] + for {set j 0} {$j < [llength $list_choice_title]} {incr j 1} { # set varequal [$doc createElement varequal] @@ -628,7 +629,9 @@ set i 0 # [info exists tb__display_id] because for fib item choice_correct_answer_p is null if { $choice_correct_answer_p == "t" || [info exists tb__display_id] } { - set list_choice_title $choice_title + + set list_choice_title [list $choice_title] + set length_list_choice_title [llength $list_choice_title] if {![info exists tb__display_id]} { Index: openacs-4/packages/assessment-portlet/assessment-portlet.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment-portlet/assessment-portlet.info,v diff -u -N -r1.4 -r1.5 --- openacs-4/packages/assessment-portlet/assessment-portlet.info 15 May 2007 20:14:18 -0000 1.4 +++ openacs-4/packages/assessment-portlet/assessment-portlet.info 7 Oct 2007 22:36:54 -0000 1.5 @@ -7,11 +7,11 @@ f t - + Jose Pablo Escobedo Del Cid - 2007-04-22 + 2007-09-08 - + Index: openacs-4/packages/assessment-portlet/www/assessment-portlet-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment-portlet/www/assessment-portlet-oracle.xql,v diff -u -N -r1.5 -r1.6 --- openacs-4/packages/assessment-portlet/www/assessment-portlet-oracle.xql 15 May 2007 20:14:19 -0000 1.5 +++ openacs-4/packages/assessment-portlet/www/assessment-portlet-oracle.xql 7 Oct 2007 22:36:55 -0000 1.6 @@ -5,13 +5,27 @@ - select cr.item_id as assessment_id, cr.title, cr.description, a.password, + select * from (select cr.item_id as assessment_id, cr.title, cr.description, a.password, to_char(a.start_time, 'YYYY-MM-DD HH24:MI:SS') as start_time, to_char(a.end_time, 'YYYY-MM-DD HH24:MI:SS') as end_time, to_char(sysdate, 'YYYY-MM-DD HH24:MI:SS') as cur_time, cf.package_id, p.instance_name as community_name, - sc.node_id as comm_node_id, sa.node_id as as_node_id, - acs_permission__permission_p(a.assessment_id,:user_id,'admin') as admin_p + sc.node_id as comm_node_id, sa.node_id as as_node_id, a.anonymous_p, + acs_permission.permission_p(a.assessment_id,:user_id,'admin') as admin_p, + (select count(*) from as_sessions s1, + cr_revisions cr1 where + s1.assessment_id=cr1.revision_id + and cr1.item_id=cr.item_id + and s1.subject_id=:user_id + and completed_datetime is null) as in_progress_p, + (select count(*) from as_sessions s1, + cr_revisions cr1 where + s1.assessment_id=cr1.revision_id + and cr1.item_id=cr.item_id + and s1.subject_id=:user_id + and completed_datetime is not null) as completed_p, + a.number_tries + from as_assessments a, cr_revisions cr, cr_items ci, cr_folders cf, site_nodes sa, site_nodes sc, apm_packages p where a.assessment_id = cr.revision_id @@ -31,7 +45,53 @@ and ppm.privilege = 'read' and ppm.party_id = :user_id) order by lower(p.instance_name), lower(cr.title) +) q where (q.completed_p < q.number_tries) or (q.number_tries=0 or q.number_tries is null) + + +select * from (select ass.*, sc.node_id as comm_node_id, sa.node_id as as_node_id, p.instance_name as community_name, +acs_permission.permission_p(ass.assessment_id,:user_id,'admin') as admin_p, + (select count(*) from as_sessions s1, + cr_revisions cr1 where + s1.assessment_id=cr1.revision_id and + cr1.item_id=ass.assessment_id + and s1.subject_id=:user_id + and completed_datetime is null) as in_progress_p, + (select count(*) from as_sessions s1, + cr_revisions cr1 where + s1.assessment_id=cr1.revision_id + and cr1.item_id=ass.assessment_id + and s1.subject_id=:user_id + and completed_datetime is not null) as completed_p + + + from + (select cr.item_id as assessment_id, cr.title, cr.description, cf.package_id, + a1.number_tries, a1.end_time + from as_assessments a, cr_revisions cr, cr_items ci, cr_folders cf, + as_assessments a1, + ( select distinct s.assessment_id + from as_sessions s + where s.subject_id = :user_id + and s.completed_datetime is not null) s + where a.assessment_id = cr.revision_id -- + and cf.package_id in ([join $list_of_package_ids ", "]) + and cr.item_id = ci.item_id + and ci.parent_id = cf.folder_id + and s.assessment_id = a.assessment_id + and a1.assessment_id = ci.latest_revision + ) ass, +site_nodes sa, site_nodes sc, apm_packages p +where sa.object_id = ass.package_id +and sc.node_id = sa.parent_id +and p.package_id = sc.object_id +order by lower(p.instance_name), lower(ass.title) +) q + where (q.number_tries is not null and q.number_tries >0 and q.completed_p >= q.number_tries) or (q.end_time is not null and q.end_time < current_timestamp) + + + + Index: openacs-4/packages/assessment-portlet/www/assessment-portlet-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment-portlet/www/assessment-portlet-postgresql.xql,v diff -u -N -r1.12 -r1.13 --- openacs-4/packages/assessment-portlet/www/assessment-portlet-postgresql.xql 15 May 2007 20:14:19 -0000 1.12 +++ openacs-4/packages/assessment-portlet/www/assessment-portlet-postgresql.xql 7 Oct 2007 22:36:55 -0000 1.13 @@ -51,4 +51,48 @@ + + +select * from (select ass.*, sc.node_id as comm_node_id, sa.node_id as as_node_id, p.instance_name as community_name, +acs_permission__permission_p(ass.assessment_id,:user_id,'admin') as admin_p, + (select count(*) from as_sessions s1, + cr_revisions cr1 where + s1.assessment_id=cr1.revision_id and + cr1.item_id=ass.assessment_id + and s1.subject_id=:user_id + and completed_datetime is null) as in_progress_p, + (select count(*) from as_sessions s1, + cr_revisions cr1 where + s1.assessment_id=cr1.revision_id + and cr1.item_id=ass.assessment_id + and s1.subject_id=:user_id + and completed_datetime is not null) as completed_p + + + from + (select cr.item_id as assessment_id, cr.title, cr.description, cf.package_id, + a1.number_tries, a1.end_time + from as_assessments a, cr_revisions cr, cr_items ci, cr_folders cf, + as_assessments a1, + ( select distinct s.assessment_id + from as_sessions s + where s.subject_id = :user_id + and s.completed_datetime is not null) s + where a.assessment_id = cr.revision_id -- + and cf.package_id in ([join $list_of_package_ids ", "]) + and cr.item_id = ci.item_id + and ci.parent_id = cf.folder_id + and s.assessment_id = a.assessment_id + and a1.assessment_id = ci.latest_revision + ) ass, +site_nodes sa, site_nodes sc, apm_packages p +where sa.object_id = ass.package_id +and sc.node_id = sa.parent_id +and p.package_id = sc.object_id +order by lower(p.instance_name), lower(ass.title) +) q + where (q.number_tries is not null and q.number_tries >0 and q.completed_p >= q.number_tries) or (q.end_time is not null and q.end_time < current_timestamp) + + + Index: openacs-4/packages/assessment-portlet/www/assessment-portlet.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment-portlet/www/Attic/assessment-portlet.xql,v diff -u -N --- openacs-4/packages/assessment-portlet/www/assessment-portlet.xql 15 May 2007 20:14:19 -0000 1.8 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,48 +0,0 @@ - - - - - -select * from (select ass.*, sc.node_id as comm_node_id, sa.node_id as as_node_id, p.instance_name as community_name, -acs_permission__permission_p(ass.assessment_id,:user_id,'admin') as admin_p, - (select count(*) from as_sessions s1, - cr_revisions cr1 where - s1.assessment_id=cr1.revision_id and - cr1.item_id=ass.assessment_id - and s1.subject_id=:user_id - and completed_datetime is null) as in_progress_p, - (select count(*) from as_sessions s1, - cr_revisions cr1 where - s1.assessment_id=cr1.revision_id - and cr1.item_id=ass.assessment_id - and s1.subject_id=:user_id - and completed_datetime is not null) as completed_p - - - from - (select cr.item_id as assessment_id, cr.title, cr.description, cf.package_id, - a1.number_tries, a1.end_time - from as_assessments a, cr_revisions cr, cr_items ci, cr_folders cf, - as_assessments a1, - ( select distinct s.assessment_id - from as_sessions s - where s.subject_id = :user_id - and s.completed_datetime is not null) s - where a.assessment_id = cr.revision_id -- - and cf.package_id in ([join $list_of_package_ids ", "]) - and cr.item_id = ci.item_id - and ci.parent_id = cf.folder_id - and s.assessment_id = a.assessment_id - and a1.assessment_id = ci.latest_revision - ) ass, -site_nodes sa, site_nodes sc, apm_packages p -where sa.object_id = ass.package_id -and sc.node_id = sa.parent_id -and p.package_id = sc.object_id -order by lower(p.instance_name), lower(ass.title) -) q - where (q.number_tries is not null and q.number_tries >0 and q.completed_p >= q.number_tries) or (q.end_time is not null and q.end_time < current_timestamp) - - - - Index: openacs-4/packages/bm-portlet/bm-portlet.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bm-portlet/bm-portlet.info,v diff -u -N -r1.14 -r1.15 --- openacs-4/packages/bm-portlet/bm-portlet.info 15 May 2007 20:14:19 -0000 1.14 +++ openacs-4/packages/bm-portlet/bm-portlet.info 7 Oct 2007 22:36:55 -0000 1.15 @@ -7,14 +7,14 @@ f t - + OpenACS - 2007-04-22 + 2007-09-08 OpenACS - + - + Index: openacs-4/packages/calendar/calendar.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/calendar.info,v diff -u -N -r1.35 -r1.36 --- openacs-4/packages/calendar/calendar.info 27 Jun 2007 22:50:08 -0000 1.35 +++ openacs-4/packages/calendar/calendar.info 7 Oct 2007 22:36:55 -0000 1.36 @@ -27,6 +27,7 @@ + Index: openacs-4/packages/calendar/tcl/apm-callback-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/tcl/apm-callback-procs.tcl,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/calendar/tcl/apm-callback-procs.tcl 7 Oct 2007 22:36:55 -0000 1.2 @@ -0,0 +1,38 @@ +ad_library { + + Calendar Package APM callbacks library + + Procedures that deal with installing, instantiating, mounting. + + @creation-date July 2007 + @author rmorales@innova.uned.es + @cvs-id $Id: apm-callback-procs.tcl,v 1.2 2007/10/07 22:36:55 donb Exp $ +} + +namespace eval calendar {} +namespace eval calendar::apm {} + + +ad_proc -public calendar::apm::package_after_upgrade { + -from_version_name:required + -to_version_name:required +} { + Upgrade script for the calendar package +} { + apm_upgrade_logic \ + -from_version_name $from_version_name \ + -to_version_name $to_version_name \ + -spec { + 2.1.0b7 2.1.0b8 { + db_transaction { + db_dml update_context {} + db_dml remove_personal_notifications {} + } on_error { + ns_log Error "Error:$errmsg" + } + } + } +} + + + Index: openacs-4/packages/calendar/tcl/apm-callback-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/tcl/apm-callback-procs.xql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/calendar/tcl/apm-callback-procs.xql 7 Oct 2007 22:36:55 -0000 1.2 @@ -0,0 +1,25 @@ + + + + + + update acs_objects + set security_inherit_p = 'f' + where object_id in (select calendar_id from calendars + where calendar_name = 'Personal') + + + + + + delete from notification_requests + where request_id in (select request_id + from notification_requests, calendars + where calendar_name = 'Personal' and package_id = object_id + and type_id = (select type_id + from notification_types + where short_name = 'calendar_notif')) + + + + Index: openacs-4/packages/calendar/tcl/calendar-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/tcl/calendar-procs.tcl,v diff -u -N -r1.30 -r1.31 --- openacs-4/packages/calendar/tcl/calendar-procs.tcl 15 May 2007 20:14:21 -0000 1.30 +++ openacs-4/packages/calendar/tcl/calendar-procs.tcl 7 Oct 2007 22:36:55 -0000 1.31 @@ -106,6 +106,8 @@ end; } ] + #removing inherited permissions + permission::set_not_inherit -object_id $calendar_id return $calendar_id Index: openacs-4/packages/calendar/www/cal-item-delete-confirm.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/www/cal-item-delete-confirm.adp,v diff -u -N -r1.12 -r1.13 --- openacs-4/packages/calendar/www/cal-item-delete-confirm.adp 15 May 2007 20:14:21 -0000 1.12 +++ openacs-4/packages/calendar/www/cal-item-delete-confirm.adp 7 Oct 2007 22:36:55 -0000 1.13 @@ -4,6 +4,7 @@ + link Index: openacs-4/packages/calendar/www/cal-item-delete-confirm.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/www/cal-item-delete-confirm.tcl,v diff -u -N -r1.8 -r1.9 --- openacs-4/packages/calendar/www/cal-item-delete-confirm.tcl 25 Feb 2004 13:07:08 -0000 1.8 +++ openacs-4/packages/calendar/www/cal-item-delete-confirm.tcl 7 Oct 2007 22:36:55 -0000 1.9 @@ -21,4 +21,17 @@ set cal_item(no_time_p) [dt_no_time_p -start_time $cal_item(start_time) -end_time $cal_item(end_time)] set date $cal_item(start_date) + +# To be replaced by a call to template::head API +if {![template::multirow exists link]} { + template::multirow create link rel type href title lang media +} +template::multirow append link \ + stylesheet \ + "text/css" \ + "/resources/calendar/calendar.css" \ + "" \ + en \ + "all" + ad_return_template Index: openacs-4/packages/calendar/www/cal-item-new.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/www/cal-item-new.adp,v diff -u -N -r1.18 -r1.19 --- openacs-4/packages/calendar/www/cal-item-new.adp 15 May 2007 20:14:21 -0000 1.18 +++ openacs-4/packages/calendar/www/cal-item-new.adp 7 Oct 2007 22:36:55 -0000 1.19 @@ -13,8 +13,8 @@ +link - - Index: openacs-4/packages/calendar/www/cal-item-new.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/www/cal-item-new.tcl,v diff -u -N -r1.33 -r1.34 --- openacs-4/packages/calendar/www/cal-item-new.tcl 13 Aug 2007 05:11:26 -0000 1.33 +++ openacs-4/packages/calendar/www/cal-item-new.tcl 7 Oct 2007 22:36:55 -0000 1.34 @@ -21,12 +21,7 @@ set package_id [ad_conn package_id] set user_id [ad_conn user_id] -set js "" -if { [ns_queryget time_p] != 1 && [ns_queryget start_time] == "" } { - set js "disableTime('cal_item');" -} - if {![info exists item_type_id]} { set item_type_id "" } @@ -36,6 +31,17 @@ set calendar_list [calendar::calendar_list] set calendar_options [calendar::calendar_list -privilege create] +# To be replaced by a call to template::head API +if {![template::multirow exists link]} { + template::multirow create link rel type href title lang media +} +template::multirow append link \ + stylesheet \ + "text/css" \ + "/resources/calendar/calendar.css" \ + "" \ + en \ + "all" # TODO: Move into ad_form if { ![ad_form_new_p -key cal_item_id] } { @@ -49,10 +55,10 @@ } # TODO: Move into ad_form if { [exists_and_not_null cal_item_id] } { - set page_title "One calendar item" + set page_title [_ calendar.Calendar_Edit_Item] set ad_form_mode display } else { - set page_title "Add a calendar item" + set page_title [_ calendar.Calendar_Add_Item] set ad_form_mode edit } Index: openacs-4/packages/calendar/www/cal-item-view.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/www/cal-item-view.adp,v diff -u -N -r1.29 -r1.30 --- openacs-4/packages/calendar/www/cal-item-view.adp 15 May 2007 20:14:21 -0000 1.29 +++ openacs-4/packages/calendar/www/cal-item-view.adp 7 Oct 2007 22:36:55 -0000 1.30 @@ -4,6 +4,7 @@ +link@cal_item_id@ Index: openacs-4/packages/calendar/www/cal-item-view.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/www/cal-item-view.tcl,v diff -u -N -r1.19 -r1.20 --- openacs-4/packages/calendar/www/cal-item-view.tcl 15 May 2007 20:14:21 -0000 1.19 +++ openacs-4/packages/calendar/www/cal-item-view.tcl 7 Oct 2007 22:36:55 -0000 1.20 @@ -18,10 +18,6 @@ set write_p [permission::write_permission_p -object_id $cal_item_id -creation_user $cal_item(creation_user)] -if {[exists_and_not_null return_url]} { - set return_url [ad_urlencode $return_url] -} - # Attachments? if {$cal_item(n_attachments) > 0} { set item_attachments [attachments::get_attachments -object_id $cal_item(cal_item_id) -return_url [ad_return_url]] @@ -48,5 +44,17 @@ set cal_item_new_url [export_vars -base "cal-item-new" {cal_item_id return_url}] set cal_item_delete_url [export_vars -base "cal-item-delete" {cal_item_id return_url}] +# To be replaced by a call to template::head API +if {![template::multirow exists link]} { + template::multirow create link rel type href title lang media +} +template::multirow append link \ + stylesheet \ + "text/css" \ + "/resources/calendar/calendar.css" \ + "" \ + en \ + "all" + ad_return_template Index: openacs-4/packages/calendar/www/view-month-display.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/www/view-month-display.adp,v diff -u -N -r1.18 -r1.19 --- openacs-4/packages/calendar/www/view-month-display.adp 13 Aug 2007 06:37:57 -0000 1.18 +++ openacs-4/packages/calendar/www/view-month-display.adp 7 Oct 2007 22:36:55 -0000 1.19 @@ -48,7 +48,8 @@ @items.start_time@ @items.event_name@ - + + [@items.calendar_name@] Index: openacs-4/packages/calendar/www/view-month-display.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/www/view-month-display.tcl,v diff -u -N -r1.21 -r1.22 --- openacs-4/packages/calendar/www/view-month-display.tcl 15 May 2007 20:14:21 -0000 1.21 +++ openacs-4/packages/calendar/www/view-month-display.tcl 7 Oct 2007 22:36:55 -0000 1.22 @@ -22,9 +22,13 @@ set portlet_mode_p 1 } +if {![info exists return_url]} { + set return_url [ad_urlencode "../"] +} + if {[info exists portlet_mode_p] && $portlet_mode_p} { set page_num_urlvar "&page_num=$page_num" - set item_template "\${url_stub}cal-item-view?show_cal_nav=0&return_url=[ad_urlencode "../"]&action=edit&cal_item_id=\$item_id" + set item_template "\${url_stub}cal-item-view?show_cal_nav=0&return_url=$return_url&action=edit&cal_item_id=\$item_id" set prev_month_template "?view=month&date=\[ad_urlencode \$prev_month\]&page_num=$page_num" set next_month_template "?view=month&date=\[ad_urlencode \$next_month\]&page_num=$page_num" set url_stub_callback "calendar_portlet_display::get_url_stub" @@ -117,7 +121,8 @@ time_p \ add_url \ day_url \ - style_class + style_class \ + num_attachments # Calculate number of greyed days and then add them to the calendar mulitrow set greyed_days_before_month [expr [expr [dt_first_day_of_month $this_year $this_month]] -1 ] @@ -151,7 +156,8 @@ "" \ "" \ "" \ - "" + "" \ + "" } } @@ -209,7 +215,8 @@ 0 \ "${base_url}cal-item-new?date=[dt_julian_to_ansi $current_day]&start_time=&end_time" \ "?view=day&date=[dt_julian_to_ansi $current_day]&$page_num_urlvar" \ - "calendar-${system_type}Item" + "calendar-${system_type}Item" \ + $num_attachments } } @@ -251,7 +258,8 @@ $time_p \ "${base_url}cal-item-new?date=[dt_julian_to_ansi $current_day]&start_time=&end_time" \ "?view=day&date=[dt_julian_to_ansi $current_day]&$page_num_urlvar" \ - "calendar-${system_type}Item" + "calendar-${system_type}Item" \ + $num_attachments } if { !$exporting_p } { @@ -285,7 +293,8 @@ 0 \ "${base_url}cal-item-new?date=[dt_julian_to_ansi $current_day]&start_time=&end_time" \ "?view=day&date=[dt_julian_to_ansi $current_day]&$page_num_urlvar" \ - "" + "" \ + "" } # Add cells for remaining days outside the month @@ -312,7 +321,8 @@ "" \ "" \ "" \ - "" + "" \ + "" } } } Index: openacs-4/packages/calendar/www/view-one-day-display.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/www/view-one-day-display.adp,v diff -u -N -r1.20 -r1.21 --- openacs-4/packages/calendar/www/view-one-day-display.adp 15 May 2007 20:14:21 -0000 1.20 +++ openacs-4/packages/calendar/www/view-one-day-display.adp 7 Oct 2007 22:36:55 -0000 1.21 @@ -12,7 +12,7 @@ Index: openacs-4/packages/calendar/www/view-one-day-display.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/www/view-one-day-display.tcl,v diff -u -N -r1.35 -r1.36 --- openacs-4/packages/calendar/www/view-one-day-display.tcl 15 May 2007 20:14:21 -0000 1.35 +++ openacs-4/packages/calendar/www/view-one-day-display.tcl 7 Oct 2007 22:36:55 -0000 1.36 @@ -16,7 +16,7 @@ set hour_height_sep 3 set hour_height_units px set bump_right_base 0 -set bump_right_delta 35 +set bump_right_delta 155 set bump_right_units px if {[info exists url_stub_callback]} { @@ -83,7 +83,8 @@ end_time \ top \ height \ - style + style \ + num_attachments set previous_intervals [list] @@ -134,7 +135,8 @@ $pretty_end_time \ 0 \ 0 \ - "left: ${bump_right_base}${bump_right_units};" + "left: ${bump_right_base}${bump_right_units};" \ + $num_attachments incr bump_right_base $bump_right_delta } @@ -216,7 +218,8 @@ $pretty_end_time \ $top \ $height \ - "left: ${bump_right}${bump_right_units};" + "left: ${bump_right}${bump_right_units};" \ + $num_attachments lappend previous_intervals $start_seconds $end_seconds } Index: openacs-4/packages/calendar/www/view-week-display.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/www/view-week-display.adp,v diff -u -N -r1.15 -r1.16 --- openacs-4/packages/calendar/www/view-week-display.adp 13 Aug 2007 06:37:57 -0000 1.15 +++ openacs-4/packages/calendar/www/view-week-display.adp 7 Oct 2007 22:36:55 -0000 1.16 @@ -33,7 +33,7 @@
    -

    @items.event_name@

    +

    @items.event_name@

    Index: openacs-4/packages/calendar/www/view-week-display.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/www/view-week-display.tcl,v diff -u -N -r1.19 -r1.20 --- openacs-4/packages/calendar/www/view-week-display.tcl 15 May 2007 20:14:21 -0000 1.19 +++ openacs-4/packages/calendar/www/view-week-display.tcl 7 Oct 2007 22:36:55 -0000 1.20 @@ -101,7 +101,8 @@ style_class \ top \ height \ - left + left \ + num_attachments # Convert date from user timezone to system timezone set first_weekday_of_the_week_tz [lc_time_conn_to_system "$first_weekday_of_the_week 00:00:00"] @@ -263,7 +264,8 @@ "calendar-Item" \ $top \ $height \ - $left + $left \ + $num_attachments set current_weekday $day_of_week Index: openacs-4/packages/calendar/www/view.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/www/view.adp,v diff -u -N -r1.30 -r1.31 --- openacs-4/packages/calendar/www/view.adp 15 May 2007 20:14:21 -0000 1.30 +++ openacs-4/packages/calendar/www/view.adp 7 Oct 2007 22:36:55 -0000 1.31 @@ -3,6 +3,7 @@ +link @@ -18,7 +19,9 @@

    - @notification_chunk;noquote@ + + @notification_chunk;noquote@ +

    Index: openacs-4/packages/calendar/www/view.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/www/view.tcl,v diff -u -N -r1.24 -r1.25 --- openacs-4/packages/calendar/www/view.tcl 15 May 2007 20:14:21 -0000 1.24 +++ openacs-4/packages/calendar/www/view.tcl 7 Oct 2007 22:36:55 -0000 1.25 @@ -53,6 +53,7 @@ set ansi_day [string trimleft [lindex $ansi_list 2] "0"] set end_date [dt_julian_to_ansi [expr [dt_ansi_to_julian $ansi_year $ansi_month $ansi_day ] + $period_days]] } +set calendar_personal_p [calendar::personal_p -calendar_id [lindex [lindex [calendar::calendar_list -package_id $package_id ] 0] 1] ] set notification_chunk [notification::display::request_widget \ -type calendar_notif \ @@ -61,5 +62,16 @@ -url [ad_conn url] \ ] +# To be replaced by a call to template::head API +if {![template::multirow exists link]} { + template::multirow create link rel type href title lang media +} +template::multirow append link \ + stylesheet \ + "text/css" \ + "/resources/calendar/calendar.css" \ + "" \ + en \ + "all" ad_return_template Index: openacs-4/packages/calendar/www/views-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/www/Attic/views-oracle.xql,v diff -u -N -r1.6 -r1.7 --- openacs-4/packages/calendar/www/views-oracle.xql 15 May 2007 20:14:21 -0000 1.6 +++ openacs-4/packages/calendar/www/views-oracle.xql 7 Oct 2007 22:36:55 -0000 1.7 @@ -20,7 +20,8 @@ e.event_id as item_id, (select type from cal_item_types where item_type_id= ci.item_type_id) as item_type, cals.calendar_id, - cals.calendar_name + cals.calendar_name, + (select count(1) from attachments where object_id=e.event_id) as num_attachments $additional_select_clause from cal_items ci, acs_events e, @@ -55,7 +56,8 @@ e.event_id as item_id, (select type from cal_item_types where item_type_id= ci.item_type_id) as item_type, cals.calendar_id, - cals.calendar_name + cals.calendar_name, + (select count(1) from attachments where object_id=e.event_id) as num_attachments $additional_select_clause from cal_items ci, acs_events e, Index: openacs-4/packages/calendar/www/views-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/www/Attic/views-postgresql.xql,v diff -u -N -r1.6 -r1.7 --- openacs-4/packages/calendar/www/views-postgresql.xql 15 May 2007 20:14:21 -0000 1.6 +++ openacs-4/packages/calendar/www/views-postgresql.xql 7 Oct 2007 22:36:55 -0000 1.7 @@ -19,7 +19,8 @@ e.event_id as item_id, cit.type as item_type, cals.calendar_id, - cals.calendar_name + cals.calendar_name, + (select count(1) from attachments where object_id=e.event_id) as num_attachments $additional_select_clause from acs_activities a, acs_events e, @@ -56,7 +57,8 @@ e.event_id as item_id, (select type from cal_item_types where item_type_id= ci.item_type_id) as item_type, cals.calendar_id, - cals.calendar_name + cals.calendar_name, + (select count(1) from attachments where object_id=e.event_id) as num_attachments $additional_select_clause from cal_items ci, acs_events e, Index: openacs-4/packages/calendar/www/resources/images/attach.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/www/resources/images/attach.png,v diff -u -N -r1.1 -r1.2 Binary files differ Index: openacs-4/packages/calendar-portlet/calendar-portlet.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar-portlet/calendar-portlet.info,v diff -u -N -r1.23 -r1.24 --- openacs-4/packages/calendar-portlet/calendar-portlet.info 15 May 2007 20:14:22 -0000 1.23 +++ openacs-4/packages/calendar-portlet/calendar-portlet.info 7 Oct 2007 22:36:56 -0000 1.24 @@ -7,14 +7,14 @@ f t - + OpenACS - 2007-04-22 + 2007-09-08 OpenACS - + - + Index: openacs-4/packages/categories/tcl/categories-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/categories/tcl/categories-procs.tcl,v diff -u -N -r1.23 -r1.24 --- openacs-4/packages/categories/tcl/categories-procs.tcl 6 Oct 2007 13:51:43 -0000 1.23 +++ openacs-4/packages/categories/tcl/categories-procs.tcl 7 Oct 2007 22:36:56 -0000 1.24 @@ -217,7 +217,22 @@ return $result } +ad_proc -public category::get_mapped_categories_multirow { + {-locale ""} + {-multirow mapped_categories} + object_id +} { + Returns multirow with: tree_id, tree_name, category_id, category_name + @param object_id object of which we want to know the mapped categories. + @return multirow with tree and category information + @author Peter Kreuzinger (peter.kreuzinger@wu-wien.ac.at) +} { + if { $locale == ""} {set locale [ad_conn locale]} + upvar $multirow mapped_categories + db_multirow mapped_categories select {} +} + ad_proc -public category::get_id { name {locale en_US} @@ -339,7 +354,46 @@ } return $result } +ad_proc -public category::get_children { + -category_id:required +} { + Returns the category ids of the direct children of the given category + @param category_id category_id + @return list of category ids of the children of the supplied category_id + @author Peter Kreuzinger (peter.kreuzinger@wu-wien.ac.at) +} { + set result [list] + set child_categories [db_list get_children_ids ""] + foreach category_id $child_categories { + lappend result $category_id + } + if {$result eq ""} {set result 0} + return $result +} + +ad_proc -public category::count_children { + {-category_id:required} +} { + counts all direct sub categories +} { + return [db_string select {}] +} + +ad_proc -public category::get_parent { + -category_id:required +} { + Returns the category id of the parent category + + @param category_id category_id + @return category id of the parent category + @author Peter Kreuzinger (peter.kreuzinger@wu-wien.ac.at) +} { + set result [db_list get_parent_id ""] + if {$result eq "{}"} {set result 0} + return $result +} + ad_proc -public category::get_tree { category_id } { @@ -376,6 +430,48 @@ return [list $category_id [category::get_name $category_id $locale] $tree_id [category_tree::get_name $tree_id $locale]] } +ad_proc -public category::get_objects { + -category_id + {-object_type ""} + {-content_type ""} + {-include_children:boolean} +} { + Returns a list of objects which are mapped to this category_id + + @param category_id CategoryID of the category we want to get the objects for + @param object_type Limit the search for objects of this object type + @param content_type Limit the search for objects of this content_type + @param include_children Include child categories' objects as well. Not yet implemented + + @author malte () + @creation-date Wed May 30 06:28:25 CEST 2007 +} { + set join_clause "" + set where_clause "" + if {$content_type ne ""} { + set join_clause ", cr_items i" + set where_clause "and i.item_id = com.object_id and i.content_type = :content_type" + } elseif {$object_type ne ""} { + set join_clause ", acs_objects o" + set where_clause "and o.object_id = com.object_id and o.object_type = :object_type" + } + return [db_list get_objects {}] +} + +ad_proc -public category::get_id_by_object_title { + title +} { + Gets the id of a category given an object title (object_type=category). + This is highly useful as the category object title will not change if you change the + name (label) of the category, so you can access the category even if the label has changed + + @param title object title of the category to retrieve + @return the category id or empty string it no category was found + @author Peter Kreuzinger (peter.kreuzinger@wu-wien.ac.at) +} { + return [db_string get_category_id {} -default ""] +} + ad_proc -public category::get_object_context { object_id } { Returns the object name and url to be used in a context bar. Index: openacs-4/packages/categories/tcl/categories-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/categories/tcl/categories-procs.xql,v diff -u -N -r1.8 -r1.9 --- openacs-4/packages/categories/tcl/categories-procs.xql 23 Mar 2005 22:44:56 -0000 1.8 +++ openacs-4/packages/categories/tcl/categories-procs.xql 7 Oct 2007 22:36:56 -0000 1.9 @@ -1,6 +1,35 @@ + + + select count(*) + from categories + where parent_id=:category_id + + + + + + + select category_id + from categories + where parent_id = :category_id + + + + + + + + select parent_id + from categories + where category_id = :category_id + limit 1 + + + + @@ -74,6 +103,22 @@ + + + + select co.tree_id, aot.title, c.category_id, ao.title + from category_object_map_tree co, categories c, category_translations ct, acs_objects ao, acs_objects aot + where co.object_id = :object_id + and co.category_id = c.category_id + and c.category_id = ao.object_id + and c.category_id = ct.category_id + and aot.object_id = co.tree_id + and ct.locale = :locale + order by aot.title, ao.title + + + + SELECT category_object_map.category_id @@ -84,6 +129,24 @@ + + + SELECT com.object_id + FROM category_object_map com $join_clause + WHERE com.category_id = :category_id $where_clause + + + + + + + select object_id + from acs_objects + where title = :title + and object_type = 'category' + + + Index: openacs-4/packages/categories/tcl/category-trees-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/categories/tcl/category-trees-procs.tcl,v diff -u -N -r1.22 -r1.23 --- openacs-4/packages/categories/tcl/category-trees-procs.tcl 6 Oct 2007 13:51:43 -0000 1.22 +++ openacs-4/packages/categories/tcl/category-trees-procs.tcl 7 Oct 2007 22:36:56 -0000 1.23 @@ -26,6 +26,21 @@ return [array get tree] } + ad_proc -public get_categories { + {-tree_id:required} + } { + returns the main categories of a given tree + } { + set locale [ad_conn locale] + set result [list] + set categories [db_list get_categories ""] + foreach category_id $categories { + lappend result $category_id + } + return $result + + } + ad_proc -public map { -tree_id:required -object_id:required @@ -216,7 +231,38 @@ return $result } + ad_proc -public get_trees { object_id } { + Get the category trees mapped to an object. + @param object_id object to get the mapped category trees. + @return tcl list of tree_ids + @author Peter Kreuzinger (peter.kreuzinger@wu-wien.ac.at) + } { + set result [list] + + db_foreach get_trees "" { + lappend result $tree_id + } + + return $result + } + + ad_proc -public get_id_by_object_title { + {-title} + } { + Gets the id of a category_tree given an object title (object_type=category). + This is highly useful as the category_tree object title will not change if you change the + name (label) of the category_tree, so you can access the category_tree even if the label has changed. + Why would you want this? E.g. if you have the category widget and want to get only one specific tree + displayed and not all of them. + + @param title object title of the category to retrieve + @return the category_tree_id or empty string it no category was found + @author Malte Sussdorff (malte.sussdorff@cognovis.de) + } { + return [db_string get_tree_id {} -default ""] + } + ad_proc -public get_mapped_trees_from_object_list { object_id_list {locale ""}} { Get the category trees mapped to a list of objects. Index: openacs-4/packages/categories/tcl/category-trees-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/categories/tcl/category-trees-procs.xql,v diff -u -N -r1.9 -r1.10 --- openacs-4/packages/categories/tcl/category-trees-procs.xql 28 Aug 2007 16:30:03 -0000 1.9 +++ openacs-4/packages/categories/tcl/category-trees-procs.xql 7 Oct 2007 22:36:56 -0000 1.10 @@ -11,7 +11,17 @@ - + + + select c.category_id as category_id from categories c, category_translations ct + where parent_id is null + and tree_id = :tree_id + and c.category_id = ct.category_id + and locale = :locale + order by name + + + @@ -36,6 +46,16 @@ + + + + select object_id + from acs_objects + where title = :title + and object_type = 'category_tree' + + + @@ -59,8 +79,16 @@ + + + + select distinct tree_id + from category_object_map_tree + where object_id = :object_id + + + - Index: openacs-4/packages/categories/tcl/widget-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/categories/tcl/widget-procs.tcl,v diff -u -N -r1.20 -r1.21 --- openacs-4/packages/categories/tcl/widget-procs.tcl 28 Aug 2007 16:30:03 -0000 1.20 +++ openacs-4/packages/categories/tcl/widget-procs.tcl 7 Oct 2007 22:36:56 -0000 1.21 @@ -14,9 +14,24 @@ namespace eval template::data::transform {} namespace eval template::data::validate {} -ad_proc -public template::widget::category { element_reference tag_attributes } { - # author: Timo Hentschel (timo@timohentschel.de) - +ad_proc -public template::widget::category { + element_reference + tag_attributes +} { + Display the category widget. This has a multitude of options: +

      +
    • value: Values should be a list of two items: the object_id being viewed and the object_id which the trees are mapped to. + This will get the mapped trees (if no value provided defaults to package_id) and the mapped categories for the object_id. If you + do not provide a value, the following options are used: +
    • category_application_id>
    • +
    • category_object_id
    • +
    • category_tree_id
    • +
    • category_subtree_id
    • +
    • category_assign_single_p
    • +
    • category_require_category_p
    • +
    + @author: Timo Hentschel (timo@timohentschel.de) +} { upvar $element_reference element if { [info exists element(html)] } { Index: openacs-4/packages/dotlrn/dotlrn.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/dotlrn.info,v diff -u -N -r1.126 -r1.127 --- openacs-4/packages/dotlrn/dotlrn.info 15 May 2007 20:14:24 -0000 1.126 +++ openacs-4/packages/dotlrn/dotlrn.info 7 Oct 2007 22:36:56 -0000 1.127 @@ -7,19 +7,19 @@ f f - + OpenACS A Course Management System - 2007-04-22 + 2007-09-08 OpenACS Course Management - + - - + + @@ -31,6 +31,7 @@ + @@ -71,6 +72,7 @@ + Index: openacs-4/packages/dotlrn/install.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/install.xml,v diff -u -N -r1.15 -r1.16 --- openacs-4/packages/dotlrn/install.xml 15 May 2007 20:14:24 -0000 1.15 +++ openacs-4/packages/dotlrn/install.xml 7 Oct 2007 22:36:56 -0000 1.16 @@ -25,9 +25,17 @@ + + + + + + + + Index: openacs-4/packages/dotlrn/lib/member-email-confirm.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/lib/member-email-confirm.tcl,v diff -u -N -r1.2 -r1.3 --- openacs-4/packages/dotlrn/lib/member-email-confirm.tcl 15 May 2007 20:14:25 -0000 1.2 +++ openacs-4/packages/dotlrn/lib/member-email-confirm.tcl 7 Oct 2007 22:36:56 -0000 1.3 @@ -21,7 +21,7 @@ -form { {from_addr:text {label "\#dotlrn.From\#"}} {subject:text {label "\#dotlrn.Subject\#"}} - {email:richtext {label "\#dotlrn.Email_1\#"}} + {email:richtext {label "\#dotlrn.Email_1\#"} {html {rows 20 cols 80 style width:100%}}} {btn_ok:text(submit) {label "[_ dotlrn.OK_Send_Email]"}} {btn_cancel:text(submit) {label "[_ dotlrn.Cancel_Dont_Send_email]"}} } -on_request { Index: openacs-4/packages/dotlrn/lib/member-email.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/lib/member-email.tcl,v diff -u -N -r1.3 -r1.4 --- openacs-4/packages/dotlrn/lib/member-email.tcl 15 Dec 2006 22:45:22 -0000 1.3 +++ openacs-4/packages/dotlrn/lib/member-email.tcl 7 Oct 2007 22:36:56 -0000 1.4 @@ -70,7 +70,7 @@ ad_form -extend -name "member_email" -form { {from_addr:text {label "From Address"} {html {size 40}}} {subject:text {label "Subject"} {html {size 40}}} - {email:richtext,optional {label "Message"} {html {rows 30 cols 80 wrap soft}} {htmlarea_p 0}} + {email:richtext,optional {label "Message"} {html {rows 30 cols 80}} {htmlarea_p 0}} {community_id:text(hidden) {value $community_id}} {type:text(hidden) {value $type}} {enabled_p:text(hidden) {value $type}} Index: openacs-4/packages/dotlrn/tcl/community-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/tcl/community-procs.tcl,v diff -u -N -r1.199 -r1.200 --- openacs-4/packages/dotlrn/tcl/community-procs.tcl 21 Jun 2007 19:04:56 -0000 1.199 +++ openacs-4/packages/dotlrn/tcl/community-procs.tcl 7 Oct 2007 22:36:56 -0000 1.200 @@ -231,6 +231,7 @@ set non_member_portal_id [portal::create \ -name "$pretty_name Non-Member Portal" \ -default_page_name [dotlrn::parameter -name non_member_page_name] \ + -layout_name [dotlrn::parameter -name non_member_layout_name] \ -context_id $community_id \ $user_id \ ] @@ -239,6 +240,7 @@ set admin_portal_id [portal::create \ -name "$pretty_name Administration Portal" \ -default_page_name [dotlrn::parameter -name admin_page_name] \ + -layout_name [dotlrn::parameter -name admin_layout_name] \ -context_id $community_id \ $user_id \ ] @@ -1035,13 +1037,22 @@ {-package_id ""} } { Returns the community id depending on the package_id - we're at, or the package_id passed in + we're at, or the package_id passed in. + + If no community_id found, return empty_string + + @param package_id PackageID for which to search the community_id for + @return community_id of the community where the package is mounted, empty string if not found } { if {[empty_string_p $package_id]} { set package_id [site_node_closest_ancestor_package -default [ad_conn package_id] dotlrn] } - return [util_memoize "dotlrn_community::get_community_id_not_cached -package_id $package_id"] + if {$package_id ne ""} { + return [util_memoize "dotlrn_community::get_community_id_not_cached -package_id $package_id"] + } else { + return "" + } } ad_proc -private get_community_id_not_cached { Index: openacs-4/packages/dotlrn/www/clone.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/clone.tcl,v diff -u -N -r1.8 -r1.9 --- openacs-4/packages/dotlrn/www/clone.tcl 8 Aug 2006 21:26:23 -0000 1.8 +++ openacs-4/packages/dotlrn/www/clone.tcl 7 Oct 2007 22:36:56 -0000 1.9 @@ -75,7 +75,7 @@ -label [_ dotlrn.Description] \ -datatype text \ -widget textarea \ - -html {rows 5 cols 60 wrap soft} \ + -html {rows 5 cols 60} \ -optional \ -value "[_ dotlrn.A_copy_of] $community_name" Index: openacs-4/packages/dotlrn/www/community-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/community-edit.tcl,v diff -u -N -r1.14 -r1.15 --- openacs-4/packages/dotlrn/www/community-edit.tcl 15 Dec 2006 22:45:22 -0000 1.14 +++ openacs-4/packages/dotlrn/www/community-edit.tcl 7 Oct 2007 22:36:56 -0000 1.15 @@ -39,7 +39,7 @@ {description:text(textarea),optional {label "#dotlrn.Description#"} - {html {rows 5 cols 60 wrap soft}} + {html {rows 5 cols 60}} {help_text "[_ dotlrn.lt_do_not_use_p_tags]"} } Index: openacs-4/packages/dotlrn/www/member-email.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/member-email.tcl,v diff -u -N -r1.2 -r1.3 --- openacs-4/packages/dotlrn/www/member-email.tcl 8 Aug 2006 21:26:24 -0000 1.2 +++ openacs-4/packages/dotlrn/www/member-email.tcl 7 Oct 2007 22:36:56 -0000 1.3 @@ -24,7 +24,7 @@ {email_id:key} {from_addr:text {label "From Address"} {html {size 40}}} {subject:text {label "Subject"} {html {size 40}}} - {email:richtext,optional {label "Message"} {html {rows 30 cols 80 wrap soft}} {htmlarea_p 1}} + {email:richtext,optional {label "Message"} {html {rows 30 cols 80}}} } -on_request { set from_addr [cc_email_from_party [ad_conn user_id]] @@ -53,4 +53,4 @@ ad_returnredirect "one-community-admin" ad_script_abort -} \ No newline at end of file +} Index: openacs-4/packages/dotlrn/www/members.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/members.adp,v diff -u -N -r1.24 -r1.25 --- openacs-4/packages/dotlrn/www/members.adp 8 Aug 2006 21:26:24 -0000 1.24 +++ openacs-4/packages/dotlrn/www/members.adp 7 Oct 2007 22:36:56 -0000 1.25 @@ -42,10 +42,13 @@ -

    #dotlrn.Membership_Requests#

    + + +

    #dotlrn.Membership_Requests#

    + +
    +
    - -
    Index: openacs-4/packages/dotlrn/www/members.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/members.tcl,v diff -u -N -r1.26 -r1.27 --- openacs-4/packages/dotlrn/www/members.tcl 4 Oct 2007 16:07:05 -0000 1.26 +++ openacs-4/packages/dotlrn/www/members.tcl 7 Oct 2007 22:36:56 -0000 1.27 @@ -31,6 +31,8 @@ set context [list [list "one-community-admin" [_ dotlrn.Admin]] [_ dotlrn.Manage_Members]] set community_id [dotlrn_community::get_community_id] set spam_p [dotlrn::user_can_spam_community_p -user_id [ad_get_user_id] -community_id $community_id] +set approval_policy_p [string eq [group::join_policy -group_id $community_id] "needs approval"] + set referer [ns_conn url] set return_url "[ns_conn url]?[ns_conn query]" @@ -73,23 +75,22 @@ # Actions for Removing Members according to their role set rel_types [dotlrn_community::get_roles -community_id $community_id] +set bulk_actions "" +set bulk_actions_export_vars "" +set actions "" + if {$admin_p} { - set bulk_actions [list "[_ dotlrn.User_Admin_Page]" "member-add-3" "[_ dotlrn.User_Admin_Page]" "[_ dotlrn.Drop_Membership]" "deregister" "[_ dotlrn.Drop_Membership]"] - set bulk_actions_export_vars [list "user_id" "rel_type" "referer" "reset"] + set bulk_actions [list "[_ dotlrn.Drop_Membership]" "deregister" "[_ dotlrn.Drop_Membership]"] + set bulk_actions_export_vars [list "user_id" "referer" "reset"] set actions [list "CSV" "members?csv=yes" "[_ dotlrn.Comma_Separated_Values]"] foreach role $rel_types { # lappend actions "[_ dotlrn.Remove_all] [lang::util::localize [lindex $role 3]]" "members?reset=1&reltype=[lindex $role 0]" "[lang::util::localize [lindex $role 2]]" lappend actions "[_ dotlrn.Remove_all] [lang::util::localize [lindex $role 3]]" "member-confirm?reset=1&reltype=[lindex $role 0]" "[lang::util::localize [lindex $role 2]]" } - -} else { - set bulk_actions "" - set actions "" - set bulk_actions_export_vars "" } -# Build the list-builder list -template::list::create -name members -multirow members -key user_id -actions $actions -bulk_actions $bulk_actions -bulk_action_export_vars $bulk_actions_export_vars -elements { +# Set the elements list +set elm_list { portrait { label "" html "align right" @@ -125,24 +126,31 @@ } role { label "[_ dotlrn.Role]" html "align left" - } action { + } +} + +if {$admin_p} { + lappend elm_list {action} { label "[_ dotlrn.Actions]" html "align left" display_template { - + #dotlrn.Drop_Membership# | #dotlrn.User_Admin_Page# } } - } -orderby { +} + +# Build the list-builder list +template::list::create -name members -multirow members -key user_id -actions $actions -bulk_actions $bulk_actions -bulk_action_export_vars $bulk_actions_export_vars -elements $elm_list -orderby { last_name {orderby last_name} first_names {orderby first_names} email {orderby email} role {orderby role} - } -selected_format csv -formats { +} -selected_format csv -formats { csv { output csv } - } +} set orderby [template::list::orderby_clause -name "members" -orderby] @@ -160,18 +168,18 @@ template::list::write_output -name members } -# Bulk action User Admin Page -# Depending on the community_type, we have allowable rel_types -set rel_types [dotlrn_community::get_roles -community_id $community_id] -set selection "" -set size [multirow size members] -if { $size > 0 } { - multirow append members "" "" "" "" "" $selection -} +# # Bulk action User Admin Page +# # Depending on the community_type, we have allowable rel_types +# set rel_types [dotlrn_community::get_roles -community_id $community_id] +# set selection "" +# set size [multirow size members] +# if { $size > 0 } { +# multirow append members "" "" "" "" "" $selection +# } set user_ids "" db_multirow -extend { member_url pending_user_referer } pending_users select_pending_users {} { Index: openacs-4/packages/dotlrn/www/spam.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/spam.tcl,v diff -u -N -r1.26 -r1.27 --- openacs-4/packages/dotlrn/www/spam.tcl 15 May 2007 20:14:25 -0000 1.26 +++ openacs-4/packages/dotlrn/www/spam.tcl 7 Oct 2007 22:36:56 -0000 1.27 @@ -123,7 +123,7 @@ -label [_ dotlrn.Message] \ -datatype text \ -widget textarea \ - -html {rows 10 cols 80 wrap soft} + -html {rows 10 cols 80} element create spam_message format \ Index: openacs-4/packages/dotlrn/www/admin/class-instance-new.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/admin/class-instance-new.tcl,v diff -u -N -r1.30 -r1.31 --- openacs-4/packages/dotlrn/www/admin/class-instance-new.tcl 28 Sep 2007 13:07:32 -0000 1.30 +++ openacs-4/packages/dotlrn/www/admin/class-instance-new.tcl 7 Oct 2007 22:36:56 -0000 1.31 @@ -118,7 +118,7 @@ } if {${add_instructor}} { - set community_id $class_instance_id + set community_id $class_instance_id ad_returnredirect "add-instructor?[export_url_vars community_id referer]" ad_script_abort } Index: openacs-4/packages/dotlrn/www/admin/class-new.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/admin/class-new.tcl,v diff -u -N -r1.18 -r1.19 --- openacs-4/packages/dotlrn/www/admin/class-new.tcl 8 Aug 2006 21:26:28 -0000 1.18 +++ openacs-4/packages/dotlrn/www/admin/class-new.tcl 7 Oct 2007 22:36:56 -0000 1.19 @@ -56,7 +56,7 @@ -label [_ dotlrn.Description] \ -datatype text \ -widget textarea \ - -html {rows 5 cols 60 wrap soft} \ + -html {rows 5 cols 60} \ -optional element create add_class subject_key \ Index: openacs-4/packages/dotlrn/www/admin/classes-chunk.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/admin/classes-chunk.tcl,v diff -u -N -r1.11 -r1.12 --- openacs-4/packages/dotlrn/www/admin/classes-chunk.tcl 8 Aug 2006 21:26:28 -0000 1.11 +++ openacs-4/packages/dotlrn/www/admin/classes-chunk.tcl 7 Oct 2007 22:36:56 -0000 1.12 @@ -55,7 +55,7 @@ } if {![exists_and_not_null referer]} { - set referer "classes?[export_vars department_key]" + set referer "classes" } set query select_classes @@ -82,7 +82,7 @@ set actions "" if { $can_create } { - set actions [list "[_ dotlrn.new_class_1]" "[export_vars -base "class-new" -url { department_key referer }]"] + set actions [list "[_ dotlrn.new_class_1]" "[export_vars -base "class-new" -url { department_key referer }]" "[_ dotlrn.new_class_1]"] } template::list::create \ @@ -117,18 +117,14 @@ label "[_ dotlrn.Actions]" display_template { - \[ - [_ dotlrn.new_class_instance] + [_ dotlrn.new_class_instance] \] - - \[ - [_ dotlrn.lt_Delete_class] + [_ dotlrn.lt_Delete_class] \] - } } Index: openacs-4/packages/dotlrn/www/admin/club-new.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/admin/club-new.tcl,v diff -u -N -r1.20 -r1.21 --- openacs-4/packages/dotlrn/www/admin/club-new.tcl 8 Aug 2006 21:26:28 -0000 1.20 +++ openacs-4/packages/dotlrn/www/admin/club-new.tcl 7 Oct 2007 22:36:56 -0000 1.21 @@ -42,7 +42,7 @@ {description:text(textarea),optional {label "#dotlrn.Description#"} - {html {rows 5 cols 60 wrap soft}} + {html {rows 5 cols 60}} {help_text "[_ dotlrn.lt_do_not_use_p_tags]"} } Index: openacs-4/packages/dotlrn/www/admin/community-type.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/admin/community-type.tcl,v diff -u -N -r1.1 -r1.2 --- openacs-4/packages/dotlrn/www/admin/community-type.tcl 28 Jul 2004 07:24:12 -0000 1.1 +++ openacs-4/packages/dotlrn/www/admin/community-type.tcl 7 Oct 2007 22:36:56 -0000 1.2 @@ -42,7 +42,7 @@ ad_form -extend -name "new_community_type" -form { {pretty_name:text {label "[_ dotlrn.Pretty_Name]"} {html {size 60 maxlength 100}}} - {description:text(textarea),optional {label "[_ dotlrn.Description]"} {html {rows 5 cols 60 wrap soft}}} + {description:text(textarea),optional {label "[_ dotlrn.Description]"} {html {rows 5 cols 60}}} } -validate { {community_type { ![dotlrn_community::type_exists $community_type] || Index: openacs-4/packages/dotlrn/www/admin/department-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/admin/department-edit.tcl,v diff -u -N -r1.9 -r1.10 --- openacs-4/packages/dotlrn/www/admin/department-edit.tcl 8 Aug 2006 21:26:28 -0000 1.9 +++ openacs-4/packages/dotlrn/www/admin/department-edit.tcl 7 Oct 2007 22:36:56 -0000 1.10 @@ -57,7 +57,7 @@ -label "[_ dotlrn.Description]" \ -datatype text \ -widget textarea \ - -html {rows 5 cols 60 wrap soft} \ + -html {rows 5 cols 60} \ -optional element create edit_department external_url \ Index: openacs-4/packages/dotlrn/www/admin/department-new.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/admin/department-new.tcl,v diff -u -N -r1.11 -r1.12 --- openacs-4/packages/dotlrn/www/admin/department-new.tcl 8 Aug 2006 21:26:28 -0000 1.11 +++ openacs-4/packages/dotlrn/www/admin/department-new.tcl 7 Oct 2007 22:36:56 -0000 1.12 @@ -45,7 +45,7 @@ -label "[_ dotlrn.Description]" \ -datatype text \ -widget textarea \ - -html {rows 5 cols 60 wrap soft} \ + -html {rows 5 cols 60} \ -optional element create add_department external_url \ Index: openacs-4/packages/dotlrn/www/admin/users-spam.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/admin/users-spam.tcl,v diff -u -N -r1.6 -r1.7 --- openacs-4/packages/dotlrn/www/admin/users-spam.tcl 8 Aug 2006 21:26:28 -0000 1.6 +++ openacs-4/packages/dotlrn/www/admin/users-spam.tcl 7 Oct 2007 22:36:56 -0000 1.7 @@ -71,7 +71,7 @@ -label [_ dotlrn.Message] \ -datatype text \ -widget textarea \ - -html {rows 10 cols 80 wrap soft} + -html {rows 10 cols 80} element create spam_message referer \ -label [_ dotlrn.Referer] \ Index: openacs-4/packages/dotlrn-assessment/dotlrn-assessment.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-assessment/dotlrn-assessment.info,v diff -u -N -r1.3 -r1.4 --- openacs-4/packages/dotlrn-assessment/dotlrn-assessment.info 15 May 2007 20:14:26 -0000 1.3 +++ openacs-4/packages/dotlrn-assessment/dotlrn-assessment.info 7 Oct 2007 22:36:57 -0000 1.4 @@ -7,13 +7,13 @@ f t - + Jose Pablo Escobedo Del Cid - 2007-04-22 + 2007-09-08 - - - + + + Index: openacs-4/packages/dotlrn-bm/dotlrn-bm.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-bm/dotlrn-bm.info,v diff -u -N -r1.11 -r1.12 --- openacs-4/packages/dotlrn-bm/dotlrn-bm.info 15 May 2007 20:14:26 -0000 1.11 +++ openacs-4/packages/dotlrn-bm/dotlrn-bm.info 7 Oct 2007 22:36:57 -0000 1.12 @@ -7,14 +7,14 @@ f t - + OpenACS - 2007-04-22 + 2007-09-08 OpenACS - - - + + + Index: openacs-4/packages/dotlrn-calendar/dotlrn-calendar.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-calendar/dotlrn-calendar.info,v diff -u -N -r1.17 -r1.18 --- openacs-4/packages/dotlrn-calendar/dotlrn-calendar.info 15 May 2007 20:14:26 -0000 1.17 +++ openacs-4/packages/dotlrn-calendar/dotlrn-calendar.info 7 Oct 2007 22:36:57 -0000 1.18 @@ -7,15 +7,15 @@ f t - + OpenACS - 2007-04-22 + 2007-09-08 OpenACS - - - - + + + + Index: openacs-4/packages/dotlrn-dotlrn/dotlrn-dotlrn.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-dotlrn/dotlrn-dotlrn.info,v diff -u -N -r1.18 -r1.19 --- openacs-4/packages/dotlrn-dotlrn/dotlrn-dotlrn.info 15 May 2007 20:14:27 -0000 1.18 +++ openacs-4/packages/dotlrn-dotlrn/dotlrn-dotlrn.info 7 Oct 2007 22:36:57 -0000 1.19 @@ -7,15 +7,15 @@ f t - + OpenACS Helper routines for dotLRN applets - 2007-04-22 + 2007-09-08 OpenACS - - - + + + Index: openacs-4/packages/dotlrn-evaluation/dotlrn-evaluation.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-evaluation/dotlrn-evaluation.info,v diff -u -N -r1.6 -r1.7 --- openacs-4/packages/dotlrn-evaluation/dotlrn-evaluation.info 15 May 2007 20:14:27 -0000 1.6 +++ openacs-4/packages/dotlrn-evaluation/dotlrn-evaluation.info 7 Oct 2007 22:36:57 -0000 1.7 @@ -7,13 +7,13 @@ f t - + Jose Pablo Escobedo Del Cid - 2007-04-22 + 2007-09-08 - - - + + + Index: openacs-4/packages/dotlrn-faq/dotlrn-faq.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-faq/dotlrn-faq.info,v diff -u -N -r1.17 -r1.18 --- openacs-4/packages/dotlrn-faq/dotlrn-faq.info 15 May 2007 20:14:28 -0000 1.17 +++ openacs-4/packages/dotlrn-faq/dotlrn-faq.info 7 Oct 2007 22:36:57 -0000 1.18 @@ -7,14 +7,14 @@ f t - + OpenACS - 2007-04-22 + 2007-09-08 OpenACS - - - + + + Index: openacs-4/packages/dotlrn-forums/dotlrn-forums.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-forums/dotlrn-forums.info,v diff -u -N -r1.15 -r1.16 --- openacs-4/packages/dotlrn-forums/dotlrn-forums.info 15 May 2007 20:14:28 -0000 1.15 +++ openacs-4/packages/dotlrn-forums/dotlrn-forums.info 7 Oct 2007 22:36:57 -0000 1.16 @@ -7,15 +7,15 @@ f t - + OpenACS - 2007-04-22 + 2007-09-08 OpenACS 0 - - - + + + Index: openacs-4/packages/dotlrn-fs/dotlrn-fs.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-fs/dotlrn-fs.info,v diff -u -N -r1.29 -r1.30 --- openacs-4/packages/dotlrn-fs/dotlrn-fs.info 15 May 2007 20:14:29 -0000 1.29 +++ openacs-4/packages/dotlrn-fs/dotlrn-fs.info 7 Oct 2007 22:36:58 -0000 1.30 @@ -7,15 +7,15 @@ f t - + OpenACS - 2007-04-22 + 2007-09-08 OpenACS - - + + - + Index: openacs-4/packages/dotlrn-homework/dotlrn-homework.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-homework/dotlrn-homework.info,v diff -u -N -r1.10 -r1.11 --- openacs-4/packages/dotlrn-homework/dotlrn-homework.info 15 May 2007 20:14:30 -0000 1.10 +++ openacs-4/packages/dotlrn-homework/dotlrn-homework.info 7 Oct 2007 22:36:58 -0000 1.11 @@ -7,16 +7,16 @@ f f - + Don Baccus Provides a homework assignment dropboxes for dotLRN classes. - 2007-04-22 + 2007-09-08 furfly.net, LLC - - - - + + + + Index: openacs-4/packages/dotlrn-homework/www/file-add.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-homework/www/file-add.tcl,v diff -u -N -r1.4 -r1.5 --- openacs-4/packages/dotlrn-homework/www/file-add.tcl 8 Aug 2006 21:26:36 -0000 1.4 +++ openacs-4/packages/dotlrn-homework/www/file-add.tcl 7 Oct 2007 22:36:58 -0000 1.5 @@ -52,7 +52,7 @@ ad_form -extend -name homework_form -form { {description:text(textarea),optional {label "[_ dotlrn-homework.Description]"} - {html {rows 5 cols 50 wrap physical}}} + {html {rows 5 cols 50}}} } -validate { {upload_file { [file size [template::util::file::get_property tmp_filename $upload_file]] <= [ad_parameter "MaximumFileSize"] } Index: openacs-4/packages/dotlrn-homework/www/version-add.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-homework/www/version-add.tcl,v diff -u -N -r1.3 -r1.4 --- openacs-4/packages/dotlrn-homework/www/version-add.tcl 20 Apr 2004 21:13:31 -0000 1.3 +++ openacs-4/packages/dotlrn-homework/www/version-add.tcl 7 Oct 2007 22:36:58 -0000 1.4 @@ -31,7 +31,7 @@ file_id:key {upload_file:file {label "[_ dotlrn-homework.lt_version_filename]"}} {description:text(textarea),optional {label "[_ dotlrn-homework.lt_version_notes]"} - {html {rows 5 cols 50 wrap physical}}} + {html {rows 5 cols 50}}} } -edit_request { } -validate { {upload_file Index: openacs-4/packages/dotlrn-news/dotlrn-news.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-news/dotlrn-news.info,v diff -u -N -r1.13 -r1.14 --- openacs-4/packages/dotlrn-news/dotlrn-news.info 15 May 2007 20:14:30 -0000 1.13 +++ openacs-4/packages/dotlrn-news/dotlrn-news.info 7 Oct 2007 22:36:58 -0000 1.14 @@ -7,14 +7,14 @@ f t - + OpenACS - 2007-04-22 + 2007-09-08 OpenACS - - - + + + Index: openacs-4/packages/dotlrn-photo-album/dotlrn-photo-album.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-photo-album/dotlrn-photo-album.info,v diff -u -N -r1.6 -r1.7 --- openacs-4/packages/dotlrn-photo-album/dotlrn-photo-album.info 15 May 2007 20:14:31 -0000 1.6 +++ openacs-4/packages/dotlrn-photo-album/dotlrn-photo-album.info 7 Oct 2007 22:36:58 -0000 1.7 @@ -7,15 +7,15 @@ f t - + Jeff Davis Xarg - 2007-04-22 + 2007-09-08 - - + + - + Index: openacs-4/packages/dotlrn-portlet/dotlrn-portlet.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-portlet/dotlrn-portlet.info,v diff -u -N -r1.22 -r1.23 --- openacs-4/packages/dotlrn-portlet/dotlrn-portlet.info 15 May 2007 20:14:31 -0000 1.22 +++ openacs-4/packages/dotlrn-portlet/dotlrn-portlet.info 7 Oct 2007 22:36:58 -0000 1.23 @@ -7,14 +7,14 @@ f t - + OpenACS - 2007-04-22 + 2007-09-08 OpenACS - - - + + + Index: openacs-4/packages/dotlrn-random-photo/dotlrn-random-photo.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-random-photo/dotlrn-random-photo.info,v diff -u -N -r1.4 -r1.5 --- openacs-4/packages/dotlrn-random-photo/dotlrn-random-photo.info 15 May 2007 20:14:32 -0000 1.4 +++ openacs-4/packages/dotlrn-random-photo/dotlrn-random-photo.info 7 Oct 2007 22:36:58 -0000 1.5 @@ -7,12 +7,12 @@ f f - + Gerardo Morales - 2007-04-22 + 2007-09-08 - - + + Index: openacs-4/packages/dotlrn-static/dotlrn-static.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-static/dotlrn-static.info,v diff -u -N -r1.14 -r1.15 --- openacs-4/packages/dotlrn-static/dotlrn-static.info 15 May 2007 20:14:32 -0000 1.14 +++ openacs-4/packages/dotlrn-static/dotlrn-static.info 7 Oct 2007 22:36:58 -0000 1.15 @@ -7,14 +7,14 @@ f t - + OpenACS - 2007-04-22 + 2007-09-08 OpenACS - - - + + + Index: openacs-4/packages/dotlrn-survey/dotlrn-survey.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-survey/dotlrn-survey.info,v diff -u -N -r1.8 -r1.9 --- openacs-4/packages/dotlrn-survey/dotlrn-survey.info 15 May 2007 20:14:32 -0000 1.8 +++ openacs-4/packages/dotlrn-survey/dotlrn-survey.info 7 Oct 2007 22:36:59 -0000 1.9 @@ -7,15 +7,15 @@ f t - + dave bauer dotLRN applet for Survey package dotLRN applet for Survey package - 2007-04-22 + 2007-09-08 - - - + + + Index: openacs-4/packages/dotlrn-syllabus/dotlrn-syllabus.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-syllabus/dotlrn-syllabus.info,v diff -u -N -r1.10 -r1.11 --- openacs-4/packages/dotlrn-syllabus/dotlrn-syllabus.info 15 May 2007 20:14:32 -0000 1.10 +++ openacs-4/packages/dotlrn-syllabus/dotlrn-syllabus.info 7 Oct 2007 22:36:59 -0000 1.11 @@ -7,14 +7,14 @@ f f - + OpenACS - 2007-04-22 + 2007-09-08 OpenACS - + - + Index: openacs-4/packages/dotlrn-weblogger/dotlrn-weblogger.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-weblogger/dotlrn-weblogger.info,v diff -u -N -r1.9 -r1.10 --- openacs-4/packages/dotlrn-weblogger/dotlrn-weblogger.info 15 May 2007 20:14:33 -0000 1.9 +++ openacs-4/packages/dotlrn-weblogger/dotlrn-weblogger.info 7 Oct 2007 22:36:59 -0000 1.10 @@ -7,14 +7,14 @@ f t - + Simon Carstensen - 2007-04-22 + 2007-09-08 Collaboraid - - - + + + Index: openacs-4/packages/evaluation/evaluation.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/evaluation.info,v diff -u -N -r1.28 -r1.29 --- openacs-4/packages/evaluation/evaluation.info 27 Jun 2007 22:56:48 -0000 1.28 +++ openacs-4/packages/evaluation/evaluation.info 7 Oct 2007 22:36:59 -0000 1.29 @@ -10,7 +10,8 @@ Jose Pablo Escobedo Del Cid This package allows the users (professors and students) to use the system to submit and grade the tasks. - 2007-06-15 + 2007-09-08 + This package allows the professors and TAs to assign tasks to the students and to grade them, and to the students to upload their answers and see their grades. 0 #evaluation.Evaluations# Index: openacs-4/packages/evaluation/www/evaluation-view.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/evaluation-view.tcl,v diff -u -N -r1.5 -r1.6 --- openacs-4/packages/evaluation/www/evaluation-view.tcl 8 Aug 2006 21:26:41 -0000 1.5 +++ openacs-4/packages/evaluation/www/evaluation-view.tcl 7 Oct 2007 22:36:59 -0000 1.6 @@ -116,7 +116,7 @@ } {comments:text(textarea) {label "[_ evaluation.Comments_1]"} - {html {rows 4 cols 40 wrap soft}} + {html {rows 4 cols 40}} {value $comments} } {evaluation_date:date,to_sql(linear_date),from_sql(sql_date) Index: openacs-4/packages/evaluation/www/task-view.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/task-view.tcl,v diff -u -N -r1.14 -r1.15 --- openacs-4/packages/evaluation/www/task-view.tcl 8 Aug 2006 21:26:41 -0000 1.14 +++ openacs-4/packages/evaluation/www/task-view.tcl 7 Oct 2007 22:36:59 -0000 1.15 @@ -79,7 +79,7 @@ {description:richtext,optional {label "[_ evaluation.lt_Assignments_Descripti]"} - {html {rows 4 cols 40 wrap soft}} + {html {rows 4 cols 40}} } {due_date:date,to_sql(linear_date),from_sql(sql_date) Index: openacs-4/packages/evaluation/www/admin/evaluations/evaluations-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/admin/evaluations/evaluations-edit.tcl,v diff -u -N -r1.12 -r1.13 --- openacs-4/packages/evaluation/www/admin/evaluations/evaluations-edit.tcl 8 Aug 2006 21:26:42 -0000 1.12 +++ openacs-4/packages/evaluation/www/admin/evaluations/evaluations-edit.tcl 7 Oct 2007 22:36:59 -0000 1.13 @@ -37,7 +37,7 @@ } ] \ edit_reason \ [list label "[_ evaluation.Edit_Reason_]" \ - display_template { } \ + display_template { } \ ] \ show_student_p \ [list label "[_ evaluation.lt_Allow_the_students_br]" \ Index: openacs-4/packages/evaluation/www/admin/evaluations/student-list.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/admin/evaluations/student-list.tcl,v diff -u -N -r1.22 -r1.23 --- openacs-4/packages/evaluation/www/admin/evaluations/student-list.tcl 8 Aug 2006 21:26:42 -0000 1.22 +++ openacs-4/packages/evaluation/www/admin/evaluations/student-list.tcl 7 Oct 2007 22:36:59 -0000 1.23 @@ -257,7 +257,7 @@ display_template {

    $max_grade max
    } ] lappend elements comments \ [list label "[_ evaluation.Comments]" \ - display_template { } \ + display_template { } \ ] lappend elements show_answer \ [list label "[_ evaluation.see_grades]" \ @@ -347,7 +347,7 @@ display_template {

    $max_grade max.
    }] lappend elements comments \ [list label "[_ evaluation.Comments]" \ - display_template { } \ + display_template { } \ ] lappend elements show_answer \ [list label "[_ evaluation.see_grades]" \ @@ -447,7 +447,7 @@ display_template {

    $max_grade max.
    }] lappend elements comments \ [list label "[_ evaluation.Comments]" \ - display_template { } \ + display_template { } \ ] lappend elements show_answer \ [list label "[_ evaluation.see_grades]" \ Index: openacs-4/packages/evaluation/www/admin/tasks/task-add-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/admin/tasks/task-add-edit.tcl,v diff -u -N -r1.29 -r1.30 --- openacs-4/packages/evaluation/www/admin/tasks/task-add-edit.tcl 15 Dec 2006 22:45:31 -0000 1.29 +++ openacs-4/packages/evaluation/www/admin/tasks/task-add-edit.tcl 7 Oct 2007 22:36:59 -0000 1.30 @@ -197,7 +197,7 @@ {description:richtext,optional {label "[_ evaluation.lt_Assignments_Descripti]"} - {html {rows 4 cols 40 wrap soft}} + {html {rows 4 cols 40}} } {due_date:date,to_sql(linear_date),from_sql(sql_date),optional Index: openacs-4/packages/evaluation/www/view/evaluation-view.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/view/evaluation-view.tcl,v diff -u -N -r1.2 -r1.3 --- openacs-4/packages/evaluation/www/view/evaluation-view.tcl 8 Aug 2006 21:26:43 -0000 1.2 +++ openacs-4/packages/evaluation/www/view/evaluation-view.tcl 7 Oct 2007 22:37:00 -0000 1.3 @@ -113,7 +113,7 @@ } {comments:text(textarea) {label "[_ evaluation.Comments_1]"} - {html {rows 4 cols 40 wrap soft}} + {html {rows 4 cols 40}} {value $comments} } {evaluation_date:date,to_sql(linear_date),from_sql(sql_date) Index: openacs-4/packages/evaluation/www/view/task-view.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation/www/view/task-view.tcl,v diff -u -N -r1.2 -r1.3 --- openacs-4/packages/evaluation/www/view/task-view.tcl 8 Aug 2006 21:26:43 -0000 1.2 +++ openacs-4/packages/evaluation/www/view/task-view.tcl 7 Oct 2007 22:37:00 -0000 1.3 @@ -79,7 +79,7 @@ {description:richtext,optional {label "[_ evaluation.lt_Assignments_Descripti]"} - {html {rows 4 cols 40 wrap soft}} + {html {rows 4 cols 40}} } {due_date:date,to_sql(linear_date),from_sql(sql_date) Index: openacs-4/packages/evaluation-portlet/evaluation-portlet.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/evaluation-portlet/evaluation-portlet.info,v diff -u -N -r1.9 -r1.10 --- openacs-4/packages/evaluation-portlet/evaluation-portlet.info 15 May 2007 20:14:33 -0000 1.9 +++ openacs-4/packages/evaluation-portlet/evaluation-portlet.info 7 Oct 2007 22:37:00 -0000 1.10 @@ -7,12 +7,12 @@ f t - + Jose Pablo Escobedo Del Cid - 2007-03-27 + 2007-09-08 - - + + Index: openacs-4/packages/faq/faq.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/faq/faq.info,v diff -u -N -r1.21 -r1.22 --- openacs-4/packages/faq/faq.info 27 Jun 2007 22:51:41 -0000 1.21 +++ openacs-4/packages/faq/faq.info 7 Oct 2007 22:37:00 -0000 1.22 @@ -12,14 +12,14 @@ Jennie Kim Housman Elizabeth Wirth Manage simple and categorized Question and Answer style FAQs with WYSIWYG and notification functionalities. - 2007-06-15 + 2007-07-11 Ybos Corporation Handles frequently asked questions Q&A presentation. Can be one Q&A per page or all presented flat. Straightforward application with room for improvement. Support for notification as well as WYSIQYG Editor and Categories - both optional. Category trees are displayed flat. No multiple filters. 2 #faq.FAQs# - + Index: openacs-4/packages/faq/sql/postgresql/faq-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/faq/sql/postgresql/faq-create.sql,v diff -u -N -r1.5 -r1.6 --- openacs-4/packages/faq/sql/postgresql/faq-create.sql 1 Apr 2004 22:52:46 -0000 1.5 +++ openacs-4/packages/faq/sql/postgresql/faq-create.sql 7 Oct 2007 22:37:00 -0000 1.6 @@ -142,9 +142,4 @@ \i faq-package-create.sql - - - - - - +\i faq-sc-create.sql Index: openacs-4/packages/faq/sql/postgresql/faq-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/faq/sql/postgresql/faq-drop.sql,v diff -u -N -r1.3 -r1.4 --- openacs-4/packages/faq/sql/postgresql/faq-drop.sql 17 May 2003 10:33:37 -0000 1.3 +++ openacs-4/packages/faq/sql/postgresql/faq-drop.sql 7 Oct 2007 22:37:00 -0000 1.4 @@ -2,6 +2,15 @@ -- @author wirth@ybos.net --openacs port @samir.symphinity.com +--drop triggers +drop trigger faq_sc__itrg on faq_q_and_as; +drop trigger faq_sc__dtrg on faq_q_and_as; +drop trigger faq_sc__utrg on faq_q_and_as; + +drop function faq_sc__itrg () +drop function faq_sc__dtrg () +drop function faq_sc__utrg () + --drop functions drop function faq__new_q_and_a (integer,integer,varchar,varchar,integer,varchar,timestamptz,integer,varchar,integer); drop function faq__delete_q_and_a (integer); Index: openacs-4/packages/faq/sql/postgresql/faq-sc-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/faq/sql/postgresql/faq-sc-create.sql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/faq/sql/postgresql/faq-sc-create.sql 7 Oct 2007 22:37:00 -0000 1.2 @@ -0,0 +1,38 @@ +-- +-- packages/faq/sql/postgresql/faq-sc-create.sql +-- +-- @author Emmanuelle Raffenne (eraffenne@dia.uned.es) +-- @creation-date 2007-07-11 +-- @arch-tag: 24e3ba57-1575-4718-b664-924e7bc170e1 +-- @cvs-id $Id: faq-sc-create.sql,v 1.2 2007/10/07 22:37:00 donb Exp $ +-- + +create function faq_sc__itrg () +returns opaque as ' + begin + perform search_observer__enqueue(new.entry_id,''INSERT''); + return new; + end; ' +language 'plpgsql'; + +create function faq_sc__dtrg () +returns opaque as ' + begin + perform search_observer__enqueue(old.entry_id,''DELETE''); + return old; + end; ' +language 'plpgsql'; + +create function faq_sc__utrg () +returns opaque as ' + begin + perform search_observer__enqueue(old.entry_id,''UPDATE''); + return old; + end; ' +language 'plpgsql'; + +create trigger faq_sc__itrg after insert on faq_q_and_as for each row execute procedure faq_sc__itrg (); + +create trigger faq_sc__dtrg after delete on faq_q_and_as for each row execute procedure faq_sc__dtrg (); + +create trigger faq_sc__utrg after update on faq_q_and_as for each row execute procedure faq_sc__utrg (); Index: openacs-4/packages/faq/sql/postgresql/upgrade/upgrade-5.2.0d4-5.2.0d5.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/faq/sql/postgresql/upgrade/upgrade-5.2.0d4-5.2.0d5.sql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/faq/sql/postgresql/upgrade/upgrade-5.2.0d4-5.2.0d5.sql 7 Oct 2007 22:37:00 -0000 1.2 @@ -0,0 +1,10 @@ +-- +-- packages/faq/sql/postgresql/upgrade/upgrade-5.2.0d4-5.2.0d5.sql +-- +-- @author Emmanuelle Raffenne (eraffenne@dia.uned.es) +-- @creation-date 2007-07-11 +-- @arch-tag: 3f699cf4-3aa2-44d5-a116-594b0fd9fede +-- @cvs-id $Id: upgrade-5.2.0d4-5.2.0d5.sql,v 1.2 2007/10/07 22:37:00 donb Exp $ +-- + +\i ../faq-sc-create.sql Index: openacs-4/packages/faq-portlet/faq-portlet.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/faq-portlet/faq-portlet.info,v diff -u -N -r1.21 -r1.22 --- openacs-4/packages/faq-portlet/faq-portlet.info 15 May 2007 20:14:35 -0000 1.21 +++ openacs-4/packages/faq-portlet/faq-portlet.info 7 Oct 2007 22:37:00 -0000 1.22 @@ -7,14 +7,14 @@ f t - + OpenACS - 2007-04-22 + 2007-09-08 OpenACS - + - + Index: openacs-4/packages/file-storage/tcl/file-storage-callback-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/tcl/file-storage-callback-procs.tcl,v diff -u -N -r1.7 -r1.8 --- openacs-4/packages/file-storage/tcl/file-storage-callback-procs.tcl 30 Jan 2007 14:05:24 -0000 1.7 +++ openacs-4/packages/file-storage/tcl/file-storage-callback-procs.tcl 7 Oct 2007 22:37:00 -0000 1.8 @@ -109,6 +109,15 @@ return "/file/$item_id/$name" } +ad_proc -public -callback search::url -impl file_storage_object { + -object_id:required +} { + Return the URL to the file_storage_object +} { + set item_id [content::revision::item_id -revision_id $object_id] + set name [db_string item "select name from cr_items where item_id = :item_id" -default ""] + return "[ad_url]/file/$item_id/$name" +} ad_proc -public -callback datamanager::copy_folder -impl datamanager { -object_id:required Index: openacs-4/packages/forums/lib/message/post.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/lib/message/post.tcl,v diff -u -N -r1.16 -r1.17 --- openacs-4/packages/forums/lib/message/post.tcl 6 Jul 2007 12:13:25 -0000 1.16 +++ openacs-4/packages/forums/lib/message/post.tcl 7 Oct 2007 22:37:01 -0000 1.17 @@ -37,7 +37,7 @@ {label "[_ forums.Subject]"} } {message_body:richtext(richtext) - {html {rows 20 cols 60 wrap soft}} + {html {rows 20 cols 60}} {label "[_ forums.Body]"} } {forum_id:integer(hidden) Index: openacs-4/packages/forums/lib/message/thread-chunk-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/lib/message/thread-chunk-oracle.xql,v diff -u -N -r1.4 -r1.5 --- openacs-4/packages/forums/lib/message/thread-chunk-oracle.xql 15 Mar 2005 20:06:45 -0000 1.4 +++ openacs-4/packages/forums/lib/message/thread-chunk-oracle.xql 7 Oct 2007 22:37:01 -0000 1.5 @@ -28,7 +28,7 @@ state, user_id, parent_id - from $table_name + from $table_name t where forum_id = :forum_id and tree_sortkey between tree.left(:tree_sortkey) and tree.right(:tree_sortkey) order by $order_by @@ -48,7 +48,7 @@ state, user_id, parent_id - from $table_name + from $table_name t where forum_id = :forum_id and tree_sortkey between tree.left(:tree_sortkey) and tree.right(:tree_sortkey) order by $order_by Index: openacs-4/packages/forums/lib/message/thread-chunk.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/lib/message/thread-chunk.tcl,v diff -u -N -r1.6 -r1.7 --- openacs-4/packages/forums/lib/message/thread-chunk.tcl 15 May 2007 20:14:39 -0000 1.6 +++ openacs-4/packages/forums/lib/message/thread-chunk.tcl 7 Oct 2007 22:37:01 -0000 1.7 @@ -90,6 +90,7 @@ db_multirow -extend { posting_date_pretty direct_url number parent_number parent_direct_url reply_p viewed_p open_p} responses $query {} { set open_p t set tree_level [min [expr {$tree_level - $message(tree_level)}] 10] + set posting_date_ansi [lc_time_system_to_conn $posting_date_ansi] set posting_date_pretty [lc_time_fmt $posting_date_ansi "%x %X"] set direct_url "$direct_url_base\#$message_id" set number [expr [lsearch $message_id_list $message_id] + 1] Index: openacs-4/packages/forums/tcl/form-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/tcl/form-procs.tcl,v diff -u -N -r1.8 -r1.9 --- openacs-4/packages/forums/tcl/form-procs.tcl 15 May 2007 20:14:40 -0000 1.8 +++ openacs-4/packages/forums/tcl/form-procs.tcl 7 Oct 2007 22:37:01 -0000 1.9 @@ -39,7 +39,7 @@ -label [_ forums.Body] \ -datatype richtext \ -widget richtext \ - -html {rows 20 cols 60 wrap soft style {width:100%}} \ + -html {rows 20 cols 60 style {width:100%}} \ $optional_switch } @@ -102,7 +102,7 @@ } { template::element create $form_name ${prefix}to_email \ -label [_ forums.Email] \ - -datatype text \ + -datatype email \ -widget text \ -html {size 60} @@ -116,7 +116,7 @@ -label [_ forums.Your_Note] \ -datatype text \ -widget textarea \ - -html {cols 80 rows 10 wrap hard} + -html {cols 80 rows 10} } ad_proc -public forums::form::search { @@ -155,7 +155,7 @@ -label [_ forums.Charter] \ -datatype richtext \ -widget richtext \ - -html {cols 60 rows 10 wrap soft} \ + -html {cols 60 rows 10} \ -validate { {expr [string length $value] <= 4000 } {#forums.charter_max_chars#} } \ -optional Index: openacs-4/packages/forums/tcl/forums-callback-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/tcl/forums-callback-procs-oracle.xql,v diff -u -N -r1.1 -r1.2 --- openacs-4/packages/forums/tcl/forums-callback-procs-oracle.xql 28 Jan 2006 15:39:03 -0000 1.1 +++ openacs-4/packages/forums/tcl/forums-callback-procs-oracle.xql 7 Oct 2007 22:37:01 -0000 1.2 @@ -35,9 +35,8 @@ select subject, content, format from forums_messages - where message_id=:message_id --- lets just get the message instead of the whole thread --- replace with a connect by + start with message_id=:message_id + connect by prior message_id = parent_id Index: openacs-4/packages/forums/tcl/forums-callback-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/tcl/forums-callback-procs-postgresql.xql,v diff -u -N -r1.1 -r1.2 --- openacs-4/packages/forums/tcl/forums-callback-procs-postgresql.xql 28 Jan 2006 15:39:03 -0000 1.1 +++ openacs-4/packages/forums/tcl/forums-callback-procs-postgresql.xql 7 Oct 2007 22:37:01 -0000 1.2 @@ -35,9 +35,9 @@ select subject, content, format from forums_messages - where message_id=:message_id --- lets just get the message instead of the whole thread --- replace with a connect by + where message_id=:message_id or (tree_sortkey between tree_left(:tree_sortkey) and tree_right(:tree_sortkey)) + and forum_id=:forum_id + order by tree_sortkey Index: openacs-4/packages/forums/www/message-email.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/www/message-email.adp,v diff -u -N -r1.10 -r1.11 --- openacs-4/packages/forums/www/message-email.adp 8 Aug 2006 21:26:53 -0000 1.10 +++ openacs-4/packages/forums/www/message-email.adp 7 Oct 2007 22:37:01 -0000 1.11 @@ -2,13 +2,15 @@ #forums.Email_Message# @message.forum_name;noquote@ - @message.subject;noquote@ @context;noquote@ - - - - - + + + + + + link +

    #forums.lt_Email_a_copy_of_the_f#

    Index: openacs-4/packages/forums/www/message-email.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/www/message-email.tcl,v diff -u -N -r1.13 -r1.14 --- openacs-4/packages/forums/www/message-email.tcl 15 Mar 2005 20:06:45 -0000 1.13 +++ openacs-4/packages/forums/www/message-email.tcl 7 Oct 2007 22:37:01 -0000 1.14 @@ -53,4 +53,48 @@ lappend context [list "./message-view?message_id=$message(message_id)" "$message(subject)"] lappend context [_ forums.Email_to_a_friend] +if {![template::multirow exists link]} { + template::multirow create link rel type href title lang media +} + +template::multirow append link \ + stylesheet \ + text/css \ + /resources/forums/forums.css \ + "" \ + [ad_conn language] \ + all + +template::multirow append link \ + "alternate stylesheet" \ + text/css \ + /resources/forums/flat.css \ + "flat" \ + [ad_conn language] \ + all + +template::multirow append link \ + "alternate stylesheet" \ + text/css \ + /resources/forums/flat-collapse.css \ + "flat-collapse" \ + [ad_conn language] \ + all + +template::multirow append link \ + "alternate stylesheet" \ + text/css \ + /resources/forums/collapse.css \ + "collapse" \ + [ad_conn language] \ + all + +template::multirow append link \ + "alternate stylesheet" \ + text/css \ + /resources/forums/expand.css \ + "expand" \ + [ad_conn language] \ + all + ad_return_template Index: openacs-4/packages/forums/www/message-post-confirm.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/www/message-post-confirm.adp,v diff -u -N -r1.15 -r1.16 --- openacs-4/packages/forums/www/message-post-confirm.adp 8 Aug 2006 21:26:53 -0000 1.15 +++ openacs-4/packages/forums/www/message-post-confirm.adp 7 Oct 2007 22:37:01 -0000 1.16 @@ -2,13 +2,15 @@ #forums.Confirm_Post_to_Forum# @forum.name;noquote@ @context;noquote@ - - - - - + + + + + + link + @context;noquote@ message.subject - - - - - + + + + + + link + @message_id@ - - - - - - - + + + + + + + - @dynamic_script;noquote@ + + + +link +script +

    @page_title;noquote@

    Index: openacs-4/packages/forums/www/message-view.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/www/message-view.tcl,v diff -u -N -r1.37 -r1.38 --- openacs-4/packages/forums/www/message-view.tcl 15 Jun 2007 11:53:51 -0000 1.37 +++ openacs-4/packages/forums/www/message-view.tcl 7 Oct 2007 22:37:01 -0000 1.38 @@ -101,8 +101,6 @@ set thread_url [export_vars -base forum-view { { forum_id $message(forum_id) } }] set dynamic_script " - - " if {$forum(presentation_type) eq "flat"} { set display_mode flat } -set page_title "#forums.Thread_title#" \ No newline at end of file +# stylesheets +if {![template::multirow exists link]} { + template::multirow create link rel type href title lang media +} + +template::multirow append link \ + stylesheet \ + text/css \ + /resources/forums/forums.css \ + "" \ + [ad_conn language] \ + all + +template::multirow append link \ + stylesheet \ + text/css \ + /resources/forums/print.css \ + "" \ + [ad_conn language] \ + print + +template::multirow append link \ + "alternate stylesheet" \ + text/css \ + /resources/forums/flat.css \ + "flat" \ + [ad_conn language] \ + all + +template::multirow append link \ + "alternate stylesheet" \ + text/css \ + /resources/forums/flat-collapse.css \ + "flat-collapse" \ + [ad_conn language] \ + all + +template::multirow append link \ + "alternate stylesheet" \ + text/css \ + /resources/forums/collapse.css \ + "collapse" \ + [ad_conn language] \ + all + +template::multirow append link \ + "alternate stylesheet" \ + text/css \ + /resources/forums/expand.css \ + "expand" \ + [ad_conn language] \ + all + +# js scripts +if {![template::multirow exists script]} { + template::multirow create script type src charset defer content +} + +template::multirow append script \ + "text/javascript" \ + "/resources/forums/forums.js" + +template::multirow append script \ + "text/javascript" \ + "/resources/forums/dynamic-comments.js" + +template::multirow append script \ + "text/javascript" \ + "" \ + "" \ + "" \ + $dynamic_script + +set page_title "#forums.Thread_title#" Index: openacs-4/packages/forums/www/moderate/message-delete.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/www/moderate/message-delete.adp,v diff -u -N -r1.10 -r1.11 --- openacs-4/packages/forums/www/moderate/message-delete.adp 8 Aug 2006 21:26:53 -0000 1.10 +++ openacs-4/packages/forums/www/moderate/message-delete.adp 7 Oct 2007 22:37:01 -0000 1.11 @@ -2,16 +2,12 @@ #forums.Confirm_Delete# @message.subject;noquote@ #forums.delete# - + - + + +link +script + Index: openacs-4/packages/forums/www/moderate/message-delete.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums/www/moderate/message-delete.tcl,v diff -u -N -r1.10 -r1.11 --- openacs-4/packages/forums/www/moderate/message-delete.tcl 17 Dec 2003 15:45:31 -0000 1.10 +++ openacs-4/packages/forums/www/moderate/message-delete.tcl 7 Oct 2007 22:37:01 -0000 1.11 @@ -18,4 +18,43 @@ # Select the stuff forum::message::get -message_id $message_id -array message +set dynamic_script " + +" +# stylesheets +if {![template::multirow exists link]} { + template::multirow create link rel type href title lang media +} + +template::multirow append link \ + stylesheet \ + text/css \ + /resources/forums/forums.css \ + "" \ + [ad_conn language] \ + all + +# js scripts +if {![template::multirow exists script]} { + template::multirow create script type src charset defer content +} + +template::multirow append script \ + "text/javascript" \ + "/resources/forums/forums.js" + +template::multirow append script \ + "text/javascript" \ + "" \ + "" \ + "" \ + $dynamic_script + ad_return_template Index: openacs-4/packages/forums-portlet/forums-portlet.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/forums-portlet/forums-portlet.info,v diff -u -N -r1.12 -r1.13 --- openacs-4/packages/forums-portlet/forums-portlet.info 15 May 2007 20:14:41 -0000 1.12 +++ openacs-4/packages/forums-portlet/forums-portlet.info 7 Oct 2007 22:37:01 -0000 1.13 @@ -7,15 +7,15 @@ f t - + OpenACS - 2007-04-22 + 2007-09-08 OpenACS 0 - + - + Index: openacs-4/packages/fs-portlet/fs-portlet.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/fs-portlet/fs-portlet.info,v diff -u -N -r1.21 -r1.22 --- openacs-4/packages/fs-portlet/fs-portlet.info 15 May 2007 20:14:41 -0000 1.21 +++ openacs-4/packages/fs-portlet/fs-portlet.info 7 Oct 2007 22:37:01 -0000 1.22 @@ -7,14 +7,14 @@ f t - + OpenACS - 2007-04-22 + 2007-09-08 OpenACS - + - + Index: openacs-4/packages/imsld/catalog/imsld.es_GT.ISO-8859-1.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/catalog/imsld.es_GT.ISO-8859-1.xml,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/imsld/catalog/imsld.es_GT.ISO-8859-1.xml 7 Oct 2007 22:37:01 -0000 1.2 @@ -0,0 +1,8 @@ + + + + Entorno + Material + Unidades de Aprendizaje + AdministraciĂłn de Unidades de Aprendizaje + Index: openacs-4/packages/imsld/lib/choice-select.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/lib/choice-select.adp,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/imsld/lib/choice-select.adp 7 Oct 2007 22:37:02 -0000 1.2 @@ -0,0 +1,41 @@ + + + + @aux_pre_text;noquote@ + + + + + + + + + + + + + + + @aux_post_text;noquote@ + + + + Index: openacs-4/packages/imsld/lib/imsld-master.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/lib/imsld-master.adp,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/imsld/lib/imsld-master.adp 7 Oct 2007 22:37:02 -0000 1.2 @@ -0,0 +1,114 @@ +@doc.type;noquote@ + lang="@doc.lang;noquote@"> + + lang="@doc.title_lang;noquote@">@doc.title;noquote@ + + http-equiv="@meta.http_equiv;noquote" + name="@meta.name;noquote@" + scheme="@meta.scheme;noquote@" + lang="@meta.lang;noquote@" content="@meta.content@">> + + + lang="@link.lang;noquote@" + title="@link.title;noquote@" + type="@link.type;noquote@" + media="@link.media@"/> + + + @head;noquote@ + + + + + + class="@body.class;noquote@" id="@body.id;noquote@"@event_handlers;noquote@> + + + + +
    +
      + +
      @user_messages.message;noquote@
      +
      +
    +
    +
    + + + + + + + + + + + + + + + + + #imsld.Hide# + + + + + #imsld.Show# + + + + + + + + Index: openacs-4/packages/imsld/lib/imsld-master.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/lib/imsld-master.tcl,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/imsld/lib/imsld-master.tcl 7 Oct 2007 22:37:02 -0000 1.2 @@ -0,0 +1,292 @@ +#ad_page_contract { blank-master +#} + +if { [template::util::is_nil title] } { + set title [ad_conn instance_name] +} + +if {![array exists doc]} { + array set doc [list] +} + +if { ![info exists header_stuff] } { + set header_stuff "" +} + +if { [string match /dotlrn/clubs/* [ad_conn url]] } { + set css_url [parameter::get_from_package_key \ + -package_key "theme-zen" \ + -parameter "communityCssUrl" \ + -default "/resources/theme-zen/css/color/purple.css"] +} elseif { [string match /dotlrn/classes/* [ad_conn url]] } { + set css_url [parameter::get_from_package_key \ + -package_key "theme-zen" \ + -parameter "courseCssUrl" \ + -default "/resources/theme-zen/css/color/green.css"] +} else { + set css_url [parameter::get_from_package_key \ + -package_key "theme-zen" \ + -parameter "cssUrl" \ + -default "/resources/theme-zen/css/color/blue.css"] +} + +set header_stuff "[subst { + + + + + + + + + + + + + + + + + + }] + $header_stuff" + +if {![info exists onload]} { + set onload "" +} + +set translations [list \ + doc_type doc(type) \ + title doc(title) \ + header_stuff head \ + onload body(onload) \ + ] + +foreach {from to} $translations { + if {[info exists $from]} { + set $to [set $from] + } else { + set $to {} + } +} + +if { ![template::util::is_nil focus] } { + # Handle elements where the name contains a dot + if { [regexp {^([^.]*)\.(.*)$} $focus match form_name element_name] } { + lappend body(onload) "acs_Focus('${form_name}', '${element_name}');" + } +} + +if {[exists_and_not_null body_attributes]} { + foreach body_attribute $body_attributes { + if {[lsearch { + id + class + onload + onunload + onclick + ondblclick + onmousedown + onmouseup + onmouseover + onmousemove + onmouseout + onkeypress + onkeydown + onkeyup + } [lindex $body_attribute 0] >= 0]} { + set body([lindex $body_attribute 0]) [lindex $body_attribute 1] + } else { + ns_log error "blank-compat: [ad_conn file] uses deprecated property body_attribute for [lindex $body_attribute 0] which is no longer supported!" + } + } +} + +if {![template::multirow exists link]} { + template::multirow create link rel type href title lang media +} + +# DRB: this shouldn't really be in blank master, there should be some way for +# the templating package to associate a particular css file with pages that use +# particular form or list templates. Therefore I'll put the hard-wired values +# in blank-compat for the moment. +multirow append link stylesheet text/css /resources/acs-templating/lists.css \ + "" [ad_conn language] all +multirow append link stylesheet text/css /resources/acs-templating/forms.css \ + "" [ad_conn language] all + +if {![template::multirow exists script]} { + template::multirow create script type src charset defer content +} + +# +# Add WYSIWYG editor content +# +global acs_blank_master__htmlareas acs_blank_master + +if {[info exists acs_blank_master__htmlareas] + && [llength $acs_blank_master__htmlareas] > 0} { + # + # Add RTE scripts if we are using RTE + # + if {[info exists acs_blank_master(rte)]} { + foreach htmlarea_id [lsort -unique $acs_blank_master__htmlareas] { + lappend body(onload) "acs_rteInit('${htmlarea_id}')" + } + + template::multirow append script \ + "text/javascript" \ + "/resources/acs-templating/rte/richtext.js" + } + + # + # Add Xinha scripts if we are using Xinha + # + if {[info exists acs_blank_master(xinha)]} { + set xinha_dir /resources/acs-templating/xinha-nightly/ + set xinha_plugins $acs_blank_master(xinha.plugins) + set xinha_params "" + set xinha_options $acs_blank_master(xinha.options) + set xinha_lang [lang::conn::language] + + if {$xinha_lang ne "en" && $xinha_lang ne "de"} { + set xinha_lang en + } + + template::multirow append script "text/javascript" {} {} {} " + _editor_url = \"$xinha_dir\"; + _editor_lang = \"$xinha_lang\";" + + template::multirow append script \ + "text/javascript" \ + "${xinha_dir}htmlarea.js" + } +} + +#ad_page_contract { blank-master +#} + +if {[template::util::is_nil doc(type)]} { + set doc(type) {} +} + +if {[template::util::is_nil doc(charset)]} { + set doc(charset) [ad_conn charset] +} + +# The document language is always set from [ad_conn lang] which by default +# returns the language setting for the current user. This is probably not a +# bad guess, but the rest of OpenACS must override this setting when +# appropriate and set the lang attribute of tags which differ from the language +# of the page. Otherwise we are lying to the browser. +set doc(lang) [ad_conn language] + +# AG: Markup in tags doesn't render well. +set doc(title) [ns_striphtml $doc(title)] + +if {![template::multirow exists meta]} { + template::multirow create meta name content http_equiv scheme lang +} + +if {![template::multirow exists script]} { + template::multirow create script type src charset defer content +} +template::multirow append script text/javascript \ + /resources/acs-subsite/core.js "" "" "" + +if {![template::multirow exists body_script]} { + template::multirow create body_script type src charset defer content +} + +# Concatenate the javascript event handlers for the body tag +if {[array exists body]} { + foreach name [array names body -glob "on*"] { + if {[llength $body($name)] > 0} { + append event_handlers " ${name}=\"" + + foreach javascript $body($name) { + append event_handlers "[string trimright $javascript "; "]; " + } + + append event_handlers "\"" + } + } +} + +######################### lrn master + +set user_id [ad_get_user_id] +set untrusted_user_id [ad_conn untrusted_user_id] +set community_id [dotlrn_community::get_community_id] +set dotlrn_url [dotlrn::get_url] + +#---------------------------------------------------------------------- +# Display user messages +#---------------------------------------------------------------------- + +util_get_user_messages -multirow "user_messages" + +# Get system name +set system_name [ad_system_name] +set system_url [ad_url] +if { [string equal [ad_conn url] "/"] } { + set system_url "" +} + +if {[dotlrn::user_p -user_id $user_id]} { + set portal_id [dotlrn::get_portal_id -user_id $user_id] +} + + +# Set up some basic stuff +if { [ad_conn untrusted_user_id] == 0 } { + set user_name {} +} else { + set user_name [acs_user::get_element -user_id [ad_conn untrusted_user_id] \ + -element name] +} + +if {![exists_and_not_null title]} { + set title [ad_system_name] +} + +if {[empty_string_p [dotlrn_community::get_parent_community_id \ + -package_id [ad_conn package_id]]]} { + set parent_comm_p 0 +} else { + set parent_comm_p 1 +} + +set navbar "" +set subnavbar "" + +if { [info exists text] } { + set text [lang::util::localize $text] +} + + +# Focus +multirow create attribute key value + +if { ![template::util::is_nil focus] } { + # Handle elements wohse name contains a dot + if { [regexp {^([^.]*)\.(.*)$} $focus match form_name element_name] } { + + # Add safety code to test that the element exists ' + append header_stuff " + <script language=\"JavaScript\" type=\"text/javascript\"> + function acs_focus( form_name, element_name ) { + if (document.forms == null) return; + if (document.forms\[form_name\] == null) return; + if (document.forms\[form_name\].elements\[element_name\] == null) return; + if (document.forms\[form_name\].elements\[element_name\].type == 'hidden') return; + + document.forms\[form_name\].elements\[element_name\].focus(); + } + </script>" + template::multirow append \ + attribute onload \ + "javascript:acs_focus('${form_name}', '${element_name}')" + } +} + Index: openacs-4/packages/imsld/sql/postgresql/upgrade/upgrade-1.1d-1.2d.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/sql/postgresql/upgrade/upgrade-1.1d-1.2d.sql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/imsld/sql/postgresql/upgrade/upgrade-1.1d-1.2d.sql 7 Oct 2007 22:37:02 -0000 1.2 @@ -0,0 +1,8 @@ +-- upgrade script from 1.1d to 1.2d + +alter table imsld_notifications alter column activity_id drop not null; + + + + + Index: openacs-4/packages/imsld/www/admin/monitor/properties-frame.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/www/admin/monitor/properties-frame.adp,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/imsld/www/admin/monitor/properties-frame.adp 7 Oct 2007 22:37:02 -0000 1.2 @@ -0,0 +1,27 @@ +<master src="../../../lib/imsld-master"> + <property name="title">@page_title;noquote@</property> + <property name="imsld_content_frame">1</property> + + <div class="frame-header"> + <if @item_select:rowcount@ not nil> + <include src="../../../lib/choice-select" &="item_select" + select_name=@select_name@ + select_id=@select_id@ + selected_item=@selected_item@ + select_string=@select_string@ + aux_pre_text=@frame_header@ + aux_post_text=@post_text;noquote@ + run_id=@run_id@ + role_id=@role_id@ + type=@type@> + </if><else>@frame_header;noquote@</else> + </div> + + <br /> + + <if @table_node@ not nil> + <div class="centered-table"> + @table_node;noquote@ + </div> + </if> + Index: openacs-4/packages/imsld/www/resources/imsld.css =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/www/resources/imsld.css,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/imsld/www/resources/imsld.css 7 Oct 2007 22:37:02 -0000 1.2 @@ -0,0 +1,93 @@ +/*-------------------------------------------------- + General styles used in the IMS-LD package + --------------------------------------------------*/ + +div.role_menu { + text-align: right; + font-size: 80%; + margin: 0px; + top: 0px; + right: 0px; + padding: 4px 4px; + float: right; +} + +.indented { + margin-left:20px; +} + +a.finish { + font-size:9px; + font-family:Tahoma,sans-serif; + text-align:left; + color:#FFFFFF; + background-color:#2878C0; + border-top-style:solid; + border-top-color:#2878C0; + border-top-width:1px; + border-bottom-style:solid; + border-bottom-color:#2878C0; + border-bottom-width:1px; + border-left-style:solid; + border-left-color:#1858B8; + border-left-width:6px; + border-right-style:solid; + border-right-color:#508CC0; + border-right-width:6px; +} +a.finish:hover { + color:#FFFFFF; + background-color:#1858B8; + border-style:double; +} +.finish { + padding:0px; + margin:0px; +} + +ul.mktree, ul.mktree ul { + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 12px; + font-style: normal; + font-weight: normal; + font-variant: normal; + text-decoration: none; + text-transform: none; + text-indent: -15px; + padding: 0px 0px 5px 0px; + margin: 0px; + white-space: nowrap; +} + +/* arrow to minimize / maximize the activitie's tree window */ + + +/* notices / messages style */ +.notice { + font-size: x-small; + font-weight: bold; + background-color: #bbbbff; + padding:0px; + margin:0px; +} + +.hide { + position:absolute; + top:0px; + left:0px; + display:none; +} +.show { + position:relative; + top:0px; + left:0px; +} + +.centered-table table { + margin-right: auto; + margin-left: auto +} + +.float-left { float: left; } + +.frame-header { text-align: center; padding: 6px 8px } Index: openacs-4/packages/imsld/www/resources/imsld.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/www/resources/imsld.js,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/imsld/www/resources/imsld.js 7 Oct 2007 22:37:02 -0000 1.2 @@ -0,0 +1,86 @@ +function confirmValue(myform) { + myform.submit(); +} + +/*==================================================*/ + +function resizeobject() { + f = document.forms[0]; + o = document.getElementById('object'); + var bodies = document.getElementsByTagName("body"); + var body = bodies[0]; + if (document.documentElement && document.documentElement.currentStyle && typeof document.documentElement.clientWidth != "undefined" && document.documentElement.clientWidth != 0) + { + o.width = document.documentElement.clientWidth + 2*parseInt(document.documentElement.currentStyle.borderWidth,10) - o.style.left; + o.height = document.documentElement.clientHeight + 2*parseInt(document.documentElement.currentStyle.borderWidth,10) - o.style.top; + } + else if (document.all && document.body && typeof document.body.clientWidth != "undefined") + { + o.width = document.body.clientWidth + 2*parseInt(document.body.currentStyle.borderWidth,10) - o.style.left; + o.height = document.body.clientHeight + 2*parseInt(document.body.currentStyle.borderWidth,10) - o.style.top; + } + else if (window.innerWidth) + { + o.width = window.innerWidth - o.style.left - 30; + o.height = window.innerHeight - o.style.top - 50; + } + else if (document.body && typeof document.body.clientWidth != "undefined") + { + o.width = document.body.clientWidth - o.style.left; + o.height = document.body.clientHeight - o.style.top; + }; + +} + +/*==================================================*/ + +function objecturl(url) { + var o = document.getElementById('object'); + o.src = url; +} + +/*==================================================*/ + +right_frame_width_percentage = "30%,*" +function _tp(a){ + var ab=document.getElementById("addc"); + var ac=document.getElementById("addc1"); + + if (a) { + ai='show'; + aj='hide'; + parent.document.getElementById("right-column").cols= right_frame_width_percentage; + } else { + /* collapse the left panel */ + ai='hide'; + aj='show'; + right_frame_width_percentage = parent.document.getElementById("right-column").cols; + parent.document.getElementById("right-column").cols= '0%, *'; + } + + ac.className=ai; + ab.className=aj; + + return false; +} + +/*==================================================*/ + +function init_activity() { + resizeobject(); + window.onresize = resizeobject; + + var as = document.getElementsByTagName("a"); + for (var i = 0; i < as.length; i++) { + var a = as[i]; + a.setAttribute('target', 'object'); + } + for (var i = 0; i < as.length; i++) { + if (!as[i].getAttribute('href').match(/#/i)) { + document.getElementById('object').src = as[i].getAttribute('href'); + break; + } + } + + tabberAutomatic(); +} Index: openacs-4/packages/imsld/www/resources/viewed.ico =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/imsld/www/resources/viewed.ico,v diff -u -N -r1.1 -r1.2 Binary files differ Index: openacs-4/packages/lars-blogger/lars-blogger.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lars-blogger/lars-blogger.info,v diff -u -N -r1.43 -r1.44 --- openacs-4/packages/lars-blogger/lars-blogger.info 15 May 2007 20:14:42 -0000 1.43 +++ openacs-4/packages/lars-blogger/lars-blogger.info 7 Oct 2007 22:37:02 -0000 1.44 @@ -7,15 +7,15 @@ <initial-install-p>f</initial-install-p> <singleton-p>f</singleton-p> - <version name="2.3.0" url="http://openacs.org/repository/download/apm/lars-blogger-2.3.0.apm"> + <version name="2.3.1" url="http://openacs.org/repository/download/apm/lars-blogger-2.3.1.apm"> <owner url="mailto:lars@pinds.com">Lars Pind</owner> <summary>Individual or collaborative web logs.</summary> - <release-date>2007-04-22</release-date> + <release-date>2007-09-08</release-date> <vendor url="http://www.openacs.org">OpenACS</vendor> <description format="text/html">Weblog creation and management with notifications, RSS, trackpack, technorati, blogroll, pings, archives, draft and published entries, includable templates for presenting on other pages, and permissioning for multiple users.</description> <maturity>0</maturity> - <provides url="lars-blogger" version="2.3.0"/> + <provides url="lars-blogger" version="2.3.1"/> <requires url="acs-datetime" version="5.2.2"/> <requires url="acs-tcl" version="5.3.1a1"/> <requires url="categories" version="1.1"/> Index: openacs-4/packages/new-portal/new-portal.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/new-portal/new-portal.info,v diff -u -N -r1.30 -r1.31 --- openacs-4/packages/new-portal/new-portal.info 15 May 2007 20:14:46 -0000 1.30 +++ openacs-4/packages/new-portal/new-portal.info 7 Oct 2007 22:37:02 -0000 1.31 @@ -8,14 +8,14 @@ <singleton-p>t</singleton-p> <auto-mount>portal</auto-mount> - <version name="2.3.0" url="http://openacs.org/repository/download/apm/new-portal-2.3.0.apm"> + <version name="2.3.1" url="http://openacs.org/repository/download/apm/new-portal-2.3.d2.apm"> <owner url="http://openacs.org">OpenACS</owner> <summary>Portals.</summary> - <release-date>2007-04-22</release-date> + <release-date>2007-09-08</release-date> <vendor url="http://openacs.org">OpenACS</vendor> <description format="text/plain">New Portal Package aka NPP. Portals are used to aggregate content from different sources within a single page. Props to Ian Baker for "Portal".</description> - <provides url="new-portal" version="2.3.0"/> + <provides url="new-portal" version="2.3.d21"/> <requires url="acs-kernel" version="5.3.1a1"/> <callbacks> Index: openacs-4/packages/new-portal/sql/oracle/api-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/new-portal/sql/oracle/api-create.sql,v diff -u -N -r1.43 -r1.44 --- openacs-4/packages/new-portal/sql/oracle/api-create.sql 15 May 2007 20:14:47 -0000 1.43 +++ openacs-4/packages/new-portal/sql/oracle/api-create.sql 7 Oct 2007 22:37:02 -0000 1.44 @@ -267,7 +267,8 @@ -- now insert the pages from the portal template for page in (select * from portal_pages - where portal_id = portal.new.template_id) + where portal_id = portal.new.template_id + order by sort_key) loop v_page_id := portal_page.new( Index: openacs-4/packages/new-portal/sql/oracle/upgrade/upgrade-2.3.1d1-2.3.1d2.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/new-portal/sql/oracle/upgrade/upgrade-2.3.1d1-2.3.1d2.sql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/new-portal/sql/oracle/upgrade/upgrade-2.3.1d1-2.3.1d2.sql 7 Oct 2007 22:37:02 -0000 1.2 @@ -0,0 +1,610 @@ +-- Yes we have to reload all the packages to ensure there are no +-- dependency issues (please correct me if this is not applicable to +-- Oracle 9 and 10) DAVEB + +-- +-- Copyright (C) 2001, 2002 MIT +-- +-- This file is part of dotLRN. +-- +-- dotLRN is free software; you can redistribute it and/or modify it under the +-- terms of the GNU General Public License as published by the Free Software +-- Foundation; either version 2 of the License, or (at your option) any later +-- version. +-- +-- dotLRN is distributed in the hope that it will be useful, but WITHOUT ANY +-- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +-- FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +-- details. +-- + +-- +-- The New Portal Package +-- copyright 2001, MIT +-- distributed under the GNU GPL v2 +-- +-- @author Arjun Sanyal (arjun@openforce.net) +-- @version $Id: upgrade-2.3.1d1-2.3.1d2.sql,v 1.2 2007/10/07 22:37:02 donb Exp $ +-- + +create or replace package portal_page +as + + function new ( + page_id in portal_pages.page_id%TYPE default null, + pretty_name in portal_pages.pretty_name%TYPE default 'Untitled Page', + accesskey in portal_pages.accesskey%TYPE default null, + portal_id in portal_pages.portal_id%TYPE, + layout_id in portal_pages.layout_id%TYPE default null, + hidden_p in portal_pages.hidden_p%TYPE default 'f', + object_type in acs_object_types.object_type%TYPE default 'portal_page', + creation_date in acs_objects.creation_date%TYPE default sysdate, + creation_user in acs_objects.creation_user%TYPE default null, + creation_ip in acs_objects.creation_ip%TYPE default null, + context_id in acs_objects.context_id%TYPE default null + ) return portal_pages.page_id%TYPE; + + procedure del ( + page_id in portal_pages.page_id%TYPE + ); + +end portal_page; +/ +show errors + +create or replace package body portal_page +as + + function new ( + page_id in portal_pages.page_id%TYPE default null, + pretty_name in portal_pages.pretty_name%TYPE default 'Untitled Page', + accesskey in portal_pages.accesskey%TYPE default null, + portal_id in portal_pages.portal_id%TYPE, + layout_id in portal_pages.layout_id%TYPE default null, + hidden_p in portal_pages.hidden_p%TYPE default 'f', + object_type in acs_object_types.object_type%TYPE default 'portal_page', + creation_date in acs_objects.creation_date%TYPE default sysdate, + creation_user in acs_objects.creation_user%TYPE default null, + creation_ip in acs_objects.creation_ip%TYPE default null, + context_id in acs_objects.context_id%TYPE default null + ) return portal_pages.page_id%TYPE + is + v_page_id portal_pages.page_id%TYPE; + v_layout_id portal_pages.layout_id%TYPE; + v_sort_key portal_pages.sort_key%TYPE; + begin + + v_page_id := acs_object.new( + object_type => object_type, + creation_date => creation_date, + creation_user => creation_user, + creation_ip => creation_ip, + context_id => context_id + ); + + if layout_id is null then + select min(layout_id) + into v_layout_id + from portal_layouts; + else + v_layout_id := layout_id; + end if; + + select nvl(max(sort_key) + 1, 0) + into v_sort_key + from portal_pages + where portal_id = portal_page.new.portal_id; + + insert into portal_pages + (page_id, pretty_name, accesskey, portal_id, layout_id, sort_key, hidden_p) + values + (v_page_id, pretty_name, accesskey, portal_id, v_layout_id, v_sort_key, hidden_p); + + return v_page_id; + + end new; + + procedure del ( + page_id in portal_pages.page_id%TYPE + ) + is + v_portal_id portal_pages.portal_id%TYPE; + v_sort_key portal_pages.sort_key%TYPE; + v_curr_sort_key portal_pages.sort_key%TYPE; + v_page_count_from_0 integer; + begin + + -- IMPORTANT: sort keys MUST be an unbroken sequence from 0 to max(sort_key) + + select portal_id, sort_key + into v_portal_id, v_sort_key + from portal_pages + where page_id = portal_page.del.page_id; + + select (count(*) - 1) + into v_page_count_from_0 + from portal_pages + where portal_id = v_portal_id; + + for i in 0 .. v_page_count_from_0 loop + + if i = v_sort_key then + + delete + from portal_pages + where page_id = portal_page.del.page_id; + + elsif i > v_sort_key then + + update portal_pages + set sort_key = -1 + where sort_key = i + and page_id = portal_page.del.page_id; + + update portal_pages + set sort_key = i - 1 + where sort_key = -1 + and page_id = portal_page.del.page_id; + + end if; + + end loop; + + acs_object.del(page_id); + + end del; + +end portal_page; +/ +show errors + +create or replace package portal +as + + function new ( + portal_id in portals.portal_id%TYPE default null, + name in portals.name%TYPE default 'Untitled', + theme_id in portals.theme_id%TYPE default null, + layout_id in portal_layouts.layout_id%TYPE default null, + template_id in portals.template_id%TYPE default null, + default_page_name in portal_pages.pretty_name%TYPE default 'Main Page', + default_accesskey in portal_pages.accesskey%TYPE default null, + object_type in acs_object_types.object_type%TYPE default 'portal', + creation_date in acs_objects.creation_date%TYPE default sysdate, + creation_user in acs_objects.creation_user%TYPE default null, + creation_ip in acs_objects.creation_ip%TYPE default null, + context_id in acs_objects.context_id%TYPE default null + ) return portals.portal_id%TYPE; + + procedure del ( + portal_id in portals.portal_id%TYPE + ); +end portal; +/ +show errors + +create or replace package body portal +as + function new ( + portal_id in portals.portal_id%TYPE default null, + name in portals.name%TYPE default 'Untitled', + theme_id in portals.theme_id%TYPE default null, + layout_id in portal_layouts.layout_id%TYPE default null, + template_id in portals.template_id%TYPE default null, + default_page_name in portal_pages.pretty_name%TYPE default 'Main Page', + default_accesskey in portal_pages.accesskey%TYPE default null, + object_type in acs_object_types.object_type%TYPE default 'portal', + creation_date in acs_objects.creation_date%TYPE default sysdate, + creation_user in acs_objects.creation_user%TYPE default null, + creation_ip in acs_objects.creation_ip%TYPE default null, + context_id in acs_objects.context_id%TYPE default null + ) return portals.portal_id%TYPE + is + v_portal_id portals.portal_id%TYPE; + v_theme_id portals.theme_id%TYPE; + v_layout_id portal_layouts.layout_id%TYPE; + v_page_id portal_pages.page_id%TYPE; + v_new_element_id portal_element_map.element_id%TYPE; + v_new_parameter_id portal_element_parameters.parameter_id%TYPE; + begin + + v_portal_id := acs_object.new( + object_id => portal_id, + object_type => object_type, + creation_date => creation_date, + creation_user => creation_user, + creation_ip => creation_ip, + context_id => context_id + ); + + if template_id is null then + + if portal.new.theme_id is null then + select max(theme_id) + into v_theme_id + from portal_element_themes; + else + v_theme_id := portal.new.theme_id; + end if; + + if layout_id is null then + select min(layout_id) + into v_layout_id + from portal_layouts; + else + v_layout_id := portal.new.layout_id; + end if; + + insert + into portals + (portal_id, name, theme_id) + values + (v_portal_id, name, v_theme_id); + + -- now insert the default page + v_page_id := portal_page.new ( + portal_id => v_portal_id, + pretty_name => default_page_name, + accesskey => default_accesskey, + layout_id => v_layout_id, + creation_date => creation_date, + creation_user => creation_user, + creation_ip => creation_ip, + context_id => context_id + ); + + else + + -- we have a portal as our template. copy it's theme, pages, layouts, + -- elements, and element params. + select theme_id + into v_theme_id + from portals + where portal_id = portal.new.template_id; + + insert + into portals + (portal_id, name, theme_id, template_id) + values + (v_portal_id, name, v_theme_id, portal.new.template_id); + + -- now insert the pages from the portal template + for page in (select * + from portal_pages + where portal_id = portal.new.template_id + order by sort_key) + loop + + v_page_id := portal_page.new( + portal_id => v_portal_id, + pretty_name => page.pretty_name, + accesskey => page.accesskey, + layout_id => page.layout_id + ); + + -- now get the elements on the template's page and put them on the new page + for element in (select * + from portal_element_map + where page_id = page.page_id) + loop + + select acs_object_id_seq.nextval + into v_new_element_id + from dual; + + insert + into portal_element_map + (element_id, name, pretty_name, page_id, datasource_id, region, state, sort_key) + select v_new_element_id, name, pretty_name, v_page_id, datasource_id, region, state, sort_key + from portal_element_map pem + where pem.element_id = element.element_id; + + -- now for the element's params + for param in (select * + from portal_element_parameters + where element_id = element.element_id) + loop + + select acs_object_id_seq.nextval + into v_new_parameter_id + from dual; + + insert + into portal_element_parameters + (parameter_id, element_id, config_required_p, configured_p, key, value) + select v_new_parameter_id, v_new_element_id, config_required_p, configured_p, key, value + from portal_element_parameters + where parameter_id = param.parameter_id; + + end loop; + + end loop; + + end loop; + + end if; + + return v_portal_id; + + end new; + + procedure del ( + portal_id in portals.portal_id%TYPE + ) + is + begin + + for page in (select page_id + from portal_pages + where portal_id = portal.del.portal_id + order by sort_key desc) + loop + portal_page.del(page_id => page.page_id); + end loop; + + acs_object.del(portal_id); + + end del; + +end portal; +/ +show errors + +create or replace package portal_element_theme +as + function new ( + theme_id in portal_element_themes.theme_id%TYPE default null, + name in portal_element_themes.name%TYPE, + description in portal_element_themes.description%TYPE default null, + filename in portal_element_themes.filename%TYPE, + resource_dir in portal_element_themes.resource_dir%TYPE, + object_type in acs_object_types.object_type%TYPE default 'portal_element_theme', + creation_date in acs_objects.creation_date%TYPE default sysdate, + creation_user in acs_objects.creation_user%TYPE default null, + creation_ip in acs_objects.creation_ip%TYPE default null, + context_id in acs_objects.context_id%TYPE default null + ) return portal_element_themes.theme_id%TYPE; + + procedure del ( + theme_id in portal_element_themes.theme_id%TYPE + ); + +end portal_element_theme; +/ +show errors + +create or replace package body portal_element_theme +as + function new ( + theme_id in portal_element_themes.theme_id%TYPE default null, + name in portal_element_themes.name%TYPE, + description in portal_element_themes.description%TYPE default null, + filename in portal_element_themes.filename%TYPE, + resource_dir in portal_element_themes.resource_dir%TYPE, + object_type in acs_object_types.object_type%TYPE default 'portal_element_theme', + creation_date in acs_objects.creation_date%TYPE default sysdate, + creation_user in acs_objects.creation_user%TYPE default null, + creation_ip in acs_objects.creation_ip%TYPE default null, + context_id in acs_objects.context_id%TYPE default null + ) return portal_element_themes.theme_id%TYPE + is + v_theme_id portal_element_themes.theme_id%TYPE; + begin + + v_theme_id := acs_object.new( + object_id => theme_id, + object_type => object_type, + creation_date => creation_date, + creation_user => creation_user, + creation_ip => creation_ip, + context_id => context_id + ); + + insert + into portal_element_themes + (theme_id, name, description, filename, resource_dir) + values + (v_theme_id, name, description, filename, resource_dir); + + return v_theme_id; + + end new; + + procedure del ( + theme_id in portal_element_themes.theme_id%TYPE + ) + is + begin + acs_object.del(theme_id); + end del; + +end portal_element_theme; +/ +show errors + +create or replace package portal_layout +as + + function new ( + layout_id in portal_layouts.layout_id%TYPE default null, + name in portal_layouts.name%TYPE, + description in portal_layouts.description%TYPE default null, + filename in portal_layouts.filename%TYPE, + resource_dir in portal_layouts.resource_dir%TYPE, + object_type in acs_object_types.object_type%TYPE default 'portal_layout', + creation_date in acs_objects.creation_date%TYPE default sysdate, + creation_user in acs_objects.creation_user%TYPE default null, + creation_ip in acs_objects.creation_ip%TYPE default null, + context_id in acs_objects.context_id%TYPE default null + ) return portal_layouts.layout_id%TYPE; + + procedure del ( + layout_id in portal_layouts.layout_id%TYPE + ); + + procedure add_region ( + layout_id in portal_supported_regions.layout_id%TYPE, + region in portal_supported_regions.region%TYPE, + immutable_p in portal_supported_regions.immutable_p%TYPE default 'f' + ); + +end portal_layout; +/ +show errors + +create or replace package body portal_layout +as + function new ( + layout_id in portal_layouts.layout_id%TYPE default null, + name in portal_layouts.name%TYPE, + description in portal_layouts.description%TYPE default null, + filename in portal_layouts.filename%TYPE, + resource_dir in portal_layouts.resource_dir%TYPE, + object_type in acs_object_types.object_type%TYPE default 'portal_layout', + creation_date in acs_objects.creation_date%TYPE default sysdate, + creation_user in acs_objects.creation_user%TYPE default null, + creation_ip in acs_objects.creation_ip%TYPE default null, + context_id in acs_objects.context_id%TYPE default null + ) return portal_layouts.layout_id%TYPE + is + v_layout_id portal_layouts.layout_id%TYPE; + begin + + v_layout_id := acs_object.new( + object_id => layout_id, + object_type => object_type, + creation_date => creation_date, + creation_user => creation_user, + creation_ip => creation_ip, + context_id => context_id + ); + + insert into portal_layouts + (layout_id, name, description, filename, resource_dir) + values + (v_layout_id, name, description, filename, resource_dir); + + return v_layout_id; + + end new; + + procedure del ( + layout_id in portal_layouts.layout_id%TYPE + ) + is + begin + acs_object.del(layout_id); + end del; + + procedure add_region ( + layout_id in portal_supported_regions.layout_id%TYPE, + region in portal_supported_regions.region%TYPE, + immutable_p in portal_supported_regions.immutable_p%TYPE default 'f' + ) + is + begin + insert + into portal_supported_regions + (layout_id, region, immutable_p) + values (layout_id, region, immutable_p); + end add_region; + +end portal_layout; +/ +show errors + +create or replace package portal_datasource +as + + function new ( + datasource_id in portal_datasources.datasource_id%TYPE default null, + name in portal_datasources.name%TYPE default null, + description in portal_datasources.description%TYPE default null, + css_dir in portal_datasources.css_dir%TYPE default null, + object_type in acs_object_types.object_type%TYPE default 'portal_datasource', + creation_date in acs_objects.creation_date%TYPE default sysdate, + creation_user in acs_objects.creation_user%TYPE default null, + creation_ip in acs_objects.creation_ip%TYPE default null, + context_id in acs_objects.context_id%TYPE default null + ) return portal_datasources.datasource_id%TYPE; + + procedure del ( + datasource_id in portal_datasources.datasource_id%TYPE + ); + + procedure set_def_param ( + datasource_id in portal_datasource_def_params.datasource_id%TYPE, + config_required_p in portal_datasource_def_params.config_required_p%TYPE default null, + configured_p in portal_datasource_def_params.configured_p%TYPE default null, + key in portal_datasource_def_params.key%TYPE, + value in portal_datasource_def_params.value%TYPE default null + ); + +end portal_datasource; +/ +show errors + +create or replace package body portal_datasource +as + + function new ( + datasource_id in portal_datasources.datasource_id%TYPE default null, + name in portal_datasources.name%TYPE default null, + description in portal_datasources.description%TYPE default null, + css_dir in portal_datasources.css_dir%TYPE default null, + object_type in acs_object_types.object_type%TYPE default 'portal_datasource', + creation_date in acs_objects.creation_date%TYPE default sysdate, + creation_user in acs_objects.creation_user%TYPE default null, + creation_ip in acs_objects.creation_ip%TYPE default null, + context_id in acs_objects.context_id%TYPE default null + ) return portal_datasources.datasource_id%TYPE + is + v_datasource_id portal_datasources.datasource_id%TYPE; + begin + + v_datasource_id := acs_object.new( + object_id => datasource_id, + object_type => object_type, + creation_date => creation_date, + creation_user => creation_user, + creation_ip => creation_ip, + context_id => context_id + ); + + insert into portal_datasources + (datasource_id, name, description, css_dir) + values + (v_datasource_id, name, description, css_dir); + + return v_datasource_id; + + end new; + + procedure del ( + datasource_id in portal_datasources.datasource_id%TYPE + ) + is + begin + acs_object.del(datasource_id); + end del; + + procedure set_def_param ( + datasource_id in portal_datasource_def_params.datasource_id%TYPE, + config_required_p in portal_datasource_def_params.config_required_p%TYPE default null, + configured_p in portal_datasource_def_params.configured_p%TYPE default null, + key in portal_datasource_def_params.key%TYPE, + value in portal_datasource_def_params.value%TYPE default null + ) + is + begin + + insert into portal_datasource_def_params + (parameter_id, datasource_id, config_required_p, configured_p, key, value) + values + (acs_object_id_seq.nextval, datasource_id, config_required_p, configured_p, key, value); + + end set_def_param; + +end portal_datasource; +/ +show errors Index: openacs-4/packages/new-portal/sql/postgresql/api-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/new-portal/sql/postgresql/api-create.sql,v diff -u -N -r1.15 -r1.16 --- openacs-4/packages/new-portal/sql/postgresql/api-create.sql 15 May 2007 20:14:47 -0000 1.15 +++ openacs-4/packages/new-portal/sql/postgresql/api-create.sql 7 Oct 2007 22:37:03 -0000 1.16 @@ -132,7 +132,7 @@ select define_function_args('portal__new','portal_id,name,theme_id,layout_id,template_id,default_page_name,default_accesskey,object_type;portal,creation_date,creation_user,creation_ip,context_id'); -create function portal__new (integer,varchar,integer,integer,integer,varchar,varchar,varchar,timestamptz,integer,varchar,integer) +create or replace function portal__new (integer,varchar,integer,integer,integer,varchar,varchar,varchar,timestamptz,integer,varchar,integer) returns integer as ' declare p_portal_id alias for $1; @@ -226,6 +226,7 @@ for v_page in select * from portal_pages where portal_id = p_template_id + order by sort_key loop v_page_id := portal_page__new( Index: openacs-4/packages/new-portal/sql/postgresql/upgrade/upgrade-2.3.1d1-2.3.1d2.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/new-portal/sql/postgresql/upgrade/upgrade-2.3.1d1-2.3.1d2.sql,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/new-portal/sql/postgresql/upgrade/upgrade-2.3.1d1-2.3.1d2.sql 7 Oct 2007 22:37:03 -0000 1.2 @@ -0,0 +1,158 @@ +-- Create portal pages in the correct order. + +create or replace function portal__new (integer,varchar,integer,integer,integer,varchar,varchar,varchar,timestamptz,integer,varchar,integer) +returns integer as ' +declare + p_portal_id alias for $1; + p_name alias for $2; + p_theme_id alias for $3; + p_layout_id alias for $4; + p_template_id alias for $5; + p_default_page_name alias for $6; + p_default_accesskey alias for $7; + p_object_type alias for $8; + p_creation_date alias for $9; + p_creation_user alias for $10; + p_creation_ip alias for $11; + p_context_id alias for $12; + v_portal_id portals.portal_id%TYPE; + v_theme_id portals.theme_id%TYPE; + v_layout_id portal_layouts.layout_id%TYPE; + v_page_id portal_pages.page_id%TYPE; + v_page record; + v_element record; + v_param record; + v_new_element_id integer; + v_new_parameter_id integer; +begin + + v_portal_id := acs_object__new( + p_portal_id, + p_object_type, + p_creation_date, + p_creation_user, + p_creation_ip, + p_context_id, + ''t'' + ); + + if p_template_id is null then + + if p_theme_id is null then + select max(theme_id) + into v_theme_id + from portal_element_themes; + else + v_theme_id := p_theme_id; + end if; + + if p_layout_id is null then + select min(layout_id) + into v_layout_id + from portal_layouts; + else + v_layout_id := p_layout_id; + end if; + + insert + into portals + (portal_id, name, theme_id) + values + (v_portal_id, p_name, v_theme_id); + + -- now insert the default page + v_page_id := portal_page__new( + null, + p_default_page_name, + p_default_accesskey, + v_portal_id, + v_layout_id, + ''f'', + ''portal_page'', + p_creation_date, + p_creation_user, + p_creation_ip, + p_context_id + ); + + else + + -- we have a portal as our template. copy its theme, pages, layouts, + -- elements, and element params. + select theme_id + into v_theme_id + from portals + where portal_id = p_template_id; + + insert + into portals + (portal_id, name, theme_id, template_id) + values + (v_portal_id, p_name, v_theme_id, p_template_id); + + -- now insert the pages from the portal template + for v_page in select * + from portal_pages + where portal_id = p_template_id + order by sort_key + loop + + v_page_id := portal_page__new( + null, + v_page.pretty_name, + v_page.accesskey, + v_portal_id, + v_page.layout_id, + ''f'', + ''portal_page'', + p_creation_date, + p_creation_user, + p_creation_ip, + p_context_id + ); + + -- now get the elements on the templates page and put them on the new page + for v_element in select * + from portal_element_map + where page_id = v_page.page_id + loop + + select acs_object_id_seq.nextval + into v_new_element_id + from dual; + + insert + into portal_element_map + (element_id, name, pretty_name, page_id, datasource_id, region, state, sort_key) + select v_new_element_id, name, pretty_name, v_page_id, datasource_id, region, state, sort_key + from portal_element_map pem + where pem.element_id = v_element.element_id; + + -- now for the elements params + for v_param in select * + from portal_element_parameters + where element_id = v_element.element_id + loop + + select acs_object_id_seq.nextval + into v_new_parameter_id + from dual; + + insert + into portal_element_parameters + (parameter_id, element_id, config_required_p, configured_p, key, value) + select v_new_parameter_id, v_new_element_id, config_required_p, configured_p, key, value + from portal_element_parameters + where parameter_id = v_param.parameter_id; + + end loop; + + end loop; + + end loop; + + end if; + + return v_portal_id; + +end;' language 'plpgsql'; Index: openacs-4/packages/new-portal/tcl/portal-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/new-portal/tcl/portal-procs.tcl,v diff -u -N -r1.182 -r1.183 --- openacs-4/packages/new-portal/tcl/portal-procs.tcl 13 Aug 2007 06:10:27 -0000 1.182 +++ openacs-4/packages/new-portal/tcl/portal-procs.tcl 7 Oct 2007 22:37:03 -0000 1.183 @@ -145,7 +145,11 @@ set page_name_list [list $default_page_name] set page_accesskey_list [list $default_accesskey] - set layout_name_list [list "#new-portal.simple_2column_layout_name#"] + if { [string eq $layout_name ""] } { + set layout_name_list [list "#new-portal.simple_2column_layout_name#"] + } else { + set layout_name_list [list $layout_name] + } if {![empty_string_p $csv_list]} { set page_name_and_layout_list [split [string trimright $csv_list ";"] ";"] Index: openacs-4/packages/new-portal/tcl/test/new-portal-test-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/new-portal/tcl/test/new-portal-test-procs.tcl,v diff -u -N --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/new-portal/tcl/test/new-portal-test-procs.tcl 7 Oct 2007 22:37:03 -0000 1.2 @@ -0,0 +1,55 @@ +# packages/new-portal/tcl/test/new-portal-test-procs.tcl +ad_library { + Tests for portals +} + +aa_register_case -cats api create_portal_from_template { + Create a portal from a template +} { + aa_run_with_teardown \ + -rollback \ + -test_code { + # create a new portal template + + + # create a test user + set user_info [ns_mktemp userXXXXXX] + array set test_user [auth::create_user \ + -username $user_info \ + -first_names $user_info \ + -last_name $user_info \ + -email "${user_info}@test.test"] + + set template_id [portal::create $test_user(user_id)] + + portal::page_create \ + -pretty_name "Page 3" \ + -portal_id $template_id + + portal::page_create \ + -pretty_name "Page 2" \ + -portal_id $template_id + + # create a portal based on the template + set user_info_2 [ns_mktemp userXXXXXX] + array set test_user_2 [auth::create_user \ + -username $user_info_2 \ + -first_names $user_info_2 \ + -last_name $user_info_2 \ + -email "${user_info_2}@test.test"] + + + set portal_id_2 [portal::create -template_id $template_id $test_user_2(user_id)] + + # make sure the pages exist and are in the same order + set correct_page_count [db_string count_correct_pages " + select count(*) from portal_pages p1, portal_pages p2 + where p1.portal_id = :template_id + and p2.portal_id = :portal_id_2 + and p1.pretty_name = p2.pretty_name + "] + + aa_true "Pages in correct order" [expr {$correct_page_count == 3}] + } + +} \ No newline at end of file Index: openacs-4/packages/news-portlet/news-portlet.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/news-portlet/news-portlet.info,v diff -u -N -r1.19 -r1.20 --- openacs-4/packages/news-portlet/news-portlet.info 15 May 2007 20:14:50 -0000 1.19 +++ openacs-4/packages/news-portlet/news-portlet.info 7 Oct 2007 22:37:03 -0000 1.20 @@ -7,13 +7,13 @@ <initial-install-p>f</initial-install-p> <singleton-p>t</singleton-p> - <version name="2.3.0" url="http://openacs.org/repository/download/apm/news-portlet-2.3.0.apm"> + <version name="2.3.1" url="http://openacs.org/repository/download/apm/news-portlet-2.3.1.apm"> <owner url="http://opeancs.org">OpenACS</owner> - <release-date>2007-04-22</release-date> + <release-date>2007-09-08</release-date> <vendor url="http://openacs.org">OpenACS</vendor> - <provides url="news-portlet" version="2.3.0"/> - <requires url="new-portal" version="2.3.0"/> + <provides url="news-portlet" version="2.3.1"/> + <requires url="new-portal" version="2.3.1"/> <requires url="news" version="5.2.0d6"/> <callbacks> Index: openacs-4/packages/photo-album/www/album-add.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/album-add.tcl,v diff -u -N -r1.4 -r1.5 --- openacs-4/packages/photo-album/www/album-add.tcl 18 Nov 2003 22:59:03 -0000 1.4 +++ openacs-4/packages/photo-album/www/album-add.tcl 7 Oct 2007 22:37:03 -0000 1.5 @@ -40,7 +40,7 @@ template::element create album_add description -html { size 50 } \ -label "[_ photo-album._Album]" -datatype text -optional -template::element create album_add story -html {cols 50 rows 4 wrap soft} \ +template::element create album_add story -html {cols 50 rows 4} \ -label "[_ photo-album._Album_1]" -datatype text -widget textarea -optional if { [template::form is_request album_add] } { Index: openacs-4/packages/photo-album/www/album-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/album-edit.tcl,v diff -u -N -r1.4 -r1.5 --- openacs-4/packages/photo-album/www/album-edit.tcl 18 Nov 2003 22:59:03 -0000 1.4 +++ openacs-4/packages/photo-album/www/album-edit.tcl 7 Oct 2007 22:37:03 -0000 1.5 @@ -47,7 +47,7 @@ template::element create edit_album description -html { size 50} \ -label "[_ photo-album._Album]" -datatype text -optional -template::element create edit_album story -html { cols 50 rows 4 wrap soft } \ +template::element create edit_album story -html { cols 50 rows 4 } \ -label "[_ photo-album._Album_1]" -datatype text -widget textarea -optional Index: openacs-4/packages/photo-album/www/photo-add.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/photo-add.tcl,v diff -u -N -r1.6 -r1.7 --- openacs-4/packages/photo-album/www/photo-add.tcl 29 Jun 2004 10:18:45 -0000 1.6 +++ openacs-4/packages/photo-album/www/photo-add.tcl 7 Oct 2007 22:37:03 -0000 1.7 @@ -44,7 +44,7 @@ element create photo_upload description -html { size 50} \ -label "[_ photo-album._Photo]" -optional -help_text "[_ photo-album.lt_OPTIONAL_Displayed_wh]" -datatype text -element create photo_upload story -html { cols 50 rows 4 wrap soft } \ +element create photo_upload story -html { cols 50 rows 4 } \ -label "[_ photo-album._Photo_1]" -optional -help_text "[_ photo-album.OPTIONAL]" -datatype text -widget textarea element set_properties photo_upload album_id -value $album_id Index: openacs-4/packages/photo-album/www/photo-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/www/photo-edit.tcl,v diff -u -N -r1.4 -r1.5 --- openacs-4/packages/photo-album/www/photo-edit.tcl 18 Nov 2003 22:59:03 -0000 1.4 +++ openacs-4/packages/photo-album/www/photo-edit.tcl 7 Oct 2007 22:37:03 -0000 1.5 @@ -59,7 +59,7 @@ template::element create edit_photo description -html { size 50} \ -label "<#_Description#>" -help_text "Displayed when viewing the photo" -optional -datatype text -template::element create edit_photo story -html { cols 50 rows 4 wrap soft } \ +template::element create edit_photo story -html { cols 50 rows 4 } \ -label "<#_Story#>" -optional -datatype text -help_text "Displayed when viewing the photo" -widget textarea template::element create edit_photo submit_b -widget submit \ Index: openacs-4/packages/photo-album-portlet/photo-album-portlet.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album-portlet/photo-album-portlet.info,v diff -u -N -r1.7 -r1.8 --- openacs-4/packages/photo-album-portlet/photo-album-portlet.info 15 May 2007 20:14:52 -0000 1.7 +++ openacs-4/packages/photo-album-portlet/photo-album-portlet.info 7 Oct 2007 22:37:04 -0000 1.8 @@ -7,13 +7,13 @@ <initial-install-p>f</initial-install-p> <singleton-p>t</singleton-p> - <version name="2.3.0" url="http://openacs.org/repository/download/apm/photo-album-portlet-2.3.0.apm"> + <version name="2.3.1" url="http://openacs.org/repository/download/apm/photo-album-portlet-2.3.1.apm"> <owner url="mailto:davis@xarg.net">Jeff Davis</owner> <vendor url="http://xarg.net">Xarg</vendor> - <release-date>2007-04-22</release-date> - <provides url="photo-album-portlet" version="2.3.0"/> + <release-date>2007-09-08</release-date> + <provides url="photo-album-portlet" version="2.3.1"/> <requires url="photo-album" version="5.2.3"/> - <requires url="new-portal" version="2.3.0"/> + <requires url="new-portal" version="2.3.1"/> <callbacks> <callback type="after-install" proc="photo_album_portlet::after_install"/> Index: openacs-4/packages/profile-provider/profile-provider.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/profile-provider/profile-provider.info,v diff -u -N -r1.11 -r1.12 --- openacs-4/packages/profile-provider/profile-provider.info 15 May 2007 20:14:52 -0000 1.11 +++ openacs-4/packages/profile-provider/profile-provider.info 7 Oct 2007 22:37:04 -0000 1.12 @@ -7,12 +7,12 @@ <initial-install-p>f</initial-install-p> <singleton-p>t</singleton-p> - <version name="2.3.0" url="http://openacs.org/repository/download/apm/profile-provider-2.3.0.apm"> + <version name="2.3.1" url="http://openacs.org/repository/download/apm/profile-provider-2.3.1.apm"> <owner url="http://openacs.org">OpenACS</owner> <vendor url="http://openacs.org">OpenACS</vendor> - <release-date>2007-04-22</release-date> + <release-date>2007-09-08</release-date> - <provides url="profile-provider" version="2.3.0"/> + <provides url="profile-provider" version="2.3.1"/> <requires url="acs-service-contract" version="5.3.1a1"/> <callbacks> Index: openacs-4/packages/random-photo-portlet/random-photo-portlet.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/random-photo-portlet/random-photo-portlet.info,v diff -u -N -r1.5 -r1.6 --- openacs-4/packages/random-photo-portlet/random-photo-portlet.info 15 May 2007 20:14:52 -0000 1.5 +++ openacs-4/packages/random-photo-portlet/random-photo-portlet.info 7 Oct 2007 22:37:04 -0000 1.6 @@ -7,12 +7,12 @@ <initial-install-p>f</initial-install-p> <singleton-p>f</singleton-p> - <version name="2.3.0" url="http://openacs.org/repository/download/apm/random-photo-portlet-2.3.0.apm"> + <version name="2.3.1" url="http://openacs.org/repository/download/apm/random-photo-portlet-2.3.1.apm"> <owner url="mailto:gmorales@galileo.edu">Gerardo Morales</owner> - <release-date>2007-04-22</release-date> + <release-date>2007-09-08</release-date> - <provides url="random-photo-portlet" version="2.3.0"/> - <requires url="dotlrn" version="2.3.0"/> + <provides url="random-photo-portlet" version="2.3.1"/> + <requires url="dotlrn" version="2.3.1"/> <callbacks> <callback type="after-install" proc="rphoto_portlet::after_install"/> Index: openacs-4/packages/static-portlet/static-portlet.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/static-portlet/static-portlet.info,v diff -u -N -r1.20 -r1.21 --- openacs-4/packages/static-portlet/static-portlet.info 15 May 2007 20:14:53 -0000 1.20 +++ openacs-4/packages/static-portlet/static-portlet.info 7 Oct 2007 22:37:04 -0000 1.21 @@ -7,14 +7,14 @@ <initial-install-p>f</initial-install-p> <singleton-p>f</singleton-p> - <version name="2.3.0" url="http://openacs.org/repository/download/apm/static-portlet-2.3.0.apm"> + <version name="2.3.1" url="http://openacs.org/repository/download/apm/static-portlet-2.3.1.apm"> <owner url="http://openacs.org">OpenACS</owner> - <release-date>2007-04-22</release-date> + <release-date>2007-09-08</release-date> <vendor url="http://openacs.org">OpenACS</vendor> - <provides url="static-portlet" version="2.3.0"/> - <requires url="dotlrn" version="2.3.0"/> - <requires url="new-portal" version="2.3.0"/> + <provides url="static-portlet" version="2.3.1"/> + <requires url="dotlrn" version="2.3.1"/> + <requires url="new-portal" version="2.3.1"/> <parameters> <parameter datatype="string" min_n_values="1" max_n_values="1" name="static_admin_portlet_pretty_name" default="#static-portlet.admin_portlet_pretty_name#" description="the name for the static admin portlet in the UI"/> Index: openacs-4/packages/static-portlet/www/element.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/static-portlet/www/element.tcl,v diff -u -N -r1.15 -r1.16 --- openacs-4/packages/static-portlet/www/element.tcl 15 Dec 2006 22:45:43 -0000 1.15 +++ openacs-4/packages/static-portlet/www/element.tcl 7 Oct 2007 22:37:04 -0000 1.16 @@ -53,7 +53,7 @@ ad_form -name static_element -form { element_content_id:key {pretty_name:text(text) {label "[_ static-portlet.Name]"} {html {size 60}}} - {content:richtext(richtext) {label "[_ static-portlet.Content]"} {html {rows 15 cols 80 wrap soft}}} + {content:richtext(richtext) {label "[_ static-portlet.Content]"} {html {rows 15 cols 80}}} } if {[lsearch $templates $type] >= 0} { Index: openacs-4/packages/survey-portlet/survey-portlet.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/survey-portlet/survey-portlet.info,v diff -u -N -r1.8 -r1.9 --- openacs-4/packages/survey-portlet/survey-portlet.info 15 May 2007 20:14:54 -0000 1.8 +++ openacs-4/packages/survey-portlet/survey-portlet.info 7 Oct 2007 22:37:04 -0000 1.9 @@ -7,14 +7,14 @@ <initial-install-p>f</initial-install-p> <singleton-p>t</singleton-p> - <version name="2.3.0" url="http://openacs.org/repository/download/apm/survey-portlet-2.3.0.apm"> + <version name="2.3.1" url="http://openacs.org/repository/download/apm/survey-portlet-2.3.1.apm"> <owner url="mailto:dave@thedesignexperience.org">dave bauer</owner> <summary>Survey package portlet for new-portal</summary> - <release-date>2007-04-22</release-date> + <release-date>2007-09-08</release-date> <description format="text/html">Survey package portlet for new-portal</description> - <provides url="survey-portlet" version="2.3.0"/> - <requires url="new-portal" version="2.3.0"/> + <provides url="survey-portlet" version="2.3.1"/> + <requires url="new-portal" version="2.3.1"/> <requires url="survey" version="5.0.1"/> <parameters> Index: openacs-4/packages/theme-selva/theme-selva.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/theme-selva/theme-selva.info,v diff -u -N -r1.18 -r1.19 --- openacs-4/packages/theme-selva/theme-selva.info 15 May 2007 20:14:54 -0000 1.18 +++ openacs-4/packages/theme-selva/theme-selva.info 7 Oct 2007 22:37:04 -0000 1.19 @@ -8,14 +8,14 @@ <singleton-p>f</singleton-p> <auto-mount>theme-selva</auto-mount> - <version name="2.3.0" url="http://openacs.org/repository/download/apm/theme-selva-2.3.0.apm"> + <version name="2.3.1" url="http://openacs.org/repository/download/apm/theme-selva-2.3.1.apm"> <owner url="http:/www.weg.ee.usyd.edu.au">Rafael Calvo</owner> - <release-date>2007-04-22</release-date> + <release-date>2007-09-08</release-date> <vendor url="http://www.weg.usyd.edu.au"></vendor> <maturity>0</maturity> - <provides url="theme-selva" version="2.3.0"/> - <requires url="dotlrn" version="2.3.0"/> + <provides url="theme-selva" version="2.3.1"/> + <requires url="dotlrn" version="2.3.1"/> <callbacks> <callback type="after-upgrade" proc="theme_selva::apm::after_upgrade"/> Index: openacs-4/packages/theme-zen/theme-zen.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/theme-zen/theme-zen.info,v diff -u -N -r1.2 -r1.3 --- openacs-4/packages/theme-zen/theme-zen.info 15 May 2007 20:14:55 -0000 1.2 +++ openacs-4/packages/theme-zen/theme-zen.info 7 Oct 2007 22:37:05 -0000 1.3 @@ -8,14 +8,14 @@ <singleton-p>t</singleton-p> <auto-mount>theme-zen</auto-mount> - <version name="2.3.0" url="http://openacs.org/repository/download/apm/theme-zen-2.3.0.apm"> + <version name="2.3.1" url="http://openacs.org/repository/download/apm/theme-zen-2.3.1.apm"> <owner url="http:/www.weg.ee.usyd.edu.au">Rafael Calvo</owner> - <release-date>2007-04-22</release-date> + <release-date>2007-09-08</release-date> <vendor url="http://www.weg.usyd.edu.au"></vendor> <maturity>0</maturity> - <provides url="theme-zen" version="2.3.0"/> - <requires url="dotlrn" version="2.3.0"/> + <provides url="theme-zen" version="2.3.1"/> + <requires url="dotlrn" version="2.3.1"/> <callbacks> <callback type="after-install" proc="theme_zen::apm::after_install"/> @@ -28,6 +28,7 @@ <parameter datatype="string" min_n_values="1" max_n_values="1" name="CssUrl" default="/resources/theme-zen/css/color/blue.css" description="default css_url"/> <parameter datatype="string" min_n_values="1" max_n_values="1" name="dotLRNToZenMap" default="#new-portal.simple_1column_layout_name# #theme-zen.Zen_1_column# #new-portal.simple_2column_layout_name# #theme-zen.Zen_2_column# #new-portal.simple_3column_layout_name# #theme-zen.Zen_3_column#" description="list of old layout/new layout names used to update and existing .LRN site"/> <parameter datatype="string" min_n_values="1" max_n_values="1" name="GenericCommunityTab" default="0" description="Use a generic name for the community tab"/> + <parameter datatype="string" min_n_values="1" max_n_values="1" name="logoImageAttributes" default="src /resources/theme-zen/images/global/dotLRN-logo.gif alt .LRN width 82 height 45" description="List of name value pairs for HTML attributes for the image tag of the logo"/> </parameters> </version> Index: openacs-4/packages/theme-zen/lib/lrn-master.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/theme-zen/lib/lrn-master.adp,v diff -u -N -r1.2 -r1.3 --- openacs-4/packages/theme-zen/lib/lrn-master.adp 15 May 2007 20:14:55 -0000 1.2 +++ openacs-4/packages/theme-zen/lib/lrn-master.adp 7 Oct 2007 22:37:05 -0000 1.3 @@ -16,7 +16,9 @@ <div id="skiptocontent"><a href="#content-wrapper" title="#theme-zen.skip_to_main_content#" accesskey="k">#theme-zen.skip_to_main_content#</a></div> <div id="header"> <div id="logo"> - <img src="/resources/theme-zen/images/global/dotLRN-logo.gif" alt=".LRN" width="82" height="45" /> + <if @img_attrib@ not nil> + <img @img_attrib;noquote@> + </if> </div> <div id="header-navigation"> <ul class="compact"> Index: openacs-4/packages/theme-zen/lib/lrn-master.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/theme-zen/lib/lrn-master.tcl,v diff -u -N -r1.3 -r1.4 --- openacs-4/packages/theme-zen/lib/lrn-master.tcl 7 Jun 2007 14:26:33 -0000 1.3 +++ openacs-4/packages/theme-zen/lib/lrn-master.tcl 7 Oct 2007 22:37:05 -0000 1.4 @@ -18,6 +18,14 @@ set system_url "" } +# Logo +array set attributes [parameter::get_from_package_key -package_key "theme-zen" -parameter logoImageAttributes] +set img_attrib "" +foreach name [array names attributes] { + append img_attrib " $name=\"$attributes($name)\"" +} + + # Get user information set sw_admin_p [acs_user::site_wide_admin_p -user_id $untrusted_user_id] if { $untrusted_user_id != 0 } { Index: openacs-4/packages/theme-zen/tcl/navigation-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/theme-zen/tcl/navigation-procs.tcl,v diff -u -N -r1.2 -r1.3 --- openacs-4/packages/theme-zen/tcl/navigation-procs.tcl 15 May 2007 20:14:56 -0000 1.2 +++ openacs-4/packages/theme-zen/tcl/navigation-procs.tcl 7 Oct 2007 22:37:05 -0000 1.3 @@ -30,60 +30,68 @@ namespace eval zen { ad_proc -public portal_navbar { - + } { - A helper procedure that generates the Navbar, ie the tabs, - for dotlrn. It is called from the zen-master template. + A helper procedure that generates the Navbar, ie the tabs, + for dotlrn. It is called from the zen-master template. } { - set current_url [ad_conn url] + set current_url [ad_conn url] set dotlrn_url [dotlrn::get_url] - # Set up some basic stuff - set community_id [dotlrn_community::get_community_id] + # Set up some basic stuff + set community_id [dotlrn_community::get_community_id] - # Get user information - set sw_admin_p 0 - set user_id [ad_conn user_id] - set untrusted_user_id [ad_conn untrusted_user_id] - if { $untrusted_user_id != 0 } { - set user_name [person::name -person_id $untrusted_user_id] - set pvt_home_url [ad_pvt_home] - set pvt_home_name [_ acs-subsite.Your_Account] - set logout_url [ad_get_logout_url] - - # Site-wide admin link - set admin_url {} - - set sw_admin_p [acs_user::site_wide_admin_p -user_id $untrusted_user_id] - - if { $sw_admin_p } { - set admin_url "/acs-admin/" - set locale_admin_url "/acs-lang/admin" - set dotlrn_admin_url "${dotlrn_url}/admin/" - } else { - set subsite_admin_p [permission::permission_p \ - -object_id [subsite::get_element -element object_id] \ - -privilege admin \ - -party_id $untrusted_user_id] - - if { $subsite_admin_p } { - set admin_url "[subsite::get_element -element url]admin/" - } - } - } else { - set login_url [ad_get_login_url -return] - set user_name {} - } - - set navbar "<ul>" + # Get user information + set sw_admin_p 0 + set dotlrn_admin_p 0 + set user_id [ad_conn user_id] + set untrusted_user_id [ad_conn untrusted_user_id] + if { $untrusted_user_id != 0 } { + set user_name [person::name -person_id $untrusted_user_id] + set pvt_home_url [ad_pvt_home] + set pvt_home_name [_ acs-subsite.Your_Account] + set logout_url [ad_get_logout_url] + + # Site-wide admin link + set admin_url {} + set dotlrn_admin_url "" + + set sw_admin_p [acs_user::site_wide_admin_p -user_id $untrusted_user_id] + set dotlrn_admin_p [permission::permission_p \ + -party_id $user_id \ + -object_id [dotlrn::get_package_id] \ + -privilege admin] + if { $dotlrn_admin_p } { + set dotlrn_admin_url "${dotlrn_url}/admin/" + } + + if { $sw_admin_p } { + set admin_url "/acs-admin/" + set locale_admin_url "/acs-lang/admin" + } else { + set subsite_admin_p [permission::permission_p \ + -object_id [subsite::get_element -element object_id] \ + -privilege admin \ + -party_id $untrusted_user_id] + + if { $subsite_admin_p } { + set admin_url "[subsite::get_element -element url]admin/" + } + } + } else { + set login_url [ad_get_login_url -return] + set user_name {} + } + + set navbar "<ul>" - set tabs_list [list] + set tabs_list [list] set which_tab_selected -1 set which_tab 0 set home_tab -1 - foreach {url name accesskey} [parameter::get_from_package_key -package_key "theme-zen" -parameter "AdditionalNavbarTabs" -default ""] { - lappend tabs_list [list $url $name $accesskey] + foreach {url name accesskey} [parameter::get_from_package_key -package_key "theme-zen" -parameter "AdditionalNavbarTabs" -default ""] { + lappend tabs_list [list $url $name $accesskey] if { $current_url == $url || $current_url == "$dotlrn_url/index" && $name eq "#dotlrn.Home#" } { set which_tab_selected $which_tab @@ -92,17 +100,17 @@ set home_tab $which_tab } incr which_tab - } + } - if { $sw_admin_p } { - lappend tabs_list [list $dotlrn_admin_url #dotlrn.Administration# #dotlrn.Administration_Accesskey#] + if { $dotlrn_admin_p } { + lappend tabs_list [list $dotlrn_admin_url #dotlrn.Administration# #dotlrn.Administration_Accesskey#] if { [string first $dotlrn_admin_url $current_url] != -1 } { set which_tab_selected $which_tab } incr which_tab - } + } - if { [exists_and_not_null community_id] } { + if { [exists_and_not_null community_id] } { set type [dotlrn_community::get_community_type_from_community_id $community_id] if { $type eq "dotlrn_community" || $type eq "dotlrn_pers_community" } { set community_message_key "#dotlrn.subcommunities_pretty_name#" @@ -115,16 +123,16 @@ set community_access_key #dotlrn.dotlrn_class_instance_access_key# } - if { ![parameter::get_from_package_key -package_key "theme-zen" -parameter "GenericCommunityTab" -default "0"] } { - # show title of the community instead of community type - # pretty name - set community_message_key [dotlrn_community::get_community_name $community_id] - } + if { ![parameter::get_from_package_key -package_key "theme-zen" -parameter "GenericCommunityTab" -default "0"] } { + # show title of the community instead of community type + # pretty name + set community_message_key [dotlrn_community::get_community_name $community_id] + } - lappend tabs_list [list [dotlrn_community::get_community_url $community_id] $community_message_key $community_access_key] + lappend tabs_list [list [dotlrn_community::get_community_url $community_id] $community_message_key $community_access_key] set which_tab_selected $which_tab incr which_tab - } + } # DRB: If we haven't found a tab to select, use the previous value if one # exists, otherwise don't select any tab. Don't write to the database for @@ -133,37 +141,37 @@ if { $which_tab_selected == -1 } { set which_tab_selected [ad_get_client_property dotlrn which_tab_selected] } else { - ad_set_client_property -persistent f dotlrn which_tab_selected $which_tab_selected + ad_set_client_property -persistent f dotlrn which_tab_selected $which_tab_selected } # DRB: Let the subnavbar proc know whether or not the home tab has been selected. - ad_set_client_property -persistent f dotlrn home_tab_selected_p \ + ad_set_client_property -persistent f dotlrn home_tab_selected_p \ [expr { $which_tab_selected == $home_tab }] - ns_log Debug "TABS" $tabs_list + ns_log Debug "TABS" $tabs_list # DRB: don't understand how the access keys were named in mark's template... set which_tab 0 - foreach tab_entry $tabs_list { + foreach tab_entry $tabs_list { foreach {url name accesskey} $tab_entry {} - if { $which_tab == $which_tab_selected } { - append navbar "\n<li id=\"main-navigation-active\"><a href=\"$url\" title=\"[_ theme-zen.goto_tab_name]\" accesskey=\"$accesskey\">[lang::util::localize $name]</a></li>" - } else { - append navbar "\n<li><a href=\"$url\" title=\"[_ theme-zen.goto_tab_name]\" accesskey=\"$accesskey\">[lang::util::localize $name]</a></li>" - } - incr which_tab - } - - append navbar "\n</ul>" + if { $which_tab == $which_tab_selected } { + append navbar "\n<li id=\"main-navigation-active\"><a href=\"$url\" title=\"[_ theme-zen.goto_tab_name]\" accesskey=\"$accesskey\">[lang::util::localize $name]</a></li>" + } else { + append navbar "\n<li><a href=\"$url\" title=\"[_ theme-zen.goto_tab_name]\" accesskey=\"$accesskey\">[lang::util::localize $name]</a></li>" + } + incr which_tab + } + + append navbar "\n</ul>" } ad_proc -public portal_subnavbar { {-user_id:required} {-control_panel_text:required} - {-link_all 0} + {-link_all 0} {-pre_html ""} {-post_html ""} } { @@ -175,7 +183,7 @@ set dotlrn_url [dotlrn::get_url] set community_id [dotlrn_community::get_community_id] set control_panel_name control-panel - set control_panel_url "$dotlrn_url/$control_panel_name" + set control_panel_url "$dotlrn_url/$control_panel_name" if { $community_id eq "" } { # We are not under a dotlrn community. However we could be @@ -184,7 +192,7 @@ set link "[dotlrn::get_url]/" if {[dotlrn::user_p -user_id $user_id] && - [ad_get_client_property dotlrn home_tab_selected_p] } { + [ad_get_client_property dotlrn home_tab_selected_p] } { # this user is a dotlrn user, we've selected the home tab, # show their personal portal subnavbar, including the control panel link set portal_id [dotlrn::get_portal_id -user_id $user_id] @@ -203,9 +211,9 @@ # some defaults set text [dotlrn_community::get_community_header_name $community_id] set control_panel_name one-community-admin - # link is important : it sets the options_set value, which will be used later to select the current page + # link is important : it sets the options_set value, which will be used later to select the current page set link [dotlrn_community::get_community_url $community_id] - set control_panel_url "$link/$control_panel_name" + set control_panel_url "$link/$control_panel_name" # figure out what this privs this user has on the community set admin_p [dotlrn::user_can_admin_community_p \ @@ -238,37 +246,37 @@ } #AG: This code belongs in the portal package, near portal::subnavbar. For display reasons we need to do this - #as a ul instead of a table, which portal::subnavbar returns. Obviously we shouldn't be letting display-level - #stuff decide where we put our code, but first we'll need to mod the portal package accordingly. + #as a ul instead of a table, which portal::subnavbar returns. Obviously we shouldn't be letting display-level + #stuff decide where we put our code, but first we'll need to mod the portal package accordingly. # DRB: the portal navbar stuff should return multirows which are then formatted by # the appropriate template, rather than include HTML as it does now. - if { [catch {set page_num [ad_get_client_property dotlrn page_num]}] || $page_num eq "" || ![string is integer $page_num] } { - set page_num [ns_queryget page_num] - #Strip out extra anchors and other crud. - #page_num will be empty_string for special pages like - #My Space and Control Panel - regsub -all {[^0-9]} $page_num {} page_num - } - - + if { [catch {set page_num [ad_get_client_property dotlrn page_num]}] || $page_num eq "" || ![string is integer $page_num] } { + set page_num [ns_queryget page_num] + #Strip out extra anchors and other crud. + #page_num will be empty_string for special pages like + #My Space and Control Panel + regsub -all {[^0-9]} $page_num {} page_num + } + + set subnavbar "" - db_foreach list_page_nums_select {} { - if {[string equal $page_num $sort_key]} { - append subnavbar "\n<li id=\"sub-navigation-active\"><a href=\"$link?page_num=$sort_key\" title=\"[_ theme-zen.goto_portal_page_pretty_name]\" accesskey=\"$accesskey\">$pretty_name</a> </li>" - } else { - append subnavbar "\n<li><a href=\"$link?page_num=$sort_key\" title=\"[_ theme-zen.goto_portal_page_pretty_name]\" accesskey=\"$accesskey\">$pretty_name</a> </li>" - } - } + db_foreach list_page_nums_select {} { + if {[string equal $page_num $sort_key]} { + append subnavbar "\n<li id=\"sub-navigation-active\"><a href=\"$link?page_num=$sort_key\" title=\"[_ theme-zen.goto_portal_page_pretty_name]\" accesskey=\"$accesskey\">$pretty_name</a> </li>" + } else { + append subnavbar "\n<li><a href=\"$link?page_num=$sort_key\" title=\"[_ theme-zen.goto_portal_page_pretty_name]\" accesskey=\"$accesskey\">$pretty_name</a> </li>" + } + } - if { $community_id ne "" && $admin_p } { - if {[string match "*/one-community-admin*" [ad_conn url]]} { - append subnavbar "\n<li id=\"sub-navigation-active\"><a href=\"${link}one-community-admin\" title=\"[_ theme-zen.goto_admin_page]\" accesskey=\"[_ theme-zen.goto_admin_page_accesskey]\">[_ theme-zen.admin]</a></li>" - } else { - append subnavbar "\n<li><a href=\"${link}one-community-admin\" title=\"[_ theme-zen.goto_admin_page]\" accesskey=\"[_ theme-zen.goto_admin_page_accesskey]\">[_ theme-zen.admin]</a></li>" - } - } + if { $community_id ne "" && $admin_p } { + if {[string match "*/one-community-admin*" [ad_conn url]]} { + append subnavbar "\n<li id=\"sub-navigation-active\"><a href=\"${link}one-community-admin\" title=\"[_ theme-zen.goto_admin_page]\" accesskey=\"[_ theme-zen.goto_admin_page_accesskey]\">[_ theme-zen.admin]</a></li>" + } else { + append subnavbar "\n<li><a href=\"${link}one-community-admin\" title=\"[_ theme-zen.goto_admin_page]\" accesskey=\"[_ theme-zen.goto_admin_page_accesskey]\">[_ theme-zen.admin]</a></li>" + } + } if { $subnavbar eq "" } { return "" Index: openacs-4/packages/theme-zen/www/admin/upgrade.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/theme-zen/www/admin/upgrade.tcl,v diff -u -N -r1.2 -r1.3 --- openacs-4/packages/theme-zen/www/admin/upgrade.tcl 15 May 2007 20:14:56 -0000 1.2 +++ openacs-4/packages/theme-zen/www/admin/upgrade.tcl 7 Oct 2007 22:37:05 -0000 1.3 @@ -41,6 +41,16 @@ -parameter DefaultMaster_p \ -value "/packages/theme-zen/lib/lrn-master" + parameter::set_default \ + -package_key dotlrn \ + -parameter non_member_layout_name \ + -value "#theme-zen.Zen_2_column#" + + parameter::set_default \ + -package_key dotlrn \ + -parameter admin_layout_name \ + -value "#theme-zen.Zen_2_column#" + # Poached from dotlrn's package instantiate callback. set site_template_id [db_string select_st_id {}] Index: openacs-4/packages/user-profile/user-profile.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/user-profile/user-profile.info,v diff -u -N -r1.11 -r1.12 --- openacs-4/packages/user-profile/user-profile.info 15 May 2007 20:15:01 -0000 1.11 +++ openacs-4/packages/user-profile/user-profile.info 7 Oct 2007 22:37:05 -0000 1.12 @@ -7,13 +7,13 @@ <initial-install-p>f</initial-install-p> <singleton-p>t</singleton-p> - <version name="2.3.0" url="http://openacs.org/repository/download/apm/user-profile-2.3.0.apm"> + <version name="2.3.1" url="http://openacs.org/repository/download/apm/user-profile-2.3.1.apm"> <owner url="http://openacs.org">OpenACS</owner> - <release-date>2007-04-22</release-date> + <release-date>2007-09-08</release-date> <vendor url="http://openacs.org">OpenACS</vendor> - <provides url="user-profile" version="2.3.0"/> - <requires url="profile-provider" version="2.3.0"/> + <provides url="user-profile" version="2.3.1"/> + <requires url="profile-provider" version="2.3.1"/> <parameters> <!-- No version parameters --> Index: openacs-4/packages/weblogger-portlet/weblogger-portlet.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/weblogger-portlet/weblogger-portlet.info,v diff -u -N -r1.8 -r1.9 --- openacs-4/packages/weblogger-portlet/weblogger-portlet.info 15 May 2007 20:15:01 -0000 1.8 +++ openacs-4/packages/weblogger-portlet/weblogger-portlet.info 7 Oct 2007 22:37:05 -0000 1.9 @@ -8,14 +8,14 @@ <singleton-p>t</singleton-p> <auto-mount>weblogger-portlet</auto-mount> - <version name="2.3.0" url="http://openacs.org/repository/download/apm/weblogger-portlet-2.3.0.apm"> + <version name="2.3.1" url="http://openacs.org/repository/download/apm/weblogger-portlet-2.3.1.apm"> <owner url="mailto:simon@bcuni.net">Simon Carstensen</owner> - <release-date>2007-04-22</release-date> + <release-date>2007-09-08</release-date> <vendor url="http://www.collaboraid.biz">Collaboraid</vendor> - <provides url="weblogger-portlet" version="2.3.0"/> - <requires url="lars-blogger" version="2.3.0"/> - <requires url="new-portal" version="2.3.0"/> + <provides url="weblogger-portlet" version="2.3.1"/> + <requires url="lars-blogger" version="2.3.1"/> + <requires url="new-portal" version="2.3.1"/> <callbacks> <callback type="after-install" proc="weblogger_portlet::after_install"/>
    -

    @items.event_name@

    +

    @items.event_name@