Index: openacs-4/packages/contacts/www/contact.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/www/contact.tcl,v diff -u -r1.16 -r1.17 --- openacs-4/packages/contacts/www/contact.tcl 20 Jun 2005 16:48:36 -0000 1.16 +++ openacs-4/packages/contacts/www/contact.tcl 21 Jun 2005 12:24:53 -0000 1.17 @@ -18,61 +18,9 @@ set object_type [contact::type -party_id $party_id] set user_id [ad_conn user_id] -set package_id [ad_conn package_id] -set pm_package_id "" -# I don't think it is wise to rely on the "title" attribute to be -# displayed by the master template. Sadly there is no quick way to do -# this, so maybe if you still want to rely on this, you can make a -# parameter out of it? -set hidden_attributes [list] -#if { $object_type == "person" } { -# set hidden_attributes [list first_names last_name] -#} elseif { $object_type == "organization" } { -# set hidden_attributes [list name] -#} -# - -set groups_belonging_to [db_list get_party_groups { select group_id from group_distinct_member_map where member_id = :party_id }] -if { [lsearch $groups_belonging_to -2] < 0 } { - ad_return_error "[_ contacts.lt_This_users_has_not_be]" "[_ contacts.lt_This_user_is_awaiting]" -} -set ams_forms [list] -foreach group [contact::groups -expand "all" -privilege_required "read"] { - set group_id [lindex $group 1] - if { [lsearch $groups_belonging_to $group_id] >= 0 } { - lappend ams_forms "${package_id}__${group_id}" - } -} - -set revision_id [contact::live_revision -party_id $party_id] - -# This is the multirow that gets the values for each attribute -# If you map the categories you have to check for the group (which is -# passed along in the form_name) and see the mapped categories. Then you have to -# retrieve the values for the category and append them to the -# attributes multirow with a section heading (e.g. the name of the -# category tree) and the pretty_name of the category along with the -# value. - -multirow create attributes section attribute value -foreach form $ams_forms { - set values [ams::values -package_key "contacts" -object_type $object_type -list_name $form -object_id $revision_id -format "html"] - foreach {section attribute_name pretty_name value} $values { - if { [lsearch $hidden_attributes $attribute_name] < 0 } { - multirow append attributes $section $pretty_name $value - } - } -} -set append_list [list] -callback contact::append_attribute -multirow_name append_list -name [contact::name -party_id $party_id] -foreach append $append_list { - multirow append attributes [lindex $append 0] [lindex $append 1] [lindex $append 2] -} - set package_url [ad_conn package_url] -multirow create rels relationship contact contact_url attribute value # Code for quickly adding an employee @@ -82,22 +30,6 @@ set employee_url "" } -db_foreach get_relationships {} { - set contact_url [contact::url -party_id $other_party_id] - multirow append rels $role_singular $other_name $contact_url {} {} - - # NOT YET IMPLEMENTED - Checking to see if role_singular or role_plural is needed - - if { [ams::list::exists_p -package_key "contacts" -object_type ${rel_type} -list_name ${package_id}] } { - set details_list [ams::values -package_key "contacts" -object_type $rel_type -list_name $package_id -object_id $rel_id -format "text"] - if { [llength $details_list] > 0 } { - foreach {section attribute_name pretty_name value} $details_list { - multirow append rels $role_singular $other_name $contact_url $pretty_name $value - } - } - } -} - set live_revision [contact::live_revision -party_id $party_id] if { [exists_and_not_null live_revision] } { set update_date [db_string get_update_date { select to_char(publish_date,'Mon FMDD, YYYY at FMHH12:MIam') from cr_revisions where revision_id = :live_revision } -default {}] @@ -111,6 +43,7 @@ } # Get the linked projekt_id to display the subprojects if projects is installed +set pm_package_id "" if { [string is false [empty_string_p [info procs "::application_data_link::get_linked"]]] } {