Commit 5b7581f1 authored by colemanw's avatar colemanw

Add icon to 'file-on-case' button

parent d34e9db0
......@@ -278,6 +278,8 @@ class CRM_Activity_Form_Activity extends CRM_Contact_Form_Task {
$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(
......@@ -740,24 +742,14 @@ class CRM_Activity_Form_Activity extends CRM_Contact_Form_Task {
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 {
......
......@@ -281,6 +281,9 @@
<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>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment