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.52 -r1.53 --- openacs-4/packages/contacts/tcl/contacts-procs.tcl 27 Dec 2005 21:50:54 -0000 1.52 +++ openacs-4/packages/contacts/tcl/contacts-procs.tcl 29 Dec 2005 14:19:14 -0000 1.53 @@ -66,6 +66,17 @@ return [lindex [split $filename "."] end] } +ad_proc -private contact::util::update_person_attributes { +} { + Updates the person attributes first_names, last_name, email for people who have not been entered using contacts +} { + db_foreach persons {select latest_revision as object_id, first_names, last_name, email from persons, parties,cr_items where person_id = party_id and person_id = item_id} { + ams::attribute::save::text -object_id $object_id -attribute_name "first_names" -value "$first_names" -object_type "person" + ams::attribute::save::text -object_id $object_id -attribute_name "last_name" -value "$last_name" -object_type "person" + ams::attribute::save::text -object_id $object_id -attribute_name "email" -value "$email" -object_type "person" + } +} + ad_proc -public contact::util::get_employees { {-organization_id:required} } { @@ -237,6 +248,7 @@ ns_log notice "The ID specified does not belong to an employee" return } + set employee_rev_id [content::item::get_best_revision -item_id $employee_id] # Get employers, if any set employers [list] @@ -259,7 +271,6 @@ set employer_exist_p 1 } # Get best/last revision - set employee_rev_id [content::item::get_best_revision -item_id $employee_id] set employer_id [lindex $employer 0] set employer_rev_id [content::item::get_best_revision -item_id $employer_id] } @@ -863,4 +874,5 @@ } else { return [array get return_array] } -} \ No newline at end of file +} +