Index: openacs-4/packages/contacts/www/contact-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/www/contact-edit.tcl,v diff -u -r1.8 -r1.9 --- openacs-4/packages/contacts/www/contact-edit.tcl 1 Jul 2005 00:36:10 -0000 1.8 +++ openacs-4/packages/contacts/www/contact-edit.tcl 6 Jul 2005 23:40:25 -0000 1.9 @@ -17,19 +17,13 @@ set object_type [contact::type -party_id $party_id] -#set attach_url [attachments::add_attachment_url \ -# -object_id $party_id \ -# -return_url [contact::url -party_id $party_id] \ -# -pretty_name [contact::name -party_id $party_id]] +if { $object_type == "user" } { + set object_type "person" +} - - -set object_type [contact::type -party_id $party_id] set user_id [ad_conn user_id] set package_id [ad_conn package_id] -# set form_elements [ams::ad_form::elements -package_key "contacts" -object_type $object_type -list_name "${object_type}_[ad_conn package_id]" -key party_id] - set groups_belonging_to [db_list get_party_groups { select group_id from group_distinct_member_map where member_id = :party_id }] set form_elements {party_id:key} Index: openacs-4/packages/contacts/www/contact-rels.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/www/contact-rels.tcl,v diff -u -r1.12 -r1.13 --- openacs-4/packages/contacts/www/contact-rels.tcl 19 Jun 2005 09:07:04 -0000 1.12 +++ openacs-4/packages/contacts/www/contact-rels.tcl 6 Jul 2005 23:40:25 -0000 1.13 @@ -27,6 +27,9 @@ } set contact_type [contact::type -party_id $party_id] +if { $contact_type == "user" } { + set contact_type "person" +} set contact_name [contact::name -party_id $party_id] set contact_url [contact::url -party_id $party_id] Index: openacs-4/packages/contacts/www/group-parties-add.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/www/group-parties-add.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/contacts/www/group-parties-add.tcl 28 Jun 2005 19:13:26 -0000 1.4 +++ openacs-4/packages/contacts/www/group-parties-add.tcl 6 Jul 2005 23:40:25 -0000 1.5 @@ -67,7 +67,7 @@ foreach party_id $party_ids { switch [contact::type -party_id $party_id] { - person { + person - user { set rel_type "membership_rel" } organization { Index: openacs-4/packages/contacts/www/group-party.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/www/group-party.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/contacts/www/group-party.tcl 18 May 2005 16:45:50 -0000 1.1 +++ openacs-4/packages/contacts/www/group-party.tcl 6 Jul 2005 23:40:25 -0000 1.2 @@ -61,7 +61,7 @@ foreach party_id $party_ids { # relation_add verifies that they aren't already in the group switch [contact::type -party_id $party_id] { - person { + person - user { set rel_type "membership_rel" } organization { Index: openacs-4/packages/contacts/www/message-action.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/www/message-action.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/contacts/www/message-action.tcl 30 Jun 2005 00:07:49 -0000 1.1 +++ openacs-4/packages/contacts/www/message-action.tcl 6 Jul 2005 23:40:25 -0000 1.2 @@ -39,7 +39,7 @@ } owner_valid -requires {owner_id} { if { [exists_and_not_null owner_id] } { - if { $owner_id == [ad_conn package_id] || ( [contact::exists_p -party_id $owner_id] && [contact::type -party_id $owner_id] == "person" ) } { + if { $owner_id == [ad_conn package_id] || ( [contact::exists_p -party_id $owner_id] && [lsearch [list person user] [contact::type -party_id $owner_id]] >= 0 ) } { } else { ad_complain [_ contacts.The_owner_id_specified_is_not_valid] } Index: openacs-4/packages/contacts/www/relationship-add.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/www/relationship-add.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/contacts/www/relationship-add.tcl 7 Jun 2005 07:45:40 -0000 1.4 +++ openacs-4/packages/contacts/www/relationship-add.tcl 6 Jul 2005 23:40:25 -0000 1.5 @@ -40,7 +40,13 @@ set contact_name_one [contact::name -party_id $party_id] set contact_name_two [contact::name -party_id $party_two] set contact_type_one [contact::type -party_id $party_id] +if { $contact_type_one == "user" } { + set contact_type_one "person" +} set contact_type_two [contact::type -party_id $party_two] +if { $contact_type_two == "user" } { + set contact_type_two "person" +} set secondary_role_pretty [db_string get_secondary_role_pretty {}] if { ![exists_and_not_null rel_type] } { set options_list [db_list_of_lists get_rel_types {}] Index: openacs-4/packages/contacts/www/search-action.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/www/search-action.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/contacts/www/search-action.tcl 14 Jun 2005 06:51:54 -0000 1.2 +++ openacs-4/packages/contacts/www/search-action.tcl 6 Jul 2005 23:40:25 -0000 1.3 @@ -39,7 +39,7 @@ } owner_valid -requires {owner_id} { if { [exists_and_not_null owner_id] } { - if { $owner_id == [ad_conn package_id] || ( [contact::exists_p -party_id $owner_id] && [contact::type -party_id $owner_id] == "person" ) } { + if { $owner_id == [ad_conn package_id] || ( [contact::exists_p -party_id $owner_id] && [lsearch [list person user] [contact::type -party_id $owner_id]] >= 0 ) } { } else { ad_complain [_ contacts.The_owner_id_specified_is_not_valid] }