Commit a45f0f90 authored by Monish Deb's avatar Monish Deb

conflict fixes with grant application

parent 8f4771c5
......@@ -99,7 +99,7 @@ class CRM_Grant_BAO_Query {
$query->_element['grant_note'] = 1;
$query->_tables['grant_note'] = 1;
}
$query->_select['grant_amount_requested'] = 'civicrm_grant.amount_requested as grant_amount_requested';
$query->_select['grant_amount_granted'] = 'civicrm_grant.amount_granted as grant_amount_granted';
$query->_select['grant_amount_total'] = 'civicrm_grant.amount_total as grant_amount_total';
......@@ -211,11 +211,11 @@ class CRM_Grant_BAO_Query {
return;
case 'grant_program_id':
$value = $strtolower(CRM_Core_DAO::escapeString(trim($value)));
$query->_where[$grouping][] = "civicrm_grant.grant_program_id $op '{$value}'";
$grantPrograms = CRM_Grant_BAO_GrantProgram::getGrantPrograms();
$value = $grantPrograms[$value];
$query->_qill[$grouping ][] = ts('Grant Type %2 %1', array(1 => $value, 2 => $op));
......@@ -259,19 +259,19 @@ class CRM_Grant_BAO_Query {
case 'grant_amount_high':
$query->numberRangeBuilder($values,
'civicrm_grant', 'grant_amount', 'amount_granted', 'Amount Granted'
);
);
case 'grant_amount_total':
case 'grant_amount_total_low':
case 'grant_amount_total_high':
$query->numberRangeBuilder($values,
'civicrm_grant', 'grant_amount_total', 'amount_total', 'Amount Requested'
'civicrm_grant', 'grant_amount_total', 'amount_total', 'Amount Requested'
);
case 'grant_assessment':
case 'grant_assessment_low':
case 'grant_assessment_high':
$query->numberRangeBuilder($values,
'civicrm_grant', 'grant_assessment', 'assessment', 'Assessment'
);
'civicrm_grant', 'grant_assessment', 'assessment', 'Assessment'
);
}
}
......@@ -297,7 +297,7 @@ class CRM_Grant_BAO_Query {
}
$from .= "$side JOIN civicrm_entity_payment AS temp1 ON (civicrm_grant.id = temp1.entity_id AND temp1.entity_table = 'civicrm_grant')
$side JOIN (SELECT payment_id AS payment_id, entity_id AS entity_id FROM civicrm_entity_payment ORDER BY payment_id DESC) AS temp2 ON temp1.entity_id = temp2.entity_id
$side JOIN civicrm_payment ON (temp2.payment_id = civicrm_payment.id)";
$side JOIN civicrm_payment ON (temp2.payment_id = civicrm_payment.id)";
break;
......@@ -433,4 +433,3 @@ $side JOIN civicrm_payment ON (temp2.payment_id = civicrm_payment.id)";
static function tableNames(&$tables) {}
}
......@@ -74,7 +74,7 @@ class CRM_Grant_Selector_Search extends CRM_Core_Selector_Base implements CRM_Co
'grant_amount_total',
'grant_amount_requested',
'grant_amount_granted',
'grant_application_received_date',
'grant_application_received_date',
'grant_payment_created',
'program_name',
'program_id',
......@@ -305,11 +305,11 @@ class CRM_Grant_Selector_Search extends CRM_Core_Selector_Base implements CRM_Co
}
$mask = CRM_Core_Action::mask($permissions);
//added by JMA
$grant = $this->_query->searchQuery(
$grant = $this->_query->searchQuery(
$offset, $rowCount, $sort,
false, false,
false, false,
false,
false, false,
false, false,
false,
$this->_grantClause );
while ($grant->fetch()) {
$grants[$grant->id] = $grant->id;
......@@ -326,11 +326,11 @@ class CRM_Grant_Selector_Search extends CRM_Core_Selector_Base implements CRM_Co
$searchGrants = implode(',', $grants);
foreach( $contactGrants as $gKey => $gVal) {
if ($foundit) {
$next = $gKey;
$next = $gKey;
break;
}
if ($gKey == $result->id) {
$next = $gKey;
$next = $gKey;
if($gKey == end($contactGrants)) {
reset($contactGrants);
$next = key($contactGrants);
......@@ -401,13 +401,14 @@ class CRM_Grant_Selector_Search extends CRM_Core_Selector_Base implements CRM_Co
* @access public
*/
public function &getColumnHeaders($action = NULL, $output = NULL) {
$statusHeader = array();
if (!isset(self::$_columnHeaders)) {
$statusHeader = array(
array('name' => ts('Status'),
if (CRM_Core_DAO::singleValueQuery("SELECT is_active FROM civicrm_extension WHERE full_name = 'biz.jmaconsulting.grantapplications'") != 1) {
$statusHeader[] = array('name' => ts('Status'),
'sort' => 'status_weight',
'direction' => CRM_Utils_Sort::ASCENDING,
),
);
);
}
self::$_columnHeaders = array(
array(
'name' => ts('Program Name'),
......@@ -471,4 +472,3 @@ class CRM_Grant_Selector_Search extends CRM_Core_Selector_Base implements CRM_Co
}
}
//end of class
......@@ -4,11 +4,11 @@
// database as appropriate. For more details, see "hook_civicrm_managed" at:
// http://wiki.civicrm.org/confluence/display/CRMDOC42/Hook+Reference
return array (
0 =>
0 =>
array (
'name' => 'Cron:Grant.ChangeStatus',
'entity' => 'Job',
'params' =>
'params' =>
array (
'version' => 3,
'name' => 'Call Grant.ChangeStatus API',
......@@ -19,4 +19,4 @@ return array (
'parameters' => '',
),
),
);
\ No newline at end of file
);
......@@ -68,7 +68,7 @@ INSERT INTO civicrm_option_value
SELECT @tpl_ovid_{$vName} := MAX(id) FROM civicrm_option_value WHERE option_group_id = @tpl_ogid_{$gName} AND name = '{$vName}';
{/foreach}
{/foreach}
INSERT INTO civicrm_msg_template
INSERT IGNORE INTO civicrm_msg_template
(msg_title, msg_subject, msg_text, msg_html, workflow_id, is_default, is_reserved) VALUES
{foreach from=$ovNames key=gName item=ovs name=for_groups}
{foreach from=$ovs key=vName item=title name=for_values}
......
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