Index: openacs-4/contrib/packages/project-manager/www/add-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/project-manager/www/Attic/add-edit.tcl,v diff -u -N -r1.12 -r1.12.2.1 --- openacs-4/contrib/packages/project-manager/www/add-edit.tcl 18 Sep 2003 23:33:54 -0000 1.12 +++ openacs-4/contrib/packages/project-manager/www/add-edit.tcl 4 Dec 2003 21:00:13 -0000 1.12.2.1 @@ -23,6 +23,7 @@ {planned_end_date ""} {deadline_scheduling ""} {ongoing_p ""} + {status_id ""} } -properties { @@ -58,87 +59,101 @@ } -ad_form -name add_edit -form { - project_id:key - - {parent_id:text(hidden) - {value $parent_id} +ad_form -name add_edit \ + -form { + project_id:key + + {parent_id:text(hidden) + {value $parent_id} + } + + {project_item_id:text(hidden) + {value $project_item_id} + } + + {project_name:text + {label "[set project_term] name"} + {value $project_name} + } + + {description:text(textarea),optional + {label "Description"} + {value $description} + {html { rows 5 cols 40 wrap soft}}} + + {planned_start_date:date,to_sql(linear_date) + {label "Starts"} + {format "MONTH DD YYYY"} + {value {[util::date acquire clock [clock scan $planned_start_date]]}} + {today} + {help} + } + + {planned_end_date:date,to_sql(linear_date) + {label "Deadline"} + {format "MONTH DD YYYY"} + {value {[util::date acquire clock [clock scan $planned_end_date]]}} + {today} + {help} + } + + {ongoing_p:text(select) + {label "Project is ongoing?"} + {options {{"No" "f"} {"Yes" "t"}} {value $ongoing_p}} + {help_text "If yes, then this project has no deadline"} + } + + {status_id:text(select) + {label "Status"} + {options {[db_list_of_lists get_status_codes { }]}} + } + } - {project_item_id:text(hidden) - {value $project_item_id} - } - {project_name:text - {label "[set project_term] name"} - {value $project_name} - } - - {description:text(textarea),optional - {label "Description"} - {value $description} - {html { rows 5 cols 40 wrap soft}}} - - {planned_start_date:date,to_sql(linear_date) - {label "Starts"} - {format "MONTH DD YYYY"} - {value {[util::date acquire clock [clock scan $planned_start_date]]}} - {today} - {help} - } - - {planned_end_date:date,to_sql(linear_date) - {label "Deadline"} - {format "MONTH DD YYYY"} - {value {[util::date acquire clock [clock scan $planned_end_date]]}} - {today} - {help} - } - - {ongoing_p:text(select) - {label "Project is ongoing?"} - {options {{"No" "f"} {"Yes" "t"}} {value $ongoing_p}} - {help_text "If yes, then this project has no deadline"} - } - -} -select_query_name project_query -on_submit { - - set user_id [ad_conn user_id] - set peeraddr [ad_conn peeraddr] - -} -new_data { - set project_id [db_exec_plsql new_project_item { *SQL* }] - set project_item_id [db_string get_item_id { }] - - ad_returnredirect "one?[export_url_vars project_item_id project_id]" - ad_script_abort - -} -edit_data { - - set project_id [db_exec_plsql new_project_revision { *SQL* }] - project_manager::project::compute_parent_status $project_item_id - -} -after_submit { - - ad_returnredirect "one?[export_url_vars project_id]" - ad_script_abort -} - if {$use_goal_p} { - ad_form -extend -name add_edit -form { - {goal:text(textarea),optional - {label "[set project_term] goal"} - {value $goal} - {html { rows 5 cols 40 wrap soft}}} - } + ad_form -extend -name add_edit \ + -form { + {goal:text(textarea),optional + {label "[set project_term] goal"} + {value $goal} + {html { rows 5 cols 40 wrap soft}}} + } } if {$use_project_code_p} { - ad_form -extend -name add_edit -form { - {project_code:text,optional - {label "[set project_term] code"} - {value $project_code} - } - } + ad_form -extend -name add_edit \ + -form { + {project_code:text,optional + {label "[set project_term] code"} + {value $project_code} + } + } } + + +ad_form -extend -name add_edit \ + -select_query_name project_query \ + -on_submit { + + set user_id [ad_conn user_id] + set peeraddr [ad_conn peeraddr] + + } -new_data { + set project_id [db_exec_plsql new_project_item { *SQL* }] + set project_item_id [db_string get_item_id { }] + + ad_returnredirect "one?[export_url_vars project_item_id project_id]" + ad_script_abort + + } -edit_data { + + set project_id [db_exec_plsql new_project_revision { *SQL* }] + project_manager::project::compute_parent_status $project_item_id + + } -after_submit { + + ad_returnredirect "one?[export_url_vars project_id]" + ad_script_abort + }