Commit 711bc3c8 authored by Pradeep Nayak's avatar Pradeep Nayak

-- RG-212, added view grant link on activity view and edit form for Grant...

-- RG-212, added view grant link on activity view and edit form for Grant status change activity type
parent e110756d
......@@ -242,6 +242,18 @@ function grantprograms_civicrm_permission(&$permissions) {
*
*/
function grantprograms_civicrm_buildForm($formName, &$form) {
if ($formName == 'CRM_Activity_Form_Activity'
&& ($form->getVar('_action') == CRM_Core_Action::UPDATE || $form->getVar('_action') == CRM_Core_Action::VIEW)) {
$activityType = CRM_Core_PseudoConstant::activityType();
$activityValues = $form->getVar('_values');
if (array_search('Grant Status Change', $activityType) != $activityValues['activity_type_id']) {
return FALSE;
}
$grantUrl = CRM_Utils_System::url('civicrm/contact/view/grant',
'reset=1&action=view&id=' . $activityValues['source_record_id'] . '&cid=' . current($activityValues['assignee_contact']));
$form->assign('grantUrl', $grantUrl);
}
if ($formName == 'CRM_Grant_Form_Grant' && ($form->getVar('_action') != CRM_Core_Action::DELETE)) {
$form->_key = CRM_Utils_Request::retrieve('key', 'String', $form);
......
{*
+--------------------------------------------------------------------+
| CiviCRM version 4.3 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2013 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
| CiviCRM is free software; you can copy, modify, and distribute it |
| under the terms of the GNU Affero General Public License |
| Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
| |
| CiviCRM is distributed in the hope that it will be useful, but |
| WITHOUT ANY WARRANTY; without even the implied warranty of |
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
| See the GNU Affero General Public License for more details. |
| |
| You should have received a copy of the GNU Affero General Public |
| License and the CiviCRM Licensing Exception along |
| with this program; if not, contact CiviCRM LLC |
| at info[AT]civicrm[DOT]org. If you have questions about the |
| GNU Affero General Public License or the licensing of CiviCRM, |
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
+--------------------------------------------------------------------+
*}
{if $grantUrl}
<a title="View Grant" class="view-grant button" href="{$grantUrl}"><span><div class="icon view-icon"></div>View Grant</span></a>
<script type="text/javascript">
{literal}
if (!cj('.crm-submit-buttons a').hasClass('view-grant')) {
cj('.view-grant').insertBefore('.crm-submit-buttons .crm-button-type-cancel');
}
{/literal}
</script>
{/if}
\ No newline at end of file
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