Advanced Search

SVN:b1162[5391]
This commit is contained in:
Eric Espié
2018-03-07 17:07:40 +00:00
parent 118b5c8a7d
commit e9bcd170c0
2 changed files with 13 additions and 4 deletions

View File

@@ -50,7 +50,9 @@ class NiceWebPage extends WebPage
$this->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/datatable.js');
$this->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/jquery.positionBy.js');
$this->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/jquery.popupmenu.js');
$this->add_ready_script(
$this->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/search/search_form_handler.js');
$this->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/search/search_form_criteria.js');
$this->add_ready_script(
<<< EOF
//add new widget called TruncatedList to properly display truncated lists when they are sorted
$.tablesorter.addWidget({

View File

@@ -38,6 +38,15 @@ use WebPage;
class SearchForm
{
/**
* @param \WebPage $oPage
* @param \CMDBObjectSet $oSet
* @param array $aExtraParams
*
* @return string
* @throws \CoreException
* @throws \DictExceptionMissingString
*/
public static function GetSearchForm(WebPage $oPage, CMDBObjectSet $oSet, $aExtraParams = array())
{
$sHtml = '';
@@ -110,8 +119,6 @@ class SearchForm
),
);
$oPage->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/search/search_form_handler.js');
$oPage->add_linked_script(utils::GetAbsoluteUrlAppRoot().'js/search/search_form_criteria.js');
$oPage->add_ready_script('$("#fs_'.$sSearchFormId.'").search_form_handler('.json_encode($aSearchParams).');');
return $sHtml;
@@ -137,10 +144,10 @@ class SearchForm
$aField['code'] = $sFilterCode;
$aField['class'] = $sClassName;
$aField['class_alias'] = $sClassAlias;
$aField['label'] = Dict::S('Class:'.$sClassName.'/Attribute:'.$sFilterCode);
if (array_key_exists($sFilterCode, $aAttrDefs))
{
$oAttrDef = $aAttrDefs[$sFilterCode];
$aField['label'] = $oAttrDef->GetLabel();
$aField['widget'] = $oAttrDef->GetSearchType();
$aField['allowed_values'] = self::GetFieldAllowedValues($oAttrDef);
}