$this->_activityTypeId = CRM_Utils_Request::retrieve('atype', 'Positive', $this);
$this->assign('atype', $this->_activityTypeId);
+ $this->assign('activityId', $this->_activityId);
+
//check for required permissions, CRM-6264
if ($this->_activityId &&
in_array($this->_action, array(
if (isset($this->_groupTree)) {
CRM_Core_BAO_CustomGroup::buildCustomDataView($this, $this->_groupTree);
}
- $buttons = array();
- // do check for permissions
- if (CRM_Case_BAO_Case::checkPermission($this->_activityId, 'File On Case', $this->_activityTypeId)) {
- $buttons[] = array(
- 'type' => 'cancel',
- 'name' => ts('File on case'),
- 'subName' => 'file_on_case',
- 'js' => array('onClick' => "javascript:fileOnCase( \"file\", $this->_activityId ); return false;")
- );
- }
// form should be frozen for view mode
$this->freeze();
+ $buttons = array();
$buttons[] = array(
'type' => 'cancel',
'name' => ts('Done')
);
-
$this->addButtons($buttons);
}
else {
<a href="{crmURL p='civicrm/contact/view/activity' q=$urlParams}" class="delete button" title="{ts}Delete{/ts}"><span><div class="icon delete-icon"></div>{ts}Delete{/ts}</span></a>
{/if}
{/if}
+ {if $action eq 4 and call_user_func(array('CRM_Case_BAO_Case','checkPermission'), $activityId, 'File On Case', $atype)}
+ <a href="#" onclick="fileOnCase('file', {$activityId}, null, this); return false;" class="cancel button" title="{ts}File On Case{/ts}"><span><div class="icon ui-icon-clipboard"></div>{ts}File On Case{/ts}</span></a>
+ {/if}
{include file="CRM/common/formButtons.tpl" location="bottom"}
</div>