mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-09 04:56:06 +00:00
Merge branch 'seeddms-5.1.x' into seeddms-6.0.x
This commit is contained in:
commit
5ff1333c9f
|
@ -136,6 +136,7 @@
|
||||||
- fix renaming of folders via webdav
|
- fix renaming of folders via webdav
|
||||||
- fix list of expired documents on MyDocuments page
|
- fix list of expired documents on MyDocuments page
|
||||||
- pass showtree to ViewDocument (Closes: #462)
|
- pass showtree to ViewDocument (Closes: #462)
|
||||||
|
- fix upgrade script for sqlite3
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
Changes in version 5.1.13
|
Changes in version 5.1.13
|
||||||
|
|
|
@ -1996,7 +1996,7 @@ class SeedDMS_Core_Document extends SeedDMS_Core_Object { /* {{{ */
|
||||||
if($fileType == '.')
|
if($fileType == '.')
|
||||||
$fileType = '';
|
$fileType = '';
|
||||||
|
|
||||||
/* Check if $user, $orgFileName, $fileType and $mimetype are the same */
|
/* Check if $user, $orgFileName, $fileType and $mimeType are the same */
|
||||||
if($user->getID() != $content->getUser()->getID()) {
|
if($user->getID() != $content->getUser()->getID()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -3411,7 +3411,7 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
|
||||||
*
|
*
|
||||||
* @return string path of file on disc
|
* @return string path of file on disc
|
||||||
*/
|
*/
|
||||||
function getPath() { return $this->_document->getDir() . $this->_version . ($this->_fileType != '.' ? $this->_fileType : ''); }
|
function getPath() { return $this->_document->getDir() . $this->_version . $this->_fileType; }
|
||||||
|
|
||||||
function setRevisionDate($date = false) { /* {{{ */
|
function setRevisionDate($date = false) { /* {{{ */
|
||||||
$db = $this->_document->getDMS()->getDB();
|
$db = $this->_document->getDMS()->getDB();
|
||||||
|
@ -6349,6 +6349,50 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
|
||||||
return $needwkflaction;
|
return $needwkflaction;
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks the internal data of the document version and repairs it.
|
||||||
|
* Currently, this function only repairs a missing filetype
|
||||||
|
*
|
||||||
|
* @return boolean true on success, otherwise false
|
||||||
|
*/
|
||||||
|
function repair() { /* {{{ */
|
||||||
|
$dms = $this->_document->getDMS();
|
||||||
|
$db = $this->_dms->getDB();
|
||||||
|
|
||||||
|
if(file_exists($this->_dms->contentDir.$this->_document->getDir() . $this->_version . $this->_fileType)) {
|
||||||
|
if(strlen($this->_fileType) < 2) {
|
||||||
|
switch($this->_mimeType) {
|
||||||
|
case "application/pdf":
|
||||||
|
case "image/png":
|
||||||
|
case "image/gif":
|
||||||
|
case "image/jpg":
|
||||||
|
$expect = substr($this->_mimeType, -3, 3);
|
||||||
|
if($this->_fileType != '.'.$expect) {
|
||||||
|
$db->startTransaction();
|
||||||
|
$queryStr = "UPDATE `tblDocumentContent` SET `fileType`='.".$expect."' WHERE `id` = ". $this->_id;
|
||||||
|
echo $queryStr."<br />";
|
||||||
|
$res = $db->getResult($queryStr);
|
||||||
|
if ($res) {
|
||||||
|
if(!SeedDMS_Core_File::renameFile($this->_dms->contentDir.$this->_document->getDir() . $this->_version . $this->_fileType, $this->_dms->contentDir.$this->_document->getDir() . $this->_version . '.' . $expect)) {
|
||||||
|
$db->rollbackTransaction();
|
||||||
|
} else {
|
||||||
|
$db->commitTransaction();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$db->rollbackTransaction();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} elseif(file_exists($this->_document->getDir() . $this->_version . '.')) {
|
||||||
|
echo "no file";
|
||||||
|
} else {
|
||||||
|
echo $this->_dms->contentDir.$this->_document->getDir() . $this->_version . $this->_fileType;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
} /* }}} */
|
||||||
|
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -96,7 +96,7 @@ class SeedDMS_Preview_PdfPreviewer extends SeedDMS_Preview_Base {
|
||||||
return false;
|
return false;
|
||||||
if(!$target)
|
if(!$target)
|
||||||
$target = $this->previewDir.$dir.md5($infile);
|
$target = $this->previewDir.$dir.md5($infile);
|
||||||
$this->lastpreviewfile = $target.'.png';
|
$this->lastpreviewfile = $target.'.pdf';
|
||||||
if($target != '' && (!file_exists($target.'.pdf') || filectime($target.'.pdf') < filectime($infile))) {
|
if($target != '' && (!file_exists($target.'.pdf') || filectime($target.'.pdf') < filectime($infile))) {
|
||||||
$cmd = '';
|
$cmd = '';
|
||||||
$mimeparts = explode('/', $mimetype, 2);
|
$mimeparts = explode('/', $mimetype, 2);
|
||||||
|
|
|
@ -203,5 +203,3 @@ class SeedDMS_ExtExample_Task extends SeedDMS_SchedulerTaskBase {
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
|
||||||
|
|
|
@ -223,6 +223,7 @@ if($view) {
|
||||||
$view->setParam('setfilesize', $setfilesize);
|
$view->setParam('setfilesize', $setfilesize);
|
||||||
$view->setParam('setchecksum', $setchecksum);
|
$view->setParam('setchecksum', $setchecksum);
|
||||||
$view->setParam('repair', $repair);
|
$view->setParam('repair', $repair);
|
||||||
|
$view->setParam('showtree', showtree());
|
||||||
$view->setParam('rootfolder', $rootfolder);
|
$view->setParam('rootfolder', $rootfolder);
|
||||||
$view->setParam('repairobjects', $repairobjects);
|
$view->setParam('repairobjects', $repairobjects);
|
||||||
$view->setParam('cachedir', $settings->_cacheDir);
|
$view->setParam('cachedir', $settings->_cacheDir);
|
||||||
|
@ -230,8 +231,11 @@ if($view) {
|
||||||
$view->setParam('previewconverters', $settings->_converters['preview']);
|
$view->setParam('previewconverters', $settings->_converters['preview']);
|
||||||
$view->setParam('timeout', $settings->_cmdTimeout);
|
$view->setParam('timeout', $settings->_cmdTimeout);
|
||||||
$view->setParam('accessobject', $accessop);
|
$view->setParam('accessobject', $accessop);
|
||||||
|
$view->setParam('previewWidthList', $settings->_previewWidthList);
|
||||||
|
$view->setParam('previewConverters', isset($settings->_converters['preview']) ? $settings->_converters['preview'] : array());
|
||||||
|
$view->setParam('timeout', $settings->_cmdTimeout);
|
||||||
|
$view->setParam('xsendfile', $settings->_enableXsendfile);
|
||||||
$view($_GET);
|
$view($_GET);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
|
||||||
|
|
|
@ -128,8 +128,8 @@ class SeedDMS_View_ObjectCheck extends SeedDMS_Bootstrap_Style {
|
||||||
print "<th>".getMLText("name")."</th>\n";
|
print "<th>".getMLText("name")."</th>\n";
|
||||||
print "<th>".getMLText("id")."</th>\n";
|
print "<th>".getMLText("id")."</th>\n";
|
||||||
print "<th>".getMLText("parent")."</th>\n";
|
print "<th>".getMLText("parent")."</th>\n";
|
||||||
print "<th>".getMLText("error")."</th>\n";
|
|
||||||
print "<th></th>\n";
|
print "<th></th>\n";
|
||||||
|
print "<th>".getMLText("error")."</th>\n";
|
||||||
print "</tr>\n</thead>\n<tbody>\n";
|
print "</tr>\n</thead>\n<tbody>\n";
|
||||||
foreach($unlinkedfolders as $error) {
|
foreach($unlinkedfolders as $error) {
|
||||||
echo "<tr>";
|
echo "<tr>";
|
||||||
|
@ -230,10 +230,12 @@ class SeedDMS_View_ObjectCheck extends SeedDMS_Bootstrap_Style {
|
||||||
foreach($nofilesizeversions as $version) {
|
foreach($nofilesizeversions as $version) {
|
||||||
$doc = $version->getDocument();
|
$doc = $version->getDocument();
|
||||||
print "<tr><td>".$doc->getId()."</td><td>".$version->getVersion()."</td><td>".$version->getOriginalFileName()."</td><td>".$version->getMimeType()."</td>";
|
print "<tr><td>".$doc->getId()."</td><td>".$version->getVersion()."</td><td>".$version->getOriginalFileName()."</td><td>".$version->getMimeType()."</td>";
|
||||||
|
echo "<td>";
|
||||||
if($setfilesize) {
|
if($setfilesize) {
|
||||||
if($version->setFileSize())
|
if($version->setFileSize())
|
||||||
echo "<td>".getMLText('repaired')."</td>";
|
echo getMLText('repaired');
|
||||||
}
|
}
|
||||||
|
echo "</td>";
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
}
|
}
|
||||||
print "</tbody></table>\n";
|
print "</tbody></table>\n";
|
||||||
|
@ -264,10 +266,12 @@ class SeedDMS_View_ObjectCheck extends SeedDMS_Bootstrap_Style {
|
||||||
foreach($nochecksumversions as $version) {
|
foreach($nochecksumversions as $version) {
|
||||||
$doc = $version->getDocument();
|
$doc = $version->getDocument();
|
||||||
print "<tr><td>".$doc->getId()."</td><td>".$version->getVersion()."</td><td>".$version->getOriginalFileName()."</td><td>".$version->getMimeType()."</td>";
|
print "<tr><td>".$doc->getId()."</td><td>".$version->getVersion()."</td><td>".$version->getOriginalFileName()."</td><td>".$version->getMimeType()."</td>";
|
||||||
|
echo "<td>";
|
||||||
if($setchecksum) {
|
if($setchecksum) {
|
||||||
if($version->setChecksum())
|
if($version->setChecksum())
|
||||||
echo "<td>".getMLText('repaired')."</td>";
|
echo getMLText('repaired');
|
||||||
}
|
}
|
||||||
|
echo "</td>";
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
}
|
}
|
||||||
print "</tbody></table>\n";
|
print "</tbody></table>\n";
|
||||||
|
|
Loading…
Reference in New Issue
Block a user