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.5 -r1.6
--- openacs-4/packages/contacts/lib/contact-complaint-form.tcl 11 Aug 2005 14:14:58 -0000 1.5
+++ openacs-4/packages/contacts/lib/contact-complaint-form.tcl 14 Sep 2005 16:37:19 -0000 1.6
@@ -44,6 +44,9 @@
db_foreach get_users { } {
lappend user_options [list $fullname $user_id]
}
+ db_foreach get_groups { } {
+ lappend user_options [list $name $group_id]
+ }
ad_form -extend -name complaint_form -form {
{supplier_id:text(select)
{label "[_ contacts.Supplier]"}
Index: openacs-4/packages/contacts/lib/contact-complaint-form.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/lib/contact-complaint-form.xql,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/contacts/lib/contact-complaint-form.xql 8 Aug 2005 21:50:57 -0000 1.1
+++ openacs-4/packages/contacts/lib/contact-complaint-form.xql 14 Sep 2005 16:37:19 -0000 1.2
@@ -14,6 +14,18 @@
+
+
+ select
+ group_id,
+ group_name
+ from
+ groups
+ order by
+ group_name asc
+
+
+
select
Index: openacs-4/packages/contacts/tcl/contacts-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/tcl/contacts-procs.tcl,v
diff -u -r1.27 -r1.28
--- openacs-4/packages/contacts/tcl/contacts-procs.tcl 24 Aug 2005 10:50:07 -0000 1.27
+++ openacs-4/packages/contacts/tcl/contacts-procs.tcl 14 Sep 2005 16:43:35 -0000 1.28
@@ -113,9 +113,15 @@
if {[contact::person_p -party_id $party_id]} {
return [person::name -person_id $party_id]
} else {
- # if there is an org the name is returned otherwise null is
- # returned
- return [db_string get_org_name {select name from organizations where organization_id = :party_id} -default {}]
+ # if there is an org the name is returned otherwise we search for a grou,
+ # if there is no group null is returned
+ set name [db_string get_org_name {select name from organizations where organization_id = :party_id} -default ""]
+ if { [empty_string_p $name] } {
+ set name [db_string get_group_name {select group_name from groups where group_id = :party_id} -default {}]
+ } else {
+ return $name
+ }
+
}
}