Index: openacs-4/packages/contacts/tcl/contacts-callback-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/tcl/contacts-callback-procs.tcl,v
diff -u -r1.50 -r1.51
--- openacs-4/packages/contacts/tcl/contacts-callback-procs.tcl	25 Nov 2006 16:28:05 -0000	1.50
+++ openacs-4/packages/contacts/tcl/contacts-callback-procs.tcl	13 Dec 2006 13:03:53 -0000	1.51
@@ -405,6 +405,7 @@
 
     if {[empty_string_p $project_id]} {
 	# no project -> mail to all organization contacts
+
 	# If we have a setup where .LRN provides the community
 	# And we just hope the community is linked to an organization
 	if {[apm_package_installed_p dotlrn]} {
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.100 -r1.101
--- openacs-4/packages/contacts/tcl/contacts-procs.tcl	15 Nov 2006 13:13:04 -0000	1.100
+++ openacs-4/packages/contacts/tcl/contacts-procs.tcl	13 Dec 2006 13:03:53 -0000	1.101
@@ -320,6 +320,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 -private contact::util::generate_filename {
     {-title:required}
     {-extension:required}
Index: openacs-4/packages/contacts/www/admin/index.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/www/admin/index.adp,v
diff -u -r1.10 -r1.11
--- openacs-4/packages/contacts/www/admin/index.adp	30 Jun 2006 16:22:21 -0000	1.10
+++ openacs-4/packages/contacts/www/admin/index.adp	13 Dec 2006 13:03:53 -0000	1.11
@@ -8,6 +8,8 @@
 <a href="permissions" class="button">#contacts.lt_Instance_Permissions_#</a>
 <a href="@parameter_url@" class="button">#acs-subsite.Parameters#</a>
 <a href="ext-search-options" class="button">#contacts.Extended_search_opt#</a>
+<if @populate_url@ ne ""><a href="@populate_url@" class="button">#contacts.Populate_CRM#</a></if>
+
 </p>
 <h1>#contacts.READ_THESE#</h1>
 <ul>
Index: openacs-4/packages/contacts/www/admin/index.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/contacts/www/admin/index.tcl,v
diff -u -r1.12 -r1.13
--- openacs-4/packages/contacts/www/admin/index.tcl	1 Nov 2006 09:12:15 -0000	1.12
+++ openacs-4/packages/contacts/www/admin/index.tcl	13 Dec 2006 13:03:53 -0000	1.13
@@ -150,3 +150,8 @@
 
 
 ad_return_template
+if {[attribute::id -object_type "organization" -attribute_name "short_name"] eq ""} {
+    set populate_url [export_vars -base "populate" -url {{populate_type "crm"}}]
+} else {
+    set populate_url ""
+}
\ No newline at end of file