Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/logger/tcl/package-procs-oracle.xql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/logger/tcl/ui-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/logger/tcl/ui-procs.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/logger/tcl/ui-procs.tcl 1 May 2003 21:17:55 -0000 1.4 +++ openacs-4/packages/logger/tcl/ui-procs.tcl 6 May 2003 17:36:31 -0000 1.5 @@ -51,7 +51,6 @@ set actual_param_value [ns_set iget [rp_getform] $param_name] - ns_log Notice "pm debug param_name $param_name param_value $param_value actual_param_value $actual_param_value" if { ![string equal $param_value $actual_param_value] } { set params_match_p 0 break @@ -66,8 +65,6 @@ set selected_p [expr $url_matches_p && $params_match_p] - ns_log Notice "pm debug url_no_slash $url_no_slash page_url $page_url selected_p $selected_p" - return $selected_p } Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/logger/tcl/util-procs.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/logger/tcl/variable-procs-oracle.xql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/logger/www/index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/logger/www/index.adp,v diff -u -r1.6 -r1.7 --- openacs-4/packages/logger/www/index.adp 2 May 2003 08:35:10 -0000 1.6 +++ openacs-4/packages/logger/www/index.adp 6 May 2003 17:36:53 -0000 1.7 @@ -207,7 +207,7 @@ projection_value="@selected_projection_value@" selected_user_id="@selected_user_id@" start_date_ansi="@start_date_ansi@" - end_date_ansi="@end_date_plus_one_ansi@" + end_date_ansi="@end_date_ansi@" selected_variable_unit="@selected_variable_unit@"/> Index: openacs-4/packages/logger/www/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/logger/www/index.tcl,v diff -u -r1.6 -r1.7 --- openacs-4/packages/logger/www/index.tcl 2 May 2003 08:35:10 -0000 1.6 +++ openacs-4/packages/logger/www/index.tcl 6 May 2003 17:36:53 -0000 1.7 @@ -9,8 +9,6 @@ {selected_variable_id:integer ""} {selected_projection_id:integer ""} {selected_user_id:integer ""} - {start_date:array {}} - {end_date:array {}} } set package_id [ad_conn package_id] @@ -102,93 +100,81 @@ ########### # -# Initialize dates +# Date Filter # ########### -if { [array size start_date] == 0 } { - # Form was not submitted +# Create the form +set export_var_list {selected_project_id selected_variable_id selected_projection_id selected_user_id} +ad_form -name time_filter -export $export_var_list -method GET -form { + + {start_date:date(date) + {label "Start day:"} + } - if { ![empty_string_p $selected_projection_id] } { - # Projection selected - use the date range of that projection - - set start_date_seconds [clock scan $projection_array(start_time)] - set end_date_seconds [clock scan $projection_array(end_time)] - } else { - # Use default date range - - # Default end date is now (today) - set end_date_seconds [clock seconds] - - # Default start date is N days back - set number_of_days_back 31 - set seconds_per_day [expr 60*60*24] - set start_date_seconds [expr $end_date_seconds - 31 * $seconds_per_day] + {end_date:date(date) + {label "Start day:"} } - # Initialize the start and end date arrays - set end_date(year) [clock format $end_date_seconds -format "%Y"] - set end_date(month) [clock format $end_date_seconds -format "%m"] - set end_date(day) [clock format $end_date_seconds -format "%d"] - - set start_date(year) [clock format $start_date_seconds -format "%Y"] - set start_date(month) [clock format $start_date_seconds -format "%m"] - set start_date(day) [clock format $start_date_seconds -format "%d"] +} -validate { + {start_date + { [template::util::date::compare $start_date $end_date] <= 0 } + "Start day must not be after end day" + } +} -on_submit { + # error "on_submit" } -# Get the ANSI representations of the dates -set start_date_ansi "$start_date(year)-$start_date(month)-$start_date(day)" -set end_date_ansi "$end_date(year)-$end_date(month)-$end_date(day)" - ########### # -# Date Filter +# Initialize dates # ########### -# Create the form -template::form create time_filter -method GET -# Export the other filter variables -template::element create time_filter selected_project_id \ - -widget hidden \ - -value $selected_project_id -template::element create time_filter selected_variable_id \ - -widget hidden \ - -value $selected_variable_id -# Reset projection choice if the dates are changed -template::element create time_filter selected_projection_id \ - -widget hidden \ - -value "" -template::element create time_filter selected_user_id \ - -widget hidden \ - -value $selected_user_id -template::element create time_filter start_date \ - -label "Start day:" \ - -widget date \ - -datatype date -template::element create time_filter end_date \ - -label "End day:" \ - -widget date \ - -datatype date +if { [template::form is_request time_filter] } { + # Form was not submitted -# Set the values of the start and end date in the form -element set_properties time_filter start_date \ - -value [eval template::util::date::create $start_date(year) $start_date(month) $start_date(day)] -element set_properties time_filter end_date \ - -value [eval template::util::date::create $end_date(year) $end_date(month) $end_date(day)] + if { ![empty_string_p $selected_projection_id] } { + # Projection selected - use the date range of that projection + set start_date_seconds [clock scan $projection_array(start_time)] + set end_date_seconds [clock scan $projection_array(end_time)] + } else { + # Use default date range + + # Default end date is now (today) + set end_date_seconds [clock seconds] + + # Default start date is N days back + set number_of_days_back 31 + set seconds_per_day [expr 60*60*24] + set start_date_seconds [expr $end_date_seconds - 31 * $seconds_per_day] + } + + set start_date_ansi [clock format $start_date_seconds -format "%Y-%m-%d"] + set end_date_ansi [clock format $end_date_seconds -format "%Y-%m-%d"] + + # Set the values of the start and end date in the form + regsub -all -- {-} $start_date_ansi { } start_date_list + regsub -all -- {-} $end_date_ansi { } end_date_list + element set_properties time_filter start_date \ + -value [eval template::util::date::create $start_date_list] + element set_properties time_filter end_date \ + -value [eval template::util::date::create $end_date_list] +} { + # Form was submitted + set start_date_value [template::element get_value time_filter start_date] + set end_date_value [template::element get_value time_filter end_date] + set start_date_ansi "[lindex $start_date_value 0]-[lindex $start_date_value 1]-[lindex $start_date_value 2]" + set end_date_ansi "[lindex $end_date_value 0]-[lindex $end_date_value 1]-[lindex $end_date_value 2]" +} + ########### # # Select log entries # ########### -# We let start date be beginning of day but end date be end of day so that if -# both are the same day you get the entries during that day -set end_date_seconds [clock scan "$end_date(year)-$end_date(month)-$end_date(day)"] -set end_date_plus_one_seconds [expr $end_date_seconds + 60*60*24] -set end_date_plus_one_ansi [clock format $end_date_plus_one_seconds -format "%Y-%m-%d"] - # template lib/entries-table is included - see adp Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/logger/www/log-delete.tcl'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/logger/www/log.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/logger/www/log.adp,v diff -u -r1.3 -r1.4 --- openacs-4/packages/logger/www/log.adp 1 May 2003 10:01:00 -0000 1.3 +++ openacs-4/packages/logger/www/log.adp 6 May 2003 17:36:53 -0000 1.4 @@ -7,7 +7,12 @@ -

