mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-02-11 09:35:00 +00:00
search() will not find docs without expiration date if filtered by expiration date
This commit is contained in:
parent
37a30e6082
commit
16e48bbb16
|
@ -1427,6 +1427,9 @@ class SeedDMS_Core_DMS {
|
|||
* meanѕ that updateѕ of a document will only result in a searchable
|
||||
* modification if a new version is uploaded.
|
||||
*
|
||||
* If the search is filtered by an expiration date, only documents with
|
||||
* an expiration date will be found. Even if just an end date is given.
|
||||
*
|
||||
* @param string $query seach query with space separated words
|
||||
* @param integer $limit number of items in result set
|
||||
* @param integer $offset index of first item in result set
|
||||
|
@ -1448,8 +1451,8 @@ class SeedDMS_Core_DMS {
|
|||
* 0x1 = documents only
|
||||
* 0x2 = folders only
|
||||
* 0x3 = both
|
||||
* @param array $expirationstartdate search for documents expiring after this date
|
||||
* @param array $expirationenddate search for documents expiring before this date
|
||||
* @param array $expirationstartdate search for documents expiring after and on this date
|
||||
* @param array $expirationenddate search for documents expiring before and on this date
|
||||
* @return array|bool
|
||||
*/
|
||||
function search($query, $limit=0, $offset=0, $logicalmode='AND', $searchin=array(), $startFolder=null, $owner=null, $status = array(), $creationstartdate=array(), $creationenddate=array(), $modificationstartdate=array(), $modificationenddate=array(), $categories=array(), $attributes=array(), $mode=0x3, $expirationstartdate=array(), $expirationenddate=array()) { /* {{{ */
|
||||
|
@ -1804,8 +1807,6 @@ class SeedDMS_Core_DMS {
|
|||
if ($expirationstartdate) {
|
||||
$startdate = SeedDMS_Core_DMS::makeTimeStamp($expirationstartdate['hour'], $expirationstartdate['minute'], $expirationstartdate['second'], $expirationstartdate['year'], $expirationstartdate["month"], $expirationstartdate["day"]);
|
||||
if ($startdate) {
|
||||
if($searchExpirationDate)
|
||||
$searchExpirationDate .= " AND ";
|
||||
$searchExpirationDate .= "`tblDocuments`.`expires` >= ".$this->db->qstr($startdate);
|
||||
}
|
||||
}
|
||||
|
@ -1814,6 +1815,8 @@ class SeedDMS_Core_DMS {
|
|||
if ($stopdate) {
|
||||
if($searchExpirationDate)
|
||||
$searchExpirationDate .= " AND ";
|
||||
else // do not find documents without an expiration date
|
||||
$searchExpirationDate .= "`tblDocuments`.`expires` != 0 AND ";
|
||||
$searchExpirationDate .= "`tblDocuments`.`expires` <= ".$this->db->qstr($stopdate);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user