}
}
- 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('&', '&', $this->_postURL);
$this->_cancelURL = str_replace('&', '&', $this->_cancelURL);
// 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') {
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);
$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 {
{* 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>