This topic is locked
[SOLVED]

 Post build coding modification. For ‘list page’ search p

8/13/2010 3:50:04 PM
PHPRunner General questions
D
DarrylW author

Hello,

I recently upgraded to 5.2 and still finding my way around it.
Does anyone know which file has the script/code for the radio buttons and 'please select' elements where the searchtype is attributed for the 'list page' search panel.
Version: phprunner 5.2 Build 5449,
I require to disable the options (Equals / Doesn't Equal) for radio buttons and 'please select' drop downs , and be left with just the options (Contains / Equals / Starts With / etc / etc / ) for text box entries.
I've been searching through php and java files but do not find the required code to disable the options.
Any directions to the correct file would be much appreciated.
Da <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=question&id=14994&image=1&table=forumtopics' class='bbc_emoticon' alt=':blink:' />

A
ann 8/16/2010

Darryl,
you can edit getCtrlSearchTypeOptions() function in the generated classes\searchcontrol.php file for this purpose.

Unfortunately we don't have a ready to go solution for this.

D
DarrylW author 8/16/2010



Darryl,
you can edit getCtrlSearchTypeOptions() function in the generated classes\searchcontrol.php file for this purpose.

Unfortunately we don't have a ready to go solution for this.


Hello Ann,
Thanks, I missed that file, <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=51923&image=1&table=forumreplies' class='bbc_emoticon' alt=':)' />
I've edited searchcontrol.php to give the required output,

As the searchtype is attached to the fields in a loop I have edited script to look for common options and depending on the options set, used ' if or else' to rewrite the output with a style class to hide the unrequired boxes.
The next task is to set the required layout...........
The advanced search panel on the list page with 5.2 is a big plus with current projects as its less work than with 5.1 when having to code the advanced search page into the list page.
Is the next version of phprunner going to have a more configurable searchpanel with regards to the options and layout?
Da.
..........................................................................................

example tested ok in a several browsers.

..........................................................................................

remove unrequired options boxes #####


$option ='<OPTION VALUE="Equals" >Equals</option><OPTION VALUE="NOT Equals" >Doesn\'t equal</option>';

$option2='<OPTION VALUE="Equals" selected>Equals</option><OPTION VALUE="NOT Equals" >Doesn\'t equal</option>';



$status=$option;

$status2=$option2;
$box='';

if ($this->getCtrlSearchTypeOptions($fName, $selOpt, $not)==$status)

{

$box='yes';

}

if ($this->getCtrlSearchTypeOptions($fName, $selOpt, $not)==$status2)

{

$box='yes';

}
if ($box=='yes')

{

$searchtype = '<SELECT id="'.$this->getSearchOptionId($fName, $recId).'" NAME="'.$this->getSearchOptionId($fName, $recId).'" SIZE=1 onchange="'.$selectOnChange.'" '.($renderHidden || !$this->getSrchPanelAttr['ctrlTypeComboStatus'] ? 'class="nobox"' : '').'>';

$searchtype .= $this->getCtrlSearchTypeOptions($fName, $selOpt, $not);

$searchtype .= "</SELECT>";

}

endof remove unrequired options boxes #####


continue with required options boxes #####


else



{

$searchtype = '<SELECT id="'.$this->getSearchOptionId($fName, $recId).'" NAME="'.$this->getSearchOptionId($fName, $recId).'" SIZE=1 onchange="'.$selectOnChange.'" '.($renderHidden || !$this->getSrchPanelAttrs['ctrlTypeComboStatus'] ? 'style="display: none;"' : '').'>';

$searchtype .= $this->getCtrlSearchTypeOptions($fName, $selOpt, $not);

$searchtype .= "</SELECT>";

}

return $searchtype;

}

endof continue with required options boxes #####


...........................................................................................

style class added to search_panel.htm
.nobox {

width: 0px;

overflow: hidden;

display: none;

visibility: hidden;

}

...........................................................................................
Note: Checking for selected'Doesn't equal' was not required as the selection will always Equals.

A
ann 8/17/2010

Hi,
I'll add this feature to our suggestion list for the next version.