mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-10-10 02:52:40 +00:00
Merge branch 'seeddms-5.0.x' into develop
This commit is contained in:
commit
fcbb5f68fe
|
@ -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
|
||||||
|
|
|
@ -1887,7 +1887,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) .", CURRENT_TIMESTAMP)";
|
$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;
|
||||||
|
|
|
@ -1513,8 +1513,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.
|
||||||
|
@ -1533,7 +1531,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;
|
||||||
|
@ -1557,7 +1555,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);
|
||||||
|
@ -1645,7 +1644,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 ."', CURRENT_TIMESTAMP, '". $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;
|
||||||
|
@ -1684,8 +1683,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) {
|
||||||
|
@ -1719,7 +1716,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;
|
||||||
|
@ -2149,7 +2146,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();
|
||||||
|
@ -2723,6 +2720,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))
|
||||||
|
@ -2966,7 +2967,7 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
|
||||||
if($date)
|
if($date)
|
||||||
$ddate = $db->qstr($date);
|
$ddate = $db->qstr($date);
|
||||||
else
|
else
|
||||||
$ddate = 'CURRENT_TIMESTAMP';
|
$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);
|
||||||
|
@ -3451,7 +3452,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', '', CURRENT_TIMESTAMP, '". $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;
|
||||||
|
@ -3509,7 +3510,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', '', CURRENT_TIMESTAMP, '". $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;
|
||||||
|
@ -3566,7 +3567,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).", CURRENT_TIMESTAMP, '".
|
(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)
|
||||||
|
@ -3618,7 +3619,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).", CURRENT_TIMESTAMP, '".
|
(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)
|
||||||
|
@ -3671,7 +3672,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', '', CURRENT_TIMESTAMP, '". $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;
|
||||||
|
@ -3727,7 +3728,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', '', CURRENT_TIMESTAMP, '". $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;
|
||||||
|
@ -3788,7 +3789,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).", CURRENT_TIMESTAMP, '".
|
(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)
|
||||||
|
@ -3832,7 +3833,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).", CURRENT_TIMESTAMP, '".
|
(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)
|
||||||
|
@ -4271,7 +4272,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', '', CURRENT_TIMESTAMP, '". $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;
|
||||||
|
@ -4302,7 +4303,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', '', CURRENT_TIMESTAMP, '". $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;
|
||||||
|
@ -4334,7 +4335,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', '', CURRENT_TIMESTAMP, '". $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;
|
||||||
|
@ -4365,7 +4366,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', '', CURRENT_TIMESTAMP, '". $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;
|
||||||
|
@ -4693,7 +4694,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().", CURRENT_TIMESTAMP)";
|
$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;
|
||||||
|
@ -4874,7 +4875,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().", CURRENT_TIMESTAMP)";
|
$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;
|
||||||
}
|
}
|
||||||
|
@ -5114,7 +5115,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().", CURRENT_TIMESTAMP, ".$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;
|
||||||
|
@ -809,7 +809,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', CURRENT_TIMESTAMP, '". $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', CURRENT_TIMESTAMP, '". $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();
|
||||||
|
|
|
@ -681,7 +681,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', CURRENT_TIMESTAMP, '". $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();
|
||||||
|
@ -692,7 +692,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', CURRENT_TIMESTAMP, '". $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();
|
||||||
|
|
|
@ -454,6 +454,40 @@ class SeedDMS_Core_DatabaseAccess {
|
||||||
return '';
|
return '';
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return sql statement for returning the current date and time
|
||||||
|
* in format Y-m-d H:i:s
|
||||||
|
*
|
||||||
|
* @return string sql code
|
||||||
|
*/
|
||||||
|
function getCurrentDatetime() { /* {{{ */
|
||||||
|
switch($this->_driver) {
|
||||||
|
case 'mysql':
|
||||||
|
return "CURRENT_TIMESTAMP";
|
||||||
|
break;
|
||||||
|
case 'sqlite':
|
||||||
|
return "datetime('now', 'localtime')";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
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 '';
|
||||||
|
} /* }}} */
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -870,5 +870,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;
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,9 +17,11 @@
|
||||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
|
|
||||||
include("../inc/inc.Settings.php");
|
include("../inc/inc.Settings.php");
|
||||||
include("../inc/inc.DBInit.php");
|
|
||||||
include("../inc/inc.Utils.php");
|
include("../inc/inc.Utils.php");
|
||||||
include("../inc/inc.Language.php");
|
include("../inc/inc.Language.php");
|
||||||
|
include("../inc/inc.Init.php");
|
||||||
|
include("../inc/inc.Extension.php");
|
||||||
|
include("../inc/inc.DBInit.php");
|
||||||
include("../inc/inc.ClassUI.php");
|
include("../inc/inc.ClassUI.php");
|
||||||
include("../inc/inc.Authentication.php");
|
include("../inc/inc.Authentication.php");
|
||||||
|
|
||||||
|
|
|
@ -2256,10 +2256,10 @@ mayscript>
|
||||||
echo "{'start': new Date('".$item['date']."'), 'content': '".$item['msg']."'},";
|
echo "{'start': new Date('".$item['date']."'), 'content': '".$item['msg']."'},";
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
{
|
/* {
|
||||||
'start': new Date(),
|
'start': new Date(),
|
||||||
'content': 'Today'
|
'content': 'Today'
|
||||||
}
|
} */
|
||||||
];
|
];
|
||||||
|
|
||||||
// specify options
|
// specify options
|
||||||
|
|
|
@ -103,7 +103,7 @@ $this->contentHeading(getMLText("timeline"));
|
||||||
}
|
}
|
||||||
$item['msg'] = $msg;
|
$item['msg'] = $msg;
|
||||||
}
|
}
|
||||||
$this->printTimeline($data, 500);
|
$this->printTimeline($data, 550);
|
||||||
echo "</div>\n";
|
echo "</div>\n";
|
||||||
echo "</div>\n";
|
echo "</div>\n";
|
||||||
|
|
||||||
|
|
|
@ -1407,13 +1407,13 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
|
||||||
foreach($timeline as &$item) {
|
foreach($timeline as &$item) {
|
||||||
switch($item['type']) {
|
switch($item['type']) {
|
||||||
case 'add_version':
|
case 'add_version':
|
||||||
$msg = getMLText('timeline_'.$item['type'], array('document'=>$item['document'], 'version'=> $item['version']));
|
$msg = getMLText('timeline_'.$item['type'], array('document'=>$item['document']->getName(), 'version'=> $item['version']));
|
||||||
break;
|
break;
|
||||||
case 'add_file':
|
case 'add_file':
|
||||||
$msg = getMLText('timeline_'.$item['type'], array('document'=>$item['document']));
|
$msg = getMLText('timeline_'.$item['type'], array('document'=>$item['document']->getName()));
|
||||||
break;
|
break;
|
||||||
case 'status_change':
|
case 'status_change':
|
||||||
$msg = getMLText('timeline_'.$item['type'], array('document'=>$item['document'], 'version'=> $item['version'], 'status'=> getOverallStatusText($item['status'])));
|
$msg = getMLText('timeline_'.$item['type'], array('document'=>$item['document']->getName(), 'version'=> $item['version'], 'status'=> getOverallStatusText($item['status'])));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$msg = '???';
|
$msg = '???';
|
||||||
|
|
Loading…
Reference in New Issue
Block a user