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:
parent
d87bf98163
commit
c4bbd08ebf
1 changed files with 11 additions and 8 deletions
|
@ -46,14 +46,13 @@ class uiSearch
|
||||||
|
|
||||||
function searchForm($id, $mask2)
|
function searchForm($id, $mask2)
|
||||||
{
|
{
|
||||||
//print_r($this->criteria['form']);
|
|
||||||
include(dirname(__FILE__).'/formmask/metadata.inc.php');
|
include(dirname(__FILE__).'/formmask/metadata.inc.php');
|
||||||
$form = new HTML_QuickForm('search', UI_STANDARD_FORM_METHOD, UI_HANDLER);
|
$form = new HTML_QuickForm('search', UI_STANDARD_FORM_METHOD, UI_HANDLER);
|
||||||
$counter = isset($this->criteria['counter']) ? $this->criteria['counter'] : 1;
|
$counter = isset($this->criteria['counter']) ? $this->criteria['counter'] : 1;
|
||||||
$form->setConstants(array('id'=>$id, 'counter'=>$counter));
|
$form->setConstants(array('id'=>$id, 'counter'=>$counter));
|
||||||
|
|
||||||
foreach ($mask['pages'] as $key=>$val) {
|
foreach ($mask['pages'] as $key=>$val) {
|
||||||
foreach ($mask['pages'][$key] as $v){
|
foreach ($mask['pages'][$key] as $v) {
|
||||||
if (isset($v['type']) && $v['type']) {
|
if (isset($v['type']) && $v['type']) {
|
||||||
$col1[uiBase::formElementEncode($v['element'])] = tra($v['label']);
|
$col1[uiBase::formElementEncode($v['element'])] = tra($v['label']);
|
||||||
if (isset($val['relation'])) {
|
if (isset($val['relation'])) {
|
||||||
|
@ -68,8 +67,8 @@ class uiSearch
|
||||||
for ($n = 1; $n <= UI_SEARCH_MAX_ROWS; $n++) {
|
for ($n = 1; $n <= UI_SEARCH_MAX_ROWS; $n++) {
|
||||||
unset($group);
|
unset($group);
|
||||||
|
|
||||||
if (($n > 1) && ($n > $counter) ) {
|
if ( ($n > 1) && ($n > $counter) ) {
|
||||||
$activerow = FALSE;
|
$activerow = FALSE;
|
||||||
} else {
|
} else {
|
||||||
$activerow = TRUE;
|
$activerow = TRUE;
|
||||||
}
|
}
|
||||||
|
@ -101,6 +100,12 @@ class uiSearch
|
||||||
$form->addElement('static', 's2', NULL, "</div id='searchRow_$n'>");
|
$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']);
|
uiBase::parseArrayToForm($form, $mask2['search']);
|
||||||
$constants = isset($this->criteria['form']) ? $this->criteria['form'] : null;
|
$constants = isset($this->criteria['form']) ? $this->criteria['form'] : null;
|
||||||
$form->setConstants($constants);
|
$form->setConstants($constants);
|
||||||
|
@ -108,8 +113,6 @@ class uiSearch
|
||||||
$renderer = new HTML_QuickForm_Renderer_Array(true, true);
|
$renderer = new HTML_QuickForm_Renderer_Array(true, true);
|
||||||
$form->accept($renderer);
|
$form->accept($renderer);
|
||||||
$output['dynform'] = $renderer->toArray();
|
$output['dynform'] = $renderer->toArray();
|
||||||
//print_r($output);
|
|
||||||
//echo '<XMP>output:'; print_r($output); echo "</XMP>\n";
|
|
||||||
return $output;
|
return $output;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -277,8 +280,8 @@ class uiSearch
|
||||||
|
|
||||||
function clear()
|
function clear()
|
||||||
{
|
{
|
||||||
//$this->results = NULL;
|
$this->criteria["conditions"] = null;
|
||||||
$this->criteria['form'] = NULL;
|
$this->criteria['form'] = NULL;
|
||||||
$this->criteria['counter'] = NULL;
|
$this->criteria['counter'] = NULL;
|
||||||
$this->setReload();
|
$this->setReload();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue