mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-14 13:42:04 +00:00
Merge branch 'seeddms-5.1.x' into seeddms-6.0.x
This commit is contained in:
commit
64e6e8f1c4
|
@ -212,6 +212,8 @@
|
||||||
- use mandatory reviewers/approvers when adding files by webdav
|
- use mandatory reviewers/approvers when adding files by webdav
|
||||||
- set some http security headers in .htaccess
|
- set some http security headers in .htaccess
|
||||||
- add searching for last date of a document status change
|
- add searching for last date of a document status change
|
||||||
|
- fix a potential problem when remove a document with files attached to
|
||||||
|
previous versions
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
Changes in version 5.1.21
|
Changes in version 5.1.21
|
||||||
|
|
|
@ -2646,7 +2646,11 @@ class SeedDMS_Core_Document extends SeedDMS_Core_Object { /* {{{ */
|
||||||
* @return array list of files, false in case of an sql error
|
* @return array list of files, false in case of an sql error
|
||||||
*/
|
*/
|
||||||
function getDocumentFiles($version=0, $incnoversion=true) { /* {{{ */
|
function getDocumentFiles($version=0, $incnoversion=true) { /* {{{ */
|
||||||
if (!isset($this->_documentFiles)) {
|
/* use a smarter caching because removing a document will call this function
|
||||||
|
* for each version and the document itself.
|
||||||
|
*/
|
||||||
|
$hash = substr(md5($version.$incnoversion), 0, 4);
|
||||||
|
if (!isset($this->_documentFiles[$hash])) {
|
||||||
$db = $this->_dms->getDB();
|
$db = $this->_dms->getDB();
|
||||||
|
|
||||||
$queryStr = "SELECT * FROM `tblDocumentFiles` WHERE `document` = " . $this->_id;
|
$queryStr = "SELECT * FROM `tblDocumentFiles` WHERE `document` = " . $this->_id;
|
||||||
|
@ -2664,16 +2668,16 @@ class SeedDMS_Core_Document extends SeedDMS_Core_Object { /* {{{ */
|
||||||
$resArr = $db->getResultArray($queryStr);
|
$resArr = $db->getResultArray($queryStr);
|
||||||
if (is_bool($resArr) && !$resArr) return false;
|
if (is_bool($resArr) && !$resArr) return false;
|
||||||
|
|
||||||
$this->_documentFiles = array();
|
$this->_documentFiles = array($hash=>array());
|
||||||
|
|
||||||
$user = $this->_dms->getLoggedInUser();
|
$user = $this->_dms->getLoggedInUser();
|
||||||
foreach ($resArr as $row) {
|
foreach ($resArr as $row) {
|
||||||
$file = new SeedDMS_Core_DocumentFile($row["id"], $this, $row["userID"], $row["comment"], $row["date"], $row["dir"], $row["fileType"], $row["mimeType"], $row["orgFileName"], $row["name"], $row["version"], $row["public"]);
|
$file = new SeedDMS_Core_DocumentFile($row["id"], $this, $row["userID"], $row["comment"], $row["date"], $row["dir"], $row["fileType"], $row["mimeType"], $row["orgFileName"], $row["name"], $row["version"], $row["public"]);
|
||||||
if($file->getAccessMode($user) >= M_READ)
|
if($file->getAccessMode($user) >= M_READ)
|
||||||
array_push($this->_documentFiles, $file);
|
array_push($this->_documentFiles[$hash], $file);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $this->_documentFiles;
|
return $this->_documentFiles[$hash];
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
function addDocumentFile($name, $comment, $user, $tmpFile, $orgFileName,$fileType, $mimeType,$version=0,$public=1) { /* {{{ */
|
function addDocumentFile($name, $comment, $user, $tmpFile, $orgFileName,$fileType, $mimeType,$version=0,$public=1) { /* {{{ */
|
||||||
|
@ -2777,11 +2781,6 @@ class SeedDMS_Core_Document extends SeedDMS_Core_Object { /* {{{ */
|
||||||
}
|
}
|
||||||
|
|
||||||
// remove all document files
|
// remove all document files
|
||||||
/* make sure to get all attachments because _removeContent() did remove
|
|
||||||
* the attachments of a version already and the list of attachments
|
|
||||||
* is still stored in _documentFiles
|
|
||||||
* */
|
|
||||||
unset($this->_documentFiles);
|
|
||||||
$res = $this->getDocumentFiles();
|
$res = $this->getDocumentFiles();
|
||||||
if (is_bool($res) && !$res) {
|
if (is_bool($res) && !$res) {
|
||||||
$db->rollbackTransaction();
|
$db->rollbackTransaction();
|
||||||
|
|
|
@ -1885,7 +1885,8 @@ add method SeedDMS_Core_DatabaseAccess::setLogFp()
|
||||||
- add parameter $incdisabled to SeedDMS_Core_Folder::getNotifyList()
|
- add parameter $incdisabled to SeedDMS_Core_Folder::getNotifyList()
|
||||||
- do not validate value in SeedDMS_Core_Attribute::setValue(), it should have been done before
|
- 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
|
- SeedDMS_Core_DMS::search() can search for last date of document status change
|
||||||
- fix SeedDMS_Core_Document::remove when version had its own attachments
|
- smarter caching in SeedDMS_Core_Document::getDocumentFiles() which fixes a potential
|
||||||
|
problem when removing a document
|
||||||
</notes>
|
</notes>
|
||||||
</release>
|
</release>
|
||||||
<release>
|
<release>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user