From a801aa5c52e2aa13c2866aea3470b9366a7e6a5b Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Sat, 29 Mar 2014 10:59:47 -0400 Subject: [PATCH] CRM-14327 - Cleanup custom delete links --- .../Page/MultipleRecordFieldsListing.php | 11 ++-- .../CRM/Contact/Page/View/CustomData.tpl | 52 ++++++------------- .../Page/MultipleRecordFieldsListing.tpl | 2 +- 3 files changed, 26 insertions(+), 39 deletions(-) diff --git a/CRM/Profile/Page/MultipleRecordFieldsListing.php b/CRM/Profile/Page/MultipleRecordFieldsListing.php index 2631801728..139a837f19 100644 --- a/CRM/Profile/Page/MultipleRecordFieldsListing.php +++ b/CRM/Profile/Page/MultipleRecordFieldsListing.php @@ -317,10 +317,15 @@ class CRM_Profile_Page_MultipleRecordFieldsListing extends CRM_Core_Page_Basic { $actionParams['newCgCount'] = $newCgCount; // DELETE action links - $redirectUrl = CRM_Core_Session::singleton()->readUserContext(); + $deleteData = array( + 'valueID' => $recId, + 'groupID' => $this->_customGroupId, + 'contactId' => $this->_contactId, + 'key' => CRM_Core_Key::get('civicrm/ajax/customvalue'), + ); $links[CRM_Core_Action::DELETE]['url'] = '#'; - $links[CRM_Core_Action::DELETE]['extra'] = " onclick=' var ru = \"{$redirectUrl}\"; showDeleteInDialog({$recId}, {$this->_customGroupId}, {$this->_contactId}, ru)' "; - $links[CRM_Core_Action::DELETE]['class'] = 'ignore-jshref'; + $links[CRM_Core_Action::DELETE]['extra'] = ' data-delete_params="'. htmlspecialchars(json_encode($deleteData)) .'"'; + $links[CRM_Core_Action::DELETE]['class'] = 'delete-custom-row'; } if (!empty($pageCheckSum)) { $actionParams['cs'] = $pageCheckSum; diff --git a/templates/CRM/Contact/Page/View/CustomData.tpl b/templates/CRM/Contact/Page/View/CustomData.tpl index 7de9712ee7..345a656d45 100644 --- a/templates/CRM/Contact/Page/View/CustomData.tpl +++ b/templates/CRM/Contact/Page/View/CustomData.tpl @@ -31,41 +31,23 @@ {include file='CRM/Profile/Page/MultipleRecordFieldsListing.tpl' showListing=1 dontShowTitle=1 pageViewType='customDataView'} {literal} {/literal} {else} @@ -93,4 +75,4 @@ on_load_init_blocks(showBlocks, hideBlocks); {/if} -{/if} \ No newline at end of file +{/if} diff --git a/templates/CRM/Profile/Page/MultipleRecordFieldsListing.tpl b/templates/CRM/Profile/Page/MultipleRecordFieldsListing.tpl index d3805b5cd8..70805bf7b5 100644 --- a/templates/CRM/Profile/Page/MultipleRecordFieldsListing.tpl +++ b/templates/CRM/Profile/Page/MultipleRecordFieldsListing.tpl @@ -32,7 +32,7 @@ {/if} {if $records and $headers} {include file="CRM/common/jsortable.tpl"} -
+
{strip} -- 2.25.1