mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-09 13:06:14 +00:00
add fulltext search for attribute=__any__
This commit is contained in:
parent
749c40211d
commit
bc70af210d
|
@ -1017,7 +1017,7 @@ $(document).ready(function() {
|
|||
default:
|
||||
$option = array($v, $v);
|
||||
}
|
||||
if(isset($attributes[$facetname]) && in_array($v, $attributes[$facetname]))
|
||||
if(isset($attributes[$facetname]) && is_array($attributes[$facetname]) && in_array($v, $attributes[$facetname]))
|
||||
$option[] = true;
|
||||
else
|
||||
$option[] = false;
|
||||
|
@ -1125,6 +1125,7 @@ $(document).ready(function() {
|
|||
} else {
|
||||
$oldvalue = [$allparams['attributes'][$facetname]];
|
||||
}
|
||||
if($oldvalue) {
|
||||
unset($allparams['attributes'][$facetname]);
|
||||
$newrequest = Symfony\Component\HttpFoundation\Request::create($request->getBaseUrl(), 'GET', $allparams);
|
||||
$menuitems[] = array('label'=>'<i class="fa fa-remove"></i> '.$dispname.' = '.implode(', ', $oldvalue), 'link'=>$newrequest->getRequestUri(), 'attributes'=>[['title', 'Click to remove']], '_badge'=>'x');
|
||||
|
@ -1133,6 +1134,7 @@ $(document).ready(function() {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
/* Create a link to remove the filter */
|
||||
$allparams = $request->query->all();
|
||||
|
@ -1201,14 +1203,14 @@ $(document).ready(function() {
|
|||
$allparams = $request->query->all();
|
||||
if(isset($allparams['attributes'])) {
|
||||
foreach($allparams['attributes'] as $an=>$av) {
|
||||
if(is_string($av) && $av == '__notset__') {
|
||||
if(is_string($av) && ($av == '__notset__')) {
|
||||
$tmp = explode('_', $an);
|
||||
if($attrdef = $dms->getAttributeDefinition($tmp[1])) {
|
||||
$dispname = $attrdef->getName();
|
||||
unset($allparams['attributes'][$an]);
|
||||
$newrequest = Symfony\Component\HttpFoundation\Request::create($request->getBaseUrl(), 'GET', $allparams);
|
||||
$menuitems[] = array('label'=>'<i class="fa fa-remove"></i> '.$dispname.' is not set', 'link'=>$newrequest->getRequestUri(), 'attributes'=>[['title', 'Click to remove']], '_badge'=>'x');
|
||||
echo '<input type="hidden" name="attributes['.$an.']" value="__notset__" />';
|
||||
echo '<input type="hidden" name="attributes['.$an.']" value="'.$av.'" />';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1275,6 +1277,7 @@ $(document).ready(function() {
|
|||
if($values && (count($values) > 1 || reset($values) < $total)) {
|
||||
$menuitems = array();
|
||||
$menuitems[] = array('label'=>getMLText('no_value_set'), 'link'=>$newrequest->getRequestUri().'&attributes['.$facetname.']=__notset__');
|
||||
$menuitems[] = array('label'=>getMLText('any_value_set'), 'link'=>$newrequest->getRequestUri().'&attributes['.$facetname.']=__any__');
|
||||
arsort($values);
|
||||
foreach($values as $v=>$c) {
|
||||
switch($attrdef->getType()) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user