mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-03-11 16:35:38 +00:00
Merge branch 'seeddms-5.1.x' into seeddms-6.0.x
This commit is contained in:
commit
fa19503ab2
|
@ -267,6 +267,9 @@
|
|||
- fix export of search result
|
||||
- use openssl instead of mcrypt
|
||||
- search form shows 'from' and 'to' field for integers and floats
|
||||
- show preview of document in EditAttributes page
|
||||
- major overhaul of fulltext search, add new search tab for a more
|
||||
facetted based search
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
Changes in version 5.1.30
|
||||
|
|
|
@ -66,22 +66,65 @@ if (isset($_GET["removecategory"]) && is_numeric($_GET["removecategory"]) && $_G
|
|||
$removecategory = (int) $_GET['removecategory'];
|
||||
}
|
||||
|
||||
$terms = [];
|
||||
$limit = (isset($_GET["limit"]) && is_numeric($_GET["limit"])) ? (int) $_GET['limit'] : 20;
|
||||
$fullsearch = ((!isset($_GET["fullsearch"]) && $settings->_defaultSearchMethod == 'fulltext') || !empty($_GET["fullsearch"])) && $settings->_enableFullSearch;
|
||||
$facetsearch = !empty($_GET["facetsearch"]) && $settings->_enableFullSearch;
|
||||
if($fullsearch) {
|
||||
// Search in Fulltext {{{
|
||||
if (isset($_GET["query"]) && is_string($_GET["query"])) {
|
||||
$query = $_GET["query"];
|
||||
// if(isset($_GET['action']) && ($_GET['action'] == 'typeahead'))
|
||||
// $query .= '*';
|
||||
/* Creation date {{{ */
|
||||
$createstartts = null;
|
||||
$createstartdate = null;
|
||||
$createendts = null;
|
||||
$createenddate = null;
|
||||
$created['from'] = null;
|
||||
$created['to'] = null;
|
||||
if(!empty($_GET["created"]["from"])) {
|
||||
$createstartts = makeTsFromDate($_GET["created"]["from"]);
|
||||
$createstartdate = array('year'=>(int)date('Y', $createstartts), 'month'=>(int)date('m', $createstartts), 'day'=>(int)date('d', $createstartts), 'hour'=>0, 'minute'=>0, 'second'=>0);
|
||||
if (!checkdate($createstartdate['month'], $createstartdate['day'], $createstartdate['year'])) {
|
||||
UI::exitError(getMLText("search"),getMLText("invalid_create_date_end"));
|
||||
}
|
||||
else {
|
||||
$query = "";
|
||||
$created['from'] = $createstartts;
|
||||
}
|
||||
if(!empty($_GET["created"]["to"])) {
|
||||
$createendts = makeTsFromDate($_GET["created"]["to"]);
|
||||
$createenddate = array('year'=>(int)date('Y', $createendts), 'month'=>(int)date('m', $createendts), 'day'=>(int)date('d', $createendts), 'hour'=>23, 'minute'=>59, 'second'=>59);
|
||||
if (!checkdate($createenddate['month'], $createenddate['day'], $createenddate['year'])) {
|
||||
UI::exitError(getMLText("search"),getMLText("invalid_create_date_end"));
|
||||
}
|
||||
$created['to'] = $createendts;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
// category
|
||||
// Check to see if the search has been restricted to a particular
|
||||
// document owner.
|
||||
// $_GET['owner'] can be a name of an array of names or ids {{{
|
||||
$owner = [];
|
||||
$ownernames = []; // Needed by fulltext search
|
||||
$ownerobjs = []; // Needed by database search
|
||||
if(!empty($_GET["owner"])) {
|
||||
$owner = $_GET['owner'];
|
||||
if (!is_array($_GET['owner'])) {
|
||||
if(is_numeric($_GET['owner']))
|
||||
$o = $dms->getUser($_GET['owner']);
|
||||
else
|
||||
$o = $dms->getUserByLogin($_GET['owner']);
|
||||
if($o) {
|
||||
$ownernames[] = $o->getLogin();
|
||||
$ownerobjs[] = $o;
|
||||
}
|
||||
} else {
|
||||
foreach($_GET["owner"] as $l) {
|
||||
if($l) {
|
||||
if(is_numeric($l))
|
||||
$o = $dms->getUser($l);
|
||||
else
|
||||
$o = $dms->getUserByLogin($l);
|
||||
if($o) {
|
||||
$ownernames[] = $o->getLogin();
|
||||
$ownerobjs[] = $o;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} /* }}} */
|
||||
|
||||
// category {{{
|
||||
$categories = array();
|
||||
$categorynames = array();
|
||||
$category = array();
|
||||
|
@ -99,6 +142,21 @@ if($fullsearch) {
|
|||
}
|
||||
}
|
||||
}
|
||||
} /* }}} */
|
||||
|
||||
$terms = [];
|
||||
$limit = (isset($_GET["limit"]) && is_numeric($_GET["limit"])) ? (int) $_GET['limit'] : 20;
|
||||
$fullsearch = ((!isset($_GET["fullsearch"]) && $settings->_defaultSearchMethod == 'fulltext') || !empty($_GET["fullsearch"])) && $settings->_enableFullSearch;
|
||||
$facetsearch = !empty($_GET["facetsearch"]) && $settings->_enableFullSearch;
|
||||
if($fullsearch) {
|
||||
// Search in Fulltext {{{
|
||||
if (isset($_GET["query"]) && is_string($_GET["query"])) {
|
||||
$query = $_GET["query"];
|
||||
// if(isset($_GET['action']) && ($_GET['action'] == 'typeahead'))
|
||||
// $query .= '*';
|
||||
}
|
||||
else {
|
||||
$query = "";
|
||||
}
|
||||
|
||||
//
|
||||
|
@ -122,33 +180,7 @@ if($fullsearch) {
|
|||
// --------------- Suche starten --------------------------------------------
|
||||
|
||||
// Check to see if the search has been restricted to a particular
|
||||
// document owner.
|
||||
$owner = [];
|
||||
$ownernames = [];
|
||||
if(!empty($_GET["owner"])) {
|
||||
$owner = $_GET['owner'];
|
||||
if (!is_array($_GET['owner'])) {
|
||||
if(is_numeric($_GET['owner'])) {
|
||||
if($o = $dms->getUser($_GET['owner']))
|
||||
$ownernames[] = $o->getLogin();
|
||||
} else {
|
||||
$ownernames[] = $_GET['owner'];
|
||||
}
|
||||
} else {
|
||||
foreach($_GET["owner"] as $l) {
|
||||
if($l) {
|
||||
if(is_numeric($l)) {
|
||||
if($o = $dms->getUser($l))
|
||||
$ownernames[] = $o->getLogin();
|
||||
} else {
|
||||
$ownernames[] = $l;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// Check to see if the search has been restricted to a particular
|
||||
// mimetype.
|
||||
// mimetype. {{{
|
||||
$mimetype = [];
|
||||
if (isset($_GET["mimetype"])) {
|
||||
if (!is_array($_GET['mimetype'])) {
|
||||
|
@ -160,28 +192,31 @@ if($fullsearch) {
|
|||
$mimetype[] = $l;
|
||||
}
|
||||
}
|
||||
}
|
||||
} /* }}} */
|
||||
|
||||
/* Creation date {{{ */
|
||||
/* Creation date {{{
|
||||
$createstartts = null;
|
||||
$createstartdate = null;
|
||||
$createendts = null;
|
||||
$createenddate = null;
|
||||
if(!empty($_GET["createstart"])) {
|
||||
$createstartts = makeTsFromDate($_GET["createstart"]);
|
||||
$created = [];
|
||||
if(!empty($_GET["created"]["from"])) {
|
||||
$createstartts = makeTsFromDate($_GET["created"]["from"]);
|
||||
$createstartdate = array('year'=>(int)date('Y', $createstartts), 'month'=>(int)date('m', $createstartts), 'day'=>(int)date('d', $createstartts), 'hour'=>0, 'minute'=>0, 'second'=>0);
|
||||
if (!checkdate($createstartdate['month'], $createstartdate['day'], $createstartdate['year'])) {
|
||||
UI::exitError(getMLText("search"),getMLText("invalid_create_date_end"));
|
||||
}
|
||||
$created['from'] = $createstartts;
|
||||
}
|
||||
if ($createstartdate && !checkdate($createstartdate['month'], $createstartdate['day'], $createstartdate['year'])) {
|
||||
UI::exitError(getMLText("search"),getMLText("invalid_create_date_end"));
|
||||
}
|
||||
if(!empty($_GET["createend"])) {
|
||||
$createendts = makeTsFromDate($_GET["createend"]);
|
||||
if(!empty($_GET["created"]["to"])) {
|
||||
$createendts = makeTsFromDate($_GET["created"]["to"]);
|
||||
$createenddate = array('year'=>(int)date('Y', $createendts), 'month'=>(int)date('m', $createendts), 'day'=>(int)date('d', $createendts), 'hour'=>23, 'minute'=>59, 'second'=>59);
|
||||
if (!checkdate($createenddate['month'], $createenddate['day'], $createenddate['year'])) {
|
||||
UI::exitError(getMLText("search"),getMLText("invalid_create_date_end"));
|
||||
}
|
||||
$created['to'] = $createendts;
|
||||
}
|
||||
if ($createenddate && !checkdate($createenddate['month'], $createenddate['day'], $createenddate['year'])) {
|
||||
UI::exitError(getMLText("search"),getMLText("invalid_create_date_end"));
|
||||
}
|
||||
/* }}} */
|
||||
}}} */
|
||||
|
||||
// status
|
||||
if(isset($_GET['status']))
|
||||
|
@ -382,7 +417,7 @@ if($fullsearch) {
|
|||
}
|
||||
|
||||
// Check to see if the search has been restricted to a particular
|
||||
// document owner.
|
||||
/* document owner. {{{
|
||||
$owner = array();
|
||||
$ownerobjs = array();
|
||||
if (isset($_GET["owner"])) {
|
||||
|
@ -399,9 +434,9 @@ if($fullsearch) {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} }}} */
|
||||
|
||||
/* Creation date {{{ */
|
||||
/* Creation date {{{
|
||||
$createstartdate = array();
|
||||
$createenddate = array();
|
||||
if(!empty($_GET["createstart"])) {
|
||||
|
@ -418,7 +453,7 @@ if($fullsearch) {
|
|||
if ($createenddate && !checkdate($createenddate['month'], $createenddate['day'], $createenddate['year'])) {
|
||||
UI::exitError(getMLText("search"),getMLText("invalid_create_date_end"));
|
||||
}
|
||||
/* }}} */
|
||||
}}} */
|
||||
|
||||
/* Revision date {{{ */
|
||||
$revisionstartdate = array();
|
||||
|
@ -525,22 +560,6 @@ if($fullsearch) {
|
|||
* to folders.
|
||||
*/
|
||||
// if($status)
|
||||
// $resultmode = 0x01;
|
||||
|
||||
// category
|
||||
$categories = array();
|
||||
$category = [];
|
||||
if(isset($_GET['category']) && $_GET['category']) {
|
||||
$category = $_GET['category'];
|
||||
foreach($_GET['category'] as $catid) {
|
||||
if($cat = $dms->getDocumentCategory($catid)) {
|
||||
$categories[] = $cat;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Do not search for folders if result shall be filtered by categories. */
|
||||
// if($categories)
|
||||
// $resultmode = 0x01;
|
||||
|
||||
if (isset($_GET["attributes"]))
|
||||
|
@ -583,7 +602,6 @@ if($fullsearch) {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
// ---------------- Start searching -----------------------------------------
|
||||
$startTime = getTime();
|
||||
$resArr = $dms->search(array(
|
||||
|
@ -595,8 +613,8 @@ if($fullsearch) {
|
|||
'startFolder'=>$startFolder,
|
||||
'owner'=>$ownerobjs,
|
||||
'status'=>$status,
|
||||
'creationstartdate'=>$createstartdate ? $createstartdate : array(),
|
||||
'creationenddate'=>$createenddate ? $createenddate : array(),
|
||||
'creationstartdate'=>$created['from'], //$createstartdate ? $createstartdate : array(),
|
||||
'creationenddate'=>$created['to'], //$createenddate ? $createenddate : array(),
|
||||
'modificationstartdate'=>array(),
|
||||
'modificationenddate'=>array(),
|
||||
'categories'=>$categories,
|
||||
|
@ -700,8 +718,9 @@ if($settings->_showSingleSearchHit && count($entries) == 1) {
|
|||
$view->setParam('searchin', isset($searchin) ? $searchin : array());
|
||||
$view->setParam('startfolder', isset($startFolder) ? $startFolder : null);
|
||||
$view->setParam('owner', $owner);
|
||||
$view->setParam('createstartdate', !empty($createstartdate) ? getReadableDate($createstartts) : '');
|
||||
$view->setParam('createenddate', !empty($createenddate) ? getReadableDate($createendts) : '');
|
||||
$view->setParam('createstartdate', $createstartts);
|
||||
$view->setParam('createenddate', $createendts);
|
||||
$view->setParam('created', $created);
|
||||
$view->setParam('revisionstartdate', !empty($revisionstartdate) ? getReadableDate($revisionstartts) : '');
|
||||
$view->setParam('revisionenddate', !empty($revisionenddate) ? getReadableDate($revisionendts) : '');
|
||||
$view->setParam('expstartdate', !empty($expstartdate) ? getReadableDate($expstartts) : '');
|
||||
|
|
|
@ -1640,13 +1640,13 @@ $(document).ready(function() {
|
|||
echo self::getDateChooser($defDate, $varName, $lang, $dateformat, $startdate, $enddate, $weekstart);
|
||||
} /* }}} */
|
||||
|
||||
function getDateChooser($defDate = '', $varName, $lang='', $dateformat='', $startdate='', $enddate='', $weekstart=null, $nogroup=false) { /* {{{ */
|
||||
function getDateChooser($defDate = '', $varName, $lang='', $dateformat='', $startdate='', $enddate='', $weekstart=null, $placeholder='', $nogroup=false) { /* {{{ */
|
||||
if(!$dateformat)
|
||||
$dateformat = getConvertDateFormat();
|
||||
$content = '';
|
||||
$content = '
|
||||
<span class="input-append date span4 datepicker" id="'.$varName.'date" '.($weekstart == null ? '' : 'data-date-week-start="'.intval($weekstart).'" ').'data-date="'.$defDate.'" data-selectmenu="presetexpdate" data-date-format="'.$dateformat.'"'.($lang ? ' data-date-language="'.str_replace('_', '-', $lang).'"' : '').($startdate ? ' data-date-start-date="'.$startdate.'"' : '').($enddate ? ' data-date-end-date="'.$enddate.'"' : '').'>
|
||||
<input class="span12" size="16" name="'.$varName.'" id="'.$varName.'" type="text" value="'.$defDate.'" autocomplete="off">
|
||||
<input class="span12" size="16" name="'.$varName.'" id="'.$varName.'" type="text" placeholder="'.htmlspecialchars($placeholder).'" value="'.$defDate.'" autocomplete="off">
|
||||
';
|
||||
if(!$nogroup)
|
||||
$content .= '
|
||||
|
|
|
@ -394,6 +394,7 @@ $(document).ready(function() {
|
|||
function show() { /* {{{ */
|
||||
$dms = $this->params['dms'];
|
||||
$user = $this->params['user'];
|
||||
$settings = $this->params['settings'];
|
||||
$request = $this->params['request'];
|
||||
$fullsearch = $this->params['fullsearch'];
|
||||
$facetsearch = $this->params['facetsearch'];
|
||||
|
@ -408,7 +409,7 @@ $(document).ready(function() {
|
|||
$resultmode = $this->params['resultmode'];
|
||||
$workflowmode = $this->params['workflowmode'];
|
||||
$enablefullsearch = $this->params['enablefullsearch'];
|
||||
$enablefacetsearch = true;
|
||||
$enablefacetsearch = ($settings->_fullSearchEngine != 'lucene');
|
||||
$enableclipboard = $this->params['enableclipboard'];
|
||||
$attributes = $this->params['attributes'];
|
||||
$categories = $this->params['categories'];
|
||||
|
@ -418,6 +419,7 @@ $(document).ready(function() {
|
|||
$startfolder = $this->params['startfolder'];
|
||||
$createstartdate = $this->params['createstartdate'];
|
||||
$createenddate = $this->params['createenddate'];
|
||||
$created = $this->params['created'];
|
||||
$expstartdate = $this->params['expstartdate'];
|
||||
$expenddate = $this->params['expenddate'];
|
||||
$statusstartdate = $this->params['statusstartdate'];
|
||||
|
@ -570,11 +572,11 @@ $(document).ready(function() {
|
|||
$this->formField(getMLText("under_folder"), $this->getFolderChooserHtml("form1", M_READ, -1, $startfolder));
|
||||
$this->formField(
|
||||
getMLText("creation_date")." (".getMLText('from').")",
|
||||
$this->getDateChooser($createstartdate, "createstart", $this->params['session']->getLanguage())
|
||||
$this->getDateChooser(!empty($createstartdate) ? getReadableDate($createstartdate) : null, "created[from]", $this->params['session']->getLanguage())
|
||||
);
|
||||
$this->formField(
|
||||
getMLText("creation_date")." (".getMLText('to').")",
|
||||
$this->getDateChooser($createenddate, "createend", $this->params['session']->getLanguage())
|
||||
$this->getDateChooser(!empty($createenddate) ? getReadableDate($createenddate) : null, "created[to]", $this->params['session']->getLanguage())
|
||||
);
|
||||
$this->contentContainerEnd();
|
||||
|
||||
|
@ -804,11 +806,11 @@ $(document).ready(function() {
|
|||
$this->formField(getMLText("under_folder"), $this->getFolderChooserHtml("form2", M_READ, -1, $startfolder, 'folderfullsearchid'));
|
||||
$this->formField(
|
||||
getMLText("creation_date")." (".getMLText('from').")",
|
||||
$this->getDateChooser($createstartdate, "createstart", $this->params['session']->getLanguage())
|
||||
$this->getDateChooser(!empty($created['from']) ? getReadableDate($created['from']) : null, "created[from]", $this->params['session']->getLanguage())
|
||||
);
|
||||
$this->formField(
|
||||
getMLText("creation_date")." (".getMLText('to').")",
|
||||
$this->getDateChooser($createenddate, "createend", $this->params['session']->getLanguage())
|
||||
$this->getDateChooser(!empty($created['to']) ? getReadableDate($created['to']) : null, "created[to]", $this->params['session']->getLanguage())
|
||||
);
|
||||
if(!isset($facets['owner'])) {
|
||||
$options = array();
|
||||
|
@ -921,7 +923,6 @@ $(document).ready(function() {
|
|||
$options[] = $option;
|
||||
}
|
||||
}
|
||||
} elseif(substr($facetname, 0, 5) == 'attr_') {
|
||||
} elseif($facetname == 'status') {
|
||||
foreach($values as $v=>$c) {
|
||||
$option = array($v, getOverallStatusText($v)/*.' ('.$c.')'*/);
|
||||
|
@ -932,6 +933,8 @@ $(document).ready(function() {
|
|||
$option[] = array(array('data-subtitle', $c.' ×'));
|
||||
$options[] = $option;
|
||||
}
|
||||
} elseif(substr($facetname, 0, 5) == 'attr_' || $facetname == 'created') {
|
||||
/* Do not even create a list of options, because it isn't used */
|
||||
} else {
|
||||
foreach($values as $v=>$c) {
|
||||
$option = array($v, $v);
|
||||
|
@ -943,7 +946,7 @@ $(document).ready(function() {
|
|||
$options[] = $option;
|
||||
}
|
||||
}
|
||||
if(substr($facetname, 0, 5) != 'attr_') {
|
||||
if(substr($facetname, 0, 5) != 'attr_' && $facetname != 'created') {
|
||||
$this->formField(
|
||||
getMLText($facetname),
|
||||
array(
|
||||
|
@ -1039,7 +1042,7 @@ $(document).ready(function() {
|
|||
if($enablefacetsearch) {
|
||||
echo "<div class=\"tab-pane ".(($fullsearch == true && $facetsearch == true) ? 'active' : '')."\" id=\"facetfulltext\">\n";
|
||||
?>
|
||||
<form class="form-horizontal" action="<?= $this->params['settings']->_httpRoot ?>out/out.Search.php" name="form2" style="min-height: 330px;">
|
||||
<form class="form-horizontal" action="<?= $this->params['settings']->_httpRoot ?>out/out.Search.php" name="form2">
|
||||
<input type="hidden" name="fullsearch" value="1" />
|
||||
<input type="hidden" name="facetsearch" value="1" />
|
||||
<?php
|
||||
|
@ -1084,14 +1087,15 @@ $(document).ready(function() {
|
|||
array_walk($allparams['attributes'][$facetname], function(&$v, $k){$v=getReadableDate($v);});
|
||||
break;
|
||||
}
|
||||
$oldvalue = implode(',', $allparams['attributes'][$facetname]);
|
||||
} else {
|
||||
$oldvalue = $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'=>'<i class="fa fa-remove"></i> '.$dispname.' = '.$oldvalue, 'link'=>$newrequest->getRequestUri(), 'attributes'=>[['title', 'Click to remove']], '_badge'=>'x');
|
||||
echo '<input type="hidden" name="attributes['.$facetname.'][]" value="'.$oldvalue.'" />';
|
||||
$menuitems[] = array('label'=>'<i class="fa fa-remove"></i> '.$dispname.' = '.implode(', ', $oldvalue), 'link'=>$newrequest->getRequestUri(), 'attributes'=>[['title', 'Click to remove']], '_badge'=>'x');
|
||||
foreach($oldvalue as $ov)
|
||||
echo '<input type="hidden" name="attributes['.$facetname.'][]" value="'.$ov.'" />';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1099,18 +1103,56 @@ $(document).ready(function() {
|
|||
/* Create a link to remove the filter */
|
||||
$allparams = $request->query->all();
|
||||
if(isset($allparams[$facetname])) {
|
||||
$oldvalue = is_array($allparams[$facetname]) ? implode(',', $allparams[$facetname]) : $allparams[$facetname];
|
||||
switch($facetname) {
|
||||
case 'category':
|
||||
$oldvalue = is_array($allparams[$facetname]) ? $allparams[$facetname] : [$allparams[$facetname]];
|
||||
$oldtransval = [];
|
||||
foreach($oldvalue as $v) {
|
||||
if(is_numeric($v))
|
||||
$fu = $dms->getDocumentCategory($v);
|
||||
else
|
||||
$fu = $dms->getDocumentCategoryByName($v);
|
||||
if($fu)
|
||||
$oldtransval[] = $fu->getName();
|
||||
}
|
||||
break;
|
||||
case 'owner':
|
||||
$oldvalue = is_array($allparams[$facetname]) ? $allparams[$facetname] : [$allparams[$facetname]];
|
||||
$oldtransval = [];
|
||||
foreach($oldvalue as $v) {
|
||||
if(is_numeric($v))
|
||||
$fu = $dms->getUser($v);
|
||||
else
|
||||
$fu = $dms->getUserByLogin($v);
|
||||
if($fu)
|
||||
$oldtransval[] = $fu->getLogin();
|
||||
}
|
||||
break;
|
||||
case 'status':
|
||||
$oldtransval = getOverallStatusText($oldvalue);
|
||||
$oldvalue = is_array($allparams[$facetname]) ? $allparams[$facetname] : [$allparams[$facetname]];
|
||||
$oldtransval = $oldvalue;
|
||||
array_walk($oldtransval, function(&$v, $k){$v = getOverallStatusText($v);});
|
||||
break;
|
||||
case 'created':
|
||||
if(!empty($allparams[$facetname]['from']) || !empty($allparams[$facetname]['to'])) {
|
||||
array_walk($allparams[$facetname], function(&$v, $k){$v=getReadableDate($v);});
|
||||
$oldvalue = $allparams[$facetname];
|
||||
$oldtransval = $oldvalue; //$oldvalue['from'].' TO '.$oldvalue['to'];
|
||||
} else {
|
||||
$oldvalue = null;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
$oldvalue = is_array($allparams[$facetname]) ? $allparams[$facetname] : [$allparams[$facetname]];
|
||||
$oldtransval = $oldvalue;
|
||||
}
|
||||
unset($allparams[$facetname]);
|
||||
$newrequest = Symfony\Component\HttpFoundation\Request::create($request->getBaseUrl(), 'GET', $allparams);
|
||||
$menuitems[] = array('label'=>'<i class="fa fa-remove"></i> '.getMLText($facetname).' = '.$oldtransval, 'link'=>$newrequest->getRequestUri(), 'attributes'=>[['title', 'Click to remove']], '_badge'=>'x');
|
||||
echo '<input type="hidden" name="'.$facetname.'[]" value="'.$oldvalue.'" />';
|
||||
if($oldvalue) {
|
||||
unset($allparams[$facetname]);
|
||||
$newrequest = Symfony\Component\HttpFoundation\Request::create($request->getBaseUrl(), 'GET', $allparams);
|
||||
$menuitems[] = array('label'=>'<i class="fa fa-remove"></i> '.getMLText($facetname).' = '.implode(', ', $oldtransval), 'link'=>$newrequest->getRequestUri(), 'attributes'=>[['title', 'Click to remove']], '_badge'=>'x');
|
||||
foreach($oldvalue as $ok=>$ov)
|
||||
echo '<input type="hidden" name="'.$facetname.'['.$ok.']" value="'.$ov.'" />';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1157,9 +1199,9 @@ $(document).ready(function() {
|
|||
$tt = array_keys($values);
|
||||
$content = '<div class="input-group">';
|
||||
$content .= '<span class="input-group-text" style="border-right: 0;"> from </span>';
|
||||
$content .= $this->getDateChooser('', "attributes[".$facetname."][from]", $this->params['session']->getLanguage(), '', getReadableDate(min($tt)), getReadableDate(max($tt)), null, true);
|
||||
$content .= $this->getDateChooser('', "attributes[".$facetname."][from]", $this->params['session']->getLanguage(), '', getReadableDate(min($tt)), getReadableDate(max($tt)), null, '', true);
|
||||
$content .= '<span class="input-group-text" style="border-left: 0; border-right: 0;"> to </span>';
|
||||
$content .= $this->getDateChooser('', "attributes[".$facetname."][to]", $this->params['session']->getLanguage(), '', getReadableDate(min($tt)), getReadableDate(max($tt)), null, true);
|
||||
$content .= $this->getDateChooser('', "attributes[".$facetname."][to]", $this->params['session']->getLanguage(), '', getReadableDate(min($tt)), getReadableDate(max($tt)), null, '', true);
|
||||
$content .= '<button class="btn btn-primary" type="submit">Set</button>';
|
||||
$content .= '</div>';
|
||||
$this->printAccordion($dispname, $content);
|
||||
|
@ -1187,6 +1229,18 @@ $(document).ready(function() {
|
|||
}
|
||||
}
|
||||
}
|
||||
} elseif($facetname == 'created') {
|
||||
if(empty($allparams[$facetname]['from']) && empty($allparams[$facetname]['to'])) {
|
||||
$tt = array_keys($values);
|
||||
$content = '<div class="input-group">';
|
||||
$content .= '<span class="input-group-text" style="border-right: 0;"> from </span>';
|
||||
$content .= $this->getDateChooser('', $facetname."[from]", $this->params['session']->getLanguage(), '', '' /*getReadableDate(min($tt))*/, getReadableDate(time()), null, '', true);
|
||||
$content .= '<span class="input-group-text" style="border-left: 0; border-right: 0;"> to </span>';
|
||||
$content .= $this->getDateChooser('', $facetname."[to]", $this->params['session']->getLanguage(), '', '' /*getReadableDate(min($tt))*/, getReadableDate(time()), null, '', true);
|
||||
$content .= '<button class="btn btn-primary" type="submit">Set</button>';
|
||||
$content .= '</div>';
|
||||
$this->printAccordion(getMLText('creation_date'), $content);
|
||||
}
|
||||
} else {
|
||||
/* Further filter makes only sense if the facet has more than 1 value
|
||||
* or in case of 1 value, if that value has a count < $total. That second
|
||||
|
@ -1202,6 +1256,12 @@ $(document).ready(function() {
|
|||
$menuitems[] = array('label'=>getOverallStatusText($v), 'link'=>$newrequest->getRequestUri().'&'.$facetname.'[]='.urlencode($v), 'badge'=>$c);
|
||||
}
|
||||
break;
|
||||
case 'owner':
|
||||
foreach($values as $v=>$c) {
|
||||
if($fu = $dms->getUserByLogin($v))
|
||||
$menuitems[] = array('label'=>$fu->getLogin(), 'link'=>$newrequest->getRequestUri().'&'.$facetname.'[]='.$fu->getId(), 'badge'=>$c);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
foreach($values as $v=>$c) {
|
||||
$menuitems[] = array('label'=>htmlspecialchars($v), 'link'=>$newrequest->getRequestUri().'&'.$facetname.'[]='.urlencode($v), 'badge'=>$c);
|
||||
|
|
|
@ -763,6 +763,11 @@ if(is_writeable($settings->_configFilePath)) {
|
|||
if($settings->_enableLargeFileUpload && $mus2 < $mus1) {
|
||||
$this->warningMsg(getMLText("settings_partionsize_below_max_filesize"));
|
||||
}
|
||||
|
||||
foreach($extmgr->getExtensionConfiguration() as $extname=>$extconf) {
|
||||
if($this->hasHook('checkConfig'))
|
||||
$this->callHook('checkConfig', $extname, $extconf);
|
||||
}
|
||||
$this->columnEnd(4);
|
||||
$this->rowEnd(4);
|
||||
$this->contentEnd();
|
||||
|
|
|
@ -808,7 +808,7 @@ $(document).ready( function() {
|
|||
echo $txt;
|
||||
} else {
|
||||
if($latestContent->getComment())
|
||||
if($settings->_markdownComments) {
|
||||
if($this->params['settings']->_markdownComments) {
|
||||
$Parsedown = new Parsedown();
|
||||
$comment = $Parsedown->text(htmlspecialchars($latestContent->getComment()));
|
||||
print "<div class=\"content-comment\">".$comment."</div>";
|
||||
|
|
|
@ -1592,13 +1592,13 @@ $(document).ready(function() {
|
|||
echo self::getDateChooser($defDate, $varName, $lang, $dateformat, $startdate, $enddate, $weekstart);
|
||||
} /* }}} */
|
||||
|
||||
function getDateChooser($defDate = '', $varName, $lang='', $dateformat='', $startdate='', $enddate='', $weekstart=null, $nogroup=false) { /* {{{ */
|
||||
function getDateChooser($defDate = '', $varName, $lang='', $dateformat='', $startdate='', $enddate='', $weekstart=null, $placeholder='', $nogroup=false) { /* {{{ */
|
||||
if(!$dateformat)
|
||||
$dateformat = getConvertDateFormat();
|
||||
$content = '';
|
||||
if(!$nogroup)
|
||||
$content .= '<div class="input-group date" id="'.$varName.'date">';
|
||||
$content .= '<input type="text" class="form-control datepicker" name="'.$varName.'" id="'.$varName.'" value="'.$defDate. '" '.($weekstart == null ? '' : 'data-date-week-start="'.intval($weekstart).'" ').'data-date="'.$defDate.'" data-selectmenu="presetexpdate" data-date-format="'.$dateformat.'"'.($lang ? 'data-date-language="'.str_replace('_', '-', $lang).'"' : '').($startdate ? ' data-date-start-date="'.$startdate.'"' : '').($enddate ? ' data-date-end-date="'.$enddate.'"' : '').' data-date-autoclose="true" data-provide="datepicker">';
|
||||
$content .= '<input type="text" class="form-control datepicker" placeholder="'.htmlspecialchars($placeholder).'" name="'.$varName.'" id="'.$varName.'" value="'.$defDate. '" '.($weekstart == null ? '' : 'data-date-week-start="'.intval($weekstart).'" ').'data-date="'.$defDate.'" data-selectmenu="presetexpdate" data-date-format="'.$dateformat.'"'.($lang ? 'data-date-language="'.str_replace('_', '-', $lang).'"' : '').($startdate ? ' data-date-start-date="'.$startdate.'"' : '').($enddate ? ' data-date-end-date="'.$enddate.'"' : '').' data-date-autoclose="true" data-provide="datepicker">';
|
||||
if(!$nogroup) {
|
||||
$content .= '<div class="input-group-append">
|
||||
<span class="input-group-text"><i class="fa fa-calendar"></i></span>
|
||||
|
|
|
@ -272,6 +272,15 @@ a.accordion2-toggle:focus, a.accordion2-toggle:hover {
|
|||
text-decoration: none;
|
||||
}
|
||||
|
||||
.select2-container--bootstrap4 .select2-selection {
|
||||
border-radius: 0px;
|
||||
}
|
||||
.select2-container--bootstrap4 .select2-selection--multiple .select2-selection__choice {
|
||||
border-radius: 0px;
|
||||
}
|
||||
.datepicker {
|
||||
border-radius: 0px;
|
||||
}
|
||||
span.datepicker {
|
||||
padding: 0px;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user