Skip to content
Snippets Groups Projects
Commit 9cbad1f5 authored by Mayur Jadhav's avatar Mayur Jadhav
Browse files

RG-119 fixed dashboard array issue and other notices

parent 3dccc0e1
No related branches found
No related tags found
No related merge requests found
......@@ -71,13 +71,13 @@ class CRM_Grant_BAO_Grant extends CRM_Grant_DAO_Grant {
WHERE g.status_id IS NOT NULL
GROUP BY g.grant_program_id, g.status_id WITH ROLLUP";
$dao = CRM_Core_DAO::executeQuery( $query, CRM_Core_DAO::$_nullArray );
$dao = CRM_Core_DAO::executeQuery($query, CRM_Core_DAO::$_nullArray);
$status = array( );
$summary = array( );
$summary['total_grants'] = null;
$summary['total_grants']['no_of_grants'] = null;
$querys = "SELECT
$summary['no_of_grants'] = null;
$querys = "SELECT
v.label as label,
v.weight as value,
v.value as info
......@@ -86,7 +86,7 @@ class CRM_Grant_BAO_Grant extends CRM_Grant_DAO_Grant {
AND g.name = 'grant_status'
AND g.is_active = 1
ORDER BY v.weight";
$daos = CRM_Core_DAO::executeQuery( $querys, CRM_Core_DAO::$_nullArray );
$daos = CRM_Core_DAO::executeQuery($querys, CRM_Core_DAO::$_nullArray);
while ($daos->fetch()) {
$status[$daos->value] = array(
'weight' => $daos->value,
......@@ -116,7 +116,7 @@ class CRM_Grant_BAO_Grant extends CRM_Grant_DAO_Grant {
$programs[$dao->label][$stats[$dao->status_id]['weight']]= array(
'label' => $stats[$dao->status_id]['label'],
'total' => $dao->status_total,
'value' => $stats[$dao->status_id]['value'],
'value' => $stats[$dao->status_id]['value'],
'amount_requested' => $dao->amount_requested ? CRM_Utils_Money::format($dao->amount_requested) : CRM_Utils_Money::format(0),
'amount_granted' => $dao->amount_granted ? CRM_Utils_Money::format($dao->amount_granted) : CRM_Utils_Money::format(0),
'total_paid' => $dao->total_paid ? CRM_Utils_Money::format($dao->total_paid) : CRM_Utils_Money::format(0),
......@@ -125,7 +125,7 @@ class CRM_Grant_BAO_Grant extends CRM_Grant_DAO_Grant {
$programs[$dao->label] = $programs[$dao->label] + array_diff_key($status, $programs[$dao->label]); //add the two arrays
ksort($programs[$dao->label]);
$summary['total_grants']['all'] = 'All';
$summary['total_grants']['no_of_grants'] += $dao->status_total;
$summary['no_of_grants'] += $dao->status_total;
} else{
$programs["<b>Subtotal $dao->label </b>"]['subtotal'] = array(
'label' => '',
......
......@@ -99,7 +99,7 @@ function grantprograms_civicrm_grantAssessment(&$params) {
if (array_key_exists('custom', $params)) {
if (isset($params['action'])) {
$grantProgramParams['id'] = $params['grant_program_id'];
$grantProgram = CRM_Grant_BAO_GrantProgram::retrieve($grantProgramParams);
$grantProgram = CRM_Grant_BAO_GrantProgram::retrieve($grantProgramParams, &$defaults);
if (!empty($grantProgram->grant_program_id)) {
$result = CRM_Core_DAO::executeQuery("SELECT id, contact_id, application_received_date, amount_granted, status_id FROM civicrm_grant WHERE status_id = ".CRM_Core_OptionGroup::getValue('grant_status', 'Paid', 'name')." AND grant_program_id = {$grantProgram->grant_program_id} AND contact_id = {$params['contact_id']}");
$grantThresholds = CRM_Core_OptionGroup::values( 'grant_thresholds' );
......
......@@ -36,8 +36,8 @@
</p>
</div>
{if $grantSummary.total_grants}
You have {$grantSummary.total_grants} grant(s) registered in your database.
{if $grantSummary.no_of_grants}
You have {$grantSummary.no_of_grants} grant(s) registered in your database.
<table class="report">
<tr class="columnheader-dark">
<th scope="col">{ts}Grant Program{/ts}</th>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment