diff --git a/views/bootstrap/class.Search.php b/views/bootstrap/class.Search.php index 87d39fc66..f90450d76 100644 --- a/views/bootstrap/class.Search.php +++ b/views/bootstrap/class.Search.php @@ -971,7 +971,13 @@ $(document).ready(function() { default: $options = []; foreach($values as $v=>$c) { - $option = array($v, $v); + switch($attrdef->getType()) { + case SeedDMS_Core_AttributeDefinition::type_date: + $option = array($v, getReadableDate($v)); + break; + default: + $option = array($v, $v); + } if(isset($attributes[$facetname]) && in_array($v, $attributes[$facetname])) $option[] = true; else @@ -1052,7 +1058,16 @@ $(document).ready(function() { echo ''; } } else { - $oldvalue = is_array($allparams['attributes'][$facetname]) ? implode(',', $allparams['attributes'][$facetname]) : $allparams['attributes'][$facetname]; + if(is_array($allparams['attributes'][$facetname])) { + switch($attrdef->getType()) { + case SeedDMS_Core_AttributeDefinition::type_date: + array_walk($allparams['attributes'][$facetname], function(&$v, $k){$v=getReadableDate($v);}); + break; + } + $oldvalue = implode(',', $allparams['attributes'][$facetname]); + } else { + $oldvalue = $allparams['attributes'][$facetname]; + } unset($allparams['attributes'][$facetname]); $newrequest = Symfony\Component\HttpFoundation\Request::create($request->getBaseUrl(), 'GET', $allparams); $menuitems[] = array('label'=>' '.$dispname.' = '.$oldvalue, 'link'=>$newrequest->getRequestUri(), 'attributes'=>[['title', 'Click to remove']], '_badge'=>'x'); @@ -1065,18 +1080,22 @@ $(document).ready(function() { $allparams = $request->query->all(); if(isset($allparams[$facetname])) { $oldvalue = is_array($allparams[$facetname]) ? implode(',', $allparams[$facetname]) : $allparams[$facetname]; + switch($facetname) { + case 'status': + $oldtransval = getOverallStatusText($oldvalue); + break; + default: + $oldtransval = $oldvalue; + } unset($allparams[$facetname]); $newrequest = Symfony\Component\HttpFoundation\Request::create($request->getBaseUrl(), 'GET', $allparams); - $menuitems[] = array('label'=>' '.getMLText($facetname).' = '.$oldvalue, 'link'=>$newrequest->getRequestUri(), 'attributes'=>[['title', 'Click to remove']], '_badge'=>'x'); + $menuitems[] = array('label'=>' '.getMLText($facetname).' = '.$oldtransval, 'link'=>$newrequest->getRequestUri(), 'attributes'=>[['title', 'Click to remove']], '_badge'=>'x'); echo ''; } } } if($menuitems) { -// ob_start(); self::showNavigationListWithBadges($menuitems); -// $content = ob_get_clean(); -// $this->printAccordion(getMLText('current_filter'), $content, true); } } echo "
"; @@ -1102,7 +1121,7 @@ $(document).ready(function() { if(empty($allparams['attributes'][$facetname]['from']) && empty($allparams['attributes'][$facetname]['to'])) { $tt = array_keys($values); $content = '