Commit a84f70cf authored by Monish Deb's avatar Monish Deb

AGBU-15: Remove NEI occurence

parent 7c8232a0
......@@ -357,7 +357,7 @@ class CRM_Grant_DAO_GrantProgram extends CRM_Core_DAO
'grant_program_id' => array(
'name' => 'grant_program_id',
'type' => CRM_Utils_Type::T_INT,
'title' => ts("Previous Year's NEI Grant Program") ,
'title' => ts("Previous Year's Grant Program") ,
'required' => true,
'import' => true,
'where' => 'civicrm_grant_program.grant_program_id',
......
......@@ -36,7 +36,7 @@
/**
* This class generates form components for Par Service Fees
*
*
*/
class CRM_Grant_Form_GrantProgram extends CRM_Core_Form {
protected $_id = NULL;
......@@ -47,12 +47,12 @@ class CRM_Grant_Form_GrantProgram extends CRM_Core_Form {
function preProcess() {
$this->_action = CRM_Utils_Request::retrieve('action', 'String', $this);
$this->_id = CRM_Utils_Request::retrieve('id', 'Positive', $this);
$title = NULL;
if ($this->_action & CRM_Core_Action::UPDATE) $title = ts('Edit Grant Program');
if ($this->_action & CRM_Core_Action::DELETE) $title = ts('Delete Grant Program');
if ($title) CRM_Utils_System::setTitle($title);
$session = CRM_Core_Session::singleton();
$session->pushUserContext(CRM_Utils_System::url('civicrm/grant_program', 'reset=1'));
$this->assign('action', $this->_action);
......@@ -60,7 +60,7 @@ class CRM_Grant_Form_GrantProgram extends CRM_Core_Form {
$this->_values = $this->get('values');
if (!is_array($this->_values)) {
$this->_values = array( );
// if we are editing
if (isset($this->_id) && $this->_id) {
$params = array('id' => $this->_id);
......@@ -70,7 +70,7 @@ class CRM_Grant_Form_GrantProgram extends CRM_Core_Form {
$this->set('values', $this->_values);
}
}
function setDefaultValues() {
$defaults = $this->_values;
if (!empty( $defaults)) {
......@@ -104,11 +104,11 @@ class CRM_Grant_Form_GrantProgram extends CRM_Core_Form {
*/
public function buildQuickForm($check = FALSE) {
parent::buildQuickForm();
if ($this->_action & CRM_Core_Action::DELETE) {
$this->addButtons(array(
array (
array (
'type' => 'next',
'name'=> ts('Delete'),
'isDefault' => TRUE),
......@@ -122,18 +122,18 @@ class CRM_Grant_Form_GrantProgram extends CRM_Core_Form {
$this->applyFilter('__ALL__','trim');
$attributes = CRM_Core_DAO::getAttribute('CRM_Grant_DAO_GrantProgram');
$grantPrograms = CRM_Grant_BAO_GrantProgram::grantPrograms();
$this->add('text', 'label', ts('Label'),
$attributes['label'], TRUE);
$grantType = CRM_Core_OptionGroup::values('grant_type');
$this->add('select', 'grant_type_id', ts('Grant Type'),
array('' => ts('- select -' )) + $grantType , TRUE);
$this->add('text', 'total_amount', ts('Total Amount'),
$attributes['total_amount'], FALSE);
$this->addRule('total_amount', ts('Please enter a valid amount.'), 'money');
$attributes['total_amount'], FALSE);
$this->addRule('total_amount', ts('Please enter a valid amount.'), 'money');
$this->add('text', 'remainder_amount', ts('Remainder Amount'),
$attributes['remainder_amount'], FALSE);
$this->addRule('remainder_amount', ts('Please enter a valid amount.'), 'money');
......@@ -146,34 +146,34 @@ class CRM_Grant_Form_GrantProgram extends CRM_Core_Form {
$contributionTypes = CRM_Grant_BAO_GrantProgram::contributionTypes();
$this->add('select', 'financial_type_id', ts('Financial Types'),
array('' => ts('- select -')) + $contributionTypes, TRUE);
$grantStatus = CRM_Core_OptionGroup::values('grant_program_status');
$this->add('select', 'status_id', ts('Grant Status'),
array('' => ts('- select -')) + $grantStatus, TRUE);
$grantAlgorithm = CRM_Core_OptionGroup::values('allocation_algorithm');
$this->add('select', 'allocation_algorithm', ts('Allocation Algorithm'),
array('' => ts('- select -')) + $grantAlgorithm , TRUE);
$this->add('select', 'grant_program_id', ts("Previous Year's NEI Grant Program"),
array('' => ts('- select -')) + $grantAlgorithm , TRUE);
$this->add('select', 'grant_program_id', ts("Previous Year's Grant Program"),
array('' => ts('- select -')) + $grantPrograms, FALSE);
$this->addDate('allocation_date', ts('Allocation Date'), FALSE, array('formatType' => 'custom'));
$this->add('checkbox', 'is_active', ts('Enabled?'));
$this->add('checkbox', 'is_auto_email', ts('Auto email?'));
$this->addButtons(array(
array (
$this->addButtons(array(
array (
'type' => 'upload',
'name' => ts('Save'),
'name' => ts('Save'),
'isDefault' => TRUE),
array (
'type' => 'cancel',
'name' => ts('Cancel')),
)
);
array (
'type' => 'cancel',
'name' => ts('Cancel')),
)
);
}
/**
......@@ -201,7 +201,7 @@ class CRM_Grant_Form_GrantProgram extends CRM_Core_Form {
$session = CRM_Core_Session::singleton();
$session->pushUserContext(CRM_Utils_System::url('civicrm/grant_program', 'reset=1&action=browse&id=' . $result->id));
}
}
function updateGrantProgram(&$values, $domainID) {
......@@ -248,5 +248,3 @@ class CRM_Grant_Form_GrantProgram extends CRM_Core_Form {
return true;
}
}
/**
* Grant Programs extension improves grant allocation
* in CiviGrant
*
* in CiviGrant
*
* Copyright (C) 2012 JMA Consulting
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
*
* This program 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
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*
* Support: https://github.com/JMAConsulting/biz.jmaconsulting.grantprograms/issues
*
*
* Contact: info@jmaconsulting.biz
* JMA Consulting
* 215 Spadina Ave, Ste 400
* Toronto, ON
* Toronto, ON
* Canada M5T 2C7
*/
UPDATE civicrm_option_group SET is_active = 0 WHERE name IN ('grant_payment_status','grant_program_status', 'allocation_algorithm', 'grant_thresholds', 'reason_grant_ineligible', 'reason_grant_incomplete', 'grant_info_too_late', 'msg_tpl_workflow_grant', 'predominant_clinical_area_of_pra_nei', 'nei_employment_status_nei', 'if_you_are_not_employed_indicate_nei', 'province_of_employment_nei', 'position_nei', 'employment_setting_nei', 'how_did_you_hear_about_this_init_nei', 'course_conference_type_nei', 'how_will_this_course_enhance_the_nei', 'type_of_course_provider_nei');
UPDATE civicrm_option_value SET is_active = 0 WHERE option_group_id IN (SELECT id FROM civicrm_option_group WHERE name IN ('grant_payment_status','grant_program_status', 'allocation_algorithm', 'grant_thresholds', 'reason_grant_ineligible', 'reason_grant_incomplete', 'grant_info_too_late', 'msg_tpl_workflow_grant', 'predominant_clinical_area_of_pra_nei', 'nei_employment_status_nei', 'if_you_are_not_employed_indicate_nei', 'province_of_employment_nei', 'position_nei', 'employment_setting_nei', 'how_did_you_hear_about_this_init_nei', 'course_conference_type_nei', 'how_will_this_course_enhance_the_nei', 'type_of_course_provider_nei'));
UPDATE civicrm_custom_group SET is_active = 0 WHERE name IN ('NEI_Employment_Information','NEI_General_information', 'NEI_Course_conference_details', 'NEI_ID');
UPDATE civicrm_custom_field SET is_active = 0 WHERE custom_group_id IN (SELECT id FROM civicrm_custom_group WHERE name IN ('NEI_General_information', 'NEI_Course_conference_details', 'NEI_ID', 'NEI_Employment_Information'));
SELECT @gtype := id FROM civicrm_option_group WHERE name = 'grant_type';
UPDATE civicrm_option_value SET is_active = 0 WHERE name = 'NEI Grant' AND option_group_id = @gtype;
UPDATE civicrm_option_group SET is_active = 0 WHERE name IN ('grant_payment_status','grant_program_status', 'allocation_algorithm', 'grant_thresholds', 'reason_grant_ineligible', 'reason_grant_incomplete', 'grant_info_too_late', 'msg_tpl_workflow_grant'):
UPDATE civicrm_financial_account SET is_active = 0 WHERE name = 'NEI Grant';
UPDATE civicrm_financial_type SET is_active = 0 WHERE name = 'NEI Grant';
UPDATE civicrm_option_value SET is_active = 0 WHERE option_group_id IN (SELECT id FROM civicrm_option_group WHERE name IN ('grant_payment_status','grant_program_status', 'allocation_algorithm', 'grant_thresholds', 'reason_grant_ineligible', 'reason_grant_incomplete', 'grant_info_too_late', 'msg_tpl_workflow_grant'));
-- RG-212
UPDATE civicrm_option_group cog INNER JOIN civicrm_option_value cov ON cov.option_group_id = cog.id
......
/**
* Grant Programs extension improves grant allocation
* in CiviGrant
*
* in CiviGrant
*
* Copyright (C) 2012 JMA Consulting
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
*
* This program 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
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*
* Support: https://github.com/JMAConsulting/biz.jmaconsulting.grantprograms/issues
*
*
* Contact: info@jmaconsulting.biz
* JMA Consulting
* 215 Spadina Ave, Ste 400
* Toronto, ON
* Toronto, ON
* Canada M5T 2C7
*/
UPDATE civicrm_option_group SET is_active = 1 WHERE name IN ('grant_payment_status','grant_program_status', 'allocation_algorithm', 'grant_thresholds', 'reason_grant_ineligible', 'reason_grant_incomplete', 'grant_info_too_late', 'msg_tpl_workflow_grant', 'predominant_clinical_area_of_pra_nei', 'nei_employment_status_nei', 'if_you_are_not_employed_indicate_nei', 'province_of_employment_nei', 'position_nei', 'employment_setting_nei', 'how_did_you_hear_about_this_init_nei', 'course_conference_type_nei', 'how_will_this_course_enhance_the_nei', 'type_of_course_provider_nei');
UPDATE civicrm_option_value SET is_active = 1 WHERE option_group_id IN (SELECT id FROM civicrm_option_group WHERE name IN ('grant_payment_status','grant_program_status', 'allocation_algorithm', 'grant_thresholds', 'reason_grant_ineligible', 'reason_grant_incomplete', 'grant_info_too_late', 'msg_tpl_workflow_grant', 'predominant_clinical_area_of_pra_nei', 'nei_employment_status_nei', 'if_you_are_not_employed_indicate_nei', 'province_of_employment_nei', 'position_nei', 'employment_setting_nei', 'how_did_you_hear_about_this_init_nei', 'course_conference_type_nei', 'how_will_this_course_enhance_the_nei', 'type_of_course_provider_nei'));
UPDATE civicrm_custom_group SET is_active = 1 WHERE name IN ('NEI_Employment_Information','NEI_General_information', 'NEI_Course_conference_details', 'NEI_ID');
UPDATE civicrm_custom_field SET is_active = 1 WHERE custom_group_id IN (SELECT id FROM civicrm_custom_group WHERE name IN ('NEI_General_information', 'NEI_Course_conference_details', 'NEI_ID', 'NEI_Employment_Information'));
SELECT @gtype := id FROM civicrm_option_group WHERE name = 'grant_type';
UPDATE civicrm_option_value SET is_active = 1 WHERE name = 'NEI Grant' AND option_group_id = @gtype;
UPDATE civicrm_option_group SET is_active = 1 WHERE name IN ('grant_payment_status','grant_program_status', 'allocation_algorithm', 'grant_thresholds', 'reason_grant_ineligible', 'reason_grant_incomplete', 'grant_info_too_late', 'msg_tpl_workflow_grant');
UPDATE civicrm_financial_account SET is_active = 1 WHERE name = 'NEI Grant';
UPDATE civicrm_financial_type SET is_active = 1 WHERE name = 'NEI Grant';
UPDATE civicrm_option_value SET is_active = 1 WHERE option_group_id IN (
SELECT id FROM civicrm_option_group
WHERE name IN ('grant_payment_status','grant_program_status', 'allocation_algorithm', 'grant_thresholds', 'reason_grant_ineligible', 'reason_grant_incomplete', 'grant_info_too_late', 'msg_tpl_workflow_grant')
);
-- RG-212
UPDATE civicrm_option_group cog INNER JOIN civicrm_option_value cov ON cov.option_group_id = cog.id
UPDATE civicrm_option_group cog INNER JOIN civicrm_option_value cov ON cov.option_group_id = cog.id
SET cov.is_active = 1
WHERE cog.name = 'activity_type' AND cov.name IN ('grant_status_change', 'grant_payment');
\ No newline at end of file
WHERE cog.name = 'activity_type' AND cov.name IN ('grant_status_change', 'grant_payment');
This diff is collapsed.
/**
* Grant Programs extension improves grant allocation
* in CiviGrant
*
* in CiviGrant
*
* Copyright (C) 2012 JMA Consulting
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
*
* This program 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
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*
* Support: https://github.com/JMAConsulting/biz.jmaconsulting.grantprograms/issues
*
*
* Contact: info@jmaconsulting.biz
* JMA Consulting
* 215 Spadina Ave, Ste 400
* Toronto, ON
* Toronto, ON
* Canada M5T 2C7
*/
......@@ -32,7 +32,7 @@ SELECT @option_group_id_arel := max(id) from civicrm_option_group where name = '
DELETE FROM civicrm_option_value WHERE option_group_id = @option_group_id_arel AND name = 'Accounts Payable Account is';
DELETE ci, ceft, ceft1, cft FROM `civicrm_entity_financial_trxn` ceft
LEFT JOIN civicrm_financial_trxn cft ON cft.id = ceft.financial_trxn_id
LEFT JOIN civicrm_financial_trxn cft ON cft.id = ceft.financial_trxn_id
LEFT JOIN civicrm_entity_financial_trxn ceft1 ON cft.id = ceft1.financial_trxn_id AND ceft1.entity_table = 'civicrm_financial_item'
LEFT JOIN civicrm_financial_item ci ON ci.id = ceft1.entity_id
WHERE ceft.entity_table = 'civicrm_grant';
......@@ -48,7 +48,7 @@ DROP TABLE IF EXISTS civicrm_payment;
ALTER TABLE civicrm_grant_program DROP FOREIGN KEY FK_civicrm_grant_program_status_id, DROP INDEX FK_civicrm_grant_program_status_id;
ALTER TABLE civicrm_grant_program DROP FOREIGN KEY FK_civicrm_grant_program_grant_type_id, DROP INDEX FK_civicrm_grant_program_grant_type_id;
ALTER TABLE civicrm_grant DROP FOREIGN KEY FK_civicrm_grant_grant_program_id, DROP INDEX FK_civicrm_grant_grant_program_id;
ALTER TABLE `civicrm_grant` DROP `grant_program_id`, DROP `grant_rejected_reason_id`, DROP `assessment`;
......@@ -81,10 +81,6 @@ UPDATE civicrm_option_value SET weight = 6 WHERE option_group_id = @grantStatus
DELETE FROM civicrm_option_value WHERE label = 'Approved for Payment' AND option_group_id = @grantStatus;
SELECT @grantType := id FROM civicrm_option_group WHERE name = 'grant_type';
DELETE FROM civicrm_option_value WHERE label = 'NEI Grant' AND option_group_id = @grantType;
SELECT @parentId1 := id FROM civicrm_navigation WHERE name = 'CiviGrant';
SELECT @parentId2 := id FROM civicrm_navigation WHERE name = 'Grants';
......@@ -92,28 +88,6 @@ DELETE FROM civicrm_navigation WHERE parent_id = @parentId2 AND label = 'Find Gr
DELETE FROM civicrm_navigation WHERE parent_id = @parentId2 AND label = 'New Grant Program' AND name = 'New Grant Program' AND url = 'civicrm/grant_program?action=add&reset=1';
DELETE FROM civicrm_navigation WHERE parent_id = @parentId1 AND label = 'Grant Programs' AND name = 'Grant Programs' AND url = 'civicrm/grant_program&reset=1';
-- custom data
DELETE FROM civicrm_custom_group WHERE name = 'NEI_Employment_Information';
DELETE FROM civicrm_custom_group WHERE name = 'NEI_General_information';
DELETE FROM civicrm_custom_group WHERE name = 'NEI_Course_conference_details';
DELETE FROM civicrm_custom_group WHERE name = 'NEI_ID';
DELETE FROM civicrm_option_group WHERE name = 'predominant_clinical_area_of_pra_nei';
DELETE FROM civicrm_option_group WHERE name = 'nei_employment_status_nei';
DELETE FROM civicrm_option_group WHERE name = 'if_you_are_not_employed_indicate_nei';
DELETE FROM civicrm_option_group WHERE name = 'province_of_employment_nei';
DELETE FROM civicrm_option_group WHERE name = 'position_nei';
DELETE FROM civicrm_option_group WHERE name = 'employment_setting_nei';
DELETE FROM civicrm_option_group WHERE name = 'how_did_you_hear_about_this_init_nei';
DELETE FROM civicrm_option_group WHERE name = 'course_conference_type_nei';
DELETE FROM civicrm_option_group WHERE name = 'how_will_this_course_enhance_the_nei';
DELETE FROM civicrm_option_group WHERE name = 'type_of_course_provider_nei';
DROP TABLE IF EXISTS civicrm_value_nei_employment_information;
DROP TABLE IF EXISTS civicrm_value_nei_general_information;
DROP TABLE IF EXISTS civicrm_value_nei_course_conference_details;
DROP TABLE IF EXISTS civicrm_value_nei_id;
DELETE FROM civicrm_msg_template WHERE msg_title = 'Trial Allocation of Funds';
DELETE FROM civicrm_msg_template WHERE msg_title = 'Grants Eligible Receipt';
DELETE FROM civicrm_msg_template WHERE msg_title = 'Grants Awaiting Information Receipt';
......@@ -125,13 +99,7 @@ DELETE FROM civicrm_msg_template WHERE msg_title = 'Grants Withdrawn Receipt';
DELETE FROM civicrm_msg_template WHERE msg_title = 'Grant Payment Check';
DELETE FROM civicrm_msg_template WHERE msg_title = 'Grant Payment Report';
SELECT @financialType := id FROM civicrm_financial_type WHERE name = 'NEI Grant';
DELETE FROM civicrm_entity_financial_account WHERE entity_table = 'civicrm_financial_type' AND entity_id = @financialType;
DELETE FROM civicrm_financial_account WHERE name = 'NEI Grant';
DELETE FROM civicrm_financial_type WHERE name = 'NEI Grant';
ALTER table civicrm_grant DROP column grant_incomplete_reason_id;
-- RG-212
DELETE cov FROM civicrm_option_group cog INNER JOIN civicrm_option_value cov ON cov.option_group_id = cog.id WHERE cog.name = 'activity_type' AND cov.name IN ('grant_status_change', 'grant_payment');
......@@ -23,7 +23,7 @@
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
+--------------------------------------------------------------------+
*}
{* this template is used for viewing grants *}
{* this template is used for viewing grants *}
<h3>{ts}View Grant Program{/ts}</h3>
<div class="crm-block crm-content-block crm-grant-view-block">
<div class="crm-submit-buttons">
......@@ -42,7 +42,7 @@
<a class="button" href="{crmURL p='civicrm/grant_program' q=$urlParams}"><span><div class="icon delete-icon"></div>{ts}Delete{/ts}</span></a>
{/if}
{include file="CRM/common/formButtons.tpl" location="top"}<br/>
</div>
<div class="buttonset" style="width:50px">
<input type="button" class="allocation" value="Allocate Approved (Trial)">
......@@ -50,7 +50,7 @@
<input type="button" class="reject" value="Mark remaining unapproved Grants as Ineligible">
</div>
<table class="crm-info-panel">
<tr class="crm-grant-program-view-form-block-name"><td class="label">{ts}Name{/ts}</td><td class="bold">{$name}</td></tr>
<tr class="crm-grant-program-view-form-block-name"><td class="label">{ts}Name{/ts}</td><td class="bold">{$name}</td></tr>
<tr class="crm-grant-program-view-form-block-grant_type_id"><td class="label">{ts}Grant Type{/ts}</td> <td>{$grantType}</td></tr>
<tr class="crm-grant-program-view-form-block-total_amount"><td class="label">{ts}Total Amount{/ts}</td> <td>{$total_amount|crmMoney}</td></tr>
<tr class="crm-grant-program-view-form-block-remainder_amount"><td class="label">{ts}Remainder Amount{/ts}</td> <td>{$remainder_amount|crmMoney}</td></tr>
......@@ -59,12 +59,12 @@
<tr class="crm-grant-program-view-form-block-contribution_type_id"><td class="label">{ts}Contribution Type{/ts}</td> <td>{$contributionType}</td></tr>
<tr class="crm-grant-program-view-form-block-status_id"><td class="label">{ts}Grant Status{/ts}</td> <td>{$grantProgramStatus}</td></tr>
<tr class="crm-grant-program-view-form-block-allocation_algorithm"><td class="label">{ts}Allocation Algorithm{/ts}</td> <td>{$grantProgramAlgorithm}</td></tr>
<tr class="crm-grant-program-view-form-block-grant_program_id"><td class="label">{ts}Previous Year's NEI Grant{/ts}</td> <td>{$grant_program_id}</td></tr>
<tr class="crm-grant-program-view-form-block-grant_program_id"><td class="label">{ts}Previous Year's Grant{/ts}</td> <td>{$grant_program_id}</td></tr>
<tr class="crm-grant-program-view-form-block-allocation_date"><td class="label">{ts}Allocation Date{/ts}</td> <td>{$allocation_date|crmDate}</td></tr>
<tr class="crm-grant-program-view-form-block-is_active"><td class="label">{ts}Enabled?{/ts}</td> <td>{if $is_active}{ts}Yes{/ts} {else}{ts}No{/ts}{/if}</td></tr>
<tr class="crm-grant-program-view-form-block-is_active"><td class="label">{ts}Auto Email?{/ts}</td> <td>{if $is_auto_email}{ts}Yes{/ts} {else}{ts}No{/ts}{/if}</td></tr>
</table>
{include file="CRM/Custom/Page/CustomDataView.tpl"}
{include file="CRM/Custom/Page/CustomDataView.tpl"}
<div class="crm-submit-buttons">
{if call_user_func(array('CRM_Core_Permission','check'), 'edit grants')}
{assign var='urlParams' value="action=update&id=$id&reset=1"}
......@@ -95,14 +95,14 @@
cj('.allocation').click(function(){
var r = confirm("Do you want to do a trial allocation?");
if (r == true)
{
{
var data = 'pid={/literal}{$id}{literal}&amount={/literal}{$total_amount}{literal}&remainder_amount={/literal}{$remainder_amount}{literal}&algorithm={/literal}{$grantProgramAlgorithm}{literal}';
var dataURL = {/literal}"{crmURL p='civicrm/grant_program/allocate'}"{literal};
cj.ajax({
url: dataURL,
cj.ajax({
url: dataURL,
data: data,
type: 'POST',
success: function(output) {
success: function(output) {
setTimeout("location.reload(true);",1500);
}
});
......@@ -115,11 +115,11 @@ cj('.finalize').click(function(){
var grantedAmount = 0;
var data = 'pid={/literal}{$id}{literal}&amount={/literal}{$total_amount}{literal}';
var dataURL = {/literal}"{crmURL p='civicrm/grant_program/finalize'}"{literal};
cj.ajax({
url: dataURL,
cj.ajax({
url: dataURL,
data: data,
type: 'POST',
success: function(output) {
success: function(output) {
var result = eval('(' + output + ')');
cj.each( result, function( index, value ) {
if( index == 'confirm' ) {
......@@ -137,13 +137,13 @@ cj('.finalize').click(function(){
if (confirmed == 'confirm' ) {
var r=confirm("Do you want finalize the award of grants for this grant program to the amounts currently allocated?");
if (r==true)
{
{
var dataURL = {/literal}"{crmURL p='civicrm/grant_program/processFinalization'}"{literal};
cj.ajax({
url: dataURL,
cj.ajax({
url: dataURL,
data: data,
type: 'POST',
success: function(output) {
success: function(output) {
setTimeout("location.reload(true);",1500);
}
});
......@@ -152,7 +152,7 @@ cj('.finalize').click(function(){
alert("The sum of the grants to be allocated ($"+grantedAmount+".00) is greater than the total amount available to be allocated by the program ($"+totalAmounts+"). Please reduce the amount granted in pending applications or increase the total amount available to be granted.");
}
}
});
});
});
cj('.reject').click(function(){
......@@ -161,16 +161,16 @@ if (r==true)
{
var data = 'pid={/literal}{$id}{literal}&remainder_amount={/literal}{$remainder_amount}{literal}';
var dataURL = {/literal}"{crmURL p='civicrm/grant_program/reject'}"{literal};
cj.ajax({
url: dataURL,
cj.ajax({
url: dataURL,
data: data,
type: 'POST',
success: function(output) {
success: function(output) {
setTimeout("location.reload(true);",1500);
}
});
}
}
});
</script>
{/literal}
\ No newline at end of file
{/literal}
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