Merge branch 'seeddms-5.1.x' into seeddms-6.0.x

This commit is contained in:
Uwe Steinmann 2020-09-17 09:27:08 +02:00
commit d06e5fa3fb
5 changed files with 17 additions and 9 deletions

View File

@ -177,6 +177,7 @@
- major rework of scripts in utils, unify reading of settings, use PHP_EOL
- allow inline editing of document name
- import of users does not issue an error if a group column isn't set
- removing a document version will not remove attachments of the document anymore
--------------------------------------------------------------------------------
Changes in version 5.1.19

View File

@ -2393,8 +2393,8 @@ class SeedDMS_Core_Document extends SeedDMS_Core_Object { /* {{{ */
}
*/
// remove document files attached to version
$res = $this->getDocumentFiles($version->getVersion());
// remove only those document files attached to version
$res = $this->getDocumentFiles($version->getVersion(), false);
if (is_bool($res) && !$res) {
$db->rollbackTransaction();
return false;
@ -2616,15 +2616,20 @@ class SeedDMS_Core_Document extends SeedDMS_Core_Object { /* {{{ */
/**
* Get list of files attached to document
*
* @param integer $version get only attachments for this version
*@param boolean $incnoversion include attachments without a version
* @return array list of files, false in case of an sql error
*/
function getDocumentFiles($version=0) { /* {{{ */
function getDocumentFiles($version=0, $incnoversion=true) { /* {{{ */
if (!isset($this->_documentFiles)) {
$db = $this->_dms->getDB();
$queryStr = "SELECT * FROM `tblDocumentFiles` WHERE `document` = " . $this->_id;
if($version) {
$queryStr .= " AND (`version`=0 OR `version`=".(int) $version.")";
if($incnoversion)
$queryStr .= " AND (`version`=0 OR `version`=".(int) $version.")";
else
$queryStr .= " AND (`version`=".(int) $version.")";
}
$queryStr .= " ORDER BY ";
if($version) {
@ -2746,7 +2751,7 @@ class SeedDMS_Core_Document extends SeedDMS_Core_Object { /* {{{ */
}
}
// remove document file
// remove all document files
$res = $this->getDocumentFiles();
if (is_bool($res) && !$res) {
$db->rollbackTransaction();

View File

@ -25,6 +25,8 @@
<license uri="http://opensource.org/licenses/gpl-license">GPL License</license>
<notes>
- SeedDMS_Core_DMS::getDocumentList() returns false, if an unknown list passed
- SeedDMS_Core_Document::getDocumentFiles() has new parameter to select only those files attached to a specific version of the document
- removing a document version will not remove attachments of the document anymore
</notes>
<contents>
<dir baseinstalldir="SeedDMS" name="/">

View File

@ -34,7 +34,7 @@ text/csv
application/vnd.oasis.opendocument.text
application/msword
application/vnd.wordperfect
application/rtf
text/rtf
unoconv -d document -f pdf --stdout -v '%f' > '%o'
image/png
@ -44,10 +44,12 @@ image/jpeg
application/vnd.ms-powerpoint
application/vnd.openxmlformats-officedocument.presentationml.presentation
application/vnd.oasis.opendocument.presentation
unoconv -d presentation -f pdf --stdout -v '%f' > '%o'
application/vnd.ms-excel
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
application/vnd.oasis.opendocument.spreadsheet
unoconv -d spreadsheet -f pdf --stdout -v '%f' > '%o'
Conversion to png for preview images
@ -78,7 +80,7 @@ application/vnd.oasis.opendocument.text
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
application/vnd.ms-excel
application/vnd.openxmlformats-officedocument.wordprocessingml.document
application/rtf
text/rtf
application/vnd.ms-powerpoint
text/csv
application/vnd.wordperfect

View File

@ -195,5 +195,3 @@ else {
add_log_line("?documentid=".$documentid."&version".$version_num);
header("Location:".$nexturl);
?>