Index: openacs-4/packages/assessment/tcl/as-assessment-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/tcl/as-assessment-procs.tcl,v
diff -u -r1.39 -r1.40
--- openacs-4/packages/assessment/tcl/as-assessment-procs.tcl 15 Jun 2018 22:47:45 -0000 1.39
+++ openacs-4/packages/assessment/tcl/as-assessment-procs.tcl 15 Jun 2018 23:11:09 -0000 1.40
@@ -47,50 +47,50 @@
# Insert as_assessment in the CR (and as_assessments table) getting the revision_id (as_assessment_id)
db_transaction {
- set assessment_item_id [db_nextval acs_object_id_seq]
- if {$name eq ""} {
- set name "ASS_$assessment_item_id"
- }
- set assessment_item_id [content::item::new \
+ set assessment_item_id [db_nextval acs_object_id_seq]
+ if {$name eq ""} {
+ set name "ASS_$assessment_item_id"
+ }
+ set assessment_item_id [content::item::new \
-item_id $assessment_item_id \
-parent_id $folder_id \
-creation_user $creator_id \
-content_type {as_assessments} \
-name $name \
-package_id $package_id \
- -context_id $folder_id]
+ -context_id $folder_id]
- set as_assessment_id [content::revision::new \
- -item_id $assessment_item_id \
- -content_type {as_assessments} \
- -title $title \
- -description $description \
- -attributes [list [list creator_id $creator_id] \
- [list run_mode $run_mode] \
- [list anonymous_p $anonymous_p] \
- [list secure_access_p $secure_access_p] \
- [list reuse_responses_p $reuse_responses_p] \
- [list show_item_name_p $show_item_name_p] \
- [list random_p $random_p] \
- [list entry_page $entry_page] \
- [list exit_page $exit_page] \
- [list return_url $return_url] \
- [list start_time $start_time] \
- [list end_time $end_time] \
- [list number_tries $number_tries] \
- [list wait_between_tries $wait_between_tries] \
- [list time_for_response $time_for_response] \
- [list ip_mask $ip_mask] \
- [list password $password] \
- [list show_feedback $show_feedback] \
- [list section_navigation $section_navigation] \
- [list survey_p $survey_p] \
- [list package_id $package_id] \
- [list type $type]]]
-
+ set as_assessment_id [content::revision::new \
+ -item_id $assessment_item_id \
+ -content_type {as_assessments} \
+ -title $title \
+ -description $description \
+ -attributes [list [list creator_id $creator_id] \
+ [list run_mode $run_mode] \
+ [list anonymous_p $anonymous_p] \
+ [list secure_access_p $secure_access_p] \
+ [list reuse_responses_p $reuse_responses_p] \
+ [list show_item_name_p $show_item_name_p] \
+ [list random_p $random_p] \
+ [list entry_page $entry_page] \
+ [list exit_page $exit_page] \
+ [list return_url $return_url] \
+ [list start_time $start_time] \
+ [list end_time $end_time] \
+ [list number_tries $number_tries] \
+ [list wait_between_tries $wait_between_tries] \
+ [list time_for_response $time_for_response] \
+ [list ip_mask $ip_mask] \
+ [list password $password] \
+ [list show_feedback $show_feedback] \
+ [list section_navigation $section_navigation] \
+ [list survey_p $survey_p] \
+ [list package_id $package_id] \
+ [list type $type]]]
+
}
db_dml update_clobs {} -clobs [list $instructions $consent_page]
-
+
return $as_assessment_id
}
@@ -130,33 +130,33 @@
# edit as_assessment in the CR
db_transaction {
- set new_rev_id [content::revision::new \
- -item_id $assessment_id \
- -content_type {as_assessments} \
- -title $title \
- -description $description \
- -attributes [list [list creator_id $creator_id] \
- [list run_mode $run_mode] \
- [list anonymous_p $anonymous_p] \
- [list secure_access_p $secure_access_p] \
- [list reuse_responses_p $reuse_responses_p] \
- [list show_item_name_p $show_item_name_p] \
- [list random_p $random_p] \
- [list entry_page $entry_page] \
- [list exit_page $exit_page] \
- [list return_url $return_url] \
- [list start_time $start_time] \
- [list end_time $end_time] \
- [list number_tries $number_tries] \
- [list wait_between_tries $wait_between_tries] \
- [list time_for_response $time_for_response] \
- [list ip_mask $ip_mask] \
- [list password $password] \
- [list show_feedback $show_feedback] \
- [list section_navigation $section_navigation] \
- [list type $type]] ]
+ set new_rev_id [content::revision::new \
+ -item_id $assessment_id \
+ -content_type {as_assessments} \
+ -title $title \
+ -description $description \
+ -attributes [list [list creator_id $creator_id] \
+ [list run_mode $run_mode] \
+ [list anonymous_p $anonymous_p] \
+ [list secure_access_p $secure_access_p] \
+ [list reuse_responses_p $reuse_responses_p] \
+ [list show_item_name_p $show_item_name_p] \
+ [list random_p $random_p] \
+ [list entry_page $entry_page] \
+ [list exit_page $exit_page] \
+ [list return_url $return_url] \
+ [list start_time $start_time] \
+ [list end_time $end_time] \
+ [list number_tries $number_tries] \
+ [list wait_between_tries $wait_between_tries] \
+ [list time_for_response $time_for_response] \
+ [list ip_mask $ip_mask] \
+ [list password $password] \
+ [list show_feedback $show_feedback] \
+ [list section_navigation $section_navigation] \
+ [list type $type]] ]
db_dml update_clobs {} -clobs [list $instructions $consent_page]
- copy_sections -assessment_id $assessment_rev_id -new_assessment_id $new_rev_id
+ copy_sections -assessment_id $assessment_rev_id -new_assessment_id $new_rev_id
}
return $new_rev_id
@@ -176,17 +176,17 @@
upvar assessment_data assessment_data
if {$assessment_id eq ""} {
- db_1row lookup_assessment_id ""
+ db_1row lookup_assessment_id ""
}
db_1row get_data_by_assessment_id {} -column_array assessment_data
if {![info exists assessment_data(assessment_id)]} {
- # assessment doesn't exist, caller has to handle this in their
- # own way
- return
+ # assessment doesn't exist, caller has to handle this in their
+ # own way
+ return
}
-
+
set assessment_data(creator_name) [person::name -person_id $assessment_data(creation_user)]
set assessment_data(title) [as::assessment::title -title $assessment_data(title)]
}
@@ -203,38 +203,38 @@
array set a [array get assessment_data]
db_transaction {
- set new_rev_id [content::revision::new \
- -item_id $assessment_id \
- -content_type {as_assessments} \
- -title $a(title) \
- -description $a(description) \
- -attributes [list [list creator_id $a(creator_id)] \
- [list run_mode $a(run_mode)] \
- [list anonymous_p $a(anonymous_p)] \
- [list secure_access_p $a(secure_access_p)] \
- [list reuse_responses_p $a(reuse_responses_p)] \
- [list show_item_name_p $a(show_item_name_p)] \
- [list random_p $a(random_p)] \
- [list entry_page $a(entry_page)] \
- [list exit_page $a(exit_page)] \
- [list return_url $a(return_url)] \
- [list start_time $a(start_time)] \
- [list end_time $a(end_time)] \
- [list number_tries $a(number_tries)] \
- [list wait_between_tries $a(wait_between_tries)] \
- [list time_for_response $a(time_for_response)] \
- [list ip_mask $a(ip_mask)] \
- [list password $a(password)] \
- [list show_feedback $a(show_feedback)] \
- [list section_navigation $a(section_navigation)] \
- [list type $a(type)]]]
-
+ set new_rev_id [content::revision::new \
+ -item_id $assessment_id \
+ -content_type {as_assessments} \
+ -title $a(title) \
+ -description $a(description) \
+ -attributes [list [list creator_id $a(creator_id)] \
+ [list run_mode $a(run_mode)] \
+ [list anonymous_p $a(anonymous_p)] \
+ [list secure_access_p $a(secure_access_p)] \
+ [list reuse_responses_p $a(reuse_responses_p)] \
+ [list show_item_name_p $a(show_item_name_p)] \
+ [list random_p $a(random_p)] \
+ [list entry_page $a(entry_page)] \
+ [list exit_page $a(exit_page)] \
+ [list return_url $a(return_url)] \
+ [list start_time $a(start_time)] \
+ [list end_time $a(end_time)] \
+ [list number_tries $a(number_tries)] \
+ [list wait_between_tries $a(wait_between_tries)] \
+ [list time_for_response $a(time_for_response)] \
+ [list ip_mask $a(ip_mask)] \
+ [list password $a(password)] \
+ [list show_feedback $a(show_feedback)] \
+ [list section_navigation $a(section_navigation)] \
+ [list type $a(type)]]]
+
set instructions $a(instructions)
set consent_page $a(consent_page)
db_dml update_clobs {} -clobs [list $a(instructions) $a(consent_page)]
- copy_sections -assessment_id $a(assessment_rev_id) -new_assessment_id $new_rev_id
- copy_categories -from_id $a(assessment_rev_id) -to_id $new_rev_id
+ copy_sections -assessment_id $a(assessment_rev_id) -new_assessment_id $new_rev_id
+ copy_categories -from_id $a(assessment_rev_id) -to_id $new_rev_id
}
return $new_rev_id
@@ -252,8 +252,8 @@
Copies an assessment with all sections and items
} {
if {$folder_id eq ""} {
- set package_id [ad_conn package_id]
- set folder_id [as::assessment::folder_id -package_id $package_id]
+ set package_id [ad_conn package_id]
+ set folder_id [as::assessment::folder_id -package_id $package_id]
}
data -assessment_id $assessment_id
@@ -265,42 +265,42 @@
}
db_transaction {
- set new_assessment_id [db_nextval acs_object_id_seq]
- if {$name eq ""} {
- set name "ASS_$new_assessment_id"
- }
- set new_assessment_id [content::item::new -item_id $new_assessment_id -parent_id $folder_id -content_type {as_assessments} -name $name]
+ set new_assessment_id [db_nextval acs_object_id_seq]
+ if {$name eq ""} {
+ set name "ASS_$new_assessment_id"
+ }
+ set new_assessment_id [content::item::new -item_id $new_assessment_id -parent_id $folder_id -content_type {as_assessments} -name $name]
- set new_rev_id [content::revision::new \
- -item_id $new_assessment_id \
- -content_type {as_assessments} \
- -title $a(title) \
- -description $a(description) \
- -attributes [list [list creator_id $a(creator_id)] \
- [list instructions $a(instructions)] \
- [list run_mode $a(run_mode)] \
- [list anonymous_p $a(anonymous_p)] \
- [list secure_access_p $a(secure_access_p)] \
- [list reuse_responses_p $a(reuse_responses_p)] \
- [list show_item_name_p $a(show_item_name_p)] \
- [list random_p $a(random_p)] \
- [list entry_page $a(entry_page)] \
- [list exit_page $a(exit_page)] \
- [list consent_page $a(consent_page)] \
- [list return_url $a(return_url)] \
- [list start_time $a(start_time)] \
- [list end_time $a(end_time)] \
- [list number_tries $a(number_tries)] \
- [list wait_between_tries $a(wait_between_tries)] \
- [list time_for_response $a(time_for_response)] \
- [list ip_mask $a(ip_mask)] \
- [list password $a(password)] \
- [list show_feedback $a(show_feedback)] \
- [list section_navigation $a(section_navigation)] \
- [list type $a(type)]] ]
-
- copy_sections -assessment_id $a(assessment_rev_id) -new_assessment_id $new_rev_id
- copy_categories -from_id $a(assessment_rev_id) -to_id $new_rev_id
+ set new_rev_id [content::revision::new \
+ -item_id $new_assessment_id \
+ -content_type {as_assessments} \
+ -title $a(title) \
+ -description $a(description) \
+ -attributes [list [list creator_id $a(creator_id)] \
+ [list instructions $a(instructions)] \
+ [list run_mode $a(run_mode)] \
+ [list anonymous_p $a(anonymous_p)] \
+ [list secure_access_p $a(secure_access_p)] \
+ [list reuse_responses_p $a(reuse_responses_p)] \
+ [list show_item_name_p $a(show_item_name_p)] \
+ [list random_p $a(random_p)] \
+ [list entry_page $a(entry_page)] \
+ [list exit_page $a(exit_page)] \
+ [list consent_page $a(consent_page)] \
+ [list return_url $a(return_url)] \
+ [list start_time $a(start_time)] \
+ [list end_time $a(end_time)] \
+ [list number_tries $a(number_tries)] \
+ [list wait_between_tries $a(wait_between_tries)] \
+ [list time_for_response $a(time_for_response)] \
+ [list ip_mask $a(ip_mask)] \
+ [list password $a(password)] \
+ [list show_feedback $a(show_feedback)] \
+ [list section_navigation $a(section_navigation)] \
+ [list type $a(type)]] ]
+
+ copy_sections -assessment_id $a(assessment_rev_id) -new_assessment_id $new_rev_id
+ copy_categories -from_id $a(assessment_rev_id) -to_id $new_rev_id
}
return $new_assessment_id
@@ -345,31 +345,31 @@
set section_list [db_list get_sorted_sections {}]
if {[llength $section_list] > 0} {
- return $section_list
+ return $section_list
}
# get all sections of assessment
set all_sections [db_list_of_lists assessment_sections {}]
if {$random_p == "f"} {
- set sort_order_type "default path"
+ set sort_order_type "default path"
}
# sort section positions
switch -exact $sort_order_type {
- randomized {
- set all_sections [util::randomize_list $all_sections]
- }
+ randomized {
+ set all_sections [util::randomize_list $all_sections]
+ }
}
# save section order
set section_list ""
set count 0
foreach one_section $all_sections {
- incr count
- lassign $one_section section_id title
- lappend section_list $section_id
- db_dml save_order {}
+ incr count
+ lassign $one_section section_id title
+ lappend section_list $section_id
+ db_dml save_order {}
}
return $section_list
@@ -385,13 +385,13 @@
Award points to this assessment if all sections are filled out
} {
if {[db_string check_sections_calculated {}] > 0} {
- return
+ return
}
db_1row sum_of_section_points {}
if {(![info exists section_max_points] || $section_max_points eq "") || $section_max_points==0} {
- set section_max_points 100
+ set section_max_points 100
}
set percent_score [expr {round(100 * $section_points / $section_max_points)}]
@@ -412,35 +412,35 @@
db_1row assessment_data {}
db_1row total_tries {}
if {$wait_between_tries ne ""} {
- set wait_between_tries [expr {60 * $wait_between_tries}]
+ set wait_between_tries [expr {60 * $wait_between_tries}]
}
if {$total_tries > 0} {
- db_1row cur_wait_time {}
+ db_1row cur_wait_time {}
} else {
- set cur_wait_time $wait_between_tries
+ set cur_wait_time $wait_between_tries
}
set error_list ""
if {($start_time ne "" && $start_time > $cur_time) || ($end_time ne "" && $end_time < $cur_time)} {
- append error_list "
[_ assessment.assessment_not_public]"
+ append error_list "[_ assessment.assessment_not_public]"
}
if {$number_tries ne "" && $number_tries > 0 && $number_tries <= $total_tries} {
- append error_list "[_ assessment.assessment_too_many_tries]"
+ append error_list "[_ assessment.assessment_too_many_tries]"
}
if {$wait_between_tries ne "" && $wait_between_tries > $cur_wait_time} {
- set pretty_wait_time [pretty_time -seconds [expr {$wait_between_tries - $cur_wait_time}]]
- append error_list "[_ assessment.assessment_wait_retry]"
+ set pretty_wait_time [pretty_time -seconds [expr {$wait_between_tries - $cur_wait_time}]]
+ append error_list "[_ assessment.assessment_wait_retry]"
}
if {$as_password ne "" && $password ne $as_password } {
- append error_list "[_ assessment.assessment_wrong_password]"
+ append error_list "[_ assessment.assessment_wrong_password]"
}
if {$ip_mask ne ""} {
- regsub -all {\.} "^$ip_mask" {\\.} ip_mask
- regsub -all {\*} $ip_mask {.*} ip_mask
- if {![regexp $ip_mask [ad_conn peeraddr]]} {
- append error_list "[_ assessment.assessment_restricted_ips]"
- }
+ regsub -all {\.} "^$ip_mask" {\\.} ip_mask
+ regsub -all {\*} $ip_mask {.*} ip_mask
+ if {![regexp $ip_mask [ad_conn peeraddr]]} {
+ append error_list "[_ assessment.assessment_restricted_ips]"
+ }
}
return $error_list
@@ -460,17 +460,17 @@
}
set time ""
if {$seconds ne ""} {
- if {$hours_p} {
- set time_hour [expr {$seconds / 3600}]
- set seconds [expr {$seconds - ($time_hour * 3600)}]
- }
- set time_min [expr {$seconds / 60}]
- set time_sec [expr {$seconds - ($time_min * 60)}]
- set pad "00"
- if {$hours_p} {
- append time "[string range $pad [string length $time_hour] end]$time_hour\:"
- }
- append time "[string range $pad [string length $time_min] end]$time_min\:[string range $pad [string length $time_sec] end]$time_sec min"
+ if {$hours_p} {
+ set time_hour [expr {$seconds / 3600}]
+ set seconds [expr {$seconds - ($time_hour * 3600)}]
+ }
+ set time_min [expr {$seconds / 60}]
+ set time_sec [expr {$seconds - ($time_min * 60)}]
+ set pad "00"
+ if {$hours_p} {
+ append time "[string range $pad [string length $time_hour] end]$time_hour\:"
+ }
+ append time "[string range $pad [string length $time_min] end]$time_min\:[string range $pad [string length $time_sec] end]$time_sec min"
}
return $time
}
@@ -488,15 +488,15 @@
}
set time ""
if {$seconds ne ""} {
- set time_hour [expr {$seconds / 3600}]
- set seconds [expr {$seconds - ($time_hour * 3600)}]
-
- set time_min [expr {$seconds / 60}]
- set time_sec [expr {$seconds - ($time_min * 60)}]
- if {$time_hour > 0} {
- append time "$time_hour \#acs-templating.hours\#"
- }
- append time " $time_min \#acs-templating.minutes\#"
+ set time_hour [expr {$seconds / 3600}]
+ set seconds [expr {$seconds - ($time_hour * 3600)}]
+
+ set time_min [expr {$seconds / 60}]
+ set time_sec [expr {$seconds - ($time_min * 60)}]
+ if {$time_hour > 0} {
+ append time "$time_hour \#acs-templating.hours\#"
+ }
+ append time " $time_min \#acs-templating.minutes\#"
}
return $time
}
@@ -524,14 +524,14 @@
Checks if a name string is unique or empty, excluding a given item
} {
if {$new_p && $name ne ""} {
- if {$item_id eq ""} {
- set count [db_string check_unique {}]
- } else {
- set count [db_string check_unique_excluding_item {}]
- }
- if {$count > 0} {
- return 0
- }
+ if {$item_id eq ""} {
+ set count [db_string check_unique {}]
+ } else {
+ set count [db_string check_unique_excluding_item {}]
+ }
+ if {$count > 0} {
+ return 0
+ }
}
return 1
}
@@ -545,9 +545,9 @@
Checks if list contains only key value pairs
} {
if {[llength $options] % 2 == 0} {
- return 1
+ return 1
} else {
- return 0
+ return 0
}
}
@@ -563,12 +563,12 @@
Returns a html snippet to display a content item (i.e. image)
} {
if {$content_id eq ""} {
- return $title
+ return $title
}
if {$content_type eq "image"} {
- return "
"
+ return "
"
} else {
- return "$title"
+ return "$title"
}
}
@@ -595,11 +595,11 @@
set a0 [expr double([lindex $a 0 0])]
set b0 [expr double([lindex $b 0 0])]
if {$a0 > $b0} {
- return 1
+ return 1
} elseif {$a0 == $b0} {
- return 0
+ return 0
} else {
- return -1
+ return -1
}
}
@@ -609,14 +609,12 @@
@annyflores@viaro.net
Remove html tags from assessment title
} {
-
+
regsub -all {\<[a-zA-Z]*\>} $title "" title
regsub -all {[a-z]*>} $title "" title
regsub -all {} $title "" title
-
- return $title
-
+ return $title
}
ad_proc -private as::assessment::delete {
@@ -634,6 +632,7 @@
content::item::delete -item_id $assessment_id
}
+
# Local variables:
# mode: tcl
# tcl-indent-level: 4
Index: openacs-4/packages/assessment/tcl/as-item-display-tb-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/tcl/as-item-display-tb-procs.tcl,v
diff -u -r1.14 -r1.15
--- openacs-4/packages/assessment/tcl/as-item-display-tb-procs.tcl 15 Jun 2018 22:47:45 -0000 1.14
+++ openacs-4/packages/assessment/tcl/as-item-display-tb-procs.tcl 15 Jun 2018 23:11:09 -0000 1.15
@@ -18,19 +18,19 @@
New Item Display TextBox Type to the database
} {
if { $package_id eq "" } {
- set package_id [ad_conn package_id]
+ set package_id [ad_conn package_id]
}
set folder_id [as::assessment::folder_id -package_id $package_id]
# Insert as_item_display_tb in the CR (and as_item_display_tb table) getting the revision_id (as_item_display_id)
db_transaction {
set item_item_display_tb_id [content::item::new -parent_id $folder_id -content_type {as_item_display_tb} -name [as::item::generate_unique_name]]
set as_item_display_tb_id [content::revision::new \
- -item_id $item_item_display_tb_id \
- -content_type {as_item_display_tb} \
- -attributes [list [list html_display_options $html_display_options] \
- [list abs_size $abs_size] \
- [list item_answer_alignment $item_answer_alignment] ] ]
+ -item_id $item_item_display_tb_id \
+ -content_type {as_item_display_tb} \
+ -attributes [list [list html_display_options $html_display_options] \
+ [list abs_size $abs_size] \
+ [list item_answer_alignment $item_answer_alignment] ] ]
}
return $as_item_display_tb_id
@@ -49,13 +49,13 @@
} {
# Update as_item_display_tb in the CR (and as_item_display_tb table) getting the revision_id (as_item_display_id)
db_transaction {
- set display_item_id [db_string display_item_id {}]
- set new_item_display_id [content::revision::new \
- -item_id $display_item_id \
- -content_type {as_item_display_tb} \
- -attributes [list [list html_display_options $html_display_options] \
- [list abs_size $abs_size] \
- [list item_answer_alignment $item_answer_alignment] ] ]
+ set display_item_id [db_string display_item_id {}]
+ set new_item_display_id [content::revision::new \
+ -item_id $display_item_id \
+ -content_type {as_item_display_tb} \
+ -attributes [list [list html_display_options $html_display_options] \
+ [list abs_size $abs_size] \
+ [list item_answer_alignment $item_answer_alignment] ] ]
}
return $new_item_display_id
@@ -74,11 +74,11 @@
# Insert as_item_display_tb in the CR (and as_item_display_tb table) getting the revision_id (as_item_display_id)
db_transaction {
- db_1row display_item_data {}
+ db_1row display_item_data {}
- set new_item_display_id [new -html_display_options $html_display_options \
- -abs_size $abs_size \
- -item_answer_alignment $item_answer_alignment]
+ set new_item_display_id [new -html_display_options $html_display_options \
+ -abs_size $abs_size \
+ -item_answer_alignment $item_answer_alignment]
}
return $new_item_display_id
@@ -104,22 +104,22 @@
} {
array set type [util_memoize [list as::item_display_tb::data -type_id $type_id]]
if {$required_p eq ""} {
- set required_p f
+ set required_p f
}
if {$datatype eq ""} {
- set datatype text
+ set datatype text
}
# fixme
set datatype text
set optional ""
if {$required_p != "t"} {
- set optional ",optional"
+ set optional ",optional"
}
set param_list [list [list label \$title] [list help_text \$subtext] [list value \$default_value] [list html \$type(html_display_options)]]
if {$type(abs_size) ne ""} {
- lappend param_list [list maxlength $type(abs_size)]
+ lappend param_list [list maxlength $type(abs_size)]
}
set element_params [concat [list "$element\:$datatype\(text)$optional"] $param_list]
ad_form -extend -name $form -form [list $element_params]
@@ -163,46 +163,47 @@
} {
- set new_assessment_rev_id [as::assessment::new_revision -assessment_id $assessment_id]
- set section_id [as::section::latest -section_id $section_id -assessment_rev_id $new_assessment_rev_id]
- set new_section_id [as::section::new_revision -section_id $section_id -assessment_id $assessment_id]
- db_dml update_section_in_assessment {}
- set old_item_id $as_item_id
+ set new_assessment_rev_id [as::assessment::new_revision -assessment_id $assessment_id]
+ set section_id [as::section::latest -section_id $section_id -assessment_rev_id $new_assessment_rev_id]
+ set new_section_id [as::section::new_revision -section_id $section_id -assessment_id $assessment_id]
+ db_dml update_section_in_assessment {}
+ set old_item_id $as_item_id
- if {![db_0or1row item_display {}] || $object_type ne "as_item_display_tb"} {
- set as_item_display_id [as::item_display_tb::new \
- -html_display_options $html_options \
- -abs_size $abs_size \
- -item_answer_alignment $answer_alignment]
-
- if {![info exists object_type]} {
- # first item display mapped
- as::item_rels::new -item_rev_id $as_item_id -target_rev_id $as_item_display_id -type as_item_display_rel
- } else {
- # old item display existing
- set as_item_id [as::item::new_revision -as_item_id $as_item_id]
- }
- } else {
- # old tb item display existing
- set as_item_id [as::item::new_revision -as_item_id $as_item_id]
- set as_item_display_id [as::item_display_tb::edit \
- -as_item_display_id $as_item_display_id \
- -html_display_options $html_options \
- -abs_size $abs_size \
- -item_answer_alignment $answer_alignment]
- }
+ if {![db_0or1row item_display {}] || $object_type ne "as_item_display_tb"} {
+ set as_item_display_id [as::item_display_tb::new \
+ -html_display_options $html_options \
+ -abs_size $abs_size \
+ -item_answer_alignment $answer_alignment]
- set old_item_id [as::item::latest -as_item_id $old_item_id -section_id $new_section_id -default 0]
- if {$old_item_id == 0} {
- db_dml move_down_items {}
- incr after
- db_dml insert_new_item {}
- } else {
- db_dml update_item_display {}
- db_1row item_data {}
- db_dml update_item {}
- }
+ if {![info exists object_type]} {
+ # first item display mapped
+ as::item_rels::new -item_rev_id $as_item_id -target_rev_id $as_item_display_id -type as_item_display_rel
+ } else {
+ # old item display existing
+ set as_item_id [as::item::new_revision -as_item_id $as_item_id]
+ }
+ } else {
+ # old tb item display existing
+ set as_item_id [as::item::new_revision -as_item_id $as_item_id]
+ set as_item_display_id [as::item_display_tb::edit \
+ -as_item_display_id $as_item_display_id \
+ -html_display_options $html_options \
+ -abs_size $abs_size \
+ -item_answer_alignment $answer_alignment]
+ }
+
+ set old_item_id [as::item::latest -as_item_id $old_item_id -section_id $new_section_id -default 0]
+ if {$old_item_id == 0} {
+ db_dml move_down_items {}
+ incr after
+ db_dml insert_new_item {}
+ } else {
+ db_dml update_item_display {}
+ db_1row item_data {}
+ db_dml update_item {}
+ }
}
+
# Local variables:
# mode: tcl
# tcl-indent-level: 4
Index: openacs-4/packages/assessment/tcl/as-item-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/tcl/as-item-procs.tcl,v
diff -u -r1.24 -r1.25
--- openacs-4/packages/assessment/tcl/as-item-procs.tcl 15 Jun 2018 22:47:45 -0000 1.24
+++ openacs-4/packages/assessment/tcl/as-item-procs.tcl 15 Jun 2018 23:11:09 -0000 1.25
@@ -28,34 +28,34 @@
New item to the database
} {
if { $package_id eq "" } {
- set package_id [ad_conn package_id]
+ set package_id [ad_conn package_id]
}
set folder_id [as::assessment::folder_id -package_id $package_id]
# Insert as_item in the CR (and as_items table) getting the revision_id (as_item_id)
db_transaction {
- if {$item_item_id eq ""} {
- set item_item_id [db_nextval acs_object_id_seq]
- }
- set name "QUE_$item_item_id"
- if {$field_name eq ""} {
- set field_name $name
- }
+ if {$item_item_id eq ""} {
+ set item_item_id [db_nextval acs_object_id_seq]
+ }
+ set name "QUE_$item_item_id"
+ if {$field_name eq ""} {
+ set field_name $name
+ }
set item_item_id [content::item::new -item_id $item_item_id -parent_id $folder_id -content_type {as_items} -name $name -creation_user [ad_conn user_id] -creation_ip [ad_conn peeraddr] -storage_type text]
set as_item_id [content::revision::new -item_id $item_item_id \
- -content_type {as_items} \
- -title [string range $title 0 999] \
+ -content_type {as_items} \
+ -title [string range $title 0 999] \
-content $title \
-mime_type "text/html" \
- -description $description \
- -attributes [list [list subtext $subtext] \
- [list field_name $field_name] \
- [list field_code $field_code] \
- [list required_p $required_p] \
- [list data_type $data_type] \
- [list max_time_to_complete $max_time_to_complete] \
- [list points $points] ] ]
+ -description $description \
+ -attributes [list [list subtext $subtext] \
+ [list field_name $field_name] \
+ [list field_code $field_code] \
+ [list required_p $required_p] \
+ [list data_type $data_type] \
+ [list max_time_to_complete $max_time_to_complete] \
+ [list points $points] ] ]
}
db_dml update_clobs "" -clobs [list $feedback_right $feedback_wrong $validate_block]
return $as_item_id
@@ -83,22 +83,22 @@
} {
# Update as_item in the CR (and as_items table) getting the revision_id (as_item_id)
db_transaction {
- set item_item_id [db_string item_item_id {}]
+ set item_item_id [db_string item_item_id {}]
set new_item_id [content::revision::new \
- -item_id $item_item_id \
- -content_type {as_items} \
- -title [string range $title 0 999] \
- -content $title \
- -description $description \
- -attributes [list [list subtext $subtext] \
- [list field_name $field_name] \
- [list field_code $field_code] \
- [list required_p $required_p] \
- [list data_type $data_type] \
- [list max_time_to_complete $max_time_to_complete] \
- [list points $points] ] ]
+ -item_id $item_item_id \
+ -content_type {as_items} \
+ -title [string range $title 0 999] \
+ -content $title \
+ -description $description \
+ -attributes [list [list subtext $subtext] \
+ [list field_name $field_name] \
+ [list field_code $field_code] \
+ [list required_p $required_p] \
+ [list data_type $data_type] \
+ [list max_time_to_complete $max_time_to_complete] \
+ [list points $points] ] ]
- copy_types -as_item_id $as_item_id -new_item_id $new_item_id
+ copy_types -as_item_id $as_item_id -new_item_id $new_item_id
}
db_dml update_clobs "" -clobs [list $feedback_right $feedback_wrong $validate_block]
return $new_item_id
@@ -114,23 +114,23 @@
} {
# Update as_item in the CR (and as_items table) getting the revision_id (as_item_id)
db_transaction {
- db_1row item_data {}
- set new_item_id [content::revision::new \
- -item_id $item_item_id \
- -content_type {as_items} \
- -title $title \
- -description $description \
- -content $content \
- -attributes [list [list subtext $subtext] \
- [list field_name $field_name] \
- [list field_code $field_code] \
- [list required_p $required_p] \
- [list data_type $data_type] \
- [list max_time_to_complete $max_time_to_complete] \
- [list points $points] ] ]
+ db_1row item_data {}
+ set new_item_id [content::revision::new \
+ -item_id $item_item_id \
+ -content_type {as_items} \
+ -title $title \
+ -description $description \
+ -content $content \
+ -attributes [list [list subtext $subtext] \
+ [list field_name $field_name] \
+ [list field_code $field_code] \
+ [list required_p $required_p] \
+ [list data_type $data_type] \
+ [list max_time_to_complete $max_time_to_complete] \
+ [list points $points] ] ]
- copy_types -as_item_id $as_item_id -new_item_id $new_item_id
- as::assessment::copy_categories -from_id $as_item_id -to_id $new_item_id
+ copy_types -as_item_id $as_item_id -new_item_id $new_item_id
+ as::assessment::copy_categories -from_id $as_item_id -to_id $new_item_id
}
db_dml update_clobs "" -clobs [list $feedback_right $feedback_wrong $validate_block]
@@ -148,7 +148,7 @@
Returns the latest revision of an item
} {
if {![db_0or1row get_latest_item_id {}] && $default ne ""} {
- return $default
+ return $default
}
return $as_item_id
}
@@ -167,45 +167,45 @@
} {
# Update as_item in the CR (and as_items table) getting the revision_id (as_item_id)
if { $package_id eq "" } {
- set package_id [ad_conn package_id]
+ set package_id [ad_conn package_id]
}
set folder_id [as::assessment::folder_id -package_id $package_id]
set new_title $title
db_transaction {
- db_1row item_data {}
+ db_1row item_data {}
- set item_item_id [db_nextval acs_object_id_seq]
- set name "QUE_$item_item_id"
- if {$field_name eq ""} {
- set field_name $name
- }
+ set item_item_id [db_nextval acs_object_id_seq]
+ set name "QUE_$item_item_id"
+ if {$field_name eq ""} {
+ set field_name $name
+ }
set item_item_id [content::item::new -item_id $item_item_id -parent_id $folder_id -content_type {as_items} -name $name -storage_type text]
set new_item_id [content::revision::new \
- -item_id $item_item_id \
- -content_type {as_items} \
- -title [string range $new_title 0 999] \
- -content $new_title \
- -description $description \
- -attributes [list [list subtext $subtext] \
- [list field_name $field_name] \
- [list field_code $field_code] \
- [list required_p $required_p] \
- [list data_type $data_type] \
- [list max_time_to_complete $max_time_to_complete] \
- [list feedback_right $feedback_right] \
- [list feedback_wrong $feedback_wrong] \
- [list points $points] \
- [list validate_block $validate_block] ] ]
+ -item_id $item_item_id \
+ -content_type {as_items} \
+ -title [string range $new_title 0 999] \
+ -content $new_title \
+ -description $description \
+ -attributes [list [list subtext $subtext] \
+ [list field_name $field_name] \
+ [list field_code $field_code] \
+ [list required_p $required_p] \
+ [list data_type $data_type] \
+ [list max_time_to_complete $max_time_to_complete] \
+ [list feedback_right $feedback_right] \
+ [list feedback_wrong $feedback_wrong] \
+ [list points $points] \
+ [list validate_block $validate_block] ] ]
- as::assessment::copy_categories -from_id $as_item_id -to_id $new_item_id
+ as::assessment::copy_categories -from_id $as_item_id -to_id $new_item_id
- set subtypes [db_list_of_lists item_subtypes {}]
- foreach subtype $subtypes {
- lassign $subtype type_id type
- set new_type_id [eval as::[string range $type 3 end]::copy -type_id $type_id]
- as::item_rels::new -item_rev_id $new_item_id -target_rev_id $new_type_id -type "[string range $type 0 end-2]rel"
- }
+ set subtypes [db_list_of_lists item_subtypes {}]
+ foreach subtype $subtypes {
+ lassign $subtype type_id type
+ set new_type_id [eval as::[string range $type 3 end]::copy -type_id $type_id]
+ as::item_rels::new -item_rev_id $new_item_id -target_rev_id $new_type_id -type "[string range $type 0 end-2]rel"
+ }
}
return $new_item_id
@@ -254,22 +254,22 @@
args
} {
Generate a unique string to be used as item name
-
+
@author Roel Canicula (roelmc@info.com.ph)
@creation-date 2005-05-06
-
+
@param args
- @return
-
- @error
+ @return
+
+ @error
} {
if { [llength $args] } {
- return [join $args "-"]
+ return [join $args "-"]
} elseif { ! [catch {set uuid [exec uuidgen]}] } {
- return $uuid
+ return $uuid
} else {
- return "[clock seconds]-[expr round([ns_rand]*100000)]"
+ return "[clock seconds]-[expr round([ns_rand]*100000)]"
}
}
@@ -278,7 +278,7 @@
{-array_name item_type_info}
} {
An array of revision_id, item_type, object_type of a certain as_item
-
+
@param as_item_id Revision_id of as_item object
@param array_name Name of array to create in caller's scope via upvar
@@ -299,7 +299,7 @@
question (as_item), and the associated as_item_type object that was related changed.
@param item_type_id revision_id of as_item_type_* object
@parma as_item_id revision_id of as_item_object
-
+
@return does not return anything interesting
@author Dave Bauer (dave@solutiongrove.com)
@@ -329,11 +329,11 @@
}
ad_proc -private as::item::get_item_type_id {
- -as_item_id
+ -as_item_id
} {
Get the item type id
} {
- return [db_string item_type_id {}]
+ return [db_string item_type_id {}]
}
# Local variables:
Index: openacs-4/packages/assessment/tcl/as-item-type-sa-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/tcl/as-item-type-sa-procs.tcl,v
diff -u -r1.19 -r1.20
--- openacs-4/packages/assessment/tcl/as-item-type-sa-procs.tcl 15 Jun 2018 22:47:45 -0000 1.19
+++ openacs-4/packages/assessment/tcl/as-item-type-sa-procs.tcl 15 Jun 2018 23:11:09 -0000 1.20
@@ -18,19 +18,19 @@
New Short Answer Answers item to the data database
} {
if { $package_id eq "" } {
- set package_id [ad_conn package_id]
+ set package_id [ad_conn package_id]
}
set folder_id [as::assessment::folder_id -package_id $package_id]
# Insert as_item_type_sa in the CR (and as_item_type_sa table) getting the revision_id (as_item_type_id)
db_transaction {
set item_item_type_sa_id [content::item::new -parent_id $folder_id -content_type {as_item_type_sa} -name [as::item::generate_unique_name]]
set as_item_type_sa_id [content::revision::new \
- -item_id $item_item_type_sa_id \
- -content_type {as_item_type_sa} \
- -title $title \
- -attributes [list [list increasing_p $increasing_p] \
- [list allow_negative_p $allow_negative_p] ] ]
+ -item_id $item_item_type_sa_id \
+ -content_type {as_item_type_sa} \
+ -title $title \
+ -attributes [list [list increasing_p $increasing_p] \
+ [list allow_negative_p $allow_negative_p] ] ]
}
return $as_item_type_sa_id
@@ -40,7 +40,7 @@
-as_item_type_id:required
{-title ""}
{-increasing_p ""}
- {-allow_negative_p ""}
+ {-allow_negative_p ""}
} {
@author Timo Hentschel (timo@timohentschel.de)
@creation-date 2004-12-07
@@ -49,13 +49,13 @@
} {
# Update as_item_type_sa in the CR (and as_item_type_sa table) getting the revision_id (as_item_type_id)
db_transaction {
- set type_item_id [db_string type_item_id {}]
+ set type_item_id [db_string type_item_id {}]
set new_item_type_id [content::revision::new \
- -item_id $type_item_id \
- -content_type {as_item_type_sa} \
- -title $title \
- -attributes [list [list increasing_p $increasing_p] \
- [list allow_negative_p $allow_negative_p] ] ]
+ -item_id $type_item_id \
+ -content_type {as_item_type_sa} \
+ -title $title \
+ -attributes [list [list increasing_p $increasing_p] \
+ [list allow_negative_p $allow_negative_p] ] ]
}
return $new_item_type_id
@@ -74,11 +74,11 @@
# Insert as_item_type_sa in the CR (and as_item_type_sa table) getting the revision_id (as_item_type_id)
db_transaction {
- db_1row item_type_data {}
+ db_1row item_type_data {}
- set new_item_type_id [new -title $title \
- -increasing_p $increasing_p \
- -allow_negative_p $allow_negative_p]
+ set new_item_type_id [new -title $title \
+ -increasing_p $increasing_p \
+ -allow_negative_p $allow_negative_p]
}
return $new_item_type_id
@@ -98,10 +98,10 @@
Render a Short Answer Type
} {
if {$default_value ne ""} {
- array set values $default_value
- set default $values(text_answer)
+ array set values $default_value
+ set default $values(text_answer)
} else {
- set default ""
+ set default ""
}
return [list $default ""]
@@ -139,13 +139,13 @@
Return the results of a given item in a given list of sessions as an array
} {
db_foreach get_results {} {
- set results($session_id) $text_answer
+ set results($session_id) $text_answer
}
if {[array exists results]} {
- return [array get results]
+ return [array get results]
} else {
- return
+ return
}
}
@@ -160,7 +160,7 @@
{-increasing_p "f"}
{-allow_negative_p "f"}
} {
- Add the short answer item to an assessment. The creates the
+ Add the short answer item to an assessment. The creates the
as_item_type_sa object and associates the as_item_id
with an assessment, or updates the assessment with the latest version
@@ -173,34 +173,34 @@
@author Dave Bauer (dave@solutiongrove.com)
@creation-date 2006-10-25
} {
- if {![as::item::get_item_type_info -as_item_id $as_item_id] \
+ if {![as::item::get_item_type_info -as_item_id $as_item_id] \
|| $item_type_info(object_type) ne "as_item_type_sa"} {
- set as_item_type_id [as::item_type_sa::new \
- -title $title \
- -increasing_p $increasing_p \
- -allow_negative_p $allow_negative_p]
-
- if {![info exists item_type_info(object_type)]} {
- # first item type mapped
- as::item_rels::new -item_rev_id $as_item_id -target_rev_id $as_item_type_id -type as_item_type_rel
- } else {
- # old item type existing
- set as_item_id [as::item::new_revision -as_item_id $as_item_id]
- db_dml update_item_type {}
- }
- } else {
- # old sa item type existing
- set as_item_id [as::item::new_revision -as_item_id $as_item_id]
- set as_item_type_id [as::item_type_sa::edit \
- -as_item_type_id $as_item_type_id \
- -title $title \
- -increasing_p $increasing_p \
- -allow_negative_p $allow_negative_p]
-
- as::item::update_item_type \
- -as_item_id $as_item_id \
- -item_type_id $as_item_type_id
- }
+ set as_item_type_id [as::item_type_sa::new \
+ -title $title \
+ -increasing_p $increasing_p \
+ -allow_negative_p $allow_negative_p]
+
+ if {![info exists item_type_info(object_type)]} {
+ # first item type mapped
+ as::item_rels::new -item_rev_id $as_item_id -target_rev_id $as_item_type_id -type as_item_type_rel
+ } else {
+ # old item type existing
+ set as_item_id [as::item::new_revision -as_item_id $as_item_id]
+ db_dml update_item_type {}
+ }
+ } else {
+ # old sa item type existing
+ set as_item_id [as::item::new_revision -as_item_id $as_item_id]
+ set as_item_type_id [as::item_type_sa::edit \
+ -as_item_type_id $as_item_type_id \
+ -title $title \
+ -increasing_p $increasing_p \
+ -allow_negative_p $allow_negative_p]
+
+ as::item::update_item_type \
+ -as_item_id $as_item_id \
+ -item_type_id $as_item_type_id
+ }
as::item_display_tb::set_item_display_type \
-as_item_id $as_item_id \
-assessment_id $assessment_id \
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.43 -r1.44
--- openacs-4/packages/bug-tracker/tcl/bug-procs.tcl 15 Jun 2018 22:47:45 -0000 1.43
+++ openacs-4/packages/bug-tracker/tcl/bug-procs.tcl 15 Jun 2018 23:11:09 -0000 1.44
@@ -1,7 +1,7 @@
ad_library {
Bug Tracker Bug Library
-
+
Procedures that deal with a single bug
@creation-date 2003-01-10
@@ -52,19 +52,19 @@
upvar $array row
db_1row select_bug_data {} -column_array row
-
+
# Get the case ID, so we can get state information
set case_id [workflow::case::get_id \
-object_id $bug_id \
-workflow_short_name [bug_tracker::bug::workflow_short_name]]
-
+
# Derived fields
set row(bug_number_display) "$row(bug_number)"
set row(component_name) [bug_tracker::component_get_name -component_id $row(component_id) -package_id $row(project_id)]
set row(found_in_version_name) [bug_tracker::version_get_name -version_id $row(found_in_version) -package_id $row(project_id)]
set row(fix_for_version_name) [bug_tracker::version_get_name -version_id $row(fix_for_version) -package_id $row(project_id)]
set row(fixed_in_version_name) [bug_tracker::version_get_name -version_id $row(fixed_in_version) -package_id $row(project_id)]
-
+
# Get state information
workflow::case::fsm::get -case_id $case_id -array case -enabled_action_id $enabled_action_id
set row(pretty_state) $case(pretty_state)
@@ -98,7 +98,7 @@
@see bug_tracker::bug::new
@return bug_id The same bug_id passed in, just for convenience.
-
+
} {
if { $user_agent eq "" && [ad_conn isconnected] } {
set user_agent [ns_set get [ns_conn headers] "User-Agent"]
@@ -115,8 +115,8 @@
oacs_util::vars_to_ns_set \
-ns_set $extra_vars \
-var_list { bug_id package_id component_id found_in_version summary
- user_agent comment_content comment_format creation_date
- fix_for_version assign_to}
+ user_agent comment_content comment_format creation_date
+ fix_for_version assign_to}
set bug_id [package_instantiate_object \
@@ -127,7 +127,7 @@
"bt_bug"]
cache_flush -bug_id $bug_id
-
+
return $bug_id
}
@@ -151,12 +151,12 @@
Create a new bug, then send out notifications, starts workflow, etc.
Calls bug_tracker::bug::insert.
-
+
@see bug_tracker::bug::insert.
@return bug_id The same bug_id passed in, just for convenience.
} {
-
+
db_transaction {
set bug_id [bug_tracker::bug::insert \
@@ -172,30 +172,30 @@
-ip_address $ip_address \
-item_subtype $item_subtype \
-content_type $content_type \
- -fix_for_version $fix_for_version ]
+ -fix_for_version $fix_for_version ]
foreach keyword_id $keyword_ids {
content::keyword::item_assign -item_id $bug_id -keyword_id $keyword_id
}
-
- if {$assign_to ne ""} {
- array set assign_array [list resolver $assign_to]
-
- } else {
- array set assign_array ""
- }
+ if {$assign_to ne ""} {
-
+ array set assign_array [list resolver $assign_to]
+
+ } else {
+ array set assign_array ""
+ }
+
+
set case_id [workflow::case::new \
-workflow_id [workflow::get_id -object_id $package_id -short_name [workflow_short_name]] \
-object_id $bug_id \
-comment $description \
-comment_mime_type $desc_format \
- -user_id $user_id \
- -assignment [array get assign_array] \
+ -user_id $user_id \
+ -assignment [array get assign_array] \
-package_id $package_id]
-
+
if {[lindex [bug_tracker::access_policy] 1] eq "user_bugs"} {
bug_tracker::grant_direct_read_permission -bug_id $bug_id -party_id $user_id
}
@@ -211,7 +211,7 @@
{-creation_ip ""}
-array:required
} {
- Update a bug in the DB. Usually, you'll want to use bug_tracker::bug::edit
+ Update a bug in the DB. Usually, you'll want to use bug_tracker::bug::edit
because that one sends out notifications, etc.
@see bug_tracker::bug::edit
@@ -256,20 +256,20 @@
Edit a bug, then send out notifications, etc.
Calls bug_tracker::bug::update.
-
+
@see bug_tracker::bug::update
@return bug_id The same bug_id passed in, just for convenience.
} {
upvar $array row
-
+
array set assignments [list]
-
+
set role_prefix "role_"
foreach name [array names row "${role_prefix}*"] {
set assignments([string range $name [string length $role_prefix] end]) $row($name)
unset row($name)
}
-
+
db_transaction {
# Update the bug info
update \
@@ -297,7 +297,7 @@
-replace \
-case_id $case_id \
-array assignments
-
+
workflow::case::action::execute \
-enabled_action_id $enabled_action_id \
-comment $description \
@@ -336,7 +336,7 @@
} {
set user_id [ad_conn user_id]
set return_url [ad_return_url]
-
+
# Get the type id
set type "workflow_case"
set type_id [notification::type::get_type_id -short_name $type]
@@ -349,8 +349,8 @@
-object_id $bug_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::subscribe_url \
-type $type \
@@ -376,14 +376,14 @@
pretty_name "#bug-tracker.Bug#"
package_key "bug-tracker"
object_type "bt_bug"
- callbacks {
- bug-tracker.FormatLogTitle
+ callbacks {
+ bug-tracker.FormatLogTitle
bug-tracker.BugNotificationInfo
}
roles {
submitter {
pretty_name "#bug-tracker.Submitter#"
- callbacks {
+ callbacks {
workflow.Role_DefaultAssignees_CreationUser
}
}
@@ -429,14 +429,14 @@
allowed_roles { submitter resolver }
privileges { write }
always_enabled_p t
- edit_fields {
- component_id
- summary
+ edit_fields {
+ component_id
+ summary
found_in_version
role_resolver
fix_for_version
- resolution
- fixed_in_version
+ resolution
+ fixed_in_version
}
}
reassign {
@@ -480,7 +480,7 @@
}
set workflow_id [workflow::fsm::new_from_spec -spec $spec]
-
+
return $workflow_id
}
@@ -493,7 +493,7 @@
}
}
-ad_proc -public bug_tracker::bug::get_package_workflow_id {} {
+ad_proc -public bug_tracker::bug::get_package_workflow_id {} {
Return the workflow_id for the package (not instance) workflow
} {
return [workflow::get_id \
@@ -505,7 +505,7 @@
ad_proc -public bug_tracker::bug::get_instance_workflow_id {
{-package_id {}}
-} {
+} {
Return the workflow_id for the package (not instance) workflow
} {
if { $package_id eq "" } {
@@ -535,7 +535,7 @@
}
db_dml update_project {}
-
+
return $workflow_id
}
@@ -632,7 +632,7 @@
} {
return [db_string select_project_maintainer {} -default {}]
}
-
+
#####
#
# Notification Info
@@ -650,7 +650,7 @@
bug_tracker::bug::get -bug_id $object_id -array bug
set url [export_vars -base "[ad_url][apm_package_url_from_id $bug(project_id)]bug" {
- { bug_number $bug(bug_number) }
+ { bug_number $bug(bug_number) }
}]
bug_tracker::get_pretty_names -array pretty_names
@@ -687,7 +687,7 @@
set label($category_id) $category_name
}
- lappend fields summary status
+ lappend fields summary status
if { [bug_tracker::versions_p -package_id $bug(project_id)] } {
lappend fields found_in_version fix_for_version fixed_in_version
@@ -708,7 +708,7 @@
set fields [lreplace $fields $index $index]
}
}
-
+
# Build up the details list
set details_list [list]
foreach field $fields {
@@ -717,10 +717,10 @@
return [list $url $one_line $details_list $notification_subject_tag]
}
-
+
#####
-#
+#
# Bug list
#
#####
@@ -747,11 +747,11 @@
summary {
label "[_ bug-tracker.Summary]"
link_url_eval {[export_vars -base bug -entire_form -override { bug_number }]}
- display_template {@bugs.summary;noi18n@}
+ display_template {@bugs.summary;noi18n@}
aggregate_label {[_ bug-tracker.Number]}
- }
- comment {
- label "[_ bug-tracker.Details]"
+ }
+ comment {
+ label "[_ bug-tracker.Details]"
display_col comment_short
hide_p 1
}
@@ -782,7 +782,7 @@
display_col fix_for_version_name
}
}
-
+
lappend elements component {
label "[_ bug-tracker.Component]"
display_col component_name
@@ -837,7 +837,7 @@
-admin_p $admin_p]
set name category_$parent_id
-
+
set where_clause [db_map category_where_clause]
lappend filters f_$name \
@@ -871,9 +871,9 @@
-package_id $package_id \
-workflow_id $workflow_id \
-action_id $action_id \
- -user_id $user_id \
+ -user_id $user_id \
-admin_p $admin_p]
-
+
lappend filters f_action_$action_id \
[list \
label $action(pretty_name) \
@@ -900,8 +900,8 @@
# or "comment").
#
set format table
-
- foreach var [bug_tracker::get_export_variables -package_id $package_id] {
+
+ foreach var [bug_tracker::get_export_variables -package_id $package_id] {
upvar \#[template::adp_level] $var $var
}
@@ -992,7 +992,7 @@
# Needed to handle ordering by categories
set from_bug_clause "bt_bugs b"
-
+
# Lars: This is a little hack because we actually need to alter the query to sort by category
# but list builder currently doesn't support that.
@@ -1029,17 +1029,17 @@
-parameter "TruncateDescriptionLength" \
-default 200]
}
- foreach var [bug_tracker::get_export_variables -package_id $package_id] {
+ foreach var [bug_tracker::get_export_variables -package_id $package_id] {
#JOEL put this back later
upvar \#[template::adp_level] $var $var
}
set workflow_id [bug_tracker::bug::get_instance_workflow_id -package_id $package_id]
- set extend_list {
+ set extend_list {
comment_short
- submitter_url
- assignee_url
+ submitter_url
+ assignee_url
status_pretty
resolution_pretty
component_name
@@ -1083,18 +1083,18 @@
set submitter_url [acs_community_member_url -user_id $submitter_user_id]
set assignee_url [acs_community_member_url -user_id $assigned_user_id]
set resolution_pretty [bug_tracker::resolution_pretty $resolution]
-
+
# Hide fields in this state
foreach element $hide_fields {
set $element {}
}
-
+
# Move categories from array to normal variables, then clear the array for next row
foreach parent_id [array names row_category] {
set category_$parent_id $row_category($parent_id)
- if {[info exists row_category_name($parent_id)]} {
+ if {[info exists row_category_name($parent_id)]} {
set category_name_$parent_id $row_category_name($parent_id)
- } else {
+ } else {
set category_name_$parent_id {}
}
}
@@ -1114,7 +1114,7 @@
ad_proc bug_tracker::bug::get_bug_numbers {} {
bug_tracker::bug::get_list -ulevel 2
bug_tracker::bug::get_multirow
-
+
set filter_bug_numbers [list]
template::multirow foreach bugs {
lappend filter_bug_numbers $bug_number
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.8 -r1.9
--- openacs-4/packages/chat/www/search-2.tcl 15 Jun 2018 22:47:45 -0000 1.8
+++ openacs-4/packages/chat/www/search-2.tcl 15 Jun 2018 23:11:09 -0000 1.9
@@ -28,7 +28,7 @@
set context [list "Search"]
if {[info exists keyword]} {
- # this is an administrator
+ # this is an administrator
if { $keyword eq "" } {
incr exception_count
append exception_text "You forgot to type a search string!\n"
@@ -67,11 +67,11 @@
set sql_keyword "%[string tolower $keyword]%"
lappend where_clause "(username like :sql_keyword or email like :sql_keyword or lower(first_names || ' ' || last_name) like :sql_keyword)"
} elseif { [info exists email] && $email ne "" } {
- set search_type "email"
+ set search_type "email"
set sql_email "%[string tolower $email]%"
lappend where_clause "email like :sql_email"
} else {
- set search_type "last"
+ set search_type "last"
set sql_last_name "%[string tolower $last_name]%"
lappend where_clause "lower(last_name) like :sql_last_name"
}
@@ -113,7 +113,7 @@
set first_names_from_search $first_names
set last_name_from_search $last_name
set email_from_search $email
-
+
set user_search:[set rowcount](user_id) $user_id
set user_search:[set rowcount](first_names) $first_names
set user_search:[set rowcount](last_name) $last_name
@@ -122,7 +122,7 @@
set user_search:[set rowcount](member_state) $member_state
set user_search:[set rowcount](url) [export_vars -base "search-3" {room_id type {party_id $user_id}}]
-
+
if { $member_state ne "approved" } {
set user_search:[set rowcount](user_finite_state_links) [join [ad_registration_finite_state_machine_admin_links $member_state $email_verified_p $user_id_from_search [export_vars -base search {email last_name keyword target passthrough limit_users_in_group_id only_authorized_p}]] " | "]
} else {