->addScriptFile('civicrm', 'templates/CRM/Contact/Page/View/Summary.js')
->addScriptFile('civicrm', 'packages/jquery/plugins/jstree/jquery.jstree.js', 0, 'html-header', FALSE)
->addStyleFile('civicrm', 'packages/jquery/plugins/jstree/themes/default/style.css', 0, 'html-header')
- ->addSetting(array('summaryPrint' => array('mode' => $this->_print)));
+ ->addScriptFile('civicrm', 'templates/CRM/common/TabHeader.js')
+ ->addSetting(array(
+ 'summaryPrint' => array('mode' => $this->_print),
+ 'tabSettings' => array('active' => CRM_Utils_Request::retrieve('selectedChild', 'String', $this, FALSE, 'summary')),
+ ));
$this->assign('summaryPrint', $this->_print);
$session = CRM_Core_Session::singleton();
$url = CRM_Utils_System::url('civicrm/contact/view', 'reset=1&cid=' . $this->_contactId);
//appending isTest to url for test soft credit CRM-3891.
//FIXME: hack ajax url.
- $q = "reset=1&snippet=1&force=1&cid={$this->_contactId}";
+ $q = "reset=1&force=1&cid={$this->_contactId}";
if (CRM_Utils_Request::retrieve('isTest', 'Positive', $this)) {
- $q = $q . "&isTest=1";
+ $q .= "&isTest=1";
}
$allTabs[] = array(
'id' => $i,
'id' => $k,
'url' => CRM_Utils_System::url(
"civicrm/contact/view/$k",
- "reset=1&snippet=1&cid={$this->_contactId}"
+ "reset=1&cid={$this->_contactId}"
),
'title' => $v,
'weight' => $weight,
$id = "custom_{$group['id']}";
$allTabs[] = array(
'id' => $id,
- 'url' => CRM_Utils_System::url($group['path'], $group['query'] . "&snippet=1&selectedChild=$id"),
+ 'url' => CRM_Utils_System::url($group['path'], $group['query'] . "&selectedChild=$id"),
'title' => $group['title'],
'weight' => $weight,
'count' => CRM_Contact_BAO_Contact::getCountComponent($id, $this->_contactId, $group['table_name']),
$this->assign('allTabs', $allTabs);
- $selectedChild = CRM_Utils_Request::retrieve('selectedChild', 'String', $this, FALSE, 'summary');
- $this->assign('selectedChild', $selectedChild);
-
// hook for contact summary
// ignored but needed to prevent warnings
$contentPlacement = CRM_Utils_Hook::SUMMARY_BELOW;
{/if}
<div class="crm-block crm-content-block crm-contact-page crm-inline-edit-container">
- <div id="mainTabContainer" class="ui-tabs ui-widget ui-widget-content ui-corner-all">
+ <div id="mainTabContainer">
<ul class="crm-contact-tabs-list">
<li id="tab_summary" class="crm-tab-button">
<a href="#contact-summary" title="{ts}Summary{/ts}">
</div>
<div class="clear"></div>
</div><!-- /.crm-content-block -->
-
- <script type="text/javascript">
- {literal}
- cj(function($) {
- //explicitly stop spinner
- function stopSpinner( ) {
- $('li.crm-tab-button span').text(' ');
- }
- {/literal}
- var selectedTab = '{if !empty($selectedChild)}{$selectedChild}{else}summary{/if}';
- var tabIndex = $('#tab_' + selectedTab).prevAll().length;
- var spinnerImage = '<img src="{$config->resourceBase}i/loading.gif" style="width:10px;height:10px"/>';
- {literal}
- $("#mainTabContainer").tabs({ active: tabIndex, spinner: spinnerImage, cache: true, load: stopSpinner});
- $(".crm-tab-button").addClass("ui-corner-bottom");
- $().crmAccordions();
-
- $('body').click(function() {
- cj('#crm-contact-actions-list').hide();
- });
- });
- {/literal}
- </script>
{/if}
{* CRM-10560 *}
});
CRM.updateContactSummaryTags = function() {
- var tags = [], $tab = $('#tab_tag');
+ var tags = [];
$('.tag-section .token-input-token-facebook p, #tagtree input:checkbox:checked+label').each(function() {
tags.push($(this).text());
});
// showing count of tags in summary tab
- $('a em', $tab).html('' + tags.length);
- $tab
- .removeClass($tab.attr('class').match(/(crm-count-\d+)/)[0])
- .addClass('crm-count-' + tags.length);
+ CRM.updateTabCount('#tab_tag', tags.length);
// update summary tab
$("#tags").html(tags.join(', '));
};