Skip to content

Commit 8454233

Browse files
committed
Refresh the contact summary on popup submit
1 parent d966404 commit 8454233

File tree

3 files changed

+24
-14
lines changed

3 files changed

+24
-14
lines changed

contactinactive.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -145,15 +145,14 @@ function contactinactive_civicrm_alterSettingsFolders(&$metaDataFolders = NULL)
145145
}
146146

147147
function contactinactive_civicrm_summaryActions(&$actions, $contactId){
148-
149148
$actions['contactinactive'] = [
150149
'title' => 'Set to Inactive',
151150
'weight' => 999,
152151
'ref' => 'contact-inactive',
153152
'key' => 'contact-inactive',
154153
'href' => CRM_Utils_System::url('civicrm/contact/setinactive', "cid=$contactId"),
154+
'tab' => 'summary',
155155
];
156-
157156
}
158157

159158
function contactinactive_civicrm_searchTasks( $objectName, &$tasks ){

info.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
<url desc="Main Extension Page">https://github.com/systopia/de.systopia.contactinactive</url>
1313
<url desc="Licensing">http://www.gnu.org/licenses/agpl-3.0.html</url>
1414
</urls>
15-
<releaseDate>2017-06-23</releaseDate>
16-
<version>0.2.dev</version>
15+
<releaseDate>2017-07-04</releaseDate>
16+
<version>0.3.dev</version>
1717
<develStage>dev</develStage>
1818
<compatibility>
1919
<ver>4.6</ver>

templates/CRM/Contactinactive/Form/Set.tpl

+21-10
Original file line numberDiff line numberDiff line change
@@ -14,30 +14,41 @@
1414
+-------------------------------------------------------*}
1515

1616
<div class="crm-submit-buttons">
17-
{include file="CRM/common/formButtons.tpl" location="top"}
17+
{include file="CRM/common/formButtons.tpl" location="top"}
1818
</div>
1919

2020
<div class="crm-content">
2121
<div class="messages status no-popup">
2222
<i class="crm-i fa-exclamation-triangle"></i>&nbsp;
2323
{if $singleContact}
24-
Are you sure you want to set this contact to inactive?
24+
Are you sure you want to set this contact to inactive?
2525
</div>
2626
<div>All privacy options will be set
2727
{if !empty($activityTypeNames)}and activity types "{$activityTypeNames}" will be set to "Cancelled".{/if}</div>
28-
{else}
29-
Are you sure you want to set the selected contact(s) to inactive?
30-
</div>
28+
{else}
29+
Are you sure you want to set the selected contact(s) to inactive?
30+
</div>
3131
<div>All privacy options will be set
3232
{if !empty($activityTypeNames)}and activity types "{$activityTypeNames}" will be set to "Cancelled" {/if}for the selected contact(s).</div>
33-
{/if}
33+
{/if}
3434
</div>
3535

3636
{if !$singleContact}
37-
<table class="form-layout">
38-
<tr><td>{include file="CRM/Contact/Form/Task.tpl"}</td></tr>
39-
</table>
37+
<table class="form-layout">
38+
<tr><td>{include file="CRM/Contact/Form/Task.tpl"}</td></tr>
39+
</table>
4040
{/if}
4141
<div class="crm-submit-buttons">
42-
{include file="CRM/common/formButtons.tpl" location="bottom"}
42+
{include file="CRM/common/formButtons.tpl" location="bottom"}
4343
</div>
44+
45+
{literal}
46+
<script type="text/javascript">
47+
CRM.$(function($) {
48+
// Refresh the contact summary (No other method seems to work properly (eg.CRM.tabHeader.resetTab('#tab_summary') does not display correctly)
49+
$('#crm-main-content-wrapper').on('crmPopupFormSuccess', function() {
50+
window.location.reload();
51+
});
52+
});
53+
</script>
54+
{/literal}

0 commit comments

Comments
 (0)