Fix towards CRM-12490
authorDeepak Srivastava <deepak.srivastava@webaccess.co.in>
Sat, 4 May 2013 19:15:54 +0000 (00:45 +0530)
committerDeepak Srivastava <deepak.srivastava@webaccess.co.in>
Sat, 4 May 2013 19:15:54 +0000 (00:45 +0530)
CRM/Report/Form.php
CRM/Report/Form/Contribute/Detail.php
templates/CRM/Report/Form/Criteria.tpl

index fef2c7232c8699097de16aaab6c2639961ec0a6e..7952582baaf024259872298b3bbc761e14ece589 100644 (file)
@@ -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() {
index 4da29238373df377f6a17704563f2c96b8993359..0b7b1a490ef263b6297f010bbbf393c49be51a4f 100644 (file)
@@ -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();
   }
 
index ea0cd1e4e6a87e1d0fe57fe0ff8b6c66e701de97..bd6f67f548b9a66fc7b8021d0b8a84d41483549e 100644 (file)
       </div>
     {/if}
 
-    {if $form.options.html || $form.options.html}
+    {if $otherOptions}
         <div id="other-options" class="civireport-criteria" >
         <h3>Other Options</h3>
         <table class="report-layout">
-            <tr class="crm-report crm-report-criteria-groupby">
-          <td>{$form.options.html}</td>
-          {if $form.blank_column_end}
-              <td>{$form.blank_column_end.label}&nbsp;&nbsp;{$form.blank_column_end.html}</td>
-                {/if}
-            </tr>
+          {assign var="optionCount" value=0}
+          <tr class="crm-report crm-report-criteria-field">
+          {foreach from=$otherOptions item=optionField key=optionName}
+            {assign var="optionCount" value=`$optionCount+1`}
+            <td>{if $form.$optionName.label}{$form.$optionName.label}&nbsp;{/if}{$form.$optionName.html}</td>
+            {if $optionCount is div by 2}
+              </tr><tr class="crm-report crm-report-criteria-field">
+            {/if}
+          {/foreach}
+          {if $optionCount is not div by 2}
+            <td colspan="2 - ($count % 2)"></td>
+          {/if}
+          </tr>
         </table>
         </div>
     {/if}