Log History for last 31 Days

+

Log History for last @log_history_n_days@ Days

- +
Index: openacs-4/packages/logger/www/log.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/logger/www/log.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/logger/www/log.tcl 1 May 2003 10:01:00 -0000 1.4 +++ openacs-4/packages/logger/www/log.tcl 6 May 2003 17:36:53 -0000 1.5 @@ -202,3 +202,9 @@ } set show_log_history_p [expr $entry_edited_by_owner_p || ! $entry_exists_p] + +set log_history_n_days 31 +set seconds_per_day [expr 60*60*24] +set start_date_seconds [expr [clock seconds] - $log_history_n_days * $seconds_per_day] +set start_date_ansi [clock format $start_date_seconds \ + -format "%Y-%m-%d"] \ No newline at end of file Index: openacs-4/packages/logger/www/admin/entries-table.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/logger/www/admin/entries-table.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/logger/www/admin/entries-table.adp 6 May 2003 17:37:09 -0000 1.1 @@ -0,0 +1,72 @@ + + + + There are no matching log entries + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 ProjectUserDateVariableValueDescription
@entries.action_links@@entries.project_name@@entries.user_name@@entries.time_stamp@@entries.variable_name@@entries.value@ @entries.unit@@entries.description@
Total:    @value_total@ @selected_variable_unit@ 
Projection:    @projection_value@ @selected_variable_unit@ 
+
+ + Index: openacs-4/packages/logger/www/admin/entries-table.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/logger/www/admin/entries-table.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/logger/www/admin/entries-table.tcl 6 May 2003 17:37:09 -0000 1.1 @@ -0,0 +1,80 @@ +set user_id [ad_conn user_id] +set package_id [ad_conn package_id] + +set where_clauses [list] +if { [exists_and_not_null selected_project_id] } { + # Only selected project + lappend where_clauses "lp.project_id = :selected_project_id" +} else { + # All projects mapped to the package + lappend where_clauses \ + "exists (select 1 + from logger_project_pkg_map + where project_id = lp.project_id + and package_id = :package_id + )" +} + +if { ![info exists selected_variable_unit] } { + set selected_variable_unit "" +} + +if { [exists_and_not_null selected_variable_id] } { + lappend where_clauses "le.variable_id = :selected_variable_id" +} + +if { [exists_and_not_null selected_user_id] } { + lappend where_clauses "submitter.user_id = :selected_user_id" +} + +if { [exists_and_not_null start_date_ansi] } { + lappend where_clauses "ao.creation_date >= to_date(:start_date_ansi,'YYYY-MM-DD')" +} + +if { [exists_and_not_null end_date_ansi] } { + lappend where_clauses "ao.creation_date <= to_date(:end_date_ansi,'YYYY-MM-DD')" +} + +set value_total "0" + +db_multirow -extend action_links entries select_entries " + select le.entry_id as id, + acs_permission.permission_p(le.entry_id, :user_id, 'delete') as delete_p, + le.time_stamp, + lv.name as variable_name, + le.value, + lv.unit, + le.description, + lp.name as project_name, + submitter.first_names || ' ' || submitter.last_name as user_name + from logger_entries le, + logger_variables lv, + logger_projects lp, + acs_objects ao, + cc_users submitter + where le.variable_id = lv.variable_id + and le.project_id = lp.project_id + and ao.object_id = le.entry_id + and ao.creation_user = submitter.user_id + [ad_decode $where_clauses "" "" "and [join $where_clauses "\n and "]"] + order by le.time_stamp desc, ao.creation_date desc +" { + set description_max_length 50 + if { [string length $description] > $description_max_length } { + set description "[string range $description 0 [expr $description_max_length - 4]]..." + } + + set action_links_list [list] + lappend action_links_list "display" + if { $delete_p } { + set onclick_script "return confirm('Are you sure you want to delete log entry with $value $unit $variable_name on $time_stamp?');" + lappend action_links_list "delete" + } + if { [llength $action_links_list] > 0 } { + set action_links "\[ [join $action_links_list " | "] \]" + } else { + set action_links "" + } + + set value_total [expr $value_total + $value] +} Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/logger/www/admin/projection-delete.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/logger/www/admin/projection.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/logger/www/admin/projection.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/logger/www/admin/set-primary-variable.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/logger/www/admin/unmap-variable-from-project.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/logger/www/admin/variable-delete.tcl'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/logger/www/lib/entries-table.adp'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/logger/www/lib/entries-table.tcl'. Fisheye: No comparison available. Pass `N' to diff?