mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-09 13:06:14 +00:00
Merge branch 'seeddms-5.1.x' into seeddms-6.0.x
This commit is contained in:
commit
1e699147ff
|
@ -1061,9 +1061,10 @@ $(document).ready(function() {
|
||||||
|
|
||||||
$this->contentContainerEnd();
|
$this->contentContainerEnd();
|
||||||
|
|
||||||
if($facets) {
|
|
||||||
$menuitems = [];
|
$menuitems = [];
|
||||||
|
if($facets) {
|
||||||
foreach($facets as $facetname=>$values) {
|
foreach($facets as $facetname=>$values) {
|
||||||
|
if($values) {
|
||||||
if(substr($facetname, 0, 5) == 'attr_') {
|
if(substr($facetname, 0, 5) == 'attr_') {
|
||||||
$tmp = explode('_', $facetname);
|
$tmp = explode('_', $facetname);
|
||||||
if($attrdef = $dms->getAttributeDefinition($tmp[1])) {
|
if($attrdef = $dms->getAttributeDefinition($tmp[1])) {
|
||||||
|
@ -1156,10 +1157,30 @@ $(document).ready(function() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Create remove links for query 'notset'. The don't have any facet
|
||||||
|
* values and will not show up in the lists created above.
|
||||||
|
* This currently just workѕ for attributes
|
||||||
|
*/
|
||||||
|
$allparams = $request->query->all();
|
||||||
|
foreach($allparams['attributes'] as $an=>$av) {
|
||||||
|
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');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if($menuitems) {
|
if($menuitems) {
|
||||||
self::showNavigationListWithBadges($menuitems);
|
self::showNavigationListWithBadges($menuitems);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
echo "<p></p>";
|
echo "<p></p>";
|
||||||
$this->formSubmit("<i class=\"fa fa-search\"></i> ".getMLText('search'));
|
$this->formSubmit("<i class=\"fa fa-search\"></i> ".getMLText('search'));
|
||||||
echo "<p></p>";
|
echo "<p></p>";
|
||||||
|
@ -1182,7 +1203,9 @@ $(document).ready(function() {
|
||||||
if($values && (count($values) > 1 || reset($values) < $total)) {
|
if($values && (count($values) > 1 || reset($values) < $total)) {
|
||||||
if(empty($allparams['attributes'][$facetname]['from']) && empty($allparams['attributes'][$facetname]['to'])) {
|
if(empty($allparams['attributes'][$facetname]['from']) && empty($allparams['attributes'][$facetname]['to'])) {
|
||||||
$tt = array_keys($values);
|
$tt = array_keys($values);
|
||||||
$content = '<div class="input-group">';
|
$content = '';
|
||||||
|
$content = '<p><a href="'.$newrequest->getRequestUri().'&attributes['.$facetname.']=__notset__">Objects without this attribute</a></p>';
|
||||||
|
$content .= '<div class="input-group">';
|
||||||
$content .= '<span class="input-group-text" style="border-right: 0;"> from </span>';
|
$content .= '<span class="input-group-text" style="border-right: 0;"> from </span>';
|
||||||
$content .= '<input type="number" class="form-control" name="attributes['.$facetname.'][from]" value="" placeholder="min is '.min($tt).'" />';
|
$content .= '<input type="number" class="form-control" name="attributes['.$facetname.'][from]" value="" placeholder="min is '.min($tt).'" />';
|
||||||
$content .= '<span class="input-group-text" style="border-left: 0; border-right: 0;"> to </span>';
|
$content .= '<span class="input-group-text" style="border-left: 0; border-right: 0;"> to </span>';
|
||||||
|
@ -1212,6 +1235,7 @@ $(document).ready(function() {
|
||||||
/* See below on an explaination for the if statement */
|
/* See below on an explaination for the if statement */
|
||||||
if($values && (count($values) > 1 || reset($values) < $total)) {
|
if($values && (count($values) > 1 || reset($values) < $total)) {
|
||||||
$menuitems = array();
|
$menuitems = array();
|
||||||
|
$menuitems[] = array('label'=>'not set', 'link'=>$newrequest->getRequestUri().'&attributes['.$facetname.']=__notset__');
|
||||||
arsort($values);
|
arsort($values);
|
||||||
foreach($values as $v=>$c) {
|
foreach($values as $v=>$c) {
|
||||||
switch($attrdef->getType()) {
|
switch($attrdef->getType()) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user