}
}
+ // define the status IDs that show the cancellation info, see CRM-17589
+ $cancelInfo_show_ids = array();
+ foreach ($statusName as $status_id => $status_name) {
+ if ($status_name == 'Cancelled' || $status_name == 'Refunded') {
+ $cancelInfo_show_ids[] = "'$status_id'";
+ }
+ }
+ $this->assign('cancelInfo_show_ids', implode(',', $cancelInfo_show_ids));
+
if ($this->_id) {
$contributionStatus = CRM_Core_DAO::getFieldValue('CRM_Contribute_DAO_Contribution', $this->_id, 'contribution_status_id');
$name = CRM_Utils_Array::value($contributionStatus, $statusName);
});
function showHideCancelInfo(obj) {
- if (obj.find(":selected").val() == '7' || obj.find(":selected").val() == '3') {
+ var selected_status_id = obj.find(":selected").val();
+ var cancelInfo_show_ids = [{/literal}{$cancelInfo_show_ids}{literal}];
+ if (cancelInfo_show_ids.indexOf(selected_status_id) > -1) {
cj('#cancelInfo').show( );
cj('#total_amount').attr('readonly', true);
}