protected $_foundRows = array();
function __construct(&$formValues) {
- $this->_formValues = $formValues;
-
$this->_text = CRM_Utils_Array::value('text', $formValues);
$this->_table = CRM_Utils_Array::value('table', $formValues);
$this->_limitRowClause = " LIMIT $rowCount";
$this->_limitDetailClause = " LIMIT $offset, $rowCount";
}
+
+ $this->_formValues = $formValues;
}
function __destruct() {
$tables['Membership'] = ts('Memberships');
}
- $form->add('select',
- 'table',
- ts('Tables'),
- $tables
- );
+ $form->add('select', 'table', ts('Tables'), $tables );
$form->assign('csID', $form->get('csid'));
// also add the limit constant
$form->assign('limit', self::LIMIT);
+ // set form defaults
+ if (!empty($form->_formValues)) {
+ $defaults = array();
+
+ if (isset($form->_formValues['text'])) {
+ $defaults['text'] = $form->_formValues['text'];
+ }
+
+ if (isset($form->_formValues['table'])) {
+ $defaults['table'] = $form->_formValues['table'];
+ $form->assign('table', $form->_formValues['table']);
+ }
+
+ $form->setDefaults($defaults);
+ }
+
/**
* You can define a custom title for the search form
*/
</div>
</div>
<div class="crm-block crm-content-block">
-{include file="CRM/common/pager.tpl" location="top"}
+{if !$table}{include file="CRM/common/pager.tpl" location="top"}{/if}
{include file="CRM/common/jsortable.tpl"}
{if $rowsEmpty}
{include file="CRM/Contact/Form/Search/Custom/EmptyResults.tpl"}
{* END Actions/Results section *}
</div>
{/if}
-{include file="CRM/common/pager.tpl" location="bottom"}
+{if !$table}{include file="CRM/common/pager.tpl" location="bottom"}{/if}
</div>