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() {
'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'"
}
$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();
}
</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} {$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} {/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}