mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-02-11 09:35:00 +00:00
Merge branch 'seeddms-4.3.x' into seeddms-5.0.x
This commit is contained in:
commit
c3296e476b
|
@ -3,6 +3,9 @@
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
- fix sql statement when searching for attributes (SeedDMS_Core, Closes: 227)
|
- fix sql statement when searching for attributes (SeedDMS_Core, Closes: 227)
|
||||||
- show preview images file list of drop folder
|
- show preview images file list of drop folder
|
||||||
|
- add timeline for single document and all documents in a given period
|
||||||
|
of time
|
||||||
|
- ensure dates in database are localtime, even if sqlite3 is used
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
Changes in version 4.3.20
|
Changes in version 4.3.20
|
||||||
|
|
|
@ -1545,7 +1545,7 @@ class SeedDMS_Core_DMS {
|
||||||
*/
|
*/
|
||||||
function createPasswordRequest($user) { /* {{{ */
|
function createPasswordRequest($user) { /* {{{ */
|
||||||
$hash = md5(uniqid(time()));
|
$hash = md5(uniqid(time()));
|
||||||
$queryStr = "INSERT INTO tblUserPasswordRequest (userID, hash, `date`) VALUES (" . $user->getId() . ", " . $this->db->qstr($hash) .", ".$db->getCurrentTimestamp().")";
|
$queryStr = "INSERT INTO tblUserPasswordRequest (userID, hash, `date`) VALUES (" . $user->getId() . ", " . $this->db->qstr($hash) .", ".$db->getCurrentDatetime().")";
|
||||||
$resArr = $this->db->getResult($queryStr);
|
$resArr = $this->db->getResult($queryStr);
|
||||||
if (is_bool($resArr) && !$resArr) return false;
|
if (is_bool($resArr) && !$resArr) return false;
|
||||||
return $hash;
|
return $hash;
|
||||||
|
|
|
@ -1188,8 +1188,6 @@ class SeedDMS_Core_Document extends SeedDMS_Core_Object { /* {{{ */
|
||||||
// the doc path is id/version.filetype
|
// the doc path is id/version.filetype
|
||||||
$dir = $this->getDir();
|
$dir = $this->getDir();
|
||||||
|
|
||||||
$date = time();
|
|
||||||
|
|
||||||
/* The version field in table tblDocumentContent used to be auto
|
/* The version field in table tblDocumentContent used to be auto
|
||||||
* increment but that requires the field to be primary as well if
|
* increment but that requires the field to be primary as well if
|
||||||
* innodb is used. That's why the version is now determined here.
|
* innodb is used. That's why the version is now determined here.
|
||||||
|
@ -1208,7 +1206,7 @@ class SeedDMS_Core_Document extends SeedDMS_Core_Object { /* {{{ */
|
||||||
|
|
||||||
$db->startTransaction();
|
$db->startTransaction();
|
||||||
$queryStr = "INSERT INTO tblDocumentContent (document, version, comment, date, createdBy, dir, orgFileName, fileType, mimeType, fileSize, checksum) VALUES ".
|
$queryStr = "INSERT INTO tblDocumentContent (document, version, comment, date, createdBy, dir, orgFileName, fileType, mimeType, fileSize, checksum) VALUES ".
|
||||||
"(".$this->_id.", ".(int)$version.",".$db->qstr($comment).", ".$date.", ".$user->getID().", ".$db->qstr($dir).", ".$db->qstr($orgFileName).", ".$db->qstr($fileType).", ".$db->qstr($mimeType).", ".$filesize.", ".$db->qstr($checksum).")";
|
"(".$this->_id.", ".(int)$version.",".$db->qstr($comment).", ".$db->getCurrentTimestamp().", ".$user->getID().", ".$db->qstr($dir).", ".$db->qstr($orgFileName).", ".$db->qstr($fileType).", ".$db->qstr($mimeType).", ".$filesize.", ".$db->qstr($checksum).")";
|
||||||
if (!$db->getResult($queryStr)) {
|
if (!$db->getResult($queryStr)) {
|
||||||
$db->rollbackTransaction();
|
$db->rollbackTransaction();
|
||||||
return false;
|
return false;
|
||||||
|
@ -1232,7 +1230,8 @@ class SeedDMS_Core_Document extends SeedDMS_Core_Object { /* {{{ */
|
||||||
|
|
||||||
unset($this->_content);
|
unset($this->_content);
|
||||||
unset($this->_latestContent);
|
unset($this->_latestContent);
|
||||||
$content = new SeedDMS_Core_DocumentContent($contentID, $this, $version, $comment, $date, $user->getID(), $dir, $orgFileName, $fileType, $mimeType, $filesize, $checksum);
|
$content = $this->getLatestContent($contentID);
|
||||||
|
// $content = new SeedDMS_Core_DocumentContent($contentID, $this, $version, $comment, $date, $user->getID(), $dir, $orgFileName, $fileType, $mimeType, $filesize, $checksum);
|
||||||
if($workflow)
|
if($workflow)
|
||||||
$content->setWorkflow($workflow, $user);
|
$content->setWorkflow($workflow, $user);
|
||||||
$docResultSet = new SeedDMS_Core_AddContentResultSet($content);
|
$docResultSet = new SeedDMS_Core_AddContentResultSet($content);
|
||||||
|
@ -1317,7 +1316,7 @@ class SeedDMS_Core_Document extends SeedDMS_Core_Object { /* {{{ */
|
||||||
$comment = "";
|
$comment = "";
|
||||||
}
|
}
|
||||||
$queryStr = "INSERT INTO `tblDocumentStatusLog` (`statusID`, `status`, `comment`, `date`, `userID`) ".
|
$queryStr = "INSERT INTO `tblDocumentStatusLog` (`statusID`, `status`, `comment`, `date`, `userID`) ".
|
||||||
"VALUES ('". $statusID ."', '". $status."', 'New document content submitted". $comment ."', ".$db->getCurrentTimestamp().", '". $user->getID() ."')";
|
"VALUES ('". $statusID ."', '". $status."', 'New document content submitted". $comment ."', ".$db->getCurrentDatetime().", '". $user->getID() ."')";
|
||||||
if (!$db->getResult($queryStr)) {
|
if (!$db->getResult($queryStr)) {
|
||||||
$db->rollbackTransaction();
|
$db->rollbackTransaction();
|
||||||
return false;
|
return false;
|
||||||
|
@ -1356,8 +1355,6 @@ class SeedDMS_Core_Document extends SeedDMS_Core_Object { /* {{{ */
|
||||||
// the doc path is id/version.filetype
|
// the doc path is id/version.filetype
|
||||||
$dir = $this->getDir();
|
$dir = $this->getDir();
|
||||||
|
|
||||||
$date = time();
|
|
||||||
|
|
||||||
/* If $version < 1 than replace the content of the latest version.
|
/* If $version < 1 than replace the content of the latest version.
|
||||||
*/
|
*/
|
||||||
if ((int) $version<1) {
|
if ((int) $version<1) {
|
||||||
|
@ -1391,7 +1388,7 @@ class SeedDMS_Core_Document extends SeedDMS_Core_Object { /* {{{ */
|
||||||
$checksum = SeedDMS_Core_File::checksum($tmpFile);
|
$checksum = SeedDMS_Core_File::checksum($tmpFile);
|
||||||
|
|
||||||
$db->startTransaction();
|
$db->startTransaction();
|
||||||
$queryStr = "UPDATE tblDocumentContent set date=".$date.", fileSize=".$filesize.", checksum=".$db->qstr($checksum)." WHERE id=".$content->getID();
|
$queryStr = "UPDATE tblDocumentContent set date=".$db->getCurrentTimestamp().", fileSize=".$filesize.", checksum=".$db->qstr($checksum)." WHERE id=".$content->getID();
|
||||||
if (!$db->getResult($queryStr)) {
|
if (!$db->getResult($queryStr)) {
|
||||||
$db->rollbackTransaction();
|
$db->rollbackTransaction();
|
||||||
return false;
|
return false;
|
||||||
|
@ -1757,7 +1754,7 @@ class SeedDMS_Core_Document extends SeedDMS_Core_Object { /* {{{ */
|
||||||
$dir = $this->getDir();
|
$dir = $this->getDir();
|
||||||
|
|
||||||
$queryStr = "INSERT INTO tblDocumentFiles (comment, date, dir, document, fileType, mimeType, orgFileName, userID, name) VALUES ".
|
$queryStr = "INSERT INTO tblDocumentFiles (comment, date, dir, document, fileType, mimeType, orgFileName, userID, name) VALUES ".
|
||||||
"(".$db->qstr($comment).", '".time()."', ".$db->qstr($dir).", ".$this->_id.", ".$db->qstr($fileType).", ".$db->qstr($mimeType).", ".$db->qstr($orgFileName).",".$user->getID().",".$db->qstr($name).")";
|
"(".$db->qstr($comment).", ".$db->getCurrentTimestamp().", ".$db->qstr($dir).", ".$this->_id.", ".$db->qstr($fileType).", ".$db->qstr($mimeType).", ".$db->qstr($orgFileName).",".$user->getID().",".$db->qstr($name).")";
|
||||||
if (!$db->getResult($queryStr)) return false;
|
if (!$db->getResult($queryStr)) return false;
|
||||||
|
|
||||||
$id = $db->getInsertID();
|
$id = $db->getInsertID();
|
||||||
|
@ -2295,6 +2292,10 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
|
||||||
|
|
||||||
if(!$date)
|
if(!$date)
|
||||||
$date = time();
|
$date = time();
|
||||||
|
else {
|
||||||
|
if(!is_numeric($date))
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
$queryStr = "UPDATE tblDocumentContent SET date = ".(int) $date." WHERE `document` = " . $this->_document->getID() . " AND `version` = " . $this->_version;
|
$queryStr = "UPDATE tblDocumentContent SET date = ".(int) $date." WHERE `document` = " . $this->_document->getID() . " AND `version` = " . $this->_version;
|
||||||
if (!$db->getResult($queryStr))
|
if (!$db->getResult($queryStr))
|
||||||
|
@ -2539,7 +2540,7 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
|
||||||
if($date)
|
if($date)
|
||||||
$ddate = $db->qstr($date);
|
$ddate = $db->qstr($date);
|
||||||
else
|
else
|
||||||
$ddate = $db->getCurrentTimestamp();
|
$ddate = $db->getCurrentDatetime();
|
||||||
$queryStr = "INSERT INTO `tblDocumentStatusLog` (`statusID`, `status`, `comment`, `date`, `userID`) ".
|
$queryStr = "INSERT INTO `tblDocumentStatusLog` (`statusID`, `status`, `comment`, `date`, `userID`) ".
|
||||||
"VALUES ('". $this->_status["statusID"] ."', '". (int) $status ."', ".$db->qstr($comment).", ".$ddate.", '". $updateUser->getID() ."')";
|
"VALUES ('". $this->_status["statusID"] ."', '". (int) $status ."', ".$db->qstr($comment).", ".$ddate.", '". $updateUser->getID() ."')";
|
||||||
$res = $db->getResult($queryStr);
|
$res = $db->getResult($queryStr);
|
||||||
|
@ -2935,7 +2936,7 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
|
||||||
}
|
}
|
||||||
|
|
||||||
$queryStr = "INSERT INTO `tblDocumentReviewLog` (`reviewID`, `status`, `comment`, `date`, `userID`) ".
|
$queryStr = "INSERT INTO `tblDocumentReviewLog` (`reviewID`, `status`, `comment`, `date`, `userID`) ".
|
||||||
"VALUES ('". $reviewID ."', '0', '', ".$db->getCurrentTimestamp().", '". $requestUser->getID() ."')";
|
"VALUES ('". $reviewID ."', '0', '', ".$db->getCurrentDatetime().", '". $requestUser->getID() ."')";
|
||||||
$res = $db->getResult($queryStr);
|
$res = $db->getResult($queryStr);
|
||||||
if (is_bool($res) && !$res) {
|
if (is_bool($res) && !$res) {
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -2993,7 +2994,7 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
|
||||||
}
|
}
|
||||||
|
|
||||||
$queryStr = "INSERT INTO `tblDocumentReviewLog` (`reviewID`, `status`, `comment`, `date`, `userID`) ".
|
$queryStr = "INSERT INTO `tblDocumentReviewLog` (`reviewID`, `status`, `comment`, `date`, `userID`) ".
|
||||||
"VALUES ('". $reviewID ."', '0', '', ".$db->getCurrentTimestamp().", '". $requestUser->getID() ."')";
|
"VALUES ('". $reviewID ."', '0', '', ".$db->getCurrentDatetime().", '". $requestUser->getID() ."')";
|
||||||
$res = $db->getResult($queryStr);
|
$res = $db->getResult($queryStr);
|
||||||
if (is_bool($res) && !$res) {
|
if (is_bool($res) && !$res) {
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -3050,7 +3051,7 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
|
||||||
$queryStr = "INSERT INTO `tblDocumentReviewLog` (`reviewID`, `status`,
|
$queryStr = "INSERT INTO `tblDocumentReviewLog` (`reviewID`, `status`,
|
||||||
`comment`, `date`, `userID`) ".
|
`comment`, `date`, `userID`) ".
|
||||||
"VALUES ('". $indstatus["reviewID"] ."', '".
|
"VALUES ('". $indstatus["reviewID"] ."', '".
|
||||||
(int) $status ."', ".$db->qstr($comment).", ".$db->getCurrentTimestamp().", '".
|
(int) $status ."', ".$db->qstr($comment).", ".$db->getCurrentDatetime().", '".
|
||||||
$requestUser->getID() ."')";
|
$requestUser->getID() ."')";
|
||||||
$res=$db->getResult($queryStr);
|
$res=$db->getResult($queryStr);
|
||||||
if (is_bool($res) && !$res)
|
if (is_bool($res) && !$res)
|
||||||
|
@ -3102,7 +3103,7 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
|
||||||
$queryStr = "INSERT INTO `tblDocumentReviewLog` (`reviewID`, `status`,
|
$queryStr = "INSERT INTO `tblDocumentReviewLog` (`reviewID`, `status`,
|
||||||
`comment`, `date`, `userID`) ".
|
`comment`, `date`, `userID`) ".
|
||||||
"VALUES ('". $reviewStatus[0]["reviewID"] ."', '".
|
"VALUES ('". $reviewStatus[0]["reviewID"] ."', '".
|
||||||
(int) $status ."', ".$db->qstr($comment).", ".$db->getCurrentTimestamp().", '".
|
(int) $status ."', ".$db->qstr($comment).", ".$db->getCurrentDatetime().", '".
|
||||||
$requestUser->getID() ."')";
|
$requestUser->getID() ."')";
|
||||||
$res=$db->getResult($queryStr);
|
$res=$db->getResult($queryStr);
|
||||||
if (is_bool($res) && !$res)
|
if (is_bool($res) && !$res)
|
||||||
|
@ -3168,7 +3169,7 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
|
||||||
}
|
}
|
||||||
|
|
||||||
$queryStr = "INSERT INTO `tblDocumentApproveLog` (`approveID`, `status`, `comment`, `date`, `userID`) ".
|
$queryStr = "INSERT INTO `tblDocumentApproveLog` (`approveID`, `status`, `comment`, `date`, `userID`) ".
|
||||||
"VALUES ('". $approveID ."', '0', '', ".$db->getCurrentTimestamp().", '". $requestUser->getID() ."')";
|
"VALUES ('". $approveID ."', '0', '', ".$db->getCurrentDatetime().", '". $requestUser->getID() ."')";
|
||||||
$res = $db->getResult($queryStr);
|
$res = $db->getResult($queryStr);
|
||||||
if (is_bool($res) && !$res) {
|
if (is_bool($res) && !$res) {
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -3224,7 +3225,7 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
|
||||||
}
|
}
|
||||||
|
|
||||||
$queryStr = "INSERT INTO `tblDocumentApproveLog` (`approveID`, `status`, `comment`, `date`, `userID`) ".
|
$queryStr = "INSERT INTO `tblDocumentApproveLog` (`approveID`, `status`, `comment`, `date`, `userID`) ".
|
||||||
"VALUES ('". $approveID ."', '0', '', ".$db->getCurrentTimestamp().", '". $requestUser->getID() ."')";
|
"VALUES ('". $approveID ."', '0', '', ".$db->getCurrentDatetime().", '". $requestUser->getID() ."')";
|
||||||
$res = $db->getResult($queryStr);
|
$res = $db->getResult($queryStr);
|
||||||
if (is_bool($res) && !$res) {
|
if (is_bool($res) && !$res) {
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -3285,7 +3286,7 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
|
||||||
$queryStr = "INSERT INTO `tblDocumentApproveLog` (`approveID`, `status`,
|
$queryStr = "INSERT INTO `tblDocumentApproveLog` (`approveID`, `status`,
|
||||||
`comment`, `date`, `userID`) ".
|
`comment`, `date`, `userID`) ".
|
||||||
"VALUES ('". $indstatus["approveID"] ."', '".
|
"VALUES ('". $indstatus["approveID"] ."', '".
|
||||||
(int) $status ."', ".$db->qstr($comment).", ".$db->getCurrentTimestamp().", '".
|
(int) $status ."', ".$db->qstr($comment).", ".$db->getCurrentDatetime().", '".
|
||||||
$requestUser->getID() ."')";
|
$requestUser->getID() ."')";
|
||||||
$res=$db->getResult($queryStr);
|
$res=$db->getResult($queryStr);
|
||||||
if (is_bool($res) && !$res)
|
if (is_bool($res) && !$res)
|
||||||
|
@ -3329,7 +3330,7 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
|
||||||
$queryStr = "INSERT INTO `tblDocumentApproveLog` (`approveID`, `status`,
|
$queryStr = "INSERT INTO `tblDocumentApproveLog` (`approveID`, `status`,
|
||||||
`comment`, `date`, `userID`) ".
|
`comment`, `date`, `userID`) ".
|
||||||
"VALUES ('". $approvalStatus[0]["approveID"] ."', '".
|
"VALUES ('". $approvalStatus[0]["approveID"] ."', '".
|
||||||
(int) $status ."', ".$db->qstr($comment).", ".$db->getCurrentTimestamp().", '".
|
(int) $status ."', ".$db->qstr($comment).", ".$db->getCurrentDatetime().", '".
|
||||||
$requestUser->getID() ."')";
|
$requestUser->getID() ."')";
|
||||||
$res=$db->getResult($queryStr);
|
$res=$db->getResult($queryStr);
|
||||||
if (is_bool($res) && !$res)
|
if (is_bool($res) && !$res)
|
||||||
|
@ -3365,7 +3366,7 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
|
||||||
}
|
}
|
||||||
|
|
||||||
$queryStr = "INSERT INTO `tblDocumentReviewLog` (`reviewID`, `status`, `comment`, `date`, `userID`) ".
|
$queryStr = "INSERT INTO `tblDocumentReviewLog` (`reviewID`, `status`, `comment`, `date`, `userID`) ".
|
||||||
"VALUES ('". $indstatus["reviewID"] ."', '-2', '', ".$db->getCurrentTimestamp().", '". $requestUser->getID() ."')";
|
"VALUES ('". $indstatus["reviewID"] ."', '-2', '', ".$db->getCurrentDatetime().", '". $requestUser->getID() ."')";
|
||||||
$res = $db->getResult($queryStr);
|
$res = $db->getResult($queryStr);
|
||||||
if (is_bool($res) && !$res) {
|
if (is_bool($res) && !$res) {
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -3396,7 +3397,7 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
|
||||||
}
|
}
|
||||||
|
|
||||||
$queryStr = "INSERT INTO `tblDocumentReviewLog` (`reviewID`, `status`, `comment`, `date`, `userID`) ".
|
$queryStr = "INSERT INTO `tblDocumentReviewLog` (`reviewID`, `status`, `comment`, `date`, `userID`) ".
|
||||||
"VALUES ('". $reviewStatus[0]["reviewID"] ."', '-2', '', ".$db->getCurrentTimestamp().", '". $requestUser->getID() ."')";
|
"VALUES ('". $reviewStatus[0]["reviewID"] ."', '-2', '', ".$db->getCurrentDatetime().", '". $requestUser->getID() ."')";
|
||||||
$res = $db->getResult($queryStr);
|
$res = $db->getResult($queryStr);
|
||||||
if (is_bool($res) && !$res) {
|
if (is_bool($res) && !$res) {
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -3428,7 +3429,7 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
|
||||||
}
|
}
|
||||||
|
|
||||||
$queryStr = "INSERT INTO `tblDocumentApproveLog` (`approveID`, `status`, `comment`, `date`, `userID`) ".
|
$queryStr = "INSERT INTO `tblDocumentApproveLog` (`approveID`, `status`, `comment`, `date`, `userID`) ".
|
||||||
"VALUES ('". $indstatus["approveID"] ."', '-2', '', ".$db->getCurrentTimestamp().", '". $requestUser->getID() ."')";
|
"VALUES ('". $indstatus["approveID"] ."', '-2', '', ".$db->getCurrentDatetime().", '". $requestUser->getID() ."')";
|
||||||
$res = $db->getResult($queryStr);
|
$res = $db->getResult($queryStr);
|
||||||
if (is_bool($res) && !$res) {
|
if (is_bool($res) && !$res) {
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -3459,7 +3460,7 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
|
||||||
}
|
}
|
||||||
|
|
||||||
$queryStr = "INSERT INTO `tblDocumentApproveLog` (`approveID`, `status`, `comment`, `date`, `userID`) ".
|
$queryStr = "INSERT INTO `tblDocumentApproveLog` (`approveID`, `status`, `comment`, `date`, `userID`) ".
|
||||||
"VALUES ('". $approvalStatus[0]["approveID"] ."', '-2', '', ".$db->getCurrentTimestamp().", '". $requestUser->getID() ."')";
|
"VALUES ('". $approvalStatus[0]["approveID"] ."', '-2', '', ".$db->getCurrentDatetime().", '". $requestUser->getID() ."')";
|
||||||
$res = $db->getResult($queryStr);
|
$res = $db->getResult($queryStr);
|
||||||
if (is_bool($res) && !$res) {
|
if (is_bool($res) && !$res) {
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -3528,7 +3529,7 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
|
||||||
if($workflow && is_object($workflow)) {
|
if($workflow && is_object($workflow)) {
|
||||||
$db->startTransaction();
|
$db->startTransaction();
|
||||||
$initstate = $workflow->getInitState();
|
$initstate = $workflow->getInitState();
|
||||||
$queryStr = "INSERT INTO tblWorkflowDocumentContent (workflow, document, version, state, date) VALUES (". $workflow->getID(). ", ". $this->_document->getID() .", ". $this->_version .", ".$initstate->getID().", ".$db->getCurrentTimestamp().")";
|
$queryStr = "INSERT INTO tblWorkflowDocumentContent (workflow, document, version, state, date) VALUES (". $workflow->getID(). ", ". $this->_document->getID() .", ". $this->_version .", ".$initstate->getID().", ".$db->getCurrentDatetime().")";
|
||||||
if (!$db->getResult($queryStr)) {
|
if (!$db->getResult($queryStr)) {
|
||||||
$db->rollbackTransaction();
|
$db->rollbackTransaction();
|
||||||
return false;
|
return false;
|
||||||
|
@ -3709,7 +3710,7 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
|
||||||
|
|
||||||
if($subworkflow) {
|
if($subworkflow) {
|
||||||
$initstate = $subworkflow->getInitState();
|
$initstate = $subworkflow->getInitState();
|
||||||
$queryStr = "INSERT INTO tblWorkflowDocumentContent (parentworkflow, workflow, document, version, state, date) VALUES (". $this->_workflow->getID(). ", ". $subworkflow->getID(). ", ". $this->_document->getID() .", ". $this->_version .", ".$initstate->getID().", ".$db->getCurrentTimestamp().")";
|
$queryStr = "INSERT INTO tblWorkflowDocumentContent (parentworkflow, workflow, document, version, state, date) VALUES (". $this->_workflow->getID(). ", ". $subworkflow->getID(). ", ". $this->_document->getID() .", ". $this->_version .", ".$initstate->getID().", ".$db->getCurrentDatetime().")";
|
||||||
if (!$db->getResult($queryStr)) {
|
if (!$db->getResult($queryStr)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -3949,7 +3950,7 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
$state = $this->_workflowState;
|
$state = $this->_workflowState;
|
||||||
$queryStr = "INSERT INTO tblWorkflowLog (document, version, workflow, userid, transition, date, comment) VALUES (".$this->_document->getID().", ".$this->_version.", " . (int) $this->_workflow->getID() . ", " .(int) $user->getID(). ", ".(int) $transition->getID().", ".$db->getCurrentTimestamp().", ".$db->qstr($comment).")";
|
$queryStr = "INSERT INTO tblWorkflowLog (document, version, workflow, userid, transition, date, comment) VALUES (".$this->_document->getID().", ".$this->_version.", " . (int) $this->_workflow->getID() . ", " .(int) $user->getID(). ", ".(int) $transition->getID().", ".$db->getCurrentDatetime().", ".$db->qstr($comment).")";
|
||||||
if (!$db->getResult($queryStr))
|
if (!$db->getResult($queryStr))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|
|
@ -512,7 +512,7 @@ class SeedDMS_Core_Folder extends SeedDMS_Core_Object {
|
||||||
|
|
||||||
//inheritAccess = true, defaultAccess = M_READ
|
//inheritAccess = true, defaultAccess = M_READ
|
||||||
$queryStr = "INSERT INTO tblFolders (name, parent, folderList, comment, date, owner, inheritAccess, defaultAccess, sequence) ".
|
$queryStr = "INSERT INTO tblFolders (name, parent, folderList, comment, date, owner, inheritAccess, defaultAccess, sequence) ".
|
||||||
"VALUES (".$db->qstr($name).", ".$this->_id.", ".$db->qstr($pathPrefix).", ".$db->qstr($comment).", ".time().", ".$owner->getID().", 1, ".M_READ.", ". $sequence.")";
|
"VALUES (".$db->qstr($name).", ".$this->_id.", ".$db->qstr($pathPrefix).", ".$db->qstr($comment).", ".$db->getCurrentTimestamp().", ".$owner->getID().", 1, ".M_READ.", ". $sequence.")";
|
||||||
if (!$db->getResult($queryStr)) {
|
if (!$db->getResult($queryStr)) {
|
||||||
$db->rollbackTransaction();
|
$db->rollbackTransaction();
|
||||||
return false;
|
return false;
|
||||||
|
@ -807,7 +807,7 @@ class SeedDMS_Core_Folder extends SeedDMS_Core_Object {
|
||||||
$db->startTransaction();
|
$db->startTransaction();
|
||||||
|
|
||||||
$queryStr = "INSERT INTO tblDocuments (name, comment, date, expires, owner, folder, folderList, inheritAccess, defaultAccess, locked, keywords, sequence) VALUES ".
|
$queryStr = "INSERT INTO tblDocuments (name, comment, date, expires, owner, folder, folderList, inheritAccess, defaultAccess, locked, keywords, sequence) VALUES ".
|
||||||
"(".$db->qstr($name).", ".$db->qstr($comment).", " . time().", ".(int) $expires.", ".$owner->getID().", ".$this->_id.",".$db->qstr($pathPrefix).", 1, ".M_READ.", -1, ".$db->qstr($keywords).", " . $sequence . ")";
|
"(".$db->qstr($name).", ".$db->qstr($comment).", ".$db->getCurrentTimestamp().", ".(int) $expires.", ".$owner->getID().", ".$this->_id.",".$db->qstr($pathPrefix).", 1, ".M_READ.", -1, ".$db->qstr($keywords).", " . $sequence . ")";
|
||||||
if (!$db->getResult($queryStr)) {
|
if (!$db->getResult($queryStr)) {
|
||||||
$db->rollbackTransaction();
|
$db->rollbackTransaction();
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -293,7 +293,7 @@ class SeedDMS_Core_Group {
|
||||||
$reviewStatus = $this->getReviewStatus();
|
$reviewStatus = $this->getReviewStatus();
|
||||||
foreach ($reviewStatus as $r) {
|
foreach ($reviewStatus as $r) {
|
||||||
$queryStr = "INSERT INTO `tblDocumentReviewLog` (`reviewID`, `status`, `comment`, `date`, `userID`) ".
|
$queryStr = "INSERT INTO `tblDocumentReviewLog` (`reviewID`, `status`, `comment`, `date`, `userID`) ".
|
||||||
"VALUES ('". $r["reviewID"] ."', '-2', 'Review group removed from process', ".$db->getCurrentTimestamp().", '". $user->getID() ."')";
|
"VALUES ('". $r["reviewID"] ."', '-2', 'Review group removed from process', ".$db->getCurrentDatetime().", '". $user->getID() ."')";
|
||||||
$res=$db->getResult($queryStr);
|
$res=$db->getResult($queryStr);
|
||||||
if(!$res) {
|
if(!$res) {
|
||||||
$db->rollbackTransaction();
|
$db->rollbackTransaction();
|
||||||
|
@ -304,7 +304,7 @@ class SeedDMS_Core_Group {
|
||||||
$approvalStatus = $this->getApprovalStatus();
|
$approvalStatus = $this->getApprovalStatus();
|
||||||
foreach ($approvalStatus as $a) {
|
foreach ($approvalStatus as $a) {
|
||||||
$queryStr = "INSERT INTO `tblDocumentApproveLog` (`approveID`, `status`, `comment`, `date`, `userID`) ".
|
$queryStr = "INSERT INTO `tblDocumentApproveLog` (`approveID`, `status`, `comment`, `date`, `userID`) ".
|
||||||
"VALUES ('". $a["approveID"] ."', '-2', 'Approval group removed from process', ".$db->getCurrentTimestamp().", '". $user->getID() ."')";
|
"VALUES ('". $a["approveID"] ."', '-2', 'Approval group removed from process', ".$db->getCurrentDatetime().", '". $user->getID() ."')";
|
||||||
$res=$db->getResult($queryStr);
|
$res=$db->getResult($queryStr);
|
||||||
if(!$res) {
|
if(!$res) {
|
||||||
$db->rollbackTransaction();
|
$db->rollbackTransaction();
|
||||||
|
|
|
@ -665,7 +665,7 @@ class SeedDMS_Core_User { /* {{{ */
|
||||||
$reviewStatus = $this->getReviewStatus();
|
$reviewStatus = $this->getReviewStatus();
|
||||||
foreach ($reviewStatus["indstatus"] as $ri) {
|
foreach ($reviewStatus["indstatus"] as $ri) {
|
||||||
$queryStr = "INSERT INTO `tblDocumentReviewLog` (`reviewID`, `status`, `comment`, `date`, `userID`) ".
|
$queryStr = "INSERT INTO `tblDocumentReviewLog` (`reviewID`, `status`, `comment`, `date`, `userID`) ".
|
||||||
"VALUES ('". $ri["reviewID"] ."', '-2', 'Reviewer removed from process', ".$db->getCurrentTimestamp().", '". $user->getID() ."')";
|
"VALUES ('". $ri["reviewID"] ."', '-2', 'Reviewer removed from process', ".$db->getCurrentDatetime().", '". $user->getID() ."')";
|
||||||
$res=$db->getResult($queryStr);
|
$res=$db->getResult($queryStr);
|
||||||
if(!$res) {
|
if(!$res) {
|
||||||
$db->rollbackTransaction();
|
$db->rollbackTransaction();
|
||||||
|
@ -676,7 +676,7 @@ class SeedDMS_Core_User { /* {{{ */
|
||||||
$approvalStatus = $this->getApprovalStatus();
|
$approvalStatus = $this->getApprovalStatus();
|
||||||
foreach ($approvalStatus["indstatus"] as $ai) {
|
foreach ($approvalStatus["indstatus"] as $ai) {
|
||||||
$queryStr = "INSERT INTO `tblDocumentApproveLog` (`approveID`, `status`, `comment`, `date`, `userID`) ".
|
$queryStr = "INSERT INTO `tblDocumentApproveLog` (`approveID`, `status`, `comment`, `date`, `userID`) ".
|
||||||
"VALUES ('". $ai["approveID"] ."', '-2', 'Approver removed from process', ".$db->getCurrentTimestamp().", '". $user->getID() ."')";
|
"VALUES ('". $ai["approveID"] ."', '-2', 'Approver removed from process', ".$db->getCurrentDatetime().", '". $user->getID() ."')";
|
||||||
$res=$db->getResult($queryStr);
|
$res=$db->getResult($queryStr);
|
||||||
if(!$res) {
|
if(!$res) {
|
||||||
$db->rollbackTransaction();
|
$db->rollbackTransaction();
|
||||||
|
|
|
@ -455,11 +455,12 @@ class SeedDMS_Core_DatabaseAccess {
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return sql statement for returning the current timestamp
|
* Return sql statement for returning the current date and time
|
||||||
|
* in format Y-m-d H:i:s
|
||||||
*
|
*
|
||||||
* @return string sql code
|
* @return string sql code
|
||||||
*/
|
*/
|
||||||
function getCurrentTimestamp() { /* {{{ */
|
function getCurrentDatetime() { /* {{{ */
|
||||||
switch($this->_driver) {
|
switch($this->_driver) {
|
||||||
case 'mysql':
|
case 'mysql':
|
||||||
return "CURRENT_TIMESTAMP";
|
return "CURRENT_TIMESTAMP";
|
||||||
|
@ -471,6 +472,22 @@ class SeedDMS_Core_DatabaseAccess {
|
||||||
return '';
|
return '';
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return sql statement for returning the current timestamp
|
||||||
|
*
|
||||||
|
* @return string sql code
|
||||||
|
*/
|
||||||
|
function getCurrentTimestamp() { /* {{{ */
|
||||||
|
switch($this->_driver) {
|
||||||
|
case 'mysql':
|
||||||
|
return "UNIX_TIMESTAMP()";
|
||||||
|
break;
|
||||||
|
case 'sqlite':
|
||||||
|
return "strftime('%s', 'now', 'localtime')";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return '';
|
||||||
|
} /* }}} */
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -867,5 +867,29 @@ clean workflow log when a document version was deleted
|
||||||
- new method cleanNotifyList()
|
- new method cleanNotifyList()
|
||||||
</notes>
|
</notes>
|
||||||
</release>
|
</release>
|
||||||
|
<release>
|
||||||
|
<date>2015-06-26</date>
|
||||||
|
<time>16:45:59</time>
|
||||||
|
<version>
|
||||||
|
<release>4.3.20</release>
|
||||||
|
<api>4.3.20</api>
|
||||||
|
</version>
|
||||||
|
<stability>
|
||||||
|
<release>stable</release>
|
||||||
|
<api>stable</api>
|
||||||
|
</stability>
|
||||||
|
<license uri="http://opensource.org/licenses/gpl-license">GPL License</license>
|
||||||
|
<notes>
|
||||||
|
- add method SeedDMS_Core_DMS::checkDate()
|
||||||
|
- add method SeedDMS_Core_Document::setDate()
|
||||||
|
- add method SeedDMS_Core_Folder::setDate()
|
||||||
|
- date can be passed to SeedDMS_Core_DocumentContent::setStatus()
|
||||||
|
- add method SeedDMS_Core_DocumentContent::rewriteStatusLog()
|
||||||
|
- add method SeedDMS_Core_DocumentContent::rewriteReviewLog()
|
||||||
|
- add method SeedDMS_Core_DocumentContent::rewriteApprovalLog()
|
||||||
|
- access rights for guest are also taken into account if set in an acl. Previously guest could gain read rights even if the access was probibited
|
||||||
|
by a group or user right
|
||||||
|
</notes>
|
||||||
|
</release>
|
||||||
</changelog>
|
</changelog>
|
||||||
</package>
|
</package>
|
||||||
|
|
|
@ -49,7 +49,7 @@ function addEvent($from, $to, $name, $comment ){
|
||||||
global $db,$user;
|
global $db,$user;
|
||||||
|
|
||||||
$queryStr = "INSERT INTO tblEvents (name, comment, start, stop, date, userID) VALUES ".
|
$queryStr = "INSERT INTO tblEvents (name, comment, start, stop, date, userID) VALUES ".
|
||||||
"(".$db->qstr($name).", ".$db->qstr($comment).", ".(int) $from.", ".(int) $to.", ".mktime().", ".$user->getID().")";
|
"(".$db->qstr($name).", ".$db->qstr($comment).", ".(int) $from.", ".(int) $to.", ".$db->getCurrentTimestamp().", ".$user->getID().")";
|
||||||
|
|
||||||
$ret = $db->getResult($queryStr);
|
$ret = $db->getResult($queryStr);
|
||||||
return $ret;
|
return $ret;
|
||||||
|
@ -76,7 +76,7 @@ function editEvent($id, $from, $to, $name, $comment ){
|
||||||
|
|
||||||
global $db;
|
global $db;
|
||||||
|
|
||||||
$queryStr = "UPDATE tblEvents SET start = " . (int) $from . ", stop = " . (int) $to . ", name = " . $db->qstr($name) . ", comment = " . $db->qstr($comment) . ", date = " . mktime() . " WHERE id = ". (int) $id;
|
$queryStr = "UPDATE tblEvents SET start = " . (int) $from . ", stop = " . (int) $to . ", name = " . $db->qstr($name) . ", comment = " . $db->qstr($comment) . ", date = " . $db->getCurrentTimestamp() . " WHERE id = ". (int) $id;
|
||||||
$ret = $db->getResult($queryStr);
|
$ret = $db->getResult($queryStr);
|
||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user