From abc8b55b6b376b2f82e21d0561f11c525b90782b Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Sun, 7 Jul 2013 21:11:33 -0700 Subject: [PATCH] js cleanup --- CRM/Profile/Form/Edit.php | 2 ++ js/crm.designerapp.js | 2 +- js/view/crm.designer.js | 2 +- templates/CRM/Profile/Form/Dynamic.tpl | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CRM/Profile/Form/Edit.php b/CRM/Profile/Form/Edit.php index a18db50c9e..2c13ae4c60 100644 --- a/CRM/Profile/Form/Edit.php +++ b/CRM/Profile/Form/Edit.php @@ -309,9 +309,11 @@ SELECT module // this is special case when we create contact using Dialog box if ($this->_context == 'dialog') { + $displayName = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Contact', $this->_id, 'display_name'); $sortName = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Contact', $this->_id, 'sort_name'); $returnArray = array( 'contactID' => $this->_id, + 'displayName' => $displayName, 'sortName' => $sortName, 'newContactSuccess' => TRUE, ); diff --git a/js/crm.designerapp.js b/js/crm.designerapp.js index a3001ac7f1..12559cde77 100644 --- a/js/crm.designerapp.js +++ b/js/crm.designerapp.js @@ -1,4 +1,4 @@ -cj(document).ready(function($) { +cj(function($) { /** * FIXME we depend on this being a global singleton, mainly to facilitate vents * diff --git a/js/view/crm.designer.js b/js/view/crm.designer.js index e59c1d98e3..9077eb39bf 100644 --- a/js/view/crm.designer.js +++ b/js/view/crm.designer.js @@ -20,7 +20,7 @@ result._collection = this.collection; result._options = this.options; return result; - } + }; /** * Display a dialog window with an editable form for a UFGroupModel diff --git a/templates/CRM/Profile/Form/Dynamic.tpl b/templates/CRM/Profile/Form/Dynamic.tpl index e053b37917..ea15467627 100644 --- a/templates/CRM/Profile/Form/Dynamic.tpl +++ b/templates/CRM/Profile/Form/Dynamic.tpl @@ -355,7 +355,7 @@ cj(document).ready(function(){ } } cj('input[name="' + prefix + 'contact_select_id[' + blockNo +']"]').val( response.contactID ); - CRM.alert(response.sortName + {/literal}'{ts escape="js"} has been created.{/ts}', '{ts escape="js"}Contact Saved{/ts}'{literal}, 'success'); + CRM.alert(response.displayName + {/literal}'{ts escape="js"} has been created.{/ts}', '{ts escape="js"}Contact Saved{/ts}'{literal}, 'success'); cj('#contact-dialog-' + prefix + blockNo ).dialog('close'); } } -- 2.25.1