Index: openacs-4/packages/project-manager/lib/project-portlet.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/project-manager/lib/project-portlet.tcl,v
diff -u -r1.6 -r1.7
--- openacs-4/packages/project-manager/lib/project-portlet.tcl 6 Jul 2005 18:24:17 -0000 1.6
+++ openacs-4/packages/project-manager/lib/project-portlet.tcl 7 Jul 2005 00:19:47 -0000 1.7
@@ -28,6 +28,7 @@
set project(earliest_finish_date) [lc_time_fmt $project(earliest_finish_date) "%x"]
set project(latest_finish_date) [lc_time_fmt $project(latest_finish_date) "%x"]
set edit_url "[ad_conn package_url]add-edit?[export_url_vars project_item_id]"
+set variables(customer_id) $project(customer_id)
# ------------------
# Dynamic Attributes
@@ -38,7 +39,7 @@
lappend form_attributes [lindex $element 3]
}
-dtype::get_object -object_id $project_id -object_type pm_project -array dattr -exclude_static
+dtype::get_object -object_id $project_id -object_type pm_project -array dattr -exclude_static -dform project -variables [array get variables]
multirow create dynamic_attributes name value
if {[array exists dattr]} {
Index: openacs-4/packages/project-manager/lib/project-portlet.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/project-manager/lib/project-portlet.xql,v
diff -u -r1.3 -r1.4
--- openacs-4/packages/project-manager/lib/project-portlet.xql 5 Jun 2005 22:58:35 -0000 1.3
+++ openacs-4/packages/project-manager/lib/project-portlet.xql 7 Jul 2005 00:19:47 -0000 1.4
@@ -27,6 +27,7 @@
p.actual_hours_completed,
p.estimated_hours_total,
p.parent_id,
+ p.customer_id,
p.dform,
s.status_type,
acs_permission__permission_p (:project_id,:user_id,'write') as write_p,
Index: openacs-4/packages/project-manager/www/add-edit-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/project-manager/www/add-edit-postgresql.xql,v
diff -u -r1.4 -r1.5
--- openacs-4/packages/project-manager/www/add-edit-postgresql.xql 8 Jun 2005 20:54:20 -0000 1.4
+++ openacs-4/packages/project-manager/www/add-edit-postgresql.xql 7 Jul 2005 00:20:09 -0000 1.5
@@ -31,6 +31,14 @@
+
+
+ select customer_id
+ from pm_projects
+ where project_id = :project_id
+
+
+
SELECT
Index: openacs-4/packages/project-manager/www/add-edit.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/project-manager/www/add-edit.tcl,v
diff -u -r1.12 -r1.13
--- openacs-4/packages/project-manager/www/add-edit.tcl 21 Jun 2005 22:16:39 -0000 1.12
+++ openacs-4/packages/project-manager/www/add-edit.tcl 7 Jul 2005 00:20:09 -0000 1.13
@@ -11,7 +11,7 @@
} {
project_id:integer,optional
- {dform:optional "implicit"}
+ {dform:optional "project"}
{project_revision_id ""}
{project_item_id ""}
{project_name ""}
@@ -193,8 +193,16 @@
}
}
-dtype::form::add_elements -dform $dform -prefix pm -object_type pm_project -object_id [value_if_exists project_id] -form add_edit -exclude_static -cr_widget none
+if {[exists_and_not_null customer_id]} {
+ set dynamic_params(customer_id) $customer_id
+} elseif {[exists_and_not_null project_item_id]} {
+ set dynamic_params(customer_id) [db_string get_customer_id {}]
+} else {
+ set dynamic_params(customer_id) ""
+}
+dtype::form::add_elements -dform $dform -prefix pm -object_type pm_project -object_id [value_if_exists project_id] -form add_edit -exclude_static -cr_widget none -variables [array get dynamic_params]
+
ad_form -extend -name add_edit \
-new_request {