mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-06-07 13:49:23 +00:00
Merge branch 'seeddms-5.1.x' into seeddms-6.0.x
This commit is contained in:
commit
d06e5fa3fb
|
@ -177,6 +177,7 @@
|
||||||
- major rework of scripts in utils, unify reading of settings, use PHP_EOL
|
- major rework of scripts in utils, unify reading of settings, use PHP_EOL
|
||||||
- allow inline editing of document name
|
- allow inline editing of document name
|
||||||
- import of users does not issue an error if a group column isn't set
|
- 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
|
Changes in version 5.1.19
|
||||||
|
|
|
@ -2393,8 +2393,8 @@ class SeedDMS_Core_Document extends SeedDMS_Core_Object { /* {{{ */
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// remove document files attached to version
|
// remove only those document files attached to version
|
||||||
$res = $this->getDocumentFiles($version->getVersion());
|
$res = $this->getDocumentFiles($version->getVersion(), false);
|
||||||
if (is_bool($res) && !$res) {
|
if (is_bool($res) && !$res) {
|
||||||
$db->rollbackTransaction();
|
$db->rollbackTransaction();
|
||||||
return false;
|
return false;
|
||||||
|
@ -2616,15 +2616,20 @@ class SeedDMS_Core_Document extends SeedDMS_Core_Object { /* {{{ */
|
||||||
/**
|
/**
|
||||||
* Get list of files attached to document
|
* 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
|
* @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)) {
|
if (!isset($this->_documentFiles)) {
|
||||||
$db = $this->_dms->getDB();
|
$db = $this->_dms->getDB();
|
||||||
|
|
||||||
$queryStr = "SELECT * FROM `tblDocumentFiles` WHERE `document` = " . $this->_id;
|
$queryStr = "SELECT * FROM `tblDocumentFiles` WHERE `document` = " . $this->_id;
|
||||||
if($version) {
|
if($version) {
|
||||||
|
if($incnoversion)
|
||||||
$queryStr .= " AND (`version`=0 OR `version`=".(int) $version.")";
|
$queryStr .= " AND (`version`=0 OR `version`=".(int) $version.")";
|
||||||
|
else
|
||||||
|
$queryStr .= " AND (`version`=".(int) $version.")";
|
||||||
}
|
}
|
||||||
$queryStr .= " ORDER BY ";
|
$queryStr .= " ORDER BY ";
|
||||||
if($version) {
|
if($version) {
|
||||||
|
@ -2746,7 +2751,7 @@ class SeedDMS_Core_Document extends SeedDMS_Core_Object { /* {{{ */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// remove document file
|
// remove all document files
|
||||||
$res = $this->getDocumentFiles();
|
$res = $this->getDocumentFiles();
|
||||||
if (is_bool($res) && !$res) {
|
if (is_bool($res) && !$res) {
|
||||||
$db->rollbackTransaction();
|
$db->rollbackTransaction();
|
||||||
|
|
|
@ -25,6 +25,8 @@
|
||||||
<license uri="http://opensource.org/licenses/gpl-license">GPL License</license>
|
<license uri="http://opensource.org/licenses/gpl-license">GPL License</license>
|
||||||
<notes>
|
<notes>
|
||||||
- SeedDMS_Core_DMS::getDocumentList() returns false, if an unknown list passed
|
- 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>
|
</notes>
|
||||||
<contents>
|
<contents>
|
||||||
<dir baseinstalldir="SeedDMS" name="/">
|
<dir baseinstalldir="SeedDMS" name="/">
|
||||||
|
|
|
@ -34,7 +34,7 @@ text/csv
|
||||||
application/vnd.oasis.opendocument.text
|
application/vnd.oasis.opendocument.text
|
||||||
application/msword
|
application/msword
|
||||||
application/vnd.wordperfect
|
application/vnd.wordperfect
|
||||||
application/rtf
|
text/rtf
|
||||||
unoconv -d document -f pdf --stdout -v '%f' > '%o'
|
unoconv -d document -f pdf --stdout -v '%f' > '%o'
|
||||||
|
|
||||||
image/png
|
image/png
|
||||||
|
@ -44,10 +44,12 @@ image/jpeg
|
||||||
|
|
||||||
application/vnd.ms-powerpoint
|
application/vnd.ms-powerpoint
|
||||||
application/vnd.openxmlformats-officedocument.presentationml.presentation
|
application/vnd.openxmlformats-officedocument.presentationml.presentation
|
||||||
|
application/vnd.oasis.opendocument.presentation
|
||||||
unoconv -d presentation -f pdf --stdout -v '%f' > '%o'
|
unoconv -d presentation -f pdf --stdout -v '%f' > '%o'
|
||||||
|
|
||||||
application/vnd.ms-excel
|
application/vnd.ms-excel
|
||||||
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
|
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
|
||||||
|
application/vnd.oasis.opendocument.spreadsheet
|
||||||
unoconv -d spreadsheet -f pdf --stdout -v '%f' > '%o'
|
unoconv -d spreadsheet -f pdf --stdout -v '%f' > '%o'
|
||||||
|
|
||||||
Conversion to png for preview images
|
Conversion to png for preview images
|
||||||
|
@ -78,7 +80,7 @@ application/vnd.oasis.opendocument.text
|
||||||
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
|
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
|
||||||
application/vnd.ms-excel
|
application/vnd.ms-excel
|
||||||
application/vnd.openxmlformats-officedocument.wordprocessingml.document
|
application/vnd.openxmlformats-officedocument.wordprocessingml.document
|
||||||
application/rtf
|
text/rtf
|
||||||
application/vnd.ms-powerpoint
|
application/vnd.ms-powerpoint
|
||||||
text/csv
|
text/csv
|
||||||
application/vnd.wordperfect
|
application/vnd.wordperfect
|
||||||
|
|
|
@ -195,5 +195,3 @@ else {
|
||||||
add_log_line("?documentid=".$documentid."&version".$version_num);
|
add_log_line("?documentid=".$documentid."&version".$version_num);
|
||||||
|
|
||||||
header("Location:".$nexturl);
|
header("Location:".$nexturl);
|
||||||
|
|
||||||
?>
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user