Index: openacs-4/packages/logger/www/admin/project.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/logger/www/admin/project.tcl,v
diff -u -r1.12 -r1.13
--- openacs-4/packages/logger/www/admin/project.tcl 27 Sep 2003 22:19:23 -0000 1.12
+++ openacs-4/packages/logger/www/admin/project.tcl 4 Jan 2004 17:24:38 -0000 1.13
@@ -117,6 +117,7 @@
ad_script_abort
}
+
if { $project_exists_p } {
# We are in edit or display mode
@@ -126,15 +127,89 @@
#
###########
- db_multirow variables variables_in_project {}
+ db_multirow -extend { display_url set_primary_url unmap_url } variables variables_in_project {} {
+ set display_url [export_vars -base variable { variable_id }]
+ set set_primary_url [export_vars -base set-primary-variable { variable_id project_id }]
+ set unmap_url [export_vars -base unmap-variable-from-project { variable_id project_id }]
+ }
- set n_can_be_mapped [db_string n_can_be_mapped {}]
-
###########
#
# Projections
#
###########
- db_multirow projections select_projections {}
+ db_multirow -extend { display_url start_date_pretty end_date_pretty value_pretty delete_url } projections select_projections {} {
+ set display_url [export_vars -base projection { projection_id }]
+ set start_date_pretty [lc_time_fmt $start_date_ansi "%x"]
+ set end_date_pretty [lc_time_fmt $end_date_ansi "%x"]
+ set value_pretty [lc_numeric $value]
+ set delete_url [export_vars -base projection-delete { projection_id }]
+ }
}
+
+template::list::create \
+ -name variables \
+ -actions [list "Add variable" [export_vars -base map-variable-to-project { project_id }] {}] \
+ -elements {
+ name {
+ label "Variable Name"
+ link_url_col display_url
+ }
+ unit {
+ label "Unit"
+ }
+ type {
+ label "Additive"
+ display_template {
+ YesNo
+ }
+ html { align center }
+ }
+ primary_p {
+ label "Primary"
+ display_template {
+ *
+ set
+ }
+ html { align center }
+ }
+ unmap {
+ label Unmap
+ link_url_col unmap_url
+ display_template {Unmap}
+ }
+ }
+
+
+template::list::create \
+ -name "projections" \
+ -actions [list "Create new projection" [export_vars -base projection { project_id }] {}] \
+ -elements {
+ name {
+ label "Projection Name"
+ link_url_col display_url
+ }
+ start_date_pretty {
+ label "Start"
+ }
+ end_date_pretty {
+ label "End"
+ }
+ variable_name {
+ label "Variable"
+ }
+ value_pretty {
+ label "Value"
+ html { align right }
+ }
+ delete {
+ sub_class narrow
+ display_template {
+
+
+ }
+ html { align center }
+ }
+ }