alter default choice for date field in Advanced search |
2/11/2007 10:36:38 AM |
PHPRunner General questions | |
T
thesofa author
my users have to filter the data using the Between choice in date fields, it would be lovely if I could always offer this as the default choice for them. |
|
J
|
Jane 2/12/2007 |
Hi, if($not) $smarty->assign("not_number"," checked"); // write search options and edit code snippet just after. See my changes in Bold: $options=""; $options.="<OPTION VALUE=\"Between\" ".(($opt=="Between")?"selected":"").">"."Between"."</option>"; $options.="<OPTION VALUE=\"Contains\" ".(($opt=="Contains")?"selected":"").">"."Contains"."</option>"; $options.="<OPTION VALUE=\"Equals\" ".(($opt=="Equals")?"selected":"").">"."Equals"."</option>"; $options.="<OPTION VALUE=\"Starts with ...\" ".(($opt=="Starts with ...")?"selected":"").">"."Starts with ..."."</option>"; $options.="<OPTION VALUE=\"More than ...\" ".(($opt=="More than ...")?"selected":"").">"."More than ..."."</option>"; $options.="<OPTION VALUE=\"Less than ...\" ".(($opt=="Less than ...")?"selected":"").">"."Less than ..."."</option>"; $options.="<OPTION VALUE=\"Equal or more than ...\" ".(($opt=="Equal or more than ...")?"selected":"").">"."Equal or more than ..."."</option>"; $options.="<OPTION VALUE=\"Equal or less than ...\" ".(($opt=="Equal or less than ...")?"selected":"").">"."Equal or less than ..."."</option>"; $options.="<OPTION VALUE=\"Empty\" ".(($opt=="Empty")?"selected":"").">"."Empty"."</option>"; |
T
|
thesofa author 2/12/2007 |
Thank you for the quick as ever reply. |
J
|
Jane 2/13/2007 |
Sure. Open C:/Program Files/PHPRunner3.2/source/search.php file, find and edit following code: ##if @f.strEditFormat==EDIT_FORMAT_DATE## $options.="<OPTION VALUE=\"Equals\" ".(($opt=="Equals")?"selected":"").">".##message EQUALS##."</option>"; $options.="<OPTION VALUE=\"More than ...\" ".(($opt=="More than ...")?"selected":"").">".##message MORE_THAN##."</option>"; $options.="<OPTION VALUE=\"Less than ...\" ".(($opt=="Less than ...")?"selected":"").">".##message LESS_THAN##."</option>"; $options.="<OPTION VALUE=\"Equal or more than ...\" ".(($opt=="Equal or more than ...")?"selected":"").">".##message EQUAL_OR_MORE##."</option>"; $options.="<OPTION VALUE=\"Equal or less than ...\" ".(($opt=="Equal or less than ...")?"selected":"").">".##message EQUAL_OR_LESS##."</option>"; $options.="<OPTION VALUE=\"Between\" ".(($opt=="Between")?"selected":"").">".##message BETWEEN##."</option>"; $options.="<OPTION VALUE=\"Empty\" ".(($opt=="Empty")?"selected":"").">".##message EMPTY##."</option>"; |