CRM-14400
authorPratik Joshi <pratik.joshi@webaccess.co.in>
Fri, 28 Mar 2014 09:14:42 +0000 (14:44 +0530)
committerPratik Joshi <pratik.joshi@webaccess.co.in>
Fri, 28 Mar 2014 13:26:04 +0000 (18:56 +0530)
CRM/Profile/Form/Edit.php
CRM/Profile/Page/MultipleRecordFieldsListing.php
templates/CRM/Profile/Form/Dynamic.tpl

index 0ff19796b3968dce986257f1c17582cbcdc51984..4c5289b4f8cd7d513997391f107bcfa6d1367f34 100644 (file)
@@ -203,30 +203,6 @@ SELECT module
         }
       }
 
-      if ($this->_multiRecordProfile) {
-        $urlParams = "reset=1&id={$this->_id}&gid={$gidString}";
-
-        // get checksum if present
-        if ($this->get('cs')) {
-          $urlParams .= "&cs=" . $this->get('cs');
-        }
-        $this->_postURL = CRM_Utils_System::url('civicrm/profile/edit', $urlParams);
-        $this->_cancelURL = CRM_Utils_System::url('civicrm/profile/edit', $urlParams);
-
-        //passing the post url to template so the popup form does
-        //proper redirection and proccess form errors if any
-        if (!isset($this->_onPopupClose) || $this->_onPopupClose == 'redirectToProfile') {
-          $popupRedirect = CRM_Utils_System::url('civicrm/profile/edit', $urlParams, FALSE, NULL, FALSE);
-        }
-        elseif ($this->_onPopupClose == 'redirectToTab') {
-          $popupRedirect = CRM_Utils_System::url('civicrm/contact/view',
-            "reset=1&cid={$this->_id}&selectedChild=custom_{$this->_customGroupId}", FALSE, NULL, FALSE);
-        }
-
-        $this->assign('urlParams', $urlParams);
-        $this->assign('postUrl', $popupRedirect);
-      }
-
       // we do this gross hack since qf also does entity replacement
       $this->_postURL = str_replace('&amp;', '&', $this->_postURL);
       $this->_cancelURL = str_replace('&amp;', '&', $this->_cancelURL);
index 316edbc0f2f2693df42e6015c015678e64c13e5b..2631801728c51a2d818e84a46a1a1b053f2aca18 100644 (file)
@@ -96,13 +96,13 @@ class CRM_Profile_Page_MultipleRecordFieldsListing extends CRM_Core_Page_Basic {
       // urls and queryStrings
       if ($this->_pageViewType == 'profileDataView') {
         $links[CRM_Core_Action::VIEW]['url'] = 'civicrm/profile/view';
-        $links[CRM_Core_Action::VIEW]['qs'] = "reset=1&id=%%id%%&recordId=%%recordId%%&gid=%%gid%%&multiRecord={$view}&context=multiProfileDialog&onPopupClose=%%onPopupClose%%";
+        $links[CRM_Core_Action::VIEW]['qs'] = "reset=1&id=%%id%%&recordId=%%recordId%%&gid=%%gid%%&multiRecord={$view}";
 
         $links[CRM_Core_Action::UPDATE]['url'] = 'civicrm/profile/edit';
-        $links[CRM_Core_Action::UPDATE]['qs'] = "reset=1&id=%%id%%&recordId=%%recordId%%&gid=%%gid%%&multiRecord={$update}&context=multiProfileDialog&onPopupClose=%%onPopupClose%%";
+        $links[CRM_Core_Action::UPDATE]['qs'] = "reset=1&id=%%id%%&recordId=%%recordId%%&gid=%%gid%%&multiRecord={$update}";
 
         $links[CRM_Core_Action::DELETE]['url'] = 'civicrm/profile/edit';
-        $links[CRM_Core_Action::DELETE]['qs'] = "reset=1&id=%%id%%&recordId=%%recordId%%&gid=%%gid%%&multiRecord={$delete}&context=multiProfileDialog&onPopupClose=%%onPopupClose%%";
+        $links[CRM_Core_Action::DELETE]['qs'] = "reset=1&id=%%id%%&recordId=%%recordId%%&gid=%%gid%%&multiRecord={$delete}";
 
       }
       elseif ($this->_pageViewType == 'customDataView') {
@@ -143,7 +143,6 @@ class CRM_Profile_Page_MultipleRecordFieldsListing extends CRM_Core_Page_Basic {
   function run() {
     // get the requested action, default to 'browse'
     $action = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE, FALSE);
-    $this->_onPopupClose = CRM_Utils_Request::retrieve('onPopupClose', 'String', $this);
 
     // assign vars to templates
     $this->assign('action', $action);
@@ -305,7 +304,7 @@ class CRM_Profile_Page_MultipleRecordFieldsListing extends CRM_Core_Page_Basic {
               $op = NULL;
               if ($this->_pageViewType == 'profileDataView') {
                 $actionParams = array('recordId' => $recId, 'gid' => $this->_profileId,
-                  'id' => $this->_contactId, 'onPopupClose' => $this->_onPopupClose);
+                  'id' => $this->_contactId);
                 $op = 'profile.multiValue.row';
               }
               else {
index 9907249f859ba27d8b078af1640505e6440c96f0..83565003632684dbe30c49423b11d274d958e672 100644 (file)
 
 {* Profile forms when embedded in CMS account create (mode=1) or
     cms account edit (mode=8) or civicrm/profile (mode=4) pages *}
-{if ($context eq 'multiProfileDialog')}
-{literal}
-<script type="text/javascript">
-cj(function($) {
-  $('#profile-dialog .crm-container-snippet #Edit').validate(CRM.validate.params);
-  var formOptions = {
-    success:       checkResponse  // post-submit callback 
-  };
-
-  //binding the callback to snippet profile form
-  $('.crm-container-snippet #Edit').ajaxForm(formOptions);
-});
-
-// post-submit callback 
-function checkResponse(responseText, statusText, xhr, $form) { 
-  //if there is any form error show the dialog
-  //else redirect to post url
-  if (!cj(responseText).find('.crm-error').html()) {
-    window.location.href = '{/literal}{$postUrl}{literal}';
-  }
-} 
-</script>
-{/literal}
-{include file="CRM/Form/validate.tpl"}
-{/if}
 {if $deleteRecord}
 <div class="messages status no-popup">
   <div class="icon inform-icon"></div>&nbsp;