Skip to content
Snippets Groups Projects
Commit 171915c8 authored by Edzelopez's avatar Edzelopez
Browse files

Merge pull request #187 from Edzelopez/RG-210

RG-210 Fixed alerts
parents 32cef1e1 fb6c93ae
No related branches found
No related tags found
No related merge requests found
......@@ -121,7 +121,7 @@ class CRM_Grant_Form_PaymentTask extends CRM_Core_Form {
$form->_componentClause =
' civicrm_payment.id IN ( ' .
implode(',', $ids) . ' ) ';
$form->assign('totalSelectedGrants', count($ids));
$form->assign('totalSelectedGrants', count($ids));
}
$form->_grantPaymentIds = $form->_componentIds = $ids;
......
......@@ -63,6 +63,9 @@ class CRM_Grant_Form_Task_Cancel extends CRM_Grant_Form_PaymentTask {
*/
function buildQuickForm() {
$this->addDefaultButtons(ts('Cancel Grants'), 'done');
$smarty = CRM_Core_Smarty::singleton();
$vars = $smarty->get_template_vars();
CRM_Core_Session::setStatus(ts('Are you sure you want to cancel the selected Grant Payments? This cancel operation cannot be undone and will delete all transactions associated with these grant payments. Number of selected grant payments: '. $vars['totalSelectedGrants']), NULL, 'no-popup');
}
/**
......
......@@ -107,28 +107,44 @@ class CRM_Grant_Form_Task_Pay extends CRM_Grant_Form_Task
*/
function buildQuickForm( )
{
if ( count($this->_approvedGrants) ) {
$this->assign( 'paid', count( $this->_paidGrants ) );
$this->assign( 'approved', count( $this->_approvedGrants ) );
$this->assign( 'total', count( $this->_grantIds ) );
$this->assign( 'notApproved', $this->_notApproved );
$this->assign( 'multipleCurrency', $this->_curency );
$message = "";
if (count($this->_approvedGrants)) {
if (count($this->_paidGrants)) {
$message = count( $this->_paidGrants ).' of the '.count($this->_grantIds).' selected grants have already been paid. ';
}
if ($this->_notApproved) {
$message .= $this->_notApproved.' of the '.count($this->_grantIds).' selected grants are not eligible. ';
}
if ($this->_curency) {
$message .= $this->_curency.' of '.count($this->_grantIds).' grants have different currency of same user. ';
}
if (count( $this->_approvedGrants )) {
$message .= 'Would you like to proceed to paying the '.count( $this->_approvedGrants ).' eligible or approved for payment but unpaid grants?';
CRM_Core_Session::setStatus(ts($message), NULL, 'no-popup');
}
$this->addButtons( array(
array ( 'type' => 'next',
'name' => ts('Continue >>'),
'spacing' => '          ',
'isDefault' => true ),
array ( 'type' => 'cancel',
'name' => ts('Cancel') ),
)
);
} else {
$this->addButtons(array(
array ( 'type' => 'cancel',
'name' => ts('Cancel') ),
)
);
$this->addButtons( array(
array (
'type' => 'next',
'name' => ts('Continue >>'),
'spacing' => '          ',
'isDefault' => true,
),
array (
'type' => 'cancel',
'name' => ts('Cancel'),
),
)
);
}
else {
CRM_Core_Session::setStatus(ts('Please select at least one grant that has been approved for payment or eligible and not been paid.'), NULL, 'no-popup');
$this->addButtons(array(
array (
'type' => 'cancel',
'name' => ts('Cancel') ),
)
);
}
}
......
......@@ -91,7 +91,6 @@ class CRM_Grant_Form_Task_Reprint extends CRM_Grant_Form_PaymentTask
}
}
$selectedPayments = count($this->_grantPaymentIds);
$this->assign( 'total', $selectedPayments );
foreach ( $this->_grantPaymentIds as $key => $paymentId ) {
$paymentDAO =& new CRM_Grant_DAO_GrantPayment();
$paymentDAO->id = $paymentId;
......@@ -101,11 +100,9 @@ class CRM_Grant_Form_Task_Reprint extends CRM_Grant_Form_PaymentTask
}
}
$reprinted = count($this->_grantPaymentIds);
$this->assign( 'stopped', $selectedPayments - $reprinted );
$this->assign( 'reprinted', $reprinted );
$stopped = $selectedPayments - $reprinted;
if ( count($this->_grantPaymentIds ) ) {
$this->assign( 'payments', 1 );
CRM_Core_Session::setStatus(ts( $stopped.' of the '.$selectedPayments.' selected grant payments have already been stopped. '.count($this->_grantPaymentIds).' of the '.count($this->_grantPaymentIds).' selected grant payments are printed or reprinted.'), NULL, 'no-popup');
$this->applyFilter('__ALL__','trim');
$attributes = CRM_Core_DAO::getAttribute( 'CRM_Grant_DAO_GrantProgram' );
......@@ -132,6 +129,7 @@ class CRM_Grant_Form_Task_Reprint extends CRM_Grant_Form_PaymentTask
)
);
} else {
CRM_Core_Session::setStatus(ts('Please select at least one grant payment that has been printed.'), NULL, 'no-popup');
$this->addButtons(array(
array ( 'type' => 'cancel',
'name' => ts('Cancel') ),
......
......@@ -123,6 +123,9 @@ class CRM_Grant_Page_GrantProgram extends CRM_Core_Page {
$this->browse();
}
$this->assign('action', $action);
if ($action & CRM_Core_Action::DELETE) {
CRM_Core_Session::setStatus(ts('Deleting a grant program cannot be undone. Do you want to continue?'), NULL, 'no-popup');
}
return parent::run();
}
......
......@@ -53,6 +53,12 @@ class CRM_Grant_Page_Payment extends CRM_Core_Page {
$controller->process();
$controller->run();
$this->assign('action', $action);
if ($action == 2097152) {
CRM_Core_Session::setStatus(ts('Do you want to record that a Stop payment request has been made with bank on this payment?'), NULL, 'no-popup');
}
elseif ($action == 8388608) {
CRM_Core_Session::setStatus(ts('Do you want to record that this cheque will not be cashed, e.g. it has been destroyed or is stale dated?'), NULL, 'no-popup');
}
return parent::run();
}
}
......@@ -27,12 +27,7 @@
<h3>{if $action eq 1}{ts}New Grant Program{/ts}{elseif $action eq 2}{ts}Edit Grant Program{/ts}{elseif $action eq 4}{ts}View Grant Program{/ts}{else}{ts}Delete Grant Program{/ts}{/if}</h3>
<div class="crm-block crm-form-block crm-contribution_type-form-block">
{if $action eq 4}
{elseif $action eq 8}
<div class="messages status">
<div class="icon inform-icon"></div>
{ts}Deleting a grant program cannot be undone.{/ts} {ts}Do you want to continue?{/ts}
</div>
{else}
<div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="top"}</div>
<table class="form-layout-compressed">
......
......@@ -48,11 +48,7 @@
</div>
{elseif $action eq 2097152}
<h3>{ts}Stop Payment{/ts}</h3>
<div class="crm-block crm-content-block crm-grant-view-block">
<div class="messages status">
<div class="icon inform-icon"></div>
{ts}Do you want to record that a Stop payment request has been made with bank on this payment?{/ts}
</div>
<div class="crm-block crm-content-block crm-grant-view-block">
<div class="crm-submit-buttons">
{include file="CRM/common/formButtons.tpl" location="bottom"}
</div>
......@@ -85,10 +81,6 @@
<h3>{ts}Withdraw Payment{/ts}</h3>
<div class="crm-block crm-content-block crm-grant-view-block">
<div class="messages status">
<div class="icon inform-icon"></div>
{ts}Do you want to record that this cheque will not be cashed, e.g. it has been destroyed or is stale dated?{/ts}
</div>
<div class="crm-submit-buttons">
{include file="CRM/common/formButtons.tpl" location="bottom"}
</div>
......
......@@ -23,9 +23,6 @@
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
+--------------------------------------------------------------------+
*}
{if $totalSelectedGrants}
{ts 1=$totalSelectedGrants}Number of selected grant paments: %1{/ts}
{/if}
{if $rows }
<div class="form-item">
<table width="30%">
......
......@@ -24,9 +24,5 @@
+--------------------------------------------------------------------+
*}
{* Confirmation of Grant Payment Cancel *}
<div class="messages status">
<p><div class="icon inform-icon"></div>&nbsp;
{ts}Are you sure you want to cancel the selected Grant Payments? This cancel operation cannot be undone and will delete all transactions associated with these grant payments.{/ts}</p>
<p>{include file="CRM/Grant/Form/PaymentTask.tpl"}</p>
</div>
{include file="CRM/Grant/Form/PaymentTask.tpl"}
<div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl"}</div>
......@@ -24,15 +24,4 @@
+--------------------------------------------------------------------+
*}
{* Confirmation of Grant pay *}
{if $approved}
<div class="messages status">
<p><div class="icon inform-icon"></div>&nbsp;
{ts}'{if $paid neq 0}{$paid} of the {$total} selected grants have already been paid.{/if} {if $notApproved neq 0}{$notApproved} of the {$total} selected grants are not eligible.{/if} {if $multipleCurrency } {$multipleCurrency} of {$total} grants have different currency of same user. {/if} Would you like to proceed to paying the {$approved} eligible or approved for payment but unpaid grants?'{/ts}</p>
</div>
{else if}
<div class="messages status">
<p><div class="icon inform-icon"></div>&nbsp;
{ts}Please select at least one grant that has been approved for payment or eligible and not been paid.{/ts}</p>
</div>
{/if}
<div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl"}</div>
......@@ -25,10 +25,6 @@
*}
{* Confirmation of Grant pay *}
{if $payments}
<div class="messages status">
<p><div class="icon inform-icon"></div>&nbsp;
{ts}'{$stopped} of the {$total} selected grant payments have already been stopped. {$reprinted} of the {$total} selected grant payments are printed or reprinted.{/ts}</p>
</div>
<h3>{ts}Reprint Payments{/ts}</h3>
<div class="crm-block crm-form-block crm-contribution_type-form-block">
<div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="top"}</div>
......@@ -61,13 +57,6 @@
</tr>
</table>
<div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="botttom"}</div>
</div>
{else if}
<div class="messages status">
<p><div class="icon inform-icon"></div>&nbsp;
{ts}Please select at least one grant payment that has been printed.{/ts}</p>
</div>
<div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl"}</div>
{/if}
<div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="botttom"}</div>
\ No newline at end of file
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