mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-21 17:11:38 +00:00
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:
parent
505763e0be
commit
8b065cf7ac
|
@ -783,15 +783,22 @@ class SeedDMS_Core_Document extends SeedDMS_Core_Object { /* {{{ */
|
||||||
$checksum = SeedDMS_Core_File::checksum($info['filename']);
|
$checksum = SeedDMS_Core_File::checksum($info['filename']);
|
||||||
if($checksum != $lc->getChecksum()) {
|
if($checksum != $lc->getChecksum()) {
|
||||||
$content = $this->addContent($comment, $user, $info['filename'], $lc->getOriginalFileName(), $lc->getFileType(), $lc->getMimeType(), $reviewers, $approvers, $version, $attributes, $workflow);
|
$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) {
|
||||||
SeedDMS_Core_File::removeFile($info['filename']);
|
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
$queryStr = "DELETE FROM tblDocumentCheckOuts WHERE document = ".$this->_id;
|
|
||||||
$db->getResult($queryStr);
|
|
||||||
|
|
||||||
return $content;
|
|
||||||
|
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue
Block a user