*
* Generated from civigrant/xml/schema/CRM/Grant/Grant.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:35a957c6b295a38c1fc0881e57ab1ec4)
+ * (GenCodeChecksum:8c32dd9b0de6a449d6ee2358a2b043fc)
*/
use CRM_Grant_ExtensionUtil as E;
*/
protected static $_paths = [
'add' => 'civicrm/grant/add?reset=1&action=add&cid=[contact_id]',
- 'view' => 'civicrm/grant/add?reset=1&action=view&id=[id]',
+ 'view' => 'civicrm/grant/view?reset=1&action=view&id=[id]',
'update' => 'civicrm/grant/add?reset=1&action=update&id=[id]',
'delete' => 'civicrm/grant/add?reset=1&action=delete&id=[id]',
];
* @return void
*/
public function preProcess() {
- $this->_contactID = CRM_Utils_Request::retrieve('cid', 'Positive', $this);
$this->_id = CRM_Utils_Request::retrieve('id', 'Positive', $this);
$context = CRM_Utils_Request::retrieve('context', 'Alphanumeric', $this);
$this->assign('context', $context);
];
foreach ($grantTokens as $token) {
- $this->assign($token, CRM_Utils_Array::value($token, $values));
+ $this->assign($token, $values[$token] ?? NULL);
}
+ $displayName = CRM_Contact_BAO_Contact::displayName($values['contact_id']);
+ $this->assign('displayName', $displayName);
if (isset($this->_id)) {
$noteDAO = new CRM_Core_BAO_Note();
}
// add Grant to Recent Items
- $url = CRM_Utils_System::url('civicrm/grant/add',
- "action=view&reset=1&id={$values['id']}&cid={$values['contact_id']}"
+ $url = CRM_Utils_System::url('civicrm/grant/view',
+ "action=view&reset=1&id={$values['id']}"
);
$title = CRM_Contact_BAO_Contact::displayName($values['contact_id']) . ' - ' . ts('Grant') . ': ' . CRM_Utils_Money::format($values['amount_total']) . ' (' . $grantType[$values['grant_type_id']] . ')';
self::$_links = [
CRM_Core_Action::VIEW => [
'name' => ts('View'),
- 'url' => 'civicrm/grant/add',
+ 'url' => 'civicrm/grant/view',
'qs' => 'reset=1&id=%%id%%&cid=%%cid%%&action=view&' . $extraParams,
'title' => ts('View Grant'),
'weight' => -20,
{ts}Are you sure you want to delete this Grant?{/ts} {ts}This action cannot be undone.{/ts}</p>
<p>{include file="CRM/Grant/Form/Task.tpl"}</p>
</div>
- {elseif $action eq 4}
- {include file="CRM/Grant/Form/GrantView.tpl"}
{else}
<div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="top"}</div>
<table class="form-layout-compressed">
<access_arguments>access CiviGrant</access_arguments>
<page_type>1</page_type>
</item>
- <!-- Unused/deprecated path redundant with civicrm/grant/add -->
<item>
- <path>civicrm/contact/view/grant</path>
- <page_callback>CRM_Grant_Form_Grant</page_callback>
+ <path>civicrm/grant/view</path>
+ <page_callback>CRM_Grant_Form_GrantView</page_callback>
<access_arguments>access CiviGrant</access_arguments>
</item>
</menu>
<icon>fa-money</icon>
<paths>
<add>civicrm/grant/add?reset=1&action=add&cid=[contact_id]</add>
- <view>civicrm/grant/add?reset=1&action=view&id=[id]</view>
+ <view>civicrm/grant/view?reset=1&action=view&id=[id]</view>
<update>civicrm/grant/add?reset=1&action=update&id=[id]</update>
<delete>civicrm/grant/add?reset=1&action=delete&id=[id]</delete>
</paths>