propperly clean checked out file in possible cases

previously the checked out file was not remove from the checkout area
if it was unchanged and checked in
This commit is contained in:
Uwe Steinmann 2015-04-23 11:48:01 +02:00
parent 505763e0be
commit 8b065cf7ac

View File

@ -783,15 +783,22 @@ class SeedDMS_Core_Document extends SeedDMS_Core_Object { /* {{{ */
$checksum = SeedDMS_Core_File::checksum($info['filename']);
if($checksum != $lc->getChecksum()) {
$content = $this->addContent($comment, $user, $info['filename'], $lc->getOriginalFileName(), $lc->getFileType(), $lc->getMimeType(), $reviewers, $approvers, $version, $attributes, $workflow);
if($content && !$this->_dms->forceRename)
if($content) {
if(!$this->_dms->forceRename) {
SeedDMS_Core_File::removeFile($info['filename']);
}
$queryStr = "DELETE FROM tblDocumentCheckOuts WHERE document = ".$this->_id;
$db->getResult($queryStr);
return $content;
} else {
return false;
}
} else {
SeedDMS_Core_File::removeFile($info['filename']);
$queryStr = "DELETE FROM tblDocumentCheckOuts WHERE document = ".$this->_id;
$db->getResult($queryStr);
return true;
}
} /* }}} */
/**