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 -r1.14 -r1.15 --- openacs-4/contrib/packages/project-manager/www/add-edit.tcl 26 Jan 2004 15:39:40 -0000 1.14 +++ openacs-4/contrib/packages/project-manager/www/add-edit.tcl 26 Feb 2004 15:15:41 -0000 1.15 @@ -10,7 +10,6 @@ @return title Page title. } { - project_id:integer,optional {project_revision_id ""} {project_item_id ""} @@ -19,6 +18,7 @@ {parent_id ""} {goal ""} {description ""} + {customer_id ""} {planned_start_date ""} {planned_end_date ""} {deadline_scheduling ""} @@ -68,11 +68,11 @@ {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} @@ -84,6 +84,11 @@ {value $description} {html { rows 5 cols 40 wrap soft}}} + {customer_id:text(select),optional + {label "Customer"} + {options {{"--- TBD ---" ""} [db_list_of_lists get_customer "select o.name, o.organization_id from organizations o order by o.name"]}} + } + {planned_start_date:date,to_sql(linear_date) {label "Starts"} {format "MONTH DD YYYY"} @@ -154,18 +159,43 @@ } + + 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_id [project_manager::project::new \ + -project_name $project_name \ + -project_code $project_code \ + -parent_id $parent_id \ + -goal $goal \ + -description $description \ + -planned_start_date $planned_start_date \ + -planned_end_date $planned_end_date \ + -actual_start_date "" \ + -actual_end_date "" \ + -ongoing_p $ongoing_p \ + -status_id $status_id \ + -organization_id $customer_id \ + -creation_date "" \ + -creation_user $user_id \ + -creation_ip $peeraddr \ + -package_id $package_id + ] + set project_item_id [db_string get_item_id { }] - category::map_object -remove_old -object_id $project_item_id $category_ids + if {[exists_and_not_null category_ids]} { + category::map_object -remove_old -object_id $project_item_id $category_ids + } if {$use_project_customizations_p} { ad_returnredirect "add-edit-2?[export_url_vars project_item_id project_id]" @@ -177,18 +207,22 @@ } -edit_data { +ns_log Notice "edit" set project_id [db_exec_plsql new_project_revision { *SQL* }] project_manager::project::compute_parent_status $project_item_id category::map_object -remove_old -object_id $project_item_id $category_ids } -after_submit { - + +ns_log Notice "after_submit" if {$use_project_customizations_p} { ad_returnredirect "add-edit-2?[export_url_vars project_id]" ad_script_abort } else { ad_returnredirect "one?[export_url_vars project_id]" ad_script_abort } - } +} + +ns_log Notice "end of it all"