js cleanup
authorColeman Watts <coleman@civicrm.org>
Mon, 8 Jul 2013 04:11:33 +0000 (21:11 -0700)
committerColeman Watts <coleman@civicrm.org>
Mon, 8 Jul 2013 04:11:33 +0000 (21:11 -0700)
CRM/Profile/Form/Edit.php
js/crm.designerapp.js
js/view/crm.designer.js
templates/CRM/Profile/Form/Dynamic.tpl

index a18db50c9eeacdeef43f650665309e4a1c5e551b..2c13ae4c60ba84a5081a4ecbc6890bb12aedcdf7 100644 (file)
@@ -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,
       );
index a3001ac7f1d69724ea98bb94e113690d47698fe3..12559cde77ecec718fd910b16e35cced86c0e5a0 100644 (file)
@@ -1,4 +1,4 @@
-cj(document).ready(function($) {
+cj(function($) {
   /**
    * FIXME we depend on this being a global singleton, mainly to facilitate vents
    *
index e59c1d98e36c82e2cb81bf91f021f5000e23049d..9077eb39bf081c6d92ba7dd6b719c473e20fafea 100644 (file)
@@ -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
index e053b37917f233a054fcb836f998350acf7af5c5..ea1546762739fd0553ad0f11dd76d98d9dd47ee2 100644 (file)
@@ -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');
         }
       }