Skip to content

Commit

Permalink
Refresh the contact summary on popup submit
Browse files Browse the repository at this point in the history
  • Loading branch information
mattwire committed Jul 4, 2017
1 parent d966404 commit 8454233
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 14 deletions.
3 changes: 1 addition & 2 deletions contactinactive.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,15 +145,14 @@ function contactinactive_civicrm_alterSettingsFolders(&$metaDataFolders = NULL)
}

function contactinactive_civicrm_summaryActions(&$actions, $contactId){

$actions['contactinactive'] = [
'title' => 'Set to Inactive',
'weight' => 999,
'ref' => 'contact-inactive',
'key' => 'contact-inactive',
'href' => CRM_Utils_System::url('civicrm/contact/setinactive', "cid=$contactId"),
'tab' => 'summary',
];

}

function contactinactive_civicrm_searchTasks( $objectName, &$tasks ){
Expand Down
4 changes: 2 additions & 2 deletions info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
<url desc="Main Extension Page">https://github.com/systopia/de.systopia.contactinactive</url>
<url desc="Licensing">http://www.gnu.org/licenses/agpl-3.0.html</url>
</urls>
<releaseDate>2017-06-23</releaseDate>
<version>0.2.dev</version>
<releaseDate>2017-07-04</releaseDate>
<version>0.3.dev</version>
<develStage>dev</develStage>
<compatibility>
<ver>4.6</ver>
Expand Down
31 changes: 21 additions & 10 deletions templates/CRM/Contactinactive/Form/Set.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -14,30 +14,41 @@
+-------------------------------------------------------*}

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

<div class="crm-content">
<div class="messages status no-popup">
<i class="crm-i fa-exclamation-triangle"></i>&nbsp;
{if $singleContact}
Are you sure you want to set this contact to inactive?
Are you sure you want to set this contact to inactive?
</div>
<div>All privacy options will be set
{if !empty($activityTypeNames)}and activity types "{$activityTypeNames}" will be set to "Cancelled".{/if}</div>
{else}
Are you sure you want to set the selected contact(s) to inactive?
</div>
{else}
Are you sure you want to set the selected contact(s) to inactive?
</div>
<div>All privacy options will be set
{if !empty($activityTypeNames)}and activity types "{$activityTypeNames}" will be set to "Cancelled" {/if}for the selected contact(s).</div>
{/if}
{/if}
</div>

{if !$singleContact}
<table class="form-layout">
<tr><td>{include file="CRM/Contact/Form/Task.tpl"}</td></tr>
</table>
<table class="form-layout">
<tr><td>{include file="CRM/Contact/Form/Task.tpl"}</td></tr>
</table>
{/if}
<div class="crm-submit-buttons">
{include file="CRM/common/formButtons.tpl" location="bottom"}
{include file="CRM/common/formButtons.tpl" location="bottom"}
</div>

{literal}
<script type="text/javascript">
CRM.$(function($) {
// Refresh the contact summary (No other method seems to work properly (eg.CRM.tabHeader.resetTab('#tab_summary') does not display correctly)
$('#crm-main-content-wrapper').on('crmPopupFormSuccess', function() {
window.location.reload();
});
});
</script>
{/literal}

0 comments on commit 8454233

Please sign in to comment.