Index: openacs-4/packages/logger/lib/entries.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/logger/lib/entries.tcl,v diff -u -r1.17 -r1.18 --- openacs-4/packages/logger/lib/entries.tcl 14 Oct 2005 22:41:16 -0000 1.17 +++ openacs-4/packages/logger/lib/entries.tcl 24 Nov 2005 16:44:49 -0000 1.18 @@ -1,31 +1,65 @@ # Expected variables: # ------------------- -# filters_p, default true, show filters - -if { ![exists_and_not_null filters_p] } { - set filters_p 1 -} - +# filters_p Boolean that indicates if you wan to show the filters or not, default true. +# # Optional variables: # ------------------- -# pm_task_id +# +# show_orderby_p The calling include may not want to show links to sort +# start_date in ansi format +# end_date in ansi format +# format Format of the list, default normal +# url of logger (if called by another package) /url/to/logger/ +# add_link If you want to override the add link (for example, to go +# directly to the correct project) +# project_manager_url If passed in, the /url/to/project-manager/ that is used to +# display the link to the task and project page. +# entry_id (not sure if this works), should highlight entries. +# return_url used for delete links +# show_tasks_p Used to specified if you want to show the task name in the list +# groupby To group the results of the list in the provided value. # pm_project_id -# show_tasks_p -# show_orderby_p the calling include may not want to show links to sort -# project_id # variable_id -# start_date in ansi format -# end_date in ansi format -# format (normal is default) -# url : of logger (if called by another package) /url/to/logger/ -# add_link If you want to override the add link (for example, to go -# directly to the correct project) -# project_manager_url : if passed in, the /url/to/project-manager/ -# that is used to display the link to the task and project page. -# entry_id (not sure if this works), should highlight entries. -# return_url (used for delete links) -# project_status (used for adding in a status for projects, active or not) +# +# Filters: +# ------- +# project_status Used for adding in a status for projects, active or not +# pm_task_id Used for showing logs for specific task_id +# description_f Used to filter according description +# user_id Used to show entries of an specific user_id +# project_id Used to filter entries for this project_id +# time_stamp To filter according the date time entry uses start_date and end_date variables +set required_param_list [list] +set optional_param_list [list filters_p show_orderby_p start_date end_date url add_link project_manager_url \ + entry_id return_url pm_project_id show_tasks_p variable_id] +set optional_unset_list [list description_f project_status pm_task_id groupby user_id time_stamp \ + start_date end_date project_id] + +foreach required_param $required_param_list { + if {![info exists $required_param]} { + return -code error "$required_param is a required parameter." + } +} + +foreach optional_param $optional_param_list { + if {![info exists $optional_param]} { + set $optional_param {} + } +} + +foreach optional_unset $optional_unset_list { + if {[info exists $optional_unset]} { + if {[empty_string_p [set $optional_unset]] || [set $optional_unset] == 0} { + unset $optional_unset + } + } +} + +if { ![exists_and_not_null filters_p] } { + set filters_p 1 +} + if { ![exists_and_not_null format] } { set format "normal" } @@ -194,7 +228,7 @@ task_name { label "[_ logger.Task]" link_url_eval {[export_vars -base "${my_project_manager_url}task-one" { task_id }]} -} + } description_long { label "[_ logger.Description]" display_eval {[string_truncate -len 400 -- $description]} @@ -208,6 +242,23 @@ # Define list filters #---------------------------------------------------------------------- + +# For the description filter we get the value of the parameter +set community_id [dotlrn_community::get_community_id] +if { ![empty_string_p $community_id] } { + set logger_package_id [dotlrn_community::get_package_id_from_package_key \ + -package_key "logger" \ + -community_id $community_id] +} else { + set logger_package_id [ad_conn package_id] +} + +set desc_options [list] +set default_descriptions [split [parameter::get -parameter "DefaultDescriptionList" -package_id $logger_package_id] ";"] +foreach desc $default_descriptions { + lappend desc_options [list $desc $desc] +} + set filters { project_id { label "[_ logger.Projects]" @@ -318,6 +369,13 @@ task.item_id = :pm_task_id } } + description_f { + label "[_ logger.Description]" + values $desc_options + where_clause { + le.description = :description_f + } + } } set orderbys { @@ -357,10 +415,11 @@ set groupby_values { - { "#logger.Day#" { { groupby time_stamp } { orderby time_stamp,desc } } } - { "#logger.Week#" { { groupby time_stamp_week } { orderby time_stamp,desc } } } - { "#logger.Project#" { { groupby project_name } { orderby project_id,asc } } } - { "#logger.User#" { { groupby user_id } { orderby user_id,asc } } } + { "\#logger.Day\#" { { groupby time_stamp } { orderby time_stamp,desc } } } + { "\#logger.Week\#" { { groupby time_stamp_week } { orderby time_stamp,desc } } } + { "\#logger.Project\#" { { groupby project_name } { orderby project_id,asc } } } + { "\#logger.User\#" { { groupby user_id } { orderby user_id,asc } } } + { "\#logger.Description\#" { { groupby description } { orderby user_id,asc } } } } set normal_row { Index: openacs-4/packages/logger/www/index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/logger/www/index.adp,v diff -u -r1.18 -r1.19 --- openacs-4/packages/logger/www/index.adp 29 Jul 2005 23:05:06 -0000 1.18 +++ openacs-4/packages/logger/www/index.adp 24 Nov 2005 16:48:26 -0000 1.19 @@ -28,7 +28,9 @@ &="page" &="return_url" &="project_manager_url" - &="show_tasks_p"> + &="show_tasks_p" + &="description_f" + &="project_status"> + &="show_tasks_p" + &="description_f" + &="project_status"> Index: openacs-4/packages/logger/www/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/logger/www/index.tcl,v diff -u -r1.23 -r1.24 --- openacs-4/packages/logger/www/index.tcl 3 Jun 2004 21:08:24 -0000 1.23 +++ openacs-4/packages/logger/www/index.tcl 24 Nov 2005 16:48:26 -0000 1.24 @@ -16,6 +16,8 @@ projection_id:optional {format "normal"} page:integer,optional + {description_f ""} + {project_status ""} } -validate { time_stamps_valid { if { [llength $time_stamp] != 0 && [llength $time_stamp] != 2 } { Index: openacs-4/packages/logger/www/log.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/logger/www/log.adp,v diff -u -r1.18 -r1.19 --- openacs-4/packages/logger/www/log.adp 14 Oct 2005 22:41:16 -0000 1.18 +++ openacs-4/packages/logger/www/log.adp 24 Nov 2005 16:48:26 -0000 1.19 @@ -58,6 +58,10 @@ show_tasks_p="@show_tasks_p;noquote@" return_url="@return_url;noquote@" project_manager_url="@project_manager_url;noquote@" + groupby="@groupby;noquote@" + description_f="@description_f;noquote@" + project_status="@project_status;noquote@" + user_id="@user_id;noquote@" /> Index: openacs-4/packages/logger/www/log.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/logger/www/log.tcl,v diff -u -r1.35 -r1.36 --- openacs-4/packages/logger/www/log.tcl 14 Oct 2005 22:48:29 -0000 1.35 +++ openacs-4/packages/logger/www/log.tcl 24 Nov 2005 16:48:26 -0000 1.36 @@ -13,7 +13,11 @@ {return_url ""} {pm_project_id:integer ""} {pm_task_id:integer ""} + {description_f ""} + {groupby ""} + {user_id ""} {__refreshing_p "0"} + {project_status ""} } -validate { project_id_required_in_add_mode { # For the sake of simplicity of the form @@ -208,6 +212,7 @@ lappend options [list $desc $desc] } + if { ![llength $default_descriptions] } { # There is no value in the list so we leave the form as it is ad_form -extend -name log_entry_form -form {