Index: openacs-4/packages/logger/lib/entries.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/logger/lib/entries.tcl,v diff -u -r1.7 -r1.8 --- openacs-4/packages/logger/lib/entries.tcl 11 Jan 2004 21:10:40 -0000 1.7 +++ openacs-4/packages/logger/lib/entries.tcl 14 Jan 2004 08:58:12 -0000 1.8 @@ -384,17 +384,16 @@ # We add a virtual column per category tree -set extend { edit_url delete_url delete_onclick time_stamp_pretty } +set extend { edit_url delete_url delete_onclick time_stamp_pretty edit_p delete_p } foreach id $tree_ids { lappend extend c_${id}_category_id } array set row_categories [list] +array set project_write_p [list] db_multirow -extend $extend -unclobber entries select_entries2 " select le.entry_id, - acs_permission__permission_p(le.entry_id, :current_user_id, 'delete') as delete_p, - acs_permission__permission_p(le.entry_id, :current_user_id, 'write') as edit_p, le.time_stamp, to_char(le.time_stamp, 'YYYY-MM-DD HH24:MI:SS') as time_stamp_ansi, to_char(le.time_stamp, 'IW-YYYY') as time_stamp_week, @@ -426,7 +425,11 @@ } else { set selected_p [string equal [ns_queryget entry_id] $entry_id] set edit_url [export_vars -base log { entry_id { edit t } { return_url [ad_return_url] } }] - set edit_p [ad_decode [expr [ad_decode $edit_p "t" 1 0] || ($user_id == [ad_conn user_id])] 1 "t" "f"] + if { ![exists_and_not_null project_write_p($project_id)] } { + set project_write_p($project_id) [template::util::is_true [permission::permission_p -object_id $project_id -privilege write]] + } + set edit_p [expr $project_write_p($project_id) || ($user_id == [ad_conn user_id])] + set delete_p $edit_p if { $delete_p } { set delete_onclick "return confirm('Are you sure you want to delete log entry with $value $variable(unit) $variable(name) on $time_stamp?');" set delete_url [export_vars -base log-delete { entry_id }] Index: openacs-4/packages/logger/lib/entries.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/logger/lib/entries.xql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/logger/lib/entries.xql 5 Jan 2004 20:54:25 -0000 1.2 +++ openacs-4/packages/logger/lib/entries.xql 14 Jan 2004 08:58:12 -0000 1.3 @@ -34,18 +34,13 @@ select lv.name || ' (' || lv.unit || ')' as name, - lv.variable_id as unique_id + lv.variable_id from logger_variables lv, - logger_projects lp, - logger_project_var_map lpvm - where lp.project_id = lpvm.project_id - and lv.variable_id = lpvm.variable_id - and exists (select 1 - from logger_project_pkg_map - where project_id = lp.project_id - and package_id = :package_id - ) - group by lv.variable_id, lv.name, lv.unit + logger_project_var_map lpvm, + logger_project_pkg_map lppm + where lppm.package_id = :package_id + and lpvm.project_id = lppm.project_id + and lv.variable_id = lpvm.variable_id Index: openacs-4/packages/logger/lib/projection.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/logger/lib/projection.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/logger/lib/projection.adp 5 Jan 2004 21:49:35 -0000 1.1 +++ openacs-4/packages/logger/lib/projection.adp 14 Jan 2004 08:58:12 -0000 1.2 @@ -2,8 +2,8 @@ Dates - @progress_time_pct@% + @progress_time_pct@%    @progress_days@/@total_days@ days @@ -16,12 +16,12 @@ @variable.name@ - @progress_value_pct@% + @progress_value_pct@% - @progress_value_pct@% + @progress_value_pct@% Index: openacs-4/packages/logger/lib/projection.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/logger/lib/projection.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/logger/lib/projection.tcl 5 Jan 2004 21:49:35 -0000 1.1 +++ openacs-4/packages/logger/lib/projection.tcl 14 Jan 2004 08:58:12 -0000 1.2 @@ -57,15 +57,22 @@ set progress_time [expr $time_stamp_epoch - $start_time_epoch] set total_days [expr $total_time / (60*60*24) + 1] -set progress_days [expr $progress_time / (60*60*24)] +set progress_days [expr $progress_time / (60*60*24) + 1] set progress_time_pct [expr round($progress_time*100.0 / $total_time)] set progress_time_pct_inverse [expr 100-$progress_time_pct] + # Calculate percentage of value spent set progress_value_pct [expr round($total_value*100.0 / $projected_value)] -set progress_value_pct_inverse [expr 100-$progress_value_pct] +set progress_value_pct_inverse [expr (100-$progress_value_pct)] + set total_value_pretty [lc_numeric $total_value] set projected_value_pretty [lc_numeric $projected_value] + +set progress_time_pct2 [expr $progress_time_pct * 2] +set progress_time_pct_inverse2 [expr $progress_time_pct_inverse * 2] +set progress_value_pct2 [expr $progress_value_pct * 2] +set progress_value_pct_inverse2 [expr $progress_value_pct_inverse * 2] Index: openacs-4/packages/logger/www/log.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/logger/www/log.tcl,v diff -u -r1.15 -r1.16 --- openacs-4/packages/logger/www/log.tcl 11 Jan 2004 21:28:36 -0000 1.15 +++ openacs-4/packages/logger/www/log.tcl 14 Jan 2004 08:58:12 -0000 1.16 @@ -172,8 +172,8 @@ ad_form -extend -name log_entry_form -select_query_name select_logger_entries -validate { {value - { [regexp {^([0-9]{1,6}|[0-9]{0,6}\.[0-9]{0,2})$} $value] } - {The value may not contain more than two decimals and must be between 0 and 999999.99} + { [regexp {^-?([0-9]{1,6}|[0-9]{0,6}\.[0-9]{0,2})$} $value] } + {The value may not contain more than two decimals and must be between -999999.99 and 999999.99} } } -new_request { # Get the date of the last entry