}
$this->assign('contactId', $this->_currentlyViewedContactId);
- if ($this->_currentlyViewedContactId) {
- CRM_Contact_Page_View::setTitle($this->_currentlyViewedContactId);
- }
-
//give the context.
if (!isset($this->_context)) {
$this->_context = CRM_Utils_Request::retrieve('context', 'String', $this);
}
}
- // Assign pageTitle to be "Activity - "+ activity name
+ // Set title
if (isset($activityTName)) {
- $pageTitle = 'Activity - ' . CRM_Utils_Array::value($this->_activityTypeId, $activityTName);
- $this->assign('pageTitle', $pageTitle);
+ $activityName = CRM_Utils_Array::value($this->_activityTypeId, $activityTName);
+ $this->assign('pageTitle', ts('%1 Activity', $activityName));
+
+ if ($this->_currentlyViewedContactId) {
+ $displayName = CRM_Contact_BAO_Contact::displayName($this->_currentlyViewedContactId);
+ // Check if this is default domain contact CRM-10482
+ if (CRM_Contact_BAO_Contact::checkDomainContact($this->_currentlyViewedContactId)) {
+ $displayName .= ' (' . ts('default organization') . ')';
+ }
+ CRM_Utils_System::setTitle($displayName . ' - ' . $activityName);
+ }
+ else {
+ CRM_Utils_System::setTitle(ts('%1 Activity', $activityName));
+ }
}
//check the mode when this form is called either single or as
public function buildQuickForm() {
$this->addButtons(array(
array(
- 'type' => 'next',
+ 'type' => 'cancel',
'name' => ts('Done'),
'spacing' => ' ',
'isDefault' => TRUE,
'weight' => 35,
'ref' => 'new-activity',
'key' => 'activity',
- 'tab' => 'activity',
'permissions' => array('edit all contacts'),
),
'pledge' => array(
}
}
};
+ // Hack to make delete dialogs smaller
+ if (url.indexOf('/delete') > 0 || url.indexOf('action=delete') > 0) {
+ settings.dialog = {
+ width: 400,
+ height: 300
+ };
+ }
// Move options that belong to crmForm. Others will be passed through to crmSnippet
options && $.each(options, function(key, value) {
if (typeof(settings.crmForm[key]) !== 'undefined') {
},
beforeSerialize: function(form, options) {
if (window.CKEDITOR && window.CKEDITOR.instances) {
- for (var instance in CKEDITOR.instances) {
- CKEDITOR.instances[instance].updateElement();
- }
+ $.each(CKEDITOR.instances, function() {
+ this.updateElement && this.updateElement();
+ });
}
},
beforeSubmit: function(submission) {
// Open action links in a popup
.off('click.crmLivePage')
.on('click.crmLivePage', 'a.button, a.action-item', function() {
- var
- dialogSettings = {},
- url = $(this).attr('href');
+ var url = $(this).attr('href');
// only follow real links not javascript buttons
if (url === '#' || $(this).attr('onclick') || $(this).hasClass('no-popup')) {
return;
}
- // Hack to make delete dialogs smaller
- if (url.indexOf('/delete') > 0 || url.indexOf('action=delete') > 0) {
- dialogSettings.width = 400;
- dialogSettings.height = 300;
- }
CRM.loadForm(url, {
- openInline: 'a:not("[href=#], .no-popup")',
- dialog: dialogSettings
+ openInline: 'a:not("[href=#], .no-popup")'
}).on('crmFormSuccess', function(e, data) {
// Refresh page when form completes
$('#crm-main-content-wrapper').crmSnippet('refresh');
{/literal}
{else}
<ul>
+ <li class="crm-activity-tab"><a href="#" data-tab="activity">{ts}Record Activity:{/ts}</a></li>
{foreach from=$activityTypes key=k item=link}
<li class="crm-activity-type_{$k}"><a href="{$urls.$k}" data-tab="activity">{$link}</a></li>
{/foreach}
ui.panel
.off('click.crmLivePage')
.on('click.crmLivePage', 'a.button, a.action-item', function() {
- var
- dialogSettings = {},
- url = $(this).attr('href');
+ var url = $(this).attr('href');
// only follow real links not javascript buttons
if (url === '#' || $(this).attr('onclick') || $(this).hasClass('no-popup')) {
return;
}
- // Hack to make delete dialogs smaller
- if (url.indexOf('/delete') > 0 || url.indexOf('action=delete') > 0) {
- dialogSettings.width = 400;
- dialogSettings.height = 300;
- }
CRM.loadForm(url, {
- openInline: 'a:not("[href=#], .no-popup")',
- dialog: dialogSettings
+ openInline: 'a:not("[href=#], .no-popup")'
}).on('crmFormSuccess', function(e, data) {
// Refresh when form completes
ui.panel.crmSnippet('refresh');