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.95 -r1.96 --- openacs-4/packages/contacts/tcl/contacts-procs.tcl 8 Sep 2006 13:45:33 -0000 1.95 +++ openacs-4/packages/contacts/tcl/contacts-procs.tcl 28 Oct 2006 16:51:14 -0000 1.96 @@ -92,13 +92,15 @@ by contacts (ones created by contacts automatically get associated item_id and live_revisions. } { + + set package_id [lindex [apm_package_id_from_key "contacts"] 0] db_foreach get_persons_without_items {} { ns_log notice "contacts::sweeper creating content_item and content_revision for party_id: $person_id" - contact::revision::new -party_id $person_id + contact::revision::new -party_id $person_id -package_id $package_id } db_foreach get_organizations_without_items {} { ns_log notice "contacts::sweeper creating content_item and content_revision for organization_id: $organization_id" - contact::revision::new -party_id $organization_id + contact::revision::new -party_id $organization_id -package_id $package_id } if { ![info exists person_id] && ![info exists organization_id] } { ns_log Debug "contacts::create_revisions_sweeper no person or organization objects exist that do not have associated content_items" @@ -314,6 +316,14 @@ } +ad_proc -public contact::util::get_account_manager { + {-organization_id:required} +} { + get the account manager's party_id for an organization +} { + return [db_list account_id "select object_id_one from acs_rels where rel_type='contact_rels_am' and object_id_two = :organization_id"] +} + ad_proc -public contact::util::get_ams_list_ids { {-user_id ""} {-package_id ""}