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

Worked on RG-164

parent dd2d5a32
No related branches found
No related tags found
No related merge requests found
......@@ -148,6 +148,7 @@ class CRM_Grant_Form_Task_Update extends CRM_Grant_Form_Task {
}
}
//CRM_Core_Error::debug( '$this', $this->sorted );
foreach ($this->sorted as $grantId) {
$ids['grant_id'] = $grantId;
$grantParams = array('id' => $grantId);
......@@ -158,18 +159,18 @@ class CRM_Grant_Form_Task_Update extends CRM_Grant_Form_Task {
$values['id'] = $grantId;
$values['status_id'] = $grant->status_id;
$values['amount_total'] = $grant->amount_total;
if ( $params['radio_ts'] == 'amount_total') {
if ($params['radio_ts'] == 'amount_total') {
unset($params['amount_granted']);
unset($values['amount_granted']);
$values['assessment'] = $grant->assessment;
$values['allocation'] = TRUE;
CRM_Grant_BAO_Grant::add($values, $ids);
}
else {
CRM_Grant_BAO_Grant::add($values, $ids);
if (!empty($params['amount_granted'])) {
CRM_Grant_BAO_GrantProgram::create($grantProgramParams, $ids);
else {
if ($params['radio_ts'] == 'no_update') {
unset($values['amount_granted']);
}
CRM_Grant_BAO_Grant::add($values, $ids);
}
$updatedGrants++;
}
......
......@@ -66,17 +66,5 @@
{literal}
<script type="text/javascript">
cj(document).ready( function() {
cj("#amount_granted").parent().parent().hide();
cj('input[name="radio_ts"]').click(function(){
if (this.value == 'amount_total' || this.value == 'no_update') {
cj("#amount_granted").parent().parent().hide();
cj("#amount_granted").val(null);
}
else {
cj("#amount_granted").parent().parent().show();
}
});
});
</script>
{/literal}
\ 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