From 52634dadd707628e18e81c5fe3f5147ad6a5488a Mon Sep 17 00:00:00 2001 From: Deepak Srivastava Date: Sun, 5 May 2013 00:45:54 +0530 Subject: [PATCH] Fix towards CRM-12490 --- CRM/Report/Form.php | 12 ++++++------ CRM/Report/Form/Contribute/Detail.php | 17 +++++++++++++++++ templates/CRM/Report/Form/Criteria.tpl | 21 ++++++++++++++------- 3 files changed, 37 insertions(+), 13 deletions(-) diff --git a/CRM/Report/Form.php b/CRM/Report/Form.php index fef2c7232c..7952582baa 100644 --- a/CRM/Report/Form.php +++ b/CRM/Report/Form.php @@ -803,16 +803,16 @@ class CRM_Report_Form extends CRM_Core_Form { if ($field['type'] == 'select') { $this->addElement('select', "{$fieldName}", $field['title'], $field['options']); } - else { + else if ($field['type'] == 'checkbox') { $options[$field['title']] = $fieldName; + $this->addCheckBox($fieldName, NULL, + $options, NULL, + NULL, NULL, NULL, $this->_fourColumnAttribute + ); } } - - $this->addCheckBox("options", $field['title'], - $options, NULL, - NULL, NULL, NULL, $this->_fourColumnAttribute - ); } + $this->assign('otherOptions', $this->_options); } function addChartOptions() { diff --git a/CRM/Report/Form/Contribute/Detail.php b/CRM/Report/Form/Contribute/Detail.php index 4da2923837..0b7b1a490e 100644 --- a/CRM/Report/Form/Contribute/Detail.php +++ b/CRM/Report/Form/Contribute/Detail.php @@ -168,6 +168,10 @@ class CRM_Report_Form_Contribute_Detail extends CRM_Report_Form { 'no_display' => TRUE, 'required' => TRUE, ), + 'list_contri_id' => array( + 'name' => 'id', + 'title' => ts('Contribution ID'), + ), 'contribution_or_soft' => array('title' => ts('Contribution OR Soft Credit?'), 'dbAlias' => "'Contribution'" @@ -343,6 +347,19 @@ class CRM_Report_Form_Contribute_Detail extends CRM_Report_Form { } $this->_currencyColumn = 'civicrm_contribution_currency'; + + $this->_options = array( + 'include_set' => + array('title' => ts('Include'), + 'type' => 'select', + 'options' => array( + '' => '-select-', + 1 => ts('Contributions Only'), + 2 => ts('Soft Credits Only'), + 3 => ts('Both'), + ), + ), + ); parent::__construct(); } diff --git a/templates/CRM/Report/Form/Criteria.tpl b/templates/CRM/Report/Form/Criteria.tpl index ea0cd1e4e6..bd6f67f548 100644 --- a/templates/CRM/Report/Form/Criteria.tpl +++ b/templates/CRM/Report/Form/Criteria.tpl @@ -146,16 +146,23 @@ {/if} - {if $form.options.html || $form.options.html} + {if $otherOptions}

Other Options

- - - {if $form.blank_column_end} - - {/if} - + {assign var="optionCount" value=0} + + {foreach from=$otherOptions item=optionField key=optionName} + {assign var="optionCount" value=`$optionCount+1`} + + {if $optionCount is div by 2} + + {/if} + {/foreach} + {if $optionCount is not div by 2} + + {/if} +
{$form.options.html}{$form.blank_column_end.label}  {$form.blank_column_end.html}
{if $form.$optionName.label}{$form.$optionName.label} {/if}{$form.$optionName.html}
{/if} -- 2.25.1