Index: openacs-4/packages/contacts/lib/contact-complaint-form.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/lib/contact-complaint-form.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/contacts/lib/contact-complaint-form.tcl 11 Aug 2005 08:27:58 -0000 1.4 +++ openacs-4/packages/contacts/lib/contact-complaint-form.tcl 11 Aug 2005 14:14:58 -0000 1.5 @@ -78,29 +78,12 @@ } } -if { ![info exist project_id] } { - set project_options [list] - db_foreach get_projects { } { - set project_name [pm::project::name -project_item_id $project_item_id] - lappend project_options [list $project_name $project_item_id] +ad_form -extend -name complaint_form -form { + {object_id:text(hidden) } - ad_form -extend -name complaint_form -form { - {object_id:text(select) - {label "[_ contacts.Project]"} - {options $project_options} - } + {project:text(inform) + {label "[_ contacts.Object]"} } -} else { - set object_id $project_id - ad_form -extend -name complaint_form -form { - {object_id:text(hidden) - {value $object_id} - } - {project:text(inform) - {label "[_ contacts.Object]"} - {value "[pm::project::name -project_item_id $object_id]"} - } - } } ad_form -extend -name complaint_form -form { @@ -110,7 +93,7 @@ {help_text "[_ contacts.complaint_paid_help]"} } - {status:text(select) + {state:text(select) {label "[_ contacts.Status]"} {options { { [_ contacts.open] open } { [_ contacts.valid] valid } { [_ contacts.invalid] invalid } }} {help_text "[_ contacts.complaint_status_help]"} @@ -136,8 +119,10 @@ -description $description \ -supplier_id $supplier_id \ -paid $paid \ - -object_id $object_id + -object_id $object_id \ + -state $state + } -edit_data { contact::complaint::new \ @@ -149,11 +134,16 @@ -description $description \ -supplier_id $supplier_id \ -paid $paid \ - -object_id $object_id + -object_id $object_id \ + -state $state + +} -new_request { + set project "[pm::project::name -project_item_id $object_id]" } -edit_request { db_1row get_revision_info { } + set project "[pm::project::name -project_item_id $object_id]" } -after_submit { ad_returnredirect $return_url Index: openacs-4/packages/contacts/lib/contact-complaint-list.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/lib/contact-complaint-list.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/contacts/lib/contact-complaint-list.xql 8 Aug 2005 21:50:57 -0000 1.1 +++ openacs-4/packages/contacts/lib/contact-complaint-list.xql 11 Aug 2005 14:14:58 -0000 1.2 @@ -5,11 +5,11 @@ select - * + cct.* from - contact_complaint_tracking + contact_complaint_tracking cct, cr_items ci where - 1 = 1 + ci.latest_revision = cct.complaint_id [template::list::filter_where_clauses -and -name complaint] Index: openacs-4/packages/contacts/www/complaint-ae.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/www/complaint-ae.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/contacts/www/complaint-ae.tcl 11 Aug 2005 08:24:53 -0000 1.2 +++ openacs-4/packages/contacts/www/complaint-ae.tcl 11 Aug 2005 14:14:58 -0000 1.3 @@ -9,6 +9,7 @@ {supplier_id:integer} {customer_id ""} {project_id ""} + {object_id ""} } -validate { contact_exists -requires {party_id} { if { ![contact::exists_p -party_id $party_id] } { @@ -21,6 +22,7 @@ if {[empty_string_p $customer_id]} { set customer_id [db_string get_customer_id "select customer_id from pm_projectsx where item_id = :project_id"] } + set object_id $project_id } ad_return_template