mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-02-06 15:14:58 +00:00
Merge branch 'seeddms-5.1.x' into seeddms-6.0.x
This commit is contained in:
commit
1710e5278b
|
@ -211,6 +211,7 @@
|
|||
arbitrary files
|
||||
- use mandatory reviewers/approvers when adding files by webdav
|
||||
- set some http security headers in .htaccess
|
||||
- add searching for last date of a document status change
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
Changes in version 5.1.21
|
||||
|
|
|
@ -2042,7 +2042,7 @@ class SeedDMS_Core_DMS {
|
|||
if(is_array($query)) {
|
||||
foreach(array('limit', 'offset', 'logicalmode', 'searchin', 'startFolder', 'owner', 'status', 'creationstartdate', 'creationenddate', 'modificationstartdate', 'modificationenddate', 'categories', 'attributes', 'mode', 'revisionstartdate', 'revisionenddate', 'expirationstartdate', 'expirationenddate', 'reception') as $paramname)
|
||||
${$paramname} = isset($query[$paramname]) ? $query[$paramname] : ${$paramname};
|
||||
foreach(array('orderby') as $paramname)
|
||||
foreach(array('orderby', 'statusstartdate', 'statusenddate') as $paramname)
|
||||
${$paramname} = isset($query[$paramname]) ? $query[$paramname] : '';
|
||||
$query = isset($query['query']) ? $query['query'] : '';
|
||||
}
|
||||
|
@ -2138,7 +2138,7 @@ class SeedDMS_Core_DMS {
|
|||
if ($creationstartdate) {
|
||||
$startdate = SeedDMS_Core_DMS::makeTimeStamp($creationstartdate['hour'], $creationstartdate['minute'], $creationstartdate['second'], $creationstartdate['year'], $creationstartdate["month"], $creationstartdate["day"]);
|
||||
if ($startdate) {
|
||||
$searchCreateDate .= "`tblFolders`.`date` >= ".$startdate;
|
||||
$searchCreateDate .= "`tblFolders`.`date` >= ".$this->db->qstr($startdate);
|
||||
}
|
||||
}
|
||||
if ($creationenddate) {
|
||||
|
@ -2147,7 +2147,7 @@ class SeedDMS_Core_DMS {
|
|||
/** @noinspection PhpUndefinedVariableInspection */
|
||||
if($startdate)
|
||||
$searchCreateDate .= " AND ";
|
||||
$searchCreateDate .= "`tblFolders`.`date` <= ".$stopdate;
|
||||
$searchCreateDate .= "`tblFolders`.`date` <= ".$this->db->qstr($stopdate);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2352,7 +2352,7 @@ class SeedDMS_Core_DMS {
|
|||
if ($creationstartdate) {
|
||||
$startdate = SeedDMS_Core_DMS::makeTimeStamp($creationstartdate['hour'], $creationstartdate['minute'], $creationstartdate['second'], $creationstartdate['year'], $creationstartdate["month"], $creationstartdate["day"]);
|
||||
if ($startdate) {
|
||||
$searchCreateDate .= "`tblDocuments`.`date` >= ".$startdate;
|
||||
$searchCreateDate .= "`tblDocuments`.`date` >= ".$this->db->qstr($startdate);
|
||||
}
|
||||
}
|
||||
if ($creationenddate) {
|
||||
|
@ -2360,7 +2360,7 @@ class SeedDMS_Core_DMS {
|
|||
if ($stopdate) {
|
||||
if($searchCreateDate)
|
||||
$searchCreateDate .= " AND ";
|
||||
$searchCreateDate .= "`tblDocuments`.`date` <= ".$stopdate;
|
||||
$searchCreateDate .= "`tblDocuments`.`date` <= ".$this->db->qstr($stopdate);
|
||||
}
|
||||
}
|
||||
if ($modificationstartdate) {
|
||||
|
@ -2376,7 +2376,7 @@ class SeedDMS_Core_DMS {
|
|||
if ($stopdate) {
|
||||
if($searchCreateDate)
|
||||
$searchCreateDate .= " AND ";
|
||||
$searchCreateDate .= "`tblDocumentContent`.`date` <= ".$stopdate;
|
||||
$searchCreateDate .= "`tblDocumentContent`.`date` <= ".$this->db->qstr($stopdate);
|
||||
}
|
||||
}
|
||||
$searchRevisionDate = "";
|
||||
|
@ -2402,7 +2402,7 @@ class SeedDMS_Core_DMS {
|
|||
if ($startdate) {
|
||||
if($searchExpirationDate)
|
||||
$searchExpirationDate .= " AND ";
|
||||
$searchExpirationDate .= "`tblDocuments`.`expires` >= ".$startdate;
|
||||
$searchExpirationDate .= "`tblDocuments`.`expires` >= ".$this->db->qstr($startdate);
|
||||
}
|
||||
}
|
||||
if ($expirationenddate) {
|
||||
|
@ -2410,7 +2410,24 @@ class SeedDMS_Core_DMS {
|
|||
if ($stopdate) {
|
||||
if($searchExpirationDate)
|
||||
$searchExpirationDate .= " AND ";
|
||||
$searchExpirationDate .= "`tblDocuments`.`expires` <= ".$stopdate;
|
||||
$searchExpirationDate .= "`tblDocuments`.`expires` <= ".$this->db->qstr($stopdate);
|
||||
}
|
||||
}
|
||||
$searchStatusDate = '';
|
||||
if ($statusstartdate) {
|
||||
$startdate = $statusstartdate['year'].'-'.$statusstartdate["month"].'-'.$statusstartdate["day"].' '.$statusstartdate['hour'].':'.$statusstartdate['minute'].':'.$statusstartdate['second'];
|
||||
if ($startdate) {
|
||||
if($searchStatusDate)
|
||||
$searchStatusDate .= " AND ";
|
||||
$searchStatusDate .= "`tblDocumentStatusLog`.`date` >= ".$this->db->qstr($startdate);
|
||||
}
|
||||
}
|
||||
if ($statusenddate) {
|
||||
$stopdate = $statusenddate['year'].'-'.$statusenddate["month"].'-'.$statusenddate["day"].' '.$statusenddate['hour'].':'.$statusenddate['minute'].':'.$statusenddate['second'];
|
||||
if ($stopdate) {
|
||||
if($searchStatusDate)
|
||||
$searchStatusDate .= " AND ";
|
||||
$searchStatusDate .= "`tblDocumentStatusLog`.`date` <= ".$this->db->qstr($stopdate);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2468,6 +2485,9 @@ class SeedDMS_Core_DMS {
|
|||
if (strlen($searchExpirationDate)>0) {
|
||||
$searchQuery .= " AND (".$searchExpirationDate.")";
|
||||
}
|
||||
if (strlen($searchStatusDate)>0) {
|
||||
$searchQuery .= " AND (".$searchStatusDate.")";
|
||||
}
|
||||
if ($searchAttributes) {
|
||||
$searchQuery .= " AND (".implode(" AND ", $searchAttributes).")";
|
||||
}
|
||||
|
@ -2498,7 +2518,7 @@ class SeedDMS_Core_DMS {
|
|||
}
|
||||
}
|
||||
|
||||
if($searchKey || $searchOwner || $searchCategories || $searchCreateDate || $searchRevisionDate || $searchExpirationDate || $searchAttributes || $status || $reception) {
|
||||
if($searchKey || $searchOwner || $searchCategories || $searchCreateDate || $searchRevisionDate || $searchExpirationDate || $searchStatusDate || $searchAttributes || $status) {
|
||||
// Count the number of rows that the search will produce.
|
||||
$resArr = $this->db->getResultArray("SELECT COUNT(*) AS num FROM (SELECT DISTINCT `tblDocuments`.`id` ".$searchQuery.") a");
|
||||
$totalDocs = 0;
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
<email>uwe@steinmann.cx</email>
|
||||
<active>yes</active>
|
||||
</lead>
|
||||
<date>2021-02-11</date>
|
||||
<date>2021-03-15</date>
|
||||
<time>13:44:55</time>
|
||||
<version>
|
||||
<release>6.0.15</release>
|
||||
|
@ -1866,7 +1866,7 @@ add method SeedDMS_Core_DatabaseAccess::setLogFp()
|
|||
</notes>
|
||||
</release>
|
||||
<release>
|
||||
<date>2021-01-08</date>
|
||||
<date>2021-03-15</date>
|
||||
<time>13:44:55</time>
|
||||
<version>
|
||||
<release>5.1.22</release>
|
||||
|
@ -1884,6 +1884,7 @@ add method SeedDMS_Core_DatabaseAccess::setLogFp()
|
|||
- add new parameter to SeedDMS_Core_DMS->getDocumentList() for skipping expired documents
|
||||
- add parameter $incdisabled to SeedDMS_Core_Folder::getNotifyList()
|
||||
- do not validate value in SeedDMS_Core_Attribute::setValue(), it should have been done before
|
||||
- SeedDMS_Core_DMS::search() can search for last date of document status change
|
||||
</notes>
|
||||
</release>
|
||||
<release>
|
||||
|
|
|
@ -387,6 +387,29 @@ if(((!isset($_GET["fullsearch"]) && $settings->_defaultSearchMethod == 'fulltext
|
|||
$revisionstopdate = array();
|
||||
}
|
||||
|
||||
$statusstartdate = array();
|
||||
$statusstopdate = array();
|
||||
if (isset($_GET["statusdate"]) && $_GET["statusdate"]!=null) {
|
||||
$statusdate = true;
|
||||
} else {
|
||||
$statusdate = false;
|
||||
}
|
||||
|
||||
if(isset($_GET["statusstart"])) {
|
||||
$tmp = explode("-", $_GET["statusstart"]);
|
||||
$statusstartdate = array('year'=>(int)$tmp[0], 'month'=>(int)$tmp[1], 'day'=>(int)$tmp[2], 'hour'=>0, 'minute'=>0, 'second'=>0);
|
||||
}
|
||||
if ($statusstartdate && !checkdate($statusstartdate['month'], $startdate['day'], $startdate['year'])) {
|
||||
UI::exitError(getMLText("search"),getMLText("invalid_status_date_end"));
|
||||
}
|
||||
if(isset($_GET["statusend"])) {
|
||||
$tmp = explode("-", $_GET["statusend"]);
|
||||
$statusstopdate = array('year'=>(int)$tmp[0], 'month'=>(int)$tmp[1], 'day'=>(int)$tmp[2], 'hour'=>23, 'minute'=>59, 'second'=>59);
|
||||
}
|
||||
if ($statusstopdate && !checkdate($statusstopdate['month'], $stopdate['day'], $stopdate['year'])) {
|
||||
UI::exitError(getMLText("search"),getMLText("invalid_status_date_end"));
|
||||
}
|
||||
|
||||
$expstartdate = array();
|
||||
$expstopdate = array();
|
||||
if (isset($_GET["expirationdate"]) && $_GET["expirationdate"]!=null) {
|
||||
|
@ -544,6 +567,8 @@ if(((!isset($_GET["fullsearch"]) && $settings->_defaultSearchMethod == 'fulltext
|
|||
'revisionstartdate'=>$revisiondate ? $revisionstartdate : array(),
|
||||
'revisionenddate'=>$revisiondate ? $revisionstopdate : array(),
|
||||
'reception'=>$reception,
|
||||
'statusstartdate'=>$statusdate ? $statusstartdate : array(),
|
||||
'statusenddate'=>$statusdate ? $statusstopdate : array(),
|
||||
'orderby'=>$orderby
|
||||
));
|
||||
$total = $resArr['totalDocs'] + $resArr['totalFolders'];
|
||||
|
@ -633,9 +658,12 @@ if($settings->_showSingleSearchHit && count($entries) == 1) {
|
|||
$view->setParam('revisionstopdate', isset($revisionstopdate) ? $revisionstopdate : array());
|
||||
$view->setParam('expstartdate', isset($expstartdate) ? $expstartdate : array());
|
||||
$view->setParam('expstopdate', isset($expstopdate) ? $expstopdate : array());
|
||||
$view->setParam('statusstartdate', isset($statusstartdate) ? $statusstartdate : array());
|
||||
$view->setParam('statusstopdate', isset($statusstopdate) ? $statusstopdate : array());
|
||||
$view->setParam('creationdate', isset($creationdate) ? $creationdate : '');
|
||||
$view->setParam('expirationdate', isset($expirationdate) ? $expirationdate: '');
|
||||
$view->setParam('revisiondate', isset($revisiondate) ? $revisiondate: '');
|
||||
$view->setParam('statusdate', isset($statusdate) ? $statusdate: '');
|
||||
$view->setParam('status', isset($status) ? $status : array());
|
||||
$view->setParam('categories', isset($categories) ? $categories : '');
|
||||
$view->setParam('category', isset($categorynames) ? $categorynames : '');
|
||||
|
|
|
@ -189,10 +189,13 @@ function typeahead() { /* {{{ */
|
|||
$stopdate = $this->params['stopdate'];
|
||||
$expstartdate = $this->params['expstartdate'];
|
||||
$expstopdate = $this->params['expstopdate'];
|
||||
$statusstartdate = $this->params['statusstartdate'];
|
||||
$statusstopdate = $this->params['statusstopdate'];
|
||||
$revisionstartdate = $this->params['revisionstartdate'];
|
||||
$revisionstopdate = $this->params['revisionstopdate'];
|
||||
$creationdate = $this->params['creationdate'];
|
||||
$expirationdate = $this->params['expirationdate'];
|
||||
$statusdate = $this->params['statusdate'];
|
||||
$revisiondate = $this->params['revisiondate'];
|
||||
$status = $this->params['status'];
|
||||
$this->query = $this->params['query'];
|
||||
|
@ -380,6 +383,8 @@ function typeahead() { /* {{{ */
|
|||
$openfilterdlg = true;
|
||||
if($reception)
|
||||
$openfilterdlg = true;
|
||||
if($statusdate)
|
||||
$openfilterdlg = true;
|
||||
?>
|
||||
<?php if($totaldocs): ?>
|
||||
<div class="accordion" id="accordion1">
|
||||
|
@ -494,6 +499,23 @@ function typeahead() { /* {{{ */
|
|||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php printMLText("status_change");?>:</td>
|
||||
<td>
|
||||
<label class="checkbox inline">
|
||||
<input type="checkbox" name="statusdate" value="true" <?php if($statusdate) echo "checked"; ?>/><?php printMLText("between");?>
|
||||
</label><br />
|
||||
<span class="input-append date datepicker" style="display: inline;" id="statusstartdate" data-date="<?php echo date('Y-m-d'); ?>" data-date-format="yyyy-mm-dd" data-date-language="<?php echo str_replace('_', '-', $this->params['session']->getLanguage()); ?>">
|
||||
<input class="span4" size="16" name="statusstart" type="text" value="<?php if($statusstartdate) printf("%04d-%02d-%02d", $statusstartdate['year'], $statusstartdate['month'], $statusstartdate['day']); else echo date('Y-m-d'); ?>">
|
||||
<span class="add-on"><i class="fa fa-calendar"></i></span>
|
||||
</span>
|
||||
<?php printMLText("and"); ?>
|
||||
<span class="input-append date datepicker" style="display: inline;" id="statusenddate" data-date="<?php echo date('Y-m-d'); ?>" data-date-format="yyyy-mm-dd" data-date-language="<?php echo str_replace('_', '-', $this->params['session']->getLanguage()); ?>">
|
||||
<input class="span4" size="16" name="statusend" type="text" value="<?php if($statusstopdate) printf("%04d-%02d-%02d", $statusstopdate['year'], $statusstopdate['month'], $statusstopdate['day']); else echo date('Y-m-d'); ?>">
|
||||
<span class="add-on"><i class="fa fa-calendar"></i></span>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
if($attrdefs) {
|
||||
foreach($attrdefs as $attrdef) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user