Fix for #2160 - Web search screen - clicking RESET CRITERIA does not redo the search. Fix for #2181 - Web search screen - form does not correctly show the operator in use.

This commit is contained in:
paul 2007-02-10 17:45:21 +00:00
parent d87bf98163
commit c4bbd08ebf

View file

@ -46,7 +46,6 @@ class uiSearch
function searchForm($id, $mask2)
{
//print_r($this->criteria['form']);
include(dirname(__FILE__).'/formmask/metadata.inc.php');
$form = new HTML_QuickForm('search', UI_STANDARD_FORM_METHOD, UI_HANDLER);
$counter = isset($this->criteria['counter']) ? $this->criteria['counter'] : 1;
@ -101,6 +100,12 @@ class uiSearch
$form->addElement('static', 's2', NULL, "</div id='searchRow_$n'>");
}
for ($i = 0; $i < count($mask2['search']); $i++) {
if ($mask2['search'][$i]['element'] == "operator") {
$mask2['search'][$i]['selected'] = strtolower($this->criteria['operator']);
break;
}
}
uiBase::parseArrayToForm($form, $mask2['search']);
$constants = isset($this->criteria['form']) ? $this->criteria['form'] : null;
$form->setConstants($constants);
@ -108,8 +113,6 @@ class uiSearch
$renderer = new HTML_QuickForm_Renderer_Array(true, true);
$form->accept($renderer);
$output['dynform'] = $renderer->toArray();
//print_r($output);
//echo '<XMP>output:'; print_r($output); echo "</XMP>\n";
return $output;
}
@ -277,7 +280,7 @@ class uiSearch
function clear()
{
//$this->results = NULL;
$this->criteria["conditions"] = null;
$this->criteria['form'] = NULL;
$this->criteria['counter'] = NULL;
$this->setReload();