Index: openacs-4/packages/acs-admin/lib/password-update.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-admin/lib/password-update.tcl,v diff -u -r1.9 -r1.10 --- openacs-4/packages/acs-admin/lib/password-update.tcl 17 Jul 2018 11:42:26 -0000 1.9 +++ openacs-4/packages/acs-admin/lib/password-update.tcl 17 Jul 2018 13:32:18 -0000 1.10 @@ -47,7 +47,7 @@ {html {size 20}} } } -on_request { - + } -validate { {password_1 { [string equal $password_1 $password_2] } @@ -71,21 +71,21 @@ ad_returnredirect [export_vars -base [ad_conn url] -entire_form -exclude { old_password } -override { { password_old $old_password } }] ad_script_abort } - ad_return_error $result(password_message) "" - ad_script_abort + ad_return_error $result(password_message) "" + ad_script_abort } default { form set_error update password_1 $result(password_message) - break + break } } - + # If the account was closed, it might be open now if {[ad_conn account_status] eq "closed"} { auth::verify_account_status } - + } -after_submit { if { $return_url eq "" } { set return_url [ad_pvt_home] Index: openacs-4/packages/acs-api-browser/www/proc-search.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-api-browser/www/proc-search.tcl,v diff -u -r1.22 -r1.23 --- openacs-4/packages/acs-api-browser/www/proc-search.tcl 17 Jul 2018 11:42:26 -0000 1.22 +++ openacs-4/packages/acs-api-browser/www/proc-search.tcl 17 Jul 2018 13:32:18 -0000 1.23 @@ -69,7 +69,7 @@ set private_matches [list] # place a [list proc_name score positionals] into matches for every proc -foreach proc [nsv_array names api_proc_doc] { +foreach proc [nsv_array names api_proc_doc] { set score 0 array set doc_elements [nsv_get api_proc_doc $proc] @@ -87,23 +87,23 @@ if {[string tolower $query_string] eq [string tolower $proc]} { incr score [expr {$name_weight * 2}] } elseif { ! $exact_match_p } { - incr score [expr {$name_weight * [::apidoc::ad_keywords_score $query_string $proc]}] + incr score [expr {$name_weight * [::apidoc::ad_keywords_score $query_string $proc]}] } } - + ################ ## Param Search: ################ if {$param_weight} { incr score [expr {$param_weight * [::apidoc::ad_keywords_score $query_string "$doc_elements(positionals) $doc_elements(switches)"]}] } - + ############## ## Doc Search: ############## if {$doc_weight > 0} { - + set doc_string [lindex $doc_elements(main) 0] if {[info exists doc_elements(param)]} { foreach parameter $doc_elements(param) { @@ -114,9 +114,9 @@ append doc_string " $doc_elements(return)" } incr score [expr {$doc_weight * [::apidoc::ad_keywords_score $query_string $doc_string]}] - + } - + ################# ## Source Search: ################# @@ -128,15 +128,15 @@ ##### ## Place Needed info in matches if {$score} { - if {$doc_elements(varargs_p)} { + if {$doc_elements(varargs_p)} { set args "$doc_elements(positionals) \[ args... \]" - } else { + } else { set args $doc_elements(positionals) - } + } if { $doc_elements(deprecated_p) } { lappend deprecated_matches [list $proc $score $args] } else { - if { $doc_elements(protection) eq "public" } { + if { $doc_elements(protection) eq "public" } { lappend matches [list $proc $score $args] } else { lappend private_matches [list $proc $score $args] Index: openacs-4/packages/acs-datetime/tcl/acs-calendar-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-datetime/tcl/acs-calendar-procs.tcl,v diff -u -r1.30 -r1.31 --- openacs-4/packages/acs-datetime/tcl/acs-calendar-procs.tcl 17 Jul 2018 11:42:26 -0000 1.30 +++ openacs-4/packages/acs-datetime/tcl/acs-calendar-procs.tcl 17 Jul 2018 13:32:18 -0000 1.31 @@ -41,15 +41,15 @@ HTML formatting) that represents the details. } { if {$days_of_week eq ""} { - set days_of_week "[_ acs-datetime.days_of_week]" + set days_of_week "[_ acs-datetime.days_of_week]" } dt_get_info $date set today_date [dt_sysdate] if {$calendar_details eq ""} { - set calendar_details [ns_set create calendar_details] + set calendar_details [ns_set create calendar_details] } set day_of_week $first_day_of_month @@ -60,13 +60,13 @@ set prev_month_url "" if {$prev_month_template ne ""} { - set ansi_date [ns_urlencode $prev_month] - set prev_month_url [subst $prev_month_template] + set ansi_date [ns_urlencode $prev_month] + set prev_month_url [subst $prev_month_template] } if {$next_month_template ne ""} { - set ansi_date [ns_urlencode $next_month] - set next_month_url [subst $next_month_template] + set ansi_date [ns_urlencode $next_month] + set next_month_url [subst $next_month_template] } # We offer an option to put the links to next and previous months @@ -228,26 +228,26 @@ @return a small calendar for a specific month. Defaults to this month. } { if {$days_of_week eq ""} { - set days_of_week [_ acs-datetime.short_days_of_week] + set days_of_week [_ acs-datetime.short_days_of_week] } return [dt_widget_month \ - -calendar_details $calendar_details \ - -date $date \ - -days_of_week $days_of_week \ - -large_calendar_p $large_calendar_p \ - -master_bgcolor $master_bgcolor \ - -header_bgcolor $header_bgcolor \ - -header_text_color $header_text_color \ - -header_text_size $header_text_size \ - -day_number_template $day_number_template \ - -day_header_size $day_header_size \ - -day_header_bgcolor $day_header_bgcolor \ - -calendar_width $calendar_width \ - -day_bgcolor $day_bgcolor \ - -day_text_color $day_text_color \ - -empty_bgcolor $empty_bgcolor \ - -next_month_template $next_month_template \ - -prev_month_template $prev_month_template ] + -calendar_details $calendar_details \ + -date $date \ + -days_of_week $days_of_week \ + -large_calendar_p $large_calendar_p \ + -master_bgcolor $master_bgcolor \ + -header_bgcolor $header_bgcolor \ + -header_text_color $header_text_color \ + -header_text_size $header_text_size \ + -day_number_template $day_number_template \ + -day_header_size $day_header_size \ + -day_header_bgcolor $day_header_bgcolor \ + -calendar_width $calendar_width \ + -day_bgcolor $day_bgcolor \ + -day_text_color $day_text_color \ + -empty_bgcolor $empty_bgcolor \ + -next_month_template $next_month_template \ + -prev_month_template $prev_month_template ] } ad_proc dt_widget_month_centered { @@ -274,7 +274,7 @@ } { if {$days_of_week eq ""} { - set days_of_week [_ acs-datetime.short_days_of_week] + set days_of_week [_ acs-datetime.short_days_of_week] } set output "" @@ -325,32 +325,32 @@ ignored. } { if { $width < 1 || $width > 12 } { - return "[_ acs-datetime.lt_Width_must_be_]" + return "[_ acs-datetime.lt_Width_must_be_]" } if {$days_of_week eq ""} { - set days_of_week "[_ acs-datetime.short_days_of_week]" + set days_of_week "[_ acs-datetime.short_days_of_week]" } set output "\n" set current_width 0 for { set n 1 } { $n <= 12 } { incr n } { - dt_get_info $date + dt_get_info $date - append output " - \n" + append output " + \n" - incr current_width + incr current_width - if { $current_width == $width && $n != 12} { - set current_width 0 - append output "\n" - } + if { $current_width == $width && $n != 12} { + set current_width 0 + append output "\n" + } - set date $next_month + set date $next_month } return [concat $output "
- [dt_widget_month_small -calendar_details $calendar_details -date $date -days_of_week $days_of_week -large_calendar_p $large_calendar_p -master_bgcolor $master_bgcolor -header_bgcolor $header_bgcolor -header_text_color $header_text_color -header_text_size $header_text_size -day_number_template $day_number_template -day_header_size $day_header_size -day_header_bgcolor $day_header_bgcolor -calendar_width $calendar_width -day_bgcolor $day_bgcolor -day_text_color $day_text_color -empty_bgcolor $empty_bgcolor -next_month_template $next_month_template -prev_month_template $prev_month_template ] - + [dt_widget_month_small -calendar_details $calendar_details -date $date -days_of_week $days_of_week -large_calendar_p $large_calendar_p -master_bgcolor $master_bgcolor -header_bgcolor $header_bgcolor -header_text_color $header_text_color -header_text_size $header_text_size -day_number_template $day_number_template -day_header_size $day_header_size -day_header_bgcolor $day_header_bgcolor -calendar_width $calendar_width -day_bgcolor $day_bgcolor -day_text_color $day_text_color -empty_bgcolor $empty_bgcolor -next_month_template $next_month_template -prev_month_template $prev_month_template ] +
\n"] @@ -380,30 +380,30 @@ passed in date. Defaults to this year. } { if {$days_of_week eq ""} { - set days_of_week "[_ acs-datetime.short_days_of_week]" + set days_of_week "[_ acs-datetime.short_days_of_week]" } dt_get_info $date return [dt_widget_year \ - -calendar_details $calendar_details \ - -date $beginning_of_year \ - -days_of_week $days_of_week \ - -large_calendar_p $large_calendar_p \ - -master_bgcolor $master_bgcolor \ - -header_bgcolor $header_bgcolor \ - -header_text_color $header_text_color \ - -header_text_size $header_text_size \ - -day_number_template $day_number_template \ - -day_header_size $day_header_size \ - -day_header_bgcolor $day_header_bgcolor \ - -calendar_width $calendar_width \ - -day_bgcolor $day_bgcolor \ - -day_text_color $day_text_color \ - -empty_bgcolor $empty_bgcolor \ - -next_month_template $next_month_template \ - -prev_month_template $prev_month_template \ - -width $width] + -calendar_details $calendar_details \ + -date $beginning_of_year \ + -days_of_week $days_of_week \ + -large_calendar_p $large_calendar_p \ + -master_bgcolor $master_bgcolor \ + -header_bgcolor $header_bgcolor \ + -header_text_color $header_text_color \ + -header_text_size $header_text_size \ + -day_number_template $day_number_template \ + -day_header_size $day_header_size \ + -day_header_bgcolor $day_header_bgcolor \ + -calendar_width $calendar_width \ + -day_bgcolor $day_bgcolor \ + -day_text_color $day_text_color \ + -empty_bgcolor $empty_bgcolor \ + -next_month_template $next_month_template \ + -prev_month_template $prev_month_template \ + -width $width] } # A couple of helper procs to return the location of navigation icons. @@ -443,15 +443,15 @@ if { $viewname == $view } { # current view append result [subst { - $text - - }] + $text + + }] } else { append result [subst { - - $text - - }] + + $text + + }] } } @@ -473,7 +473,7 @@ } { # Return immediately of the current view isn't month or year if {$view ni [list month year]} { - return "" + return "" } # Convert the given data into current calendar time @@ -483,23 +483,23 @@ # Check that links to prev/next year don't lead to illegal dates that would bomb if {[catch {set prev_year [clock format [clock scan "1 year ago" -base $now] -format "%Y-%m-%d"]} err]} { - set prev_year_legal_p 0 + set prev_year_legal_p 0 } else { - if {[catch {clock scan $prev_year}]} { - set prev_year_legal_p 0 - } else { - set prev_year_legal_p 1 - } + if {[catch {clock scan $prev_year}]} { + set prev_year_legal_p 0 + } else { + set prev_year_legal_p 1 + } } if {[catch {set next_year [clock format [clock scan "1 year" -base $now] -format "%Y-%m-%d"]} err]} { - set next_year_legal_p 0 + set next_year_legal_p 0 } else { - if {[catch {clock scan $next_year}]} { - set next_year_legal_p 0 - } else { - set next_year_legal_p 1 - } + if {[catch {clock scan $next_year}]} { + set next_year_legal_p 0 + } else { + set next_year_legal_p 1 + } } set curr_year [clock format $now -format "%Y"] @@ -513,29 +513,29 @@ # Serve arrow link to prev year if it leads to legal date if {$prev_year_legal_p != 0} { - append result [subst { - - left arrow - }] + append result [subst { + + left arrow + }] } append result " $curr_year" # Serve arrow to next year if it leads to a legal date if {$next_year_legal_p != 0} { - append result [subst { - - right arrow - }] + append result [subst { + + right arrow + }] } append result " - - - - - \n" + + + + + \n" return $result } @@ -552,48 +552,48 @@ # Check that the arrows to prev/next months don't go to illegal dates and bomb if {[catch {set prev_month [clock format [clock scan "1 month ago" -base $now] -format "%Y-%m-%d"]} err ]} { - set prev_month_legal_p 0 + set prev_month_legal_p 0 } else { - if {[catch {clock scan $prev_month}]} { - set prev_month_legal_p 0 - } else { - set prev_month_legal_p 1 - } + if {[catch {clock scan $prev_month}]} { + set prev_month_legal_p 0 + } else { + set prev_month_legal_p 1 + } } if {[catch {set next_month [clock format [clock scan "1 month" -base $now] -format "%Y-%m-%d"]} err]} { - set next_month_legal_p 0 + set next_month_legal_p 0 } else { - if {[catch {clock scan $next_month}]} { - set next_month_legal_p 0 - } else { - set next_month_legal_p 1 - } + if {[catch {clock scan $next_month}]} { + set next_month_legal_p 0 + } else { + set next_month_legal_p 1 + } } append results [subst { - - -
+
+ + - " - if { $r(correct_answer_p) && $assessment_data(type) ne "survey"} { - append stats "" - } else { - append stats "" - } - append stats "\n" + set total_responses_limit_session "" + if { [info exists limit_to_section_clause] && $limit_to_section_clause ne "" } { set total_responses_limit_session "and s.session_id in $limit_to_section_clause" } - if { $first_p } { - append stats " -\n" + if {([info exists session_id_list] && $session_id_list ne "")} { + set total_responses_limit_session " and s.session_id in ([template::util::tcl_to_sql_list $session_id_list]) " + } + set total_responses [db_string count_responses "select count(*) from (select distinct s.session_id from as_sessions s, as_item_data, cr_revisions cr1, cr_revisions cr2 where cr1.revision_id=:revision_id and cr1.item_id=cr2.item_id and as_item_id = cr2.revision_id and s.session_id = as_item_data.session_id and s.completed_datetime is not null $total_responses_limit_session ) d"] - set first_p 0 - } else { - append stats "\n" - } - } - append stats "
}] # Output link to previous month only if it's legal if {$prev_month_legal_p != 0} { - append results [subst { - - left arrow - }] + append results [subst { + + left arrow + }] } append results " $curr_month" # Output link to next month only if it's a legal month if {$next_month_legal_p != 0} { - append results [subst { - - - }] + append results [subst { + + + }] } append results " @@ -626,17 +626,17 @@ # valid views are "list" "day" "week" "month" "year" if {$base_url eq ""} { - set base_url [ns_conn url] + set base_url [ns_conn url] } if {$pass_in_vars ne ""} { - append base_url "?$pass_in_vars&" + append base_url "?$pass_in_vars&" } else { - append base_url "?" + append base_url "?" } if {$date eq ""} { - set date [dt_sysdate] + set date [dt_sysdate] } set list_of_vars [list] @@ -662,182 +662,182 @@ [dt_navbar_year $view $base_url $date]\n" if {$view eq "month"} { - # month view - append output [subst { -
- - - }] + # month view + append output [subst { + + + +
+ + + }] - set months_list [dt_month_names] - set now [clock scan $date] - set curr_month [expr {[util::trim_leading_zeros [clock format $now -format "%m"]] - 1}] + set months_list [dt_month_names] + set now [clock scan $date] + set curr_month [expr {[util::trim_leading_zeros [clock format $now -format "%m"]] - 1}] - for {set i 0} {$i < 12} {incr i} { + for {set i 0} {$i < 12} {incr i} { - set month [lindex $months_list $i] + set month [lindex $months_list $i] - # show 3 months in a row + # show 3 months in a row - if {$i != 0 && $i % 3 == 0} { - append output "" - } + if {$i != 0 && $i % 3 == 0} { + append output "" + } - if {$i == $curr_month} { - append output " - \n" - } else { - set target_date [clock format \ - [clock scan "[expr {$i-$curr_month}] month" -base $now] \ - -format "%Y-%m-%d"] + if {$i == $curr_month} { + append output " + \n" + } else { + set target_date [clock format \ + [clock scan "[expr {$i-$curr_month}] month" -base $now] \ + -format "%Y-%m-%d"] - append output [subst { - - }] - } - } + append output [subst { + + }] + } + } - append output "" + append output "" } elseif {$view eq "year"} { - # year view + # year view - append output " - - + - + +
- $month - + $month + - - $month - + + $month +
- - \n" + append output " + + - + append output " + [dt_navbar_month $view $base_url $date] +
+ + \n" - set now [clock scan $date] - set curr_year $year - set end_year [expr {$year + 2}] - set monthday [clock format $now -format "%m-%d"] + set now [clock scan $date] + set curr_year $year + set end_year [expr {$year + 2}] + set monthday [clock format $now -format "%m-%d"] - for {set year [expr {$curr_year - 2}]} {$year <= $end_year} {incr year} { - if {$year == $curr_year} { - append output " - \n" - } else { - append output [subst { - - }] - } - } + for {set year [expr {$curr_year - 2}]} {$year <= $end_year} {incr year} { + if {$year == $curr_year} { + append output " + \n" + } else { + append output [subst { + + }] + } + } - append output "" + append output "" } else { - append output " - [dt_navbar_month $view $base_url $date] -
$year - - $year - $year + + $year +
-
+
- - - " + - - + + - -
+ + + " - set days_of_week [list S M T W T F S] + set days_of_week [list S M T W T F S] - foreach day_of_week $days_of_week { - append output [subst { - - }] - } - append output "" + foreach day_of_week $days_of_week { + append output [subst { + + }] + } + append output "" - set day_of_week 1 - set julian_date $first_julian_date - set day_number $first_day + set day_of_week 1 + set julian_date $first_julian_date + set day_number $first_day - while {1} { + while {1} { - if {$julian_date < $first_julian_date_of_month} { - set before_month_p 1 - set after_month_p 0 - } elseif {$julian_date > $last_julian_date_in_month} { - set before_month_p 0 - set after_month_p 1 - } else { - set before_month_p 0 - set after_month_p 0 - } + if {$julian_date < $first_julian_date_of_month} { + set before_month_p 1 + set after_month_p 0 + } elseif {$julian_date > $last_julian_date_in_month} { + set before_month_p 0 + set after_month_p 1 + } else { + set before_month_p 0 + set after_month_p 0 + } - set ansi_date [dt_julian_to_ansi $julian_date] + set ansi_date [dt_julian_to_ansi $julian_date] - if {$julian_date == $first_julian_date_of_month} { - set day_number 1 - } elseif {$julian_date > $last_julian_date} { - break - } elseif {$julian_date == $last_julian_date_in_month + 1} { - set day_number 1 - } + if {$julian_date == $first_julian_date_of_month} { + set day_number 1 + } elseif {$julian_date > $last_julian_date} { + break + } elseif {$julian_date == $last_julian_date_in_month + 1} { + set day_number 1 + } - if { $day_of_week == 1} { - append output "\n" - } + if { $day_of_week == 1} { + append output "\n" + } - if {$before_month_p || $after_month_p} { - append output [subst { - - }] - } elseif {$julian_date == $julian_date_today} { - append output " - " - } else { - append output [subst { - - }] - } + if {$before_month_p || $after_month_p} { + append output [subst { + + }] + } elseif {$julian_date == $julian_date_today} { + append output " + " + } else { + append output [subst { + + }] + } - incr day_of_week - incr julian_date - incr day_number + incr day_of_week + incr julian_date + incr day_number - if { $day_of_week > 7 } { - set day_of_week 1 - append output "\n" - } - } + if { $day_of_week > 7 } { + set day_of_week 1 + append output "\n" + } + } } append today_url "$base_url" "view=day&date=[ns_urlencode [dt_sysdate]]" append output " - - -
$day_of_week -

$day_of_week +

- - $day_number - - $day_number - - - $day_number - + + $day_number + + $day_number + + + $day_number +
- - -
-
-
- - + +
- " +
+ + +
+
+
+ + - + - -
+ " if { $view eq "day" && [dt_sysdate] == $date } { append output "Today" @@ -846,29 +846,29 @@ } append output [subst { - is [dt_ansi_to_pretty]

-
-
- -
- Date as YYYYMMDD - -
+ is [dt_ansi_to_pretty]

+ +
+ +
+ Date as YYYYMMDD + +
}] foreach var $list_of_vars { append output "" } append output " - -
-
\n" + +
+
\n" return $output } Index: openacs-4/packages/acs-lang/lib/change-locale-bar.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-lang/lib/Attic/change-locale-bar.tcl,v diff -u -r1.7 -r1.8 --- openacs-4/packages/acs-lang/lib/change-locale-bar.tcl 17 Jul 2018 11:42:26 -0000 1.7 +++ openacs-4/packages/acs-lang/lib/change-locale-bar.tcl 17 Jul 2018 13:32:18 -0000 1.8 @@ -29,11 +29,11 @@ db_multirow -extend {l10n_label switch_url} locale_list get_locale_list " select el.label, el.locale, - (select count(*) + (select count(*) from user_preferences where locale = el.locale) as user_count from enabled_locales el - where (select count(*) + where (select count(*) from lang_messages where message_key = :avail_key and locale = el.locale) > 0 @@ -49,9 +49,9 @@ ####################################################################### # The text to change locales, in decreasing order of desirability -# 1) "Change Locale" in the browser's requested locale. +# 1) "Change Locale" in the browser's requested locale. # 2) If there is a list of locales, "..." -# (NOT to the system default for "Change Locale". The reason is that, after a list of +# (NOT to the system default for "Change Locale". The reason is that, after a list of # language names, "..." should be more recognizable than a foreign word) # 3) Fall back on the standard defaults for Change Locale @@ -63,7 +63,7 @@ set change_locale_text "[_ acs-lang.change-locale]" } -if {$enabled_locale_count > 1 && $enabled_locale_count > $switchable_count} { +if {$enabled_locale_count > 1 && $enabled_locale_count > $switchable_count} { set change_locale_url [export_vars -base ${base_lang_url} {return_url}] } @@ -84,7 +84,7 @@ set lang_admin_text "Administer Locales" } else { set lang_admin_text "Add Locales" -} +} # Local variables: # mode: tcl Index: openacs-4/packages/acs-lang/tcl/lang-message-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-lang/tcl/lang-message-procs.tcl,v diff -u -r1.62 -r1.63 --- openacs-4/packages/acs-lang/tcl/lang-message-procs.tcl 17 Jul 2018 11:42:26 -0000 1.62 +++ openacs-4/packages/acs-lang/tcl/lang-message-procs.tcl 17 Jul 2018 13:32:18 -0000 1.63 @@ -1,5 +1,5 @@ #/packages/acs-lang/tcl/lang-message-procs.tcl -ad_library { +ad_library { Routines for displaying web pages in multiple languages

@@ -17,17 +17,17 @@ namespace eval lang::message {} -ad_proc -public lang::message::check { +ad_proc -public lang::message::check { locale package_key message_key message -} { +} {

Check a message for semantic and sanity correctness (usually called just before a message is registered). Throws an error when one of the checks fails.

-} { +} { # Qualify the locale variable value with a country code if it is # just a language if { [string length $locale] == 2 } { @@ -36,7 +36,7 @@ # invoked by users. # let's get the default locale for that language set locale [lang::util::default_locale_from_lang $locale] - } + } # Create a globally (across packages) unique key for the cache set key "${package_key}.${message_key}" @@ -52,47 +52,47 @@ if { [llength $missing_vars] > 0 } { set msg "Message key '$key' in locale '$locale' has these embedded variables not present in the en_US locale:\ - [join $missing_vars ","]." + [join $missing_vars ","]." ad_log error $msg error $msg } } - + # If a localization key from acs-lang... if {[regexp {^acs-lang\.localization-(.*)$} $key match lc_key]} { - # - # ...number separators for decimal and thousands must be - # checked to ensure they are not equal, otherwise the - # localized number parsing will fail. - # - if {$lc_key in {decimal_point thousands_sep mon_thousands_sep}} { - # - # Fetch values in case there were already loaded. - # - foreach k {decimal_point thousands_sep mon_thousands_sep} { - set $k [expr {[lang::message::message_exists_p $locale acs-lang.localization-$k] ? - [lc_get -locale $locale $k] : ""}] - } - # - # Overwrite the fetched value with the provided one. - # - set $lc_key $message + # + # ...number separators for decimal and thousands must be + # checked to ensure they are not equal, otherwise the + # localized number parsing will fail. + # + if {$lc_key in {decimal_point thousands_sep mon_thousands_sep}} { + # + # Fetch values in case there were already loaded. + # + foreach k {decimal_point thousands_sep mon_thousands_sep} { + set $k [expr {[lang::message::message_exists_p $locale acs-lang.localization-$k] ? + [lc_get -locale $locale $k] : ""}] + } + # + # Overwrite the fetched value with the provided one. + # + set $lc_key $message - # - # We require, that the decimal_point was either provided - # or loaded before to be able to compare it with the - # thousands points. - # - if {$decimal_point ne "" && - [string first $decimal_point "$thousands_sep$mon_thousands_sep"] > -1} { - error "locale $locale, key: $key: Message keys for thousands and decimal separators must be different." - } - } + # + # We require, that the decimal_point was either provided + # or loaded before to be able to compare it with the + # thousands points. + # + if {$decimal_point ne "" && + [string first $decimal_point "$thousands_sep$mon_thousands_sep"] > -1} { + error "locale $locale, key: $key: Message keys for thousands and decimal separators must be different." + } + } } } -ad_proc -public lang::message::register { +ad_proc -public lang::message::register { {-update_sync:boolean} {-upgrade_status "no_upgrade"} {-conflict:boolean} @@ -101,7 +101,7 @@ package_key message_key message -} { +} {

Registers a message for a given locale and package. Inserts the message key into the database if it @@ -117,9 +117,9 @@ @author Christian Hvid @see _mr - + @param locale Locale or language of the message. If a language is supplied, - the default locale for the language is looked up. + the default locale for the language is looked up. @param package_key The package key of the package that the message belongs to. @@ -132,17 +132,17 @@ a message should only be not null when we know that message in catalog file and db are identical (in sync). This message is then used as a merge base for message catalog upgrades. For more info, - see the lang::catalog::upgrade proc. + see the lang::catalog::upgrade proc. - @param upgrade_status Set the upgrade status of the new message to "added", "updated", "deleted". + @param upgrade_status Set the upgrade status of the new message to "added", "updated", "deleted". Defaults to "no_upgrade". - - @param conflict Set this switch if the upgrade represents a conflict between + + @param conflict Set this switch if the upgrade represents a conflict between changes made in the database and in catalog files. @see lang::message::lookup @see _ -} { +} { # Qualify the locale variable value with a country code if it is # just a language if { [string length $locale] == 2 } { @@ -151,7 +151,7 @@ # invoked by users. # let's get the default locale for that language set locale [lang::util::default_locale_from_lang $locale] - } + } # Create a globally (across packages) unique key for the cache set key "${package_key}.${message_key}" @@ -173,17 +173,17 @@ error $error_message } } - + # Call semantic and sanity checks on the key before registering. lang::message::check $locale $package_key $message_key $message - + # Build up an array of columns to set array set cols [list] if { $update_sync_p } { set cols(sync_time) [db_map sync_time] } else { set cols(sync_time) "null" - } + } if { [string trim $message] eq "" } { set cols(message) "null" } else { @@ -195,7 +195,7 @@ set cols(conflict_p) :conflict_db_p # Different logic for update and insert - if { [nsv_exists lang_message_$locale $key] } { + if { [nsv_exists lang_message_$locale $key] } { # Update existing message if the message has changed # For use in audit log call @@ -218,7 +218,7 @@ } db_transaction { - + # Update audit log lang::audit::changed_message \ $old_message \ @@ -230,16 +230,16 @@ $old_message_array(sync_time) \ $old_message_array(conflict_p) \ $old_message_array(upgrade_status) - - # Trying to avoid hitting Oracle bug#2011927 + + # Trying to avoid hitting Oracle bug#2011927 if { [string trim $message] eq "" } { db_dml lang_message_update {} - } else { + } else { set cols(message) [db_map message] db_dml lang_message_update {} -clobs [list $message] } } - } else { + } else { # Insert new message set cols(package_key) :package_key @@ -249,17 +249,17 @@ # We wrap this in a catch, so that it still works in the bootstrap-installer where ad_conn user_id will fail. # LARS NOTE: Why not make ad_conn user_id return 0 in the bootstrap-installer? catch { - set creation_user [ad_conn user_id] + set creation_user [ad_conn user_id] set cols(creation_user) :creation_user } - + set col_clauses [list] set val_clauses [list] foreach col [array names cols] { lappend col_clauses $col lappend val_clauses $cols($col) } - + # avoiding bug#2011927 from Oracle. if { [string trim $message] eq "" } { db_dml lang_message_insert_null_msg {} @@ -272,7 +272,7 @@ nsv_set lang_message_$locale $key $message } -ad_proc -public lang::message::delete { +ad_proc -public lang::message::delete { -package_key:required -message_key:required -locale:required @@ -312,9 +312,9 @@ where lma2.package_key = lma1.package_key and lma2.message_key = lma1.message_key and lma2.locale = lma1.locale - ) + ) }] - + lang::message::register \ $locale \ $package_key \ @@ -326,7 +326,7 @@ -package_key:required -message_key:required -locale:required - -element:required + -element:required } { Get value of a single attribute of a message. @@ -345,18 +345,18 @@ return $message_array($element) } -ad_proc -public lang::message::get { +ad_proc -public lang::message::get { -package_key:required -message_key:required -locale:required -array:required } { Get all properties of a message in a particular locale. - - @param array Name of an array in the caller's namespace into + + @param array Name of an array in the caller's namespace into which you want the message properties delivered. - @return The array will contain the following entries: + @return The array will contain the following entries: message_key, package_key, locale, @@ -395,15 +395,15 @@ } -column_array row } -ad_proc -public lang::message::unregister { +ad_proc -public lang::message::unregister { package_key message_key } { Unregisters a message key, i.e. deletes it along with all its messages from the database and deleted entries in the cache. This proc is useful when installing a package. - To delete an individual message, as opposed to the entire key, + To delete an individual message, as opposed to the entire key, use lang::message::delete. @see lang::message::delete @@ -444,7 +444,7 @@ @param edit_array_list An array list holding names of columns and the values to set them to. Valid keys in this array list are any column names in the - lang_messages table. + lang_messages table. @param update_sync If this switch is provided the sync_time of the message will be updated to current time. If not @@ -482,7 +482,7 @@ $old_message_array(deleted_p) \ $old_message_array(sync_time) \ $old_message_array(conflict_p) \ - $old_message_array(upgrade_status) + $old_message_array(upgrade_status) # If we are deleting an en_US message we need to mark the message deleted in all locales if {$locale eq "en_US"} { @@ -515,7 +515,7 @@ } if { [llength $set_clauses] > 0 } { - + set sql " update lang_messages set [join $set_clauses ", "] @@ -533,7 +533,7 @@ } { Return the number of messages with conflicts (conflict_p=t) resulting from catalog imports. - + @param package_key Restrict count to package with this key @param locale Restrict count to messages of this locale @@ -584,7 +584,7 @@ message } { Returns a list of embedded substitution variables on the form %varname% in a message. - This is useful if you want to check that the variables used in a translated message also + This is useful if you want to check that the variables used in a translated message also appear in the en_US message. If not, there's likely to be a typo. @param message A message with embedded %varname% notation @@ -620,19 +620,19 @@ with array_key (what's between the percentage sings). If value_array_list is not provided then attempt to fetch variable values the number of levels up given by upvar_level (defaults to 3 because this proc is typically invoked from the underscore - lookup proc). + lookup proc). Here is an example: set localized_message "The %animal% jumped across the %barrier%. About 50% of the time, he stumbled, or maybe it was %%20 %times%." set value_list { animal "frog" barrier "fence" } ns_log notice formatted=[format $localized_message $value_list] - + The output from the example is: The frog jumped across the fence. About 50% of the time, he stumbled, or maybe it was %20 %times%. -} { +} { array set value_array $value_array_list set value_array_keys [array names value_array] set remaining_message $localized_message @@ -649,10 +649,10 @@ if { [llength $value_array_list] > 0 } { # A substitution list is provided, the key should be in there - + if {$variable_string ni $value_array_keys} { ns_log Warning "lang::message::format: The value_array_list \"$value_array_list\" does not contain the variable name $variable_string found in the message: $localized_message" - + # There is no value available to do the substitution with # so don't substitute at all append formatted_message $percent_match @@ -677,7 +677,7 @@ } } else { ns_log warning "Message contains a variable named '$variable_name' which doesn't exist in the caller's environment: message $localized_message" - append formatted_message "MISSING: variable '$variable_name' is not available" + append formatted_message "MISSING: variable '$variable_name' is not available" } } } @@ -690,7 +690,7 @@ } ad_proc -private lang::message::embedded_vars_regexp {} { - The regexp pattern used to loop over variables embedded in + The regexp pattern used to loop over variables embedded in message catalog texts. @author Peter Marklund (peter@collaboraid.biz) @@ -707,7 +707,7 @@ # Make sure messages are in the cache lang::message::cache - return [nsv_exists lang_message_$locale $key] + return [nsv_exists lang_message_$locale $key] } ad_proc -public lang::message::lookup { @@ -723,32 +723,32 @@ Returns a translated string for the given locale and message key. If the user is a translator, inserts tags to link to the translator interface. This allows a translator to work from the context of a web page. - - Messages will have %name% replaced with variables either from substitution_list, + + Messages will have %name% replaced with variables either from substitution_list, if present, or from the caller's namespace (or upvar_level's namespace). Set upvar_level to 0 and substitution_list empty to prevent substitution from happening - Note that this proc does not use named parameters, because named parameters are + Note that this proc does not use named parameters, because named parameters are relatively slow, and this is going to get called a whole lot on each request. @param locale Locale (e.g., "en_US") or language (e.g., "en") string. If locale is the empty string ad_conn locale will be used if we are in an HTTP connection, otherwise the system locale (SiteWideLocale) will be used. - @param key Unique identifier for this message. Will be the same - identifier for each locale. All keys belong to a certain - package and should be prefixed with the package key of that package - on the format package_key.message_key (the dot is reserved for separating + @param key Unique identifier for this message. Will be the same + identifier for each locale. All keys belong to a certain + package and should be prefixed with the package key of that package + on the format package_key.message_key (the dot is reserved for separating the package key, the rest of the key should contain only alpha-numeric - characters and underscores). If the key does not belong to + characters and underscores). If the key does not belong to any particular package it should not contain a dot. A lookup is always attempted with the exact key given to this proc. @param default Text to return if there is no message in the message catalog for the given locale. This argument is optional. If this argument is not provided or is the empty string then the text returned will - be TRANSLATION MISSING - $key. + be TRANSLATION MISSING - $key. @param substitution_list A list of values to substitute into the message. This argument should only be given for certain messages that contain place holders (on the syntax @@ -760,8 +760,8 @@ @param upvar_level If there are embedded variables and no substitution list provided, this parameter specifies how many levels up to fetch the values of the variables in the message. The default is 1. - - @param translator_mode_p Set to 0 if you do not want this call to honor translator mode. + + @param translator_mode_p Set to 0 if you do not want this call to honor translator mode. Useful if you're not using this message in the page itself, but e.g. for localization data or for the list of messages on the page. @@ -771,18 +771,18 @@ @see _ @see lang::message::register - + @return A localized piece of text. -} { +} { # Make sure messages are in the cache lang::message::cache # Make sure that a default of "" is transformed into Translation Missing # As per discussion on IRC on 2008-03-06 if { $default eq ""} { - set default "TRANSLATION MISSING" + set default "TRANSLATION MISSING" } - + if { $locale eq "" } { # No locale provided @@ -801,9 +801,9 @@ } else { set locale $default_locale } - } + } - # We remember the passed-in locale, because we want the translator mode to show which + # We remember the passed-in locale, because we want the translator mode to show which # messages have been translated, and which have not. set org_locale $locale @@ -832,18 +832,18 @@ if { [message_exists_p $locale $key] } { set message [nsv_get lang_message_$locale $key] } else { - if {"TRANSLATION MISSING" ne $default} { - set message $default - } else { + if {"TRANSLATION MISSING" ne $default} { + set message $default + } else { ad_log Error "lang::message::lookup: Key '$key' does not exist in en_US" set message "MESSAGE KEY MISSING: '$key'" - } - } + } + } } } } } - + # Do any variable substitutions (interpolation of variables) # Set upvar_level to 0 and substitution_list empty to prevent substitution from happening if { [llength $substitution_list] > 0 || ($upvar_level >= 1 && [string first "%" $message] != -1) } { @@ -853,15 +853,15 @@ if { [lang::util::translator_mode_p] } { # Translator mode - record the message lookup lang::util::record_message_lookup $key - + if { $translator_mode_p } { global message_key_num if { ![info exists message_key_num] } { set message_key_num 1 } else { incr message_key_num } - + # encode the key in the page set message "$message\x02(\x01$key\x01)\x02" } @@ -870,17 +870,17 @@ return $message } -ad_proc -private lang::message::translate { +ad_proc -private lang::message::translate { msg locale } { Translates an English string into a different language using Babelfish. Warning - october 2002: This is broken. - + @author Henry Minsky (hqm@mit.edu) - + @param msg String to translate @param lang Abbreviation for lang in which to translate string @return Translated string @@ -898,7 +898,7 @@ } else { error "Babelfish translation error" } -} +} ad_proc -private lang::message::cache { @@ -910,23 +910,23 @@ # if we segregage instead by package. Check for problems with ns_info locks. # LARS TODO: Use a mutex - if { ![nsv_exists lang_message_cache executed_p] } { + if { ![nsv_exists lang_message_cache executed_p] } { nsv_set lang_message_cache executed_p 1 if { $package_key eq "" } { set package_where_clause "" } else { set package_where_clause "where package_key = :package_key" } - - set i 0 + + set i 0 db_foreach select_locale_keys {} { nsv_set lang_message_$locale "${package_key}.${message_key}" $message incr i } - + db_release_unused_handles - + ns_log Notice "lang::message::cache - Initialized message cache with $i rows from database" } } @@ -945,14 +945,14 @@ Inserts the message into the table lang_messages if it does not exist and updates if it does. - For backward compatibility - it assumes that the key + For backward compatibility - it assumes that the key is the concatenation of message and package key like this: package_key.message_key @author Jeff Davis (davis@xarg.net) - + @param locale Abbreviation for language of the message or the locale. @param key Unique identifier for this message. Will be the same identifier for each language @@ -968,13 +968,13 @@ key {substitution_list {}} } { - Short hand proc that invokes the lang::message::lookup proc. + Short hand proc that invokes the lang::message::lookup proc. Returns a localized text from the message catalog with the locale ad_conn locale if invoked within a request, or the system locale otherwise.

- Example: + Example:

     set the_url [export_vars -base "[ad_conn package_url]view" { item_id }]
     set body [_ my-package.lt_To_view_this_item [list item_url $the_url]]
@@ -985,15 +985,15 @@
     @param key        Unique identifier for this message. Will be the same identifier
                       for each locale. The key is on the format package_key.message_key
 
-    @param substitution_list 
-                      A list of values to substitute into the message on the form { name value name value ... }. 
+    @param substitution_list
+                      A list of values to substitute into the message on the form { name value name value ... }.
                       This argument should only be given for certain messages that contain place holders (on the syntax
                       %1:pretty_name%, %2:another_pretty_name% etc) for embedding variable values.
                       If the message contains variables that should be interpolated and this argument
                       is not provided then upvar will be used to fetch the variable values.
 
     @return           A localized message
-    
+
     @author Jeff Davis (davis@xarg.net)
     @author Peter Marklund (peter@collaboraid.biz)
     @author Christian Hvid (chvid@collaboraid.biz)
Index: openacs-4/packages/acs-tcl/lib/static-progress-bar.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/lib/static-progress-bar.tcl,v
diff -u -r1.4 -r1.5
--- openacs-4/packages/acs-tcl/lib/static-progress-bar.tcl	17 Jul 2018 11:42:26 -0000	1.4
+++ openacs-4/packages/acs-tcl/lib/static-progress-bar.tcl	17 Jul 2018 13:32:18 -0000	1.5
@@ -47,13 +47,12 @@
     set percentage_done 100
 } elseif {[info exists finished_page] && $finished_page == $current} {
     # subtract 1 from current, since we haven't completed this page yet
-    set percentage_done [expr {round($current * 100.0 / $total)}]    
+    set percentage_done [expr {round($current * 100.0 / $total)}]
 } else {
     # subtract 1 from current, since we haven't completed this page yet
     set percentage_done [expr {round(($current - 1) * 100.0 / $total)}]
 }
 
-
 # Local variables:
 #    mode: tcl
 #    tcl-indent-level: 4
Index: openacs-4/packages/acs-tcl/tcl/navigation-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/navigation-procs.tcl,v
diff -u -r1.44 -r1.45
--- openacs-4/packages/acs-tcl/tcl/navigation-procs.tcl	17 Jul 2018 11:42:26 -0000	1.44
+++ openacs-4/packages/acs-tcl/tcl/navigation-procs.tcl	17 Jul 2018 13:32:18 -0000	1.45
@@ -108,7 +108,7 @@
     @see ad_context_bar_html
 } {
     if {![parameter::get -package_id [ad_conn subsite_id] -parameter ShowContextBarP -default 1]} {
-	return ""
+        return ""
     }
 
     if { $node_id eq "" } {
@@ -129,7 +129,7 @@
     template::multirow create $multirow url label
 
     foreach elm [ad_context_node_list -from_node $from_node $node_id] {
-	lassign $elm elm_0 elm_1
+        lassign $elm elm_0 elm_1
         if { $node_id_url_end > 0 && [string match -nocase $node_id_url [string range $elm_0 0 ${node_id_url_end}-1] ] } {
             set elm_0 [string range $elm_0 $node_id_url_end end]
         }
@@ -169,7 +169,7 @@
     @see ad_context_bar_html
 } {
     if {![parameter::get -package_id [ad_conn subsite_id] -parameter ShowContextBarP -default 1]} {
-	return ""
+        return ""
     }
 
     if { $node_id eq "" } {
@@ -187,10 +187,10 @@
         # fix last element to just be literal string
         lset context end [lindex $context end 1]
     } else {
-	if {![string match "\{*" $args]} {
-	    # args is not a list, transform it into one.
-	    set args [list $args]
-	}
+        if {![string match "\{*" $args]} {
+            # args is not a list, transform it into one.
+            set args [list $args]
+        }
     }
     lappend context {*}$args
     if { [info exists separator] } {
@@ -218,12 +218,12 @@
     set counter 0
     foreach arg $args {
         lappend link_list [subst {[ns_quotehtml [lindex $element 1]]}]
-	incr counter
+        incr counter
     }
     if { $counter } {
-	return "\[[join $link_list " | "]\]"
+        return "\[[join $link_list " | "]\]"
     } else {
-	return ""
+        return ""
     }
 }
 
@@ -237,19 +237,19 @@
     set return_list [list]
 
     foreach value $values {
-	if { $default eq $value  } {
-	    lappend return_list "[lindex $items $count]"
-	} else {
-	    lappend return_list [subst {[ns_quotehtml [lindex $items $count]]}]
-	}
+        if { $default eq $value  } {
+            lappend return_list "[lindex $items $count]"
+        } else {
+            lappend return_list [subst {[ns_quotehtml [lindex $items $count]]}]
+        }
 
-	incr count
+        incr count
     }
 
     if { [llength $return_list] > 0 } {
         return "\[[join $return_list " | "]\]"
     } else {
-	return ""
+        return ""
     }
 
 }
@@ -299,13 +299,13 @@
 
     # Netscape browser just have Mozilla in their user-agent header
     if {$internet_explorer_p == 0} {
-	set netscape_p [regexp -nocase "mozilla" $user_agent match]
+        set netscape_p [regexp -nocase "mozilla" $user_agent match]
     }
 
     set java_script_p 0
 
     if { ($netscape_p && ($version >= 3)) || ($internet_explorer_p && ($version >= 4)) } {
-	set java_script_p 1
+        set java_script_p 1
     }
 
     return $java_script_p
@@ -328,13 +328,13 @@
 
     # Netscape browser just have Mozilla in their user-agent header
     if {$internet_explorer_p == 0} {
-	set netscape_p [regexp -nocase "mozilla" $user_agent match]
+        set netscape_p [regexp -nocase "mozilla" $user_agent match]
     }
 
     set netscape3_p 0
 
     if { $netscape_p && $version == 3 } {
-	set netscape3_p 1
+        set netscape3_p 1
     }
 
     return $netscape3_p
@@ -358,25 +358,25 @@
         -script {go_to_url(this.options[this.selectedIndex].value);}
 
     foreach item $items {
-	set url_stub [ad_conn url]
+        set url_stub [ad_conn url]
 
-	# if the url matches the url you would redirect to, as determined
-	# either by highlight_url, or if highlight_url is not set,
-	# the current url then select it
-	if {$highlight_url ne "" && $highlight_url == [lindex $urls $counter]} {
- 	    append return_string [subst {
 $r(choice_title):$r(choice_responses)[format "%.2f" [expr {double($r(choice_responses)) / $total_responses * 100}]]% -[_ assessment.Total_Responses] $total_responses
" - if {$assessment_data(type) ne "survey"} { - append stats " -[_ assessment.Total_Correct] $total_correct" - - if { $total_correct > 0 } { - append stats ", [format "%.2f" [expr {double($total_correct) / $total_responses * 100}]]%" - } - } - append stats "
\n" - } else { - append stats "[_ assessment.No_responses]" - } - } else { - switch $data_type { + if { $total_responses } { + append stats "\n" + set first_p 1 + foreach choice $choices { + array set r $choice + + append stats "" + if { $r(correct_answer_p) && $assessment_data(type) ne "survey"} { + append stats "" + } else { + append stats "" + } + append stats "\n" + + if { $first_p } { + append stats " + \n" + + set first_p 0 + } else { + append stats "\n" + } + } + append stats "
 $r(choice_title):$r(choice_responses)[format "%.2f" [expr {double($r(choice_responses)) / $total_responses * 100}]]% + [_ assessment.Total_Responses] $total_responses
" + if {$assessment_data(type) ne "survey"} { + append stats " + [_ assessment.Total_Correct] $total_correct" + + if { $total_correct > 0 } { + append stats ", [format "%.2f" [expr {double($total_correct) / $total_responses * 100}]]%" + } + } + append stats "
\n" + } else { + append stats "[_ assessment.No_responses]" + } + } else { + switch $data_type { "content_type" - - "file" - - "date" - - "timestamp" - - "text" - - "varchar" { - set stats "[_ assessment.View_Responses_1]" - } - "boolean" { - append stats "\n" - db_foreach get_boolean_answers { - select boolean_answer, count(*) as n_responses - from as_item_data - where as_item_id = :revision_id - group by boolean_answer - order by boolean_answer - } { - append stats "\n" - } - append stats "
$boolean_answer: $n_responses
\n" - } - "integer" - - "float" { - set stats "\n" + "file" - + "date" - + "timestamp" - + "text" - + "varchar" { + set stats "[_ assessment.View_Responses_1]" + } + "boolean" { + append stats "
\n" + db_foreach get_boolean_answers { + select boolean_answer, count(*) as n_responses + from as_item_data + where as_item_id = :revision_id + group by boolean_answer + order by boolean_answer + } { + append stats "\n" + } + append stats "
$boolean_answer: $n_responses
\n" + } + "integer" - + "float" { + set stats "\n" - set number_answers [list] - set total_responses 0 - db_foreach get_number_answers { - select count(*) as n_responses, numeric_answer - from as_item_data - where as_item_id = :revision_id - group by numeric_answer - order by numeric_answer - } { - lappend number_answers [list numeric_answer $numeric_answer n_responses $n_responses] - incr total_responses - } + set number_answers [list] + set total_responses 0 + db_foreach get_number_answers { + select count(*) as n_responses, numeric_answer + from as_item_data + where as_item_id = :revision_id + group by numeric_answer + order by numeric_answer + } { + lappend number_answers [list numeric_answer $numeric_answer n_responses $n_responses] + incr total_responses + } - set first_p 0 - foreach number_answer $number_answers { - array set r $number_answer + set first_p 0 + foreach number_answer $number_answers { + array set r $number_answer - append stats "\n" + append stats "\n" - if { $first_p } { - db_1row get_number_average { - select avg(numeric_answers) as mean, stddev(numeric_answers) as standard_deviation - from as_item_data - where as_item_id = :revision_id - group by numeric_answers - } + if { $first_p } { + db_1row get_number_average { + select avg(numeric_answers) as mean, stddev(numeric_answers) as standard_deviation + from as_item_data + where as_item_id = :revision_id + group by numeric_answers + } - append stats " - -" - set first_p 0 - } - } - } - } - } - - template::multirow append items $item_id $revision_id $title $data_type $display_type $stats $section_id $section_title + append stats " + + " + set first_p 0 + } + } + } + } + } + + template::multirow append items $item_id $revision_id $title $data_type $display_type $stats $section_id $section_title } } + # Local variables: # mode: tcl # tcl-indent-level: 4 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 -r1.18 -r1.19 --- openacs-4/packages/assessment/www/asm-admin/one-a.tcl 17 Jul 2018 11:42:26 -0000 1.18 +++ openacs-4/packages/assessment/www/asm-admin/one-a.tcl 17 Jul 2018 13:32:18 -0000 1.19 @@ -6,7 +6,7 @@ @author timo@timohentschel.de @creation-date September 28, 2004 - @cvs-id $Id$ + @cvs-id $Id$ } { assessment_id:naturalnum,notnull {context ""} @@ -53,7 +53,7 @@ set reg_url "[apm_package_url_from_id $asm_instance]admin" } else { set reg_url "../admin" -} +} if { $assessment_id eq $registration_id } { # This is the user-registration assessment @@ -78,14 +78,14 @@ set target "[export_vars -base one-a {assessment_id reg_p}]" set notification_chunk [notification::display::request_widget \ - -type assessment_response_notif \ - -object_id $assessment_id \ - -pretty_name $title \ - -url [ad_return_url] ] + -type assessment_response_notif \ + -object_id $assessment_id \ + -pretty_name $title \ + -url [ad_return_url] ] db_multirow -extend { section_url } sections assessment_sections {} { if {$points eq ""} { - set points 0 + set points 0 } set max_time_to_complete [as::assessment::pretty_time -seconds $max_time_to_complete] set section_url [export_vars -base one-section {assessment_id section_id}] Index: openacs-4/packages/assessment/www/asm-admin/section-select.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/section-select.tcl,v diff -u -r1.10 -r1.11 --- openacs-4/packages/assessment/www/asm-admin/section-select.tcl 17 Jul 2018 11:42:26 -0000 1.10 +++ openacs-4/packages/assessment/www/asm-admin/section-select.tcl 17 Jul 2018 13:32:18 -0000 1.11 @@ -1,9 +1,9 @@ ad_page_contract { - + @author Anny Flores (annyflores@viaro.net) Viaro Networks (www.viaro.net) @creation-date 2005-01-07 - - This page allows to add branches or actions to the question and its choices. + + This page allows to add branches or actions to the question and its choices. } { assessment_id:naturalnum,notnull inter_item_check_id:naturalnum,notnull @@ -29,9 +29,9 @@ if { [info exists by_item_p] && $by_item_p ne "" } { if { $by_item_p == 1} { - set return_url "checks-admin?assessment_id=$assessment_id§ion_id=$section_id&item_id=$item_id" + set return_url "checks-admin?assessment_id=$assessment_id§ion_id=$section_id&item_id=$item_id" } else { - set return_url "checks-admin?assessment_id=$assessment_id§ion_id=$section_id" + set return_url "checks-admin?assessment_id=$assessment_id§ion_id=$section_id" } } @@ -47,29 +47,30 @@ ad_form -name get_section -export {by_item_p item_id} -form { inter_item_check_id:key {assessment_id:text(hidden) - {value $assessment_id}} + {value $assessment_id}} {section_id:text(hidden) - {value $section_id}} - + {value $section_id}} + {section_id_to:text(select) - {label "[_ assessment.section_to_branch]"} - {options $sections_list} - {help_text "[_ assessment.lead_you]"} + {label "[_ assessment.section_to_branch]"} + {options $sections_list} + {help_text "[_ assessment.lead_you]"} } - + } -new_data { db_transaction { - db_dml update_check {} + db_dml update_check {} } } -edit_request { db_1row get_section {} } -edit_data { db_dml update_check {} - + } -on_submit { - ad_returnredirect $return_url + ad_returnredirect $return_url ad_script_abort } + # Local variables: # mode: tcl # tcl-indent-level: 4 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 -r1.11 -r1.12 --- openacs-4/packages/assessment/www/asm-admin/sessions.tcl 17 Jul 2018 11:42:26 -0000 1.11 +++ openacs-4/packages/assessment/www/asm-admin/sessions.tcl 17 Jul 2018 13:32:18 -0000 1.12 @@ -1,9 +1,9 @@ # packages/assessment/www/asm-admin/sessions.tcl ad_page_contract { - + List subjects who completed assessment - + @author Roel Canicula (roel@solutiongrove.com) @creation-date 2006-06-05 @@ -37,7 +37,7 @@ set actions [list] if { [info exists subject_id] } { - set actions [list "[_ assessment.All_Users]" ? "[_ assessment.All_Users]"] + set actions [list "[_ assessment.All_Users]" ? "[_ assessment.All_Users]"] set person_name [person::name -person_id $subject_id] } @@ -73,69 +73,69 @@ -actions $actions \ -no_data "[_ assessment.No_sessions_found]" \ -elements { - name { - label "[_ assessment.Name]" - display_template { - @sessions.last_name@, @sessions.first_names@ - } - hide_p {[info exists subject_id]} - } - title { - label "[_ assessment.Assessment]" - display_template { - @sessions.title@ - } - hide_p {[info exists assessment_id]} - } - status { - label "[_ assessment.Status]" - display_template { - - [_ assessment.Not_Taken] - - - [_ assessment.Incomplete] - - - [_ assessment.Complete] - - } - } - last_mod_datetime { - label "[_ assessment.Last_Updated]" - } - percent_score { - label {[_ assessment.Percent_Score]} - html {align right} - display_template { - - - - @sessions.percent_score@% - - - - } - hide_p {[expr {[info exists assessment_data(type)] && $assessment_data(type) ne "test"}]} - } + name { + label "[_ assessment.Name]" + display_template { + @sessions.last_name@, @sessions.first_names@ + } + hide_p {[info exists subject_id]} + } + title { + label "[_ assessment.Assessment]" + display_template { + @sessions.title@ + } + hide_p {[info exists assessment_id]} + } + status { + label "[_ assessment.Status]" + display_template { + + [_ assessment.Not_Taken] + + + [_ assessment.Incomplete] + + + [_ assessment.Complete] + + } + } + last_mod_datetime { + label "[_ assessment.Last_Updated]" + } + percent_score { + label {[_ assessment.Percent_Score]} + html {align right} + display_template { + + + + @sessions.percent_score@% + + + + } + hide_p {[expr {[info exists assessment_data(type)] && $assessment_data(type) ne "test"}]} + } } \ -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 - } - } + 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 + } + } } db_multirow sessions get_sessions "" Index: openacs-4/packages/bug-tracker/tcl/bug-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bug-tracker/tcl/bug-procs.tcl,v diff -u -r1.46 -r1.47 --- openacs-4/packages/bug-tracker/tcl/bug-procs.tcl 17 Jul 2018 11:42:26 -0000 1.46 +++ openacs-4/packages/bug-tracker/tcl/bug-procs.tcl 17 Jul 2018 13:32:18 -0000 1.47 @@ -1122,3 +1122,9 @@ return $filter_bug_numbers } + +# Local variables: +# mode: tcl +# tcl-indent-level: 4 +# indent-tabs-mode: nil +# End: Index: openacs-4/packages/bug-tracker/tcl/bug-tracker-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bug-tracker/tcl/bug-tracker-procs.tcl,v diff -u -r1.62 -r1.63 --- openacs-4/packages/bug-tracker/tcl/bug-tracker-procs.tcl 17 Jul 2018 11:42:26 -0000 1.62 +++ openacs-4/packages/bug-tracker/tcl/bug-tracker-procs.tcl 17 Jul 2018 13:32:18 -0000 1.63 @@ -1580,7 +1580,6 @@ } } } - } ad_proc -private bug_tracker::grant_direct_read_permission { @@ -1623,3 +1622,9 @@ return [db_map user_bugs_only] } } + +# Local variables: +# mode: tcl +# tcl-indent-level: 4 +# indent-tabs-mode: nil +# End: Index: openacs-4/packages/bug-tracker/www/map-patch-to-bugs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bug-tracker/www/map-patch-to-bugs.tcl,v diff -u -r1.16 -r1.17 --- openacs-4/packages/bug-tracker/www/map-patch-to-bugs.tcl 17 Jul 2018 11:42:26 -0000 1.16 +++ openacs-4/packages/bug-tracker/www/map-patch-to-bugs.tcl 17 Jul 2018 13:32:18 -0000 1.17 @@ -6,7 +6,7 @@ @cvs-id $Id$ } { patch_number:integer,notnull - bug_number:integer,optional,multiple + bug_number:integer,optional,multiple component_id:naturalnum,optional {show_all_components_p:boolean "0"} {show_only_open_p:boolean "1"} @@ -16,10 +16,10 @@ {return_url:trim,notnull ""} } -validate { valid_return_url -requires return_url { - # actually, one should use the page filter localurl from OpenACS 5.9 - if {[util::external_url_p $return_url]} { - ad_complain "invalid return_url" - } + # actually, one should use the page filter localurl from OpenACS 5.9 + if {[util::external_url_p $return_url]} { + ad_complain "invalid return_url" + } } } @@ -39,8 +39,8 @@ set write_p [permission::permission_p -object_id $package_id -privilege write] set user_is_submitter_p [expr {$user_id == [bug_tracker::get_patch_submitter -patch_number $patch_number]}] -if { !($user_is_submitter_p || $write_p) } { - ad_return_forbidden "[_ bug-tracker.Permission]" "[_ bug-tracker.You_1]" +if { !($user_is_submitter_p || $write_p) } { + ad_return_forbidden "[_ bug-tracker.Permission]" "[_ bug-tracker.You_1]" ad_script_abort } @@ -77,14 +77,14 @@ set component_filter_url [export_vars -base map-patch-to-bugs {patch_number component_id return_url offset show_only_open_p interval_size}] if { $show_all_components_p } { set component_filter [subst {\[ - [_ bug-tracker.Only] | - [_ bug-tracker.All_1] \]}] + [_ bug-tracker.Only] | + [_ bug-tracker.All_1] \]}] } else { set component_where_clause "\n and bt_bugs.component_id = :component_id" - + set component_filter [subst {\[ - [_ bug-tracker.Only_1] | - [_ bug-tracker.All_1] \]}] + [_ bug-tracker.Only_1] | + [_ bug-tracker.All_1] \]}] } } @@ -100,13 +100,13 @@ if { $show_only_open_p } { set open_where_clause "and cfsm.current_state = :initial_state_id" set open_filter [subst {$only_open_label | - $any_status_label + $any_status_label }] } else { set open_where_clause "" set open_filter [subst { - $only_open_label | - $any_status_label + $only_open_label | + $any_status_label }] } @@ -126,8 +126,14 @@ # Build the pagination filter set bug_count [db_string bug_count_for_mapping {}] -set pagination_export_var_set [ad_tcl_vars_to_ns_set patch_number component_id return_url show_all_components_p show_only_open_p] +set pagination_export_var_set [ad_tcl_vars_to_ns_set patch_number component_id return_url show_all_components_p show_only_open_p] db_multirow open_bugs select_open_bugs {} ad_return_template + +# Local variables: +# mode: tcl +# tcl-indent-level: 4 +# indent-tabs-mode: nil +# End: Index: openacs-4/packages/bug-tracker/www/notifications.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bug-tracker/www/notifications.tcl,v diff -u -r1.6 -r1.7 --- openacs-4/packages/bug-tracker/www/notifications.tcl 17 Jul 2018 11:42:26 -0000 1.6 +++ openacs-4/packages/bug-tracker/www/notifications.tcl 17 Jul 2018 13:32:18 -0000 1.7 @@ -66,8 +66,8 @@ -object_id $object_id \ -user_id $user_id] - set subscribed_p [expr {$request_id ne ""}] - + set subscribed_p [expr {$request_id ne ""}] + if { $subscribed_p } { set url [notification::display::unsubscribe_url -request_id $request_id -url $return_url] } else { @@ -90,3 +90,9 @@ } set manage_url "[apm_package_url_from_key [notification::package_key]]manage" + +# Local variables: +# mode: tcl +# tcl-indent-level: 4 +# indent-tabs-mode: nil +# End: Index: openacs-4/packages/bug-tracker/www/patch-add.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bug-tracker/www/patch-add.tcl,v diff -u -r1.21 -r1.22 --- openacs-4/packages/bug-tracker/www/patch-add.tcl 17 Jul 2018 11:42:26 -0000 1.21 +++ openacs-4/packages/bug-tracker/www/patch-add.tcl 17 Jul 2018 13:32:18 -0000 1.22 @@ -13,10 +13,10 @@ {return_url:notnull,trim ""} } -validate { valid_return_url -requires return_url { - # actually, one should use the page filter localurl from OpenACS 5.9 - if {[util::external_url_p $return_url]} { - ad_complain "invalid return_url" - } + # actually, one should use the page filter localurl from OpenACS 5.9 + if {[util::external_url_p $return_url]} { + ad_complain "invalid return_url" + } } } @@ -81,7 +81,7 @@ -label "[_ bug-tracker.Generated]" \ -options [bug_tracker::version_get_options -include_unknown] \ -optional - + element create patch patch_file \ -datatype file \ -widget file \ @@ -124,7 +124,7 @@ if { [info exists component_id] } { element set_properties patch component_id -value $component_id - } + } } if { [form is_valid patch] } { @@ -138,7 +138,7 @@ set content [bug_tracker::get_uploaded_patch_file_content] set ip_address [ns_conn peeraddr] - + db_exec_plsql new_patch {} set patch_number [db_string patch_number_for_id {}] @@ -149,7 +149,7 @@ } else { set redirect_url $return_url } - + # Fetch any provided bug id to map the patch to catch {set bug_number [element get_value patch bug_number]} if { [info exists bug_number] } { @@ -161,7 +161,7 @@ # No bug id provided so redirect to page for selecting bugs if the # user wishes to go there set select_bugs_p [element get_value patch select_bugs_p] - + if { $select_bugs_p } { set redirect_url [export_vars -base map-patch-to-bugs { return_url patch_number component_id }] } @@ -173,3 +173,9 @@ } ad_return_template + +# Local variables: +# mode: tcl +# tcl-indent-level: 4 +# indent-tabs-mode: nil +# End: Index: openacs-4/packages/bug-tracker/www/admin/category-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bug-tracker/www/admin/category-edit.tcl,v diff -u -r1.9 -r1.10 --- openacs-4/packages/bug-tracker/www/admin/category-edit.tcl 17 Jul 2018 11:42:26 -0000 1.9 +++ openacs-4/packages/bug-tracker/www/admin/category-edit.tcl 17 Jul 2018 13:32:18 -0000 1.10 @@ -33,7 +33,7 @@ set parent_id [bug_tracker::conn project_root_keyword_id] } } -select_query { - select child.parent_id, + select child.parent_id, child.heading from cr_keywords child where child.keyword_id = :keyword_id @@ -51,3 +51,9 @@ ad_returnredirect categories ad_script_abort } + +# Local variables: +# mode: tcl +# tcl-indent-level: 4 +# indent-tabs-mode: nil +# End: Index: openacs-4/packages/calendar-portlet/www/calendar-full-portlet.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/calendar-portlet/www/calendar-full-portlet.tcl,v diff -u -r1.45 -r1.46 --- openacs-4/packages/calendar-portlet/www/calendar-full-portlet.tcl 17 Jul 2018 11:42:26 -0000 1.45 +++ openacs-4/packages/calendar-portlet/www/calendar-full-portlet.tcl 17 Jul 2018 13:32:18 -0000 1.46 @@ -27,7 +27,7 @@ {period_days:naturalnum,optional} {julian_date ""} } -properties { - + } -validate { valid_date -requires { date } { if {$date ne "" } { @@ -138,7 +138,7 @@ } ad_script_abort } else { - ad_return_template + ad_return_template } # Local variables: Index: openacs-4/packages/chat/www/search-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/chat/www/search-2.tcl,v diff -u -r1.10 -r1.11 --- openacs-4/packages/chat/www/search-2.tcl 17 Jul 2018 11:42:26 -0000 1.10 +++ openacs-4/packages/chat/www/search-2.tcl 17 Jul 2018 13:32:18 -0000 1.11 @@ -144,3 +144,9 @@ set export_authorize [export_ns_set_vars {url} {only_authorized_p}] ad_return_template + +# Local variables: +# mode: tcl +# tcl-indent-level: 4 +# indent-tabs-mode: nil +# End: Index: openacs-4/packages/faq/lib/faq-add-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/faq/lib/faq-add-edit.tcl,v diff -u -r1.6 -r1.7 --- openacs-4/packages/faq/lib/faq-add-edit.tcl 17 Jul 2018 11:42:26 -0000 1.6 +++ openacs-4/packages/faq/lib/faq-add-edit.tcl 17 Jul 2018 13:32:18 -0000 1.7 @@ -9,14 +9,14 @@ {separate_p:text(select) {label "#faq.QA_on_Separate_Pages#"} { options {{[_ faq.No] f} {[_ faq.Yes] t}} } } } -select_query_name get_faq -new_data { set user_id [ad_conn user_id] - set creation_ip [ad_conn host] - set package_id [ad_conn package_id] + set creation_ip [ad_conn host] + set package_id [ad_conn package_id] set faq_id [db_exec_plsql create_faq {}] } -edit_data { db_dml edit_faq {} } -after_submit { if { ![info exists return_url] || $return_url eq "" } { - set return_url [export_vars -base one-faq { faq_id }] + set return_url [export_vars -base one-faq { faq_id }] } ad_returnredirect $return_url ad_script_abort 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 -r1.25 -r1.26 --- openacs-4/packages/static-portlet/www/element.tcl 17 Jul 2018 11:42:27 -0000 1.25 +++ openacs-4/packages/static-portlet/www/element.tcl 17 Jul 2018 13:32:18 -0000 1.26 @@ -80,59 +80,59 @@ -package_id $package_id \ -content [template::util::richtext::get_property contents $content] \ -format [template::util::richtext::get_property format $content] \ - -pretty_name $pretty_name] - + -pretty_name $pretty_name] + set old_element_id [static_portal_content::add_to_portal \ - -portal_id $portal_id \ - -package_id $package_id \ - -content_id $item_id] + -portal_id $portal_id \ + -package_id $package_id \ + -content_id $item_id] } # support for templates & already created portals for users, # classes, etc. (roc) switch $type { - user { - set query "select portal_id as target_portal_id from dotlrn_users" - set community_id $package_id - set new_content_id $item_id - } - dotlrn_class_instance { set query "select portal_id as target_portal_id, community_id from dotlrn_class_instances_full" } - dotlrn_club { set query "select portal_id as target_portal_id, community_id from dotlrn_clubs_full" } - dotlrn_community { set query "select portal_id as target_portal_id, community_id from dotlrn_communities_full" } - default { - ad_returnredirect $referer - ad_script_abort - } + user { + set query "select portal_id as target_portal_id from dotlrn_users" + set community_id $package_id + set new_content_id $item_id + } + dotlrn_class_instance { set query "select portal_id as target_portal_id, community_id from dotlrn_class_instances_full" } + dotlrn_club { set query "select portal_id as target_portal_id, community_id from dotlrn_clubs_full" } + dotlrn_community { set query "select portal_id as target_portal_id, community_id from dotlrn_communities_full" } + default { + ad_returnredirect $referer + ad_script_abort + } } - + db_foreach dotlrn_type_portals "$query" { - if {$type ne "user" } { - # clone the template's content - set new_content_id [static_portal_content::new \ - -package_id $community_id \ - -content [template::util::richtext::get_property contents $content] \ - -format [template::util::richtext::get_property format $content] \ - -pretty_name $pretty_name ] - } - + if {$type ne "user" } { + # clone the template's content + set new_content_id [static_portal_content::new \ + -package_id $community_id \ + -content [template::util::richtext::get_property contents $content] \ + -format [template::util::richtext::get_property format $content] \ + -pretty_name $pretty_name ] + } - set new_element_id [ static_portal_content::add_to_portal \ - -portal_id $target_portal_id \ - -package_id $community_id \ - -content_id $new_content_id] - + set new_element_id [ static_portal_content::add_to_portal \ + -portal_id $target_portal_id \ + -package_id $community_id \ + -content_id $new_content_id] - portal::set_element_param $new_element_id "package_id" $community_id - portal::set_element_param $new_element_id "content_id" $new_content_id - if {$enforce_portlet == 0} { - db_dml hide_portlet { update portal_element_map set state = 'hidden' where element_id = :new_element_id } - } + portal::set_element_param $new_element_id "package_id" $community_id + portal::set_element_param $new_element_id "content_id" $new_content_id + + if {$enforce_portlet == 0} { + db_dml hide_portlet { update portal_element_map set state = 'hidden' where element_id = :new_element_id } + } + } # redirect and abort @@ -145,84 +145,82 @@ static_portal_content::update \ -portal_id $portal_id \ -content_id $element_content_id \ - -pretty_name $pretty_name \ - -content [template::util::richtext::get_property contents $content] \ - -format [template::util::richtext::get_property format $content] + -pretty_name $pretty_name \ + -content [template::util::richtext::get_property contents $content] \ + -format [template::util::richtext::get_property format $content] } switch $type { - user { - set query "select portal_id as target_portal_id from dotlrn_users" + user { + set query "select portal_id as target_portal_id from dotlrn_users" set community_id $package_id - } - dotlrn_class_instance { set query "select portal_id as target_portal_id, community_id from dotlrn_class_instances_full" } - dotlrn_club { set query "select portal_id as target_portal_id, community_id from dotlrn_clubs_full" } - dotlrn_community { set query "select portal_id as target_portal_id, community_id from dotlrn_communities_full" } - default { - ad_returnredirect $referer - ad_script_abort - } + } + dotlrn_class_instance { set query "select portal_id as target_portal_id, community_id from dotlrn_class_instances_full" } + dotlrn_club { set query "select portal_id as target_portal_id, community_id from dotlrn_clubs_full" } + dotlrn_community { set query "select portal_id as target_portal_id, community_id from dotlrn_communities_full" } + default { + ad_returnredirect $referer + ad_script_abort + } } db_foreach dotlrn_type_portals "$query" { - if { $type ne "user" } { - catch { - set element_content_id [db_string get_content_id { - select content_id - from static_portal_content - where package_id = :community_id - and pretty_name = :pretty_name - }] - } errmsg2 - } + if { $type ne "user" } { + catch { + set element_content_id [db_string get_content_id { + select content_id + from static_portal_content + where package_id = :community_id + and pretty_name = :pretty_name + }] + } errmsg2 + } - set no_portlet [catch {set element_id [portal::get_element_id_from_unique_param -portal_id $target_portal_id -key content_id -value $element_content_id]} errmsg] + set no_portlet [catch {set element_id [portal::get_element_id_from_unique_param -portal_id $target_portal_id -key content_id -value $element_content_id]} errmsg] - if { $no_portlet } { + if { $no_portlet } { - # if we are here, means that the portlet do not exists - # for given portal_id, then instead of update, we'll - # create it + # if we are here, means that the portlet do not exists + # for given portal_id, then instead of update, we'll + # create it - if {$type ne "user" } { - # clone the template's content - set element_content_id [static_portal_content::new \ - -package_id $community_id \ - -content [template::util::richtext::get_property contents $content] \ - -format [template::util::richtext::get_property format $content] \ - -pretty_name $pretty_name ] - } + if {$type ne "user" } { + # clone the template's content + set element_content_id [static_portal_content::new \ + -package_id $community_id \ + -content [template::util::richtext::get_property contents $content] \ + -format [template::util::richtext::get_property format $content] \ + -pretty_name $pretty_name ] + } - set new_element_id [ static_portal_content::add_to_portal \ - -portal_id $target_portal_id \ - -package_id $community_id \ - -content_id $element_content_id] + set new_element_id [ static_portal_content::add_to_portal \ + -portal_id $target_portal_id \ + -package_id $community_id \ + -content_id $element_content_id] - portal::set_element_param $new_element_id "package_id" $community_id - portal::set_element_param $new_element_id "content_id" $element_content_id - set element_id $element_content_id + portal::set_element_param $new_element_id "package_id" $community_id + portal::set_element_param $new_element_id "content_id" $element_content_id + set element_id $element_content_id + } else { - } else { + static_portal_content::update \ + -portal_id $target_portal_id \ + -content_id $element_content_id \ + -pretty_name $pretty_name \ + -content [template::util::richtext::get_property contents $content] \ + -format [template::util::richtext::get_property format $content] + } - static_portal_content::update \ - -portal_id $target_portal_id \ - -content_id $element_content_id \ - -pretty_name $pretty_name \ - -content [template::util::richtext::get_property contents $content] \ - -format [template::util::richtext::get_property format $content] - } - - if {$enforce_portlet == 0} { - db_dml hide_portlet { update portal_element_map set state = 'hidden' where element_id = :element_id } - } else { - db_dml hide_portlet { update portal_element_map set state = 'full' where element_id = :element_id } - } - + if {$enforce_portlet == 0} { + db_dml hide_portlet { update portal_element_map set state = 'hidden' where element_id = :element_id } + } else { + db_dml hide_portlet { update portal_element_map set state = 'full' where element_id = :element_id } + } } - + # redirect and abort ad_returnredirect $referer ad_script_abort @@ -238,18 +236,18 @@ {label "[_ static-portlet.File]"} } {content_format:text(select) - {label "Format"} - {options [template::util::richtext::format_options]} + {label "Format"} + {options [template::util::richtext::format_options]} {value "text/plain"} } } if {$type in $templates} { set elements [list \ - [list {enforce_portlet:text(select)} [list label [_ static-portlet.lt_Enforce_this_applet_t]] \ - [list help_text [_ static-portlet.lt_Enforce_True_means_th]] \ - [list options [list [list [_ static-portlet.True] 1] [list [_ static-portlet.False_0] 0]]] \ - [list value 0]]] + [list {enforce_portlet:text(select)} [list label [_ static-portlet.lt_Enforce_this_applet_t]] \ + [list help_text [_ static-portlet.lt_Enforce_True_means_th]] \ + [list options [list [list [_ static-portlet.True] 1] [list [_ static-portlet.False_0] 0]]] \ + [list value 0]]] ad_form -extend -name static_file -form $elements } @@ -283,8 +281,8 @@ set item_id [static_portal_content::new \ -package_id $package_id \ -content $content \ - -format $content_format \ - -pretty_name $pretty_name + -format $content_format \ + -pretty_name $pretty_name ] static_portal_content::add_to_portal \ @@ -298,48 +296,46 @@ # classes, etc. (roc) switch $type { - user { - set query "select portal_id as target_portal_id from dotlrn_users" - set community_id $package_id - set new_content_id $item_id - } - dotlrn_class_instance { set query "select portal_id as target_portal_id, community_id from dotlrn_class_instances_full" } - dotlrn_club { set query "select portal_id as target_portal_id, community_id from dotlrn_clubs_full" } - dotlrn_community { set query "select portal_id as target_portal_id, community_id from dotlrn_communities_full" } - default { - ad_returnredirect $referer - ad_script_abort - } + user { + set query "select portal_id as target_portal_id from dotlrn_users" + set community_id $package_id + set new_content_id $item_id + } + dotlrn_class_instance { set query "select portal_id as target_portal_id, community_id from dotlrn_class_instances_full" } + dotlrn_club { set query "select portal_id as target_portal_id, community_id from dotlrn_clubs_full" } + dotlrn_community { set query "select portal_id as target_portal_id, community_id from dotlrn_communities_full" } + default { + ad_returnredirect $referer + ad_script_abort + } } - + db_foreach dotlrn_type_portals "$query" { - if {$type ne "user" } { - # clone the template's content - set new_content_id [static_portal_content::new \ - -package_id $community_id \ - -content $content \ - -format $content_format \ - -pretty_name $pretty_name ] - } + if {$type ne "user" } { + # clone the template's content + set new_content_id [static_portal_content::new \ + -package_id $community_id \ + -content $content \ + -format $content_format \ + -pretty_name $pretty_name ] + } - set new_element_id [ static_portal_content::add_to_portal \ - -portal_id $target_portal_id \ - -package_id $community_id \ - -content_id $new_content_id] + set new_element_id [ static_portal_content::add_to_portal \ + -portal_id $target_portal_id \ + -package_id $community_id \ + -content_id $new_content_id] - portal::set_element_param $new_element_id "package_id" $community_id - portal::set_element_param $new_element_id "content_id" $new_content_id + portal::set_element_param $new_element_id "package_id" $community_id + portal::set_element_param $new_element_id "content_id" $new_content_id - if {$enforce_portlet == 0} { - db_dml hide_portlet { update portal_element_map set state = 'hidden' where element_id = :new_element_id } - } - + if {$enforce_portlet == 0} { + db_dml hide_portlet { update portal_element_map set state = 'hidden' where element_id = :new_element_id } + } } - # redirect and abort ad_returnredirect $referer ad_script_abort @@ -361,83 +357,80 @@ -portal_id $portal_id \ -content_id $file_content_id \ -pretty_name $pretty_name \ - -content $content \ - -format $content_format + -content $content \ + -format $content_format } switch $type { - user { - set query "select portal_id as target_portal_id from dotlrn_users" - set community_id $package_id - } - dotlrn_class_instance { set query "select portal_id as target_portal_id, community_id from dotlrn_class_instances_full" } - dotlrn_club { set query "select portal_id as target_portal_id, community_id from dotlrn_clubs_full" } - dotlrn_community { set query "select portal_id as target_portal_id, community_id from dotlrn_communities_full" } - default { - ad_returnredirect $referer - ad_script_abort - } + user { + set query "select portal_id as target_portal_id from dotlrn_users" + set community_id $package_id + } + dotlrn_class_instance { set query "select portal_id as target_portal_id, community_id from dotlrn_class_instances_full" } + dotlrn_club { set query "select portal_id as target_portal_id, community_id from dotlrn_clubs_full" } + dotlrn_community { set query "select portal_id as target_portal_id, community_id from dotlrn_communities_full" } + default { + ad_returnredirect $referer + ad_script_abort + } } - + db_foreach dotlrn_type_portals "$query" { - if {$type ne "user" } { - catch { - set file_content_id [db_string get_content_id { - select content_id - from static_portal_content - where package_id = :community_id - and pretty_name = :pretty_name - }] - } errmsg2 - } + if {$type ne "user" } { + catch { + set file_content_id [db_string get_content_id { + select content_id + from static_portal_content + where package_id = :community_id + and pretty_name = :pretty_name + }] + } errmsg2 + } + set no_portlet [catch {set element_id [portal::get_element_id_from_unique_param -portal_id $target_portal_id -key content_id -value $file_content_id]} errmsg] - set no_portlet [catch {set element_id [portal::get_element_id_from_unique_param -portal_id $target_portal_id -key content_id -value $file_content_id]} errmsg] + if { $no_portlet } { - if { $no_portlet } { + # if we are here, means that the portlet do not exists + # for given portal_id, then instead of update, we'll + # create it - # if we are here, means that the portlet do not exists - # for given portal_id, then instead of update, we'll - # create it + if {$type ne "user" } { + # clone the template's content + set file_content_id [static_portal_content::new \ + -package_id $community_id \ + -content $content \ + -format $content_format \ + -pretty_name $pretty_name ] + } - if {$type ne "user" } { - # clone the template's content - set file_content_id [static_portal_content::new \ - -package_id $community_id \ - -content $content \ - -format $content_format \ - -pretty_name $pretty_name ] - } + set new_element_id [ static_portal_content::add_to_portal \ + -portal_id $target_portal_id \ + -package_id $community_id \ + -content_id $file_content_id] - set new_element_id [ static_portal_content::add_to_portal \ - -portal_id $target_portal_id \ - -package_id $community_id \ - -content_id $file_content_id] + portal::set_element_param $new_element_id "package_id" $community_id + portal::set_element_param $new_element_id "content_id" $file_content_id + set element_id $file_content_id - portal::set_element_param $new_element_id "package_id" $community_id - portal::set_element_param $new_element_id "content_id" $file_content_id - set element_id $file_content_id + } else { + static_portal_content::update \ + -portal_id $target_portal_id \ + -content_id $file_content_id \ + -pretty_name $pretty_name \ + -content $content \ + -format $content_format + } - } else { - - static_portal_content::update \ - -portal_id $target_portal_id \ - -content_id $file_content_id \ - -pretty_name $pretty_name \ - -content $content \ - -format $content_format - } + if {$enforce_portlet == 0} { + db_dml hide_portlet { update portal_element_map set state = 'hidden' where element_id = :element_id } + } else { + db_dml hide_portlet { update portal_element_map set state = 'full' where element_id = :element_id } + } + } - if {$enforce_portlet == 0} { - db_dml hide_portlet { update portal_element_map set state = 'hidden' where element_id = :element_id } - } else { - db_dml hide_portlet { update portal_element_map set state = 'full' where element_id = :element_id } - } - - } - # redirect and abort ad_returnredirect $referer ad_script_abort Index: openacs-4/packages/theme-selva/tcl/selva-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/theme-selva/tcl/selva-procs.tcl,v diff -u -r1.20 -r1.21 --- openacs-4/packages/theme-selva/tcl/selva-procs.tcl 17 Jul 2018 11:42:27 -0000 1.20 +++ openacs-4/packages/theme-selva/tcl/selva-procs.tcl 17 Jul 2018 13:32:18 -0000 1.21 @@ -268,3 +268,9 @@ append subnavbar "" } } + +# Local variables: +# mode: tcl +# tcl-indent-level: 4 +# indent-tabs-mode: nil +# End:
$r(number_answer):$r(n_responses)
$r(number_answer):$r(n_responses)
-[_ assessment.Mean] $mean
-[_ assessment.Standard_Deviation] $standard_deviation -
+ [_ assessment.Mean] $mean
+ [_ assessment.Standard_Deviation] $standard_deviation +