Merge branch 'seeddms-5.1.x' into seeddms-6.0.x

This commit is contained in:
Uwe Steinmann 2020-01-13 09:45:05 +01:00
commit cfdd951369
5 changed files with 108 additions and 87 deletions

View File

@ -133,6 +133,7 @@
used method by setting a parameter in the extension's config file will no
longer work.
- clean up code for managing extensions
- fix renaming of folders via webdav
--------------------------------------------------------------------------------
Changes in version 5.1.13

View File

@ -3398,7 +3398,7 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
function getUser() { /* {{{ */
if (!isset($this->_user))
$this->_user = $this->_document->_dms->getUser($this->_userID);
$this->_user = $this->_document->getDMS()->getUser($this->_userID);
return $this->_user;
} /* }}} */
@ -3414,7 +3414,7 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
function getPath() { return $this->_document->getDir() . $this->_version . ($this->_fileType != '.' ? $this->_fileType : ''); }
function setRevisionDate($date = false) { /* {{{ */
$db = $this->_document->_dms->getDB();
$db = $this->_document->getDMS()->getDB();
if(!$date)
$queryStr = "UPDATE `tblDocumentContent` SET `revisiondate` = null WHERE `document` = " . $this->_document->getID() . " AND `version` = " . $this->_version;
@ -3431,7 +3431,7 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
} /* }}} */
function setDate($date = false) { /* {{{ */
$db = $this->_document->_dms->getDB();
$db = $this->_document->getDMS()->getDB();
if(!$date)
$date = time();
@ -3461,7 +3461,7 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
if($filesize === false)
return false;
$db = $this->_document->_dms->getDB();
$db = $this->_document->getDMS()->getDB();
$queryStr = "UPDATE `tblDocumentContent` SET `fileSize` = ".$filesize." where `document` = " . $this->_document->getID() . " AND `version` = " . $this->_version;
if (!$db->getResult($queryStr))
return false;
@ -3482,7 +3482,7 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
if($checksum === false)
return false;
$db = $this->_document->_dms->getDB();
$db = $this->_document->getDMS()->getDB();
$queryStr = "UPDATE `tblDocumentContent` SET `checksum` = ".$db->qstr($checksum)." where `document` = " . $this->_document->getID() . " AND `version` = " . $this->_version;
if (!$db->getResult($queryStr))
return false;
@ -3492,7 +3492,7 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
} /* }}} */
function setComment($newComment) { /* {{{ */
$db = $this->_document->_dms->getDB();
$db = $this->_document->getDMS()->getDB();
$queryStr = "UPDATE `tblDocumentContent` SET `comment` = ".$db->qstr($newComment)." WHERE `document` = " . $this->_document->getID() . " AND `version` = " . $this->_version;
if (!$db->getResult($queryStr))
@ -3527,7 +3527,7 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
* @return array latest record from tblDocumentStatusLog
*/
function getStatus($limit=1) { /* {{{ */
$db = $this->_document->_dms->getDB();
$db = $this->_document->getDMS()->getDB();
if (!is_numeric($limit)) return false;
@ -3561,7 +3561,7 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
* @return array list of status changes
*/
function getStatusLog($limit=0) { /* {{{ */
$db = $this->_document->_dms->getDB();
$db = $this->_document->getDMS()->getDB();
if (!is_numeric($limit)) return false;
@ -3596,7 +3596,7 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
* @return boolean true on success, otherwise false
*/
function setStatus($status, $comment, $updateUser, $date='') { /* {{{ */
$db = $this->_document->_dms->getDB();
$db = $this->_document->getDMS()->getDB();
if (!is_numeric($status)) return false;
@ -3652,7 +3652,7 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
* @return boolean true on success, otherwise false
*/
function rewriteStatusLog($statuslog) { /* {{{ */
$db = $this->_document->_dms->getDB();
$db = $this->_document->getDMS()->getDB();
$queryStr= "SELECT `tblDocumentStatus`.* FROM `tblDocumentStatus` WHERE `tblDocumentStatus`.`documentID` = '". $this->_document->getID() ."' AND `tblDocumentStatus`.`version` = '". $this->_version ."' ";
$res = $db->getResultArray($queryStr);
@ -3711,7 +3711,7 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
* @return integer either M_NONE or M_READ
*/
function getAccessMode($u) { /* {{{ */
$dms = $this->_document->_dms;
$dms = $this->_document->getDMS();
/* Check if 'onCheckAccessDocumentContent' callback is set */
if(isset($this->_dms->callbacks['onCheckAccessDocumentContent'])) {
@ -3843,7 +3843,7 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
* @return array list of review status
*/
function getReviewStatus($limit=1) { /* {{{ */
$db = $this->_document->_dms->getDB();
$db = $this->_document->getDMS()->getDB();
if (!is_numeric($limit)) return false;
@ -3903,7 +3903,7 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
* @return boolean true on success, otherwise false
*/
function rewriteReviewLog($reviewers) { /* {{{ */
$db = $this->_document->_dms->getDB();
$db = $this->_document->getDMS()->getDB();
$queryStr= "SELECT `tblDocumentReviewers`.* FROM `tblDocumentReviewers` WHERE `tblDocumentReviewers`.`documentID` = '". $this->_document->getID() ."' AND `tblDocumentReviewers`.`version` = '". $this->_version ."' ";
$res = $db->getResultArray($queryStr);
@ -3971,7 +3971,7 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
* @return array list of approval status
*/
function getApprovalStatus($limit=1) { /* {{{ */
$db = $this->_document->_dms->getDB();
$db = $this->_document->getDMS()->getDB();
if (!is_numeric($limit)) return false;
@ -4031,7 +4031,7 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
* @return boolean true on success, otherwise false
*/
function rewriteApprovalLog($reviewers) { /* {{{ */
$db = $this->_document->_dms->getDB();
$db = $this->_document->getDMS()->getDB();
$queryStr= "SELECT `tblDocumentApprovers`.* FROM `tblDocumentApprovers` WHERE `tblDocumentApprovers`.`documentID` = '". $this->_document->getID() ."' AND `tblDocumentApprovers`.`version` = '". $this->_version ."' ";
$res = $db->getResultArray($queryStr);
@ -4099,7 +4099,7 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
* @return array list of receipts
*/
function getReceiptStatus($limit=1) { /* {{{ */
$db = $this->_document->_dms->getDB();
$db = $this->_document->getDMS()->getDB();
if (!is_numeric($limit)) return false;
@ -4175,7 +4175,7 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
* @return boolean true on success, otherwise false
*/
function rewriteReceiptLog($recipients) { /* {{{ */
$db = $this->_document->_dms->getDB();
$db = $this->_document->getDMS()->getDB();
$queryStr= "SELECT `tblDocumentRecipients`.* FROM `tblDocumentRecipients` WHERE `tblDocumentRecipients`.`documentID` = '". $this->_document->getID() ."' AND `tblDocumentRecipients`.`version` = '". $this->_version ."' ";
$res = $db->getResultArray($queryStr);
@ -4243,7 +4243,7 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
* @return array list of revisions
*/
function getRevisionStatus($limit=1) { /* {{{ */
$db = $this->_document->_dms->getDB();
$db = $this->_document->getDMS()->getDB();
if (!is_numeric($limit)) return false;
@ -4298,7 +4298,7 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
* @return boolean 0 on success, otherwise a negativ error number
*/
function rewriteRevisionLog($revisions) { /* {{{ */
$db = $this->_document->_dms->getDB();
$db = $this->_document->getDMS()->getDB();
$queryStr= "SELECT `tblDocumentRevisors`.* FROM `tblDocumentRevisors` WHERE `tblDocumentRevisors`.`documentID` = '". $this->_document->getID() ."' AND `tblDocumentRevisors`.`version` = '". $this->_version ."' ";
$res = $db->getResultArray($queryStr);
@ -4359,7 +4359,7 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
} /* }}} */
function addIndReviewer($user, $requestUser) { /* {{{ */
$db = $this->_document->_dms->getDB();
$db = $this->_document->getDMS()->getDB();
$userID = $user->getID();
@ -4410,7 +4410,7 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
} /* }}} */
function addGrpReviewer($group, $requestUser) { /* {{{ */
$db = $this->_document->_dms->getDB();
$db = $this->_document->getDMS()->getDB();
$groupID = $group->getID();
@ -4488,7 +4488,7 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
* @return integer new review log id
*/
function setReviewByInd($user, $requestUser, $status, $comment, $file='') { /* {{{ */
$db = $this->_document->_dms->getDB();
$db = $this->_document->getDMS()->getDB();
// Check to see if the user can be removed from the review list.
$reviewStatus = $user->getReviewStatus($this->_document->getID(), $this->_version);
@ -4540,7 +4540,7 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
* @return integer new review log id
*/
function setReviewByGrp($group, $requestUser, $status, $comment, $file='') { /* {{{ */
$db = $this->_document->_dms->getDB();
$db = $this->_document->getDMS()->getDB();
// Check to see if the user can be removed from the review list.
$reviewStatus = $group->getReviewStatus($this->_document->getID(), $this->_version);
@ -4579,7 +4579,7 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
} /* }}} */
function addIndApprover($user, $requestUser) { /* {{{ */
$db = $this->_document->_dms->getDB();
$db = $this->_document->getDMS()->getDB();
$userID = $user->getID();
@ -4628,7 +4628,7 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
} /* }}} */
function addGrpApprover($group, $requestUser) { /* {{{ */
$db = $this->_document->_dms->getDB();
$db = $this->_document->getDMS()->getDB();
$groupID = $group->getID();
@ -4710,7 +4710,7 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
* @return integer 0 on success, < 0 in case of an error
*/
function setApprovalByInd($user, $requestUser, $status, $comment, $file='') { /* {{{ */
$db = $this->_document->_dms->getDB();
$db = $this->_document->getDMS()->getDB();
// Check to see if the user can be removed from the approval list.
$approvalStatus = $user->getApprovalStatus($this->_document->getID(), $this->_version);
@ -4754,7 +4754,7 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
* group instead of a user
*/
function setApprovalByGrp($group, $requestUser, $status, $comment, $file='') { /* {{{ */
$db = $this->_document->_dms->getDB();
$db = $this->_document->getDMS()->getDB();
// Check to see if the user can be removed from the approval list.
$approvalStatus = $group->getApprovalStatus($this->_document->getID(), $this->_version);
@ -4792,7 +4792,7 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
} /* }}} */
function addIndRecipient($user, $requestUser) { /* {{{ */
$db = $this->_document->_dms->getDB();
$db = $this->_document->getDMS()->getDB();
$userID = $user->getID();
@ -4843,7 +4843,7 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
} /* }}} */
function addGrpRecipient($group, $requestUser) { /* {{{ */
$db = $this->_document->_dms->getDB();
$db = $this->_document->getDMS()->getDB();
$groupID = $group->getID();
@ -4916,7 +4916,7 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
* @return integer 0 if successful otherwise a value < 0
*/
function addRevisor($object, $requestUser) { /* {{{ */
$dms = $this->_document->_dms;
$dms = $this->_document->getDMS();
$db = $dms->getDB();
/* getRevisionStatus() returns an array with either an element
@ -5025,7 +5025,7 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
* @return integer new receipt log id
*/
function setReceiptByInd($user, $requestUser, $status, $comment) { /* {{{ */
$db = $this->_document->_dms->getDB();
$db = $this->_document->getDMS()->getDB();
// Check to see if the user can be removed from the review list.
$receiptStatus = $user->getReceiptStatus($this->_document->getID(), $this->_version);
@ -5073,7 +5073,7 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
* @return integer new receipt log id
*/
function setReceiptByGrp($group, $requestUser, $status, $comment) { /* {{{ */
$db = $this->_document->_dms->getDB();
$db = $this->_document->getDMS()->getDB();
// Check to see if the user can be removed from the recipient list.
$receiptStatus = $group->getReceiptStatus($this->_document->getID(), $this->_version);
@ -5139,7 +5139,7 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
* -5: the revision has not been started at all.
*/
function setRevision($object, $requestUser, $status, $comment) { /* {{{ */
$dms = $this->_document->_dms;
$dms = $this->_document->getDMS();
$db = $dms->getDB();
/* getRevisionStatus() returns an array with either an element
@ -5200,7 +5200,7 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
} /* }}} */
function delIndReviewer($user, $requestUser, $msg='') { /* {{{ */
$db = $this->_document->_dms->getDB();
$db = $this->_document->getDMS()->getDB();
// Check to see if the user can be removed from the review list.
$reviewStatus = $user->getReviewStatus($this->_document->getID(), $this->_version);
@ -5230,7 +5230,7 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
} /* }}} */
function delGrpReviewer($group, $requestUser, $msg='') { /* {{{ */
$db = $this->_document->_dms->getDB();
$db = $this->_document->getDMS()->getDB();
$groupID = $group->getID();
@ -5261,7 +5261,7 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
} /* }}} */
function delIndApprover($user, $requestUser, $msg='') { /* {{{ */
$db = $this->_document->_dms->getDB();
$db = $this->_document->getDMS()->getDB();
$userID = $user->getID();
@ -5293,7 +5293,7 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
} /* }}} */
function delGrpApprover($group, $requestUser, $msg='') { /* {{{ */
$db = $this->_document->_dms->getDB();
$db = $this->_document->getDMS()->getDB();
$groupID = $group->getID();
@ -5324,7 +5324,7 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
} /* }}} */
function delIndRecipient($user, $requestUser, $msg='') { /* {{{ */
$db = $this->_document->_dms->getDB();
$db = $this->_document->getDMS()->getDB();
$userID = $user->getID();
@ -5356,7 +5356,7 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
} /* }}} */
function delGrpRecipient($group, $requestUser, $msg='') { /* {{{ */
$db = $this->_document->_dms->getDB();
$db = $this->_document->getDMS()->getDB();
$groupID = $group->getID();
@ -5406,7 +5406,7 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
*
*/
function delRevisor($object, $requestUser, $msg='') { /* {{{ */
$dms = $this->_document->_dms;
$dms = $this->_document->getDMS();
$db = $dms->getDB();
/* getRevisionStatus() returns an array with either an element
@ -5480,7 +5480,7 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
* @param string $msg message saved for the initial log message
*/
function startRevision($requestUser, $msg='') { /* {{{ */
$dms = $this->_document->_dms;
$dms = $this->_document->getDMS();
$db = $dms->getDB();
$revisionStatus = self::getRevisionStatus();
@ -5547,7 +5547,7 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
* @param string $msg message saved in document status log
*/
function finishRevision($requestUser, $docstatus, $msg='', $docmsg='') { /* {{{ */
$dms = $this->_document->_dms;
$dms = $this->_document->getDMS();
$db = $dms->getDB();
$revisionStatus = self::getRevisionStatus();
@ -5600,7 +5600,7 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
* @param object $state
*/
function setWorkflowState($state) { /* {{{ */
$db = $this->_document->_dms->getDB();
$db = $this->_document->getDMS()->getDB();
if($this->_workflow) {
$queryStr = "UPDATE `tblWorkflowDocumentContent` set `state`=". $state->getID() ." WHERE `id`=". $this->_workflow['id'];
@ -5620,7 +5620,7 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
* or false in case of error, e.g. the version has not a workflow
*/
function getWorkflowState() { /* {{{ */
$db = $this->_document->_dms->getDB();
$db = $this->_document->getDMS()->getDB();
if(!$this->_workflow)
$this->getWorkflow();
@ -5635,7 +5635,7 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
if (is_bool($recs) && !$recs)
return false;
$this->_workflowState = new SeedDMS_Core_Workflow_State($recs[0]['id'], $recs[0]['name'], $recs[0]['maxtime'], $recs[0]['precondfunc'], $recs[0]['documentstatus']);
$this->_workflowState->setDMS($this->_document->_dms);
$this->_workflowState->setDMS($this->_document->getDMS());
}
return $this->_workflowState;
} /* }}} */
@ -5646,7 +5646,7 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
* @param object $workflow
*/
function setWorkflow($workflow, $user) { /* {{{ */
$db = $this->_document->_dms->getDB();
$db = $this->_document->getDMS()->getDB();
$this->getWorkflow();
if($this->_workflow)
@ -5690,7 +5690,7 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
* or false in case of error, e.g. the version has not a workflow
*/
function getWorkflow() { /* {{{ */
$db = $this->_document->_dms->getDB();
$db = $this->_document->getDMS()->getDB();
if (!isset($this->_workflow)) {
$queryStr=
@ -5703,8 +5703,8 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
return false;
if(!$recs)
return false;
$this->_workflow = array('id'=>(int)$recs[0]['wdcid'], 'parent'=>(int)$recs[0]['parent'], 'workflow'=>new SeedDMS_Core_Workflow($recs[0]['id'], $recs[0]['name'], $this->_document->_dms->getWorkflowState($recs[0]['initstate']), $recs[0]["layoutdata"]));
$this->_workflow['workflow']->setDMS($this->_document->_dms);
$this->_workflow = array('id'=>(int)$recs[0]['wdcid'], 'parent'=>(int)$recs[0]['parent'], 'workflow'=>new SeedDMS_Core_Workflow($recs[0]['id'], $recs[0]['name'], $this->_document->getDMS()->getWorkflowState($recs[0]['initstate']), $recs[0]["layoutdata"]));
$this->_workflow['workflow']->setDMS($this->_document->getDMS());
}
return $this->_workflow['workflow'];
} /* }}} */
@ -5720,7 +5720,7 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
* @return boolean true on success, otherwise false
*/
function rewriteWorkflowLog($workflowlog) { /* {{{ */
$db = $this->_document->_dms->getDB();
$db = $this->_document->getDMS()->getDB();
/* Get the workflowdocumentcontent */
$queryStr = "SELECT `id` FROM `tblWorkflowDocumentContent` WHERE `tblWorkflowDocumentContent`.`document` = '". $this->_document->getID() ."' AND `tblWorkflowDocumentContent`.`version` = '". $this->_version ."'";
@ -5765,7 +5765,7 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
* or false in case of error
*/
function rewindWorkflow() { /* {{{ */
$db = $this->_document->_dms->getDB();
$db = $this->_document->getDMS()->getDB();
$this->getWorkflow();
@ -5808,7 +5808,7 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
* or false in case of error
*/
function removeWorkflow($user, $unlink=false) { /* {{{ */
$db = $this->_document->_dms->getDB();
$db = $this->_document->getDMS()->getDB();
$this->getWorkflow();
@ -5861,7 +5861,7 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
* @param object $subworkflow
*/
function getParentWorkflow() { /* {{{ */
$db = $this->_document->_dms->getDB();
$db = $this->_document->getDMS()->getDB();
/* document content must be in a workflow */
$this->getWorkflow();
@ -5880,7 +5880,7 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
return false;
if($recs[0]['workflow'])
return $this->_document->_dms->getWorkflow((int)$recs[0]['workflow']);
return $this->_document->getDMS()->getWorkflow((int)$recs[0]['workflow']);
return false;
} /* }}} */
@ -5891,7 +5891,7 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
* @param object $subworkflow
*/
function runSubWorkflow($subworkflow) { /* {{{ */
$db = $this->_document->_dms->getDB();
$db = $this->_document->getDMS()->getDB();
/* document content must be in a workflow */
$this->getWorkflow();
@ -5925,7 +5925,7 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
* @param string comment for the transition trigger
*/
function returnFromSubWorkflow($user, $transition=null, $comment='') { /* {{{ */
$db = $this->_document->_dms->getDB();
$db = $this->_document->getDMS()->getDB();
/* document content must be in a workflow */
$this->getWorkflow();
@ -5974,7 +5974,7 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
* @return boolean true if user may trigger transaction
*/
function triggerWorkflowTransitionIsAllowed($user, $transition) { /* {{{ */
$db = $this->_document->_dms->getDB();
$db = $this->_document->getDMS()->getDB();
if(!$this->_workflow)
$this->getWorkflow();
@ -6116,7 +6116,7 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
* false in case of an error
*/
function triggerWorkflowTransition($user, $transition, $comment='') { /* {{{ */
$db = $this->_document->_dms->getDB();
$db = $this->_document->getDMS()->getDB();
if(!$this->_workflow)
$this->getWorkflow();
@ -6261,7 +6261,7 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
* @return array list of operations
*/
function getWorkflowLog($transition = null) { /* {{{ */
$db = $this->_document->_dms->getDB();
$db = $this->_document->getDMS()->getDB();
if(!$this->_workflow)
$this->getWorkflow();
@ -6280,8 +6280,8 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
$workflowlogs = array();
for ($i = 0; $i < count($resArr); $i++) {
$workflow = $this->_document->_dms->getWorkflow($resArr[$i]["workflow"]);
$workflowlog = new SeedDMS_Core_Workflow_Log($resArr[$i]["id"], $this->_document->_dms->getDocument($resArr[$i]["document"]), $resArr[$i]["version"], $workflow, $this->_document->_dms->getUser($resArr[$i]["userid"]), $workflow->getTransition($resArr[$i]["transition"]), $resArr[$i]["date"], $resArr[$i]["comment"]);
$workflow = $this->_document->getDMS()->getWorkflow($resArr[$i]["workflow"]);
$workflowlog = new SeedDMS_Core_Workflow_Log($resArr[$i]["id"], $this->_document->getDMS()->getDocument($resArr[$i]["document"]), $resArr[$i]["version"], $workflow, $this->_document->getDMS()->getUser($resArr[$i]["userid"]), $workflow->getTransition($resArr[$i]["transition"]), $resArr[$i]["date"], $resArr[$i]["comment"]);
$workflowlog->setDMS($this);
if($this->_workflow && $transition)
$workflowlogs[] = $workflowlog;
@ -6299,7 +6299,7 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
* @return array list of operations
*/
function getLastWorkflowTransition() { /* {{{ */
$db = $this->_document->_dms->getDB();
$db = $this->_document->getDMS()->getDB();
if(!$this->_workflow)
$this->getWorkflow();
@ -6316,7 +6316,7 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */
$workflowlogs = array();
$i = 0;
$workflowlog = new SeedDMS_Core_Workflow_Log($resArr[$i]["id"], $this->_document->_dms->getDocument($resArr[$i]["document"]), $resArr[$i]["version"], $this->_workflow, $this->_document->_dms->getUser($resArr[$i]["userid"]), $this->_workflow->getTransition($resArr[$i]["transition"]), $resArr[$i]["date"], $resArr[$i]["comment"]);
$workflowlog = new SeedDMS_Core_Workflow_Log($resArr[$i]["id"], $this->_document->getDMS()->getDocument($resArr[$i]["document"]), $resArr[$i]["version"], $this->_workflow, $this->_document->getDMS()->getUser($resArr[$i]["userid"]), $this->_workflow->getTransition($resArr[$i]["transition"]), $resArr[$i]["date"], $resArr[$i]["comment"]);
$workflowlog->setDMS($this);
return $workflowlog;
@ -6435,8 +6435,9 @@ class SeedDMS_Core_DocumentLink { /* {{{ */
* @return bool|SeedDMS_Core_User
*/
function getUser() {
if (!isset($this->_user))
$this->_user = $this->_document->_dms->getUser($this->_userID);
if (!isset($this->_user)) {
$this->_user = $this->_document->getDMS()->getUser($this->_userID);
}
return $this->_user;
}
@ -6612,7 +6613,7 @@ class SeedDMS_Core_DocumentFile { /* {{{ */
* @param string $newComment string new comment of document
*/
function setComment($newComment) { /* {{{ */
$db = $this->_document->_dms->getDB();
$db = $this->_document->getDMS()->getDB();
$queryStr = "UPDATE `tblDocumentFiles` SET `comment` = ".$db->qstr($newComment)." WHERE `document` = ".$this->_document->getId()." AND `id` = ". $this->_id;
if (!$db->getResult($queryStr))
@ -6635,7 +6636,7 @@ class SeedDMS_Core_DocumentFile { /* {{{ */
* @return boolean true on success
*/
function setDate($date) { /* {{{ */
$db = $this->_document->_dms->getDB();
$db = $this->_document->getDMS()->getDB();
if(!$date)
$date = time();
@ -6682,7 +6683,7 @@ class SeedDMS_Core_DocumentFile { /* {{{ */
* @param $newComment string new name of document
*/
function setName($newName) { /* {{{ */
$db = $this->_document->_dms->getDB();
$db = $this->_document->getDMS()->getDB();
$queryStr = "UPDATE `tblDocumentFiles` SET `name` = ".$db->qstr($newName)." WHERE `document` = ".$this->_document->getId()." AND `id` = ". $this->_id;
if (!$db->getResult($queryStr))
@ -6697,7 +6698,7 @@ class SeedDMS_Core_DocumentFile { /* {{{ */
*/
function getUser() {
if (!isset($this->_user))
$this->_user = $this->_document->_dms->getUser($this->_userID);
$this->_user = $this->_document->getDMS()->getUser($this->_userID);
return $this->_user;
}
@ -6719,7 +6720,7 @@ class SeedDMS_Core_DocumentFile { /* {{{ */
* @param $newComment string new version of document
*/
function setVersion($newVersion) { /* {{{ */
$db = $this->_document->_dms->getDB();
$db = $this->_document->getDMS()->getDB();
if(!is_numeric($newVersion) && $newVersion != '')
return false;
@ -6743,7 +6744,7 @@ class SeedDMS_Core_DocumentFile { /* {{{ */
* @param $newComment string new comment of document
*/
function setPublic($newPublic) { /* {{{ */
$db = $this->_document->_dms->getDB();
$db = $this->_document->getDMS()->getDB();
$queryStr = "UPDATE `tblDocumentFiles` SET `public` = ".($newPublic ? 1 : 0)." WHERE `document` = ".$this->_document->getId()." AND `id` = ". $this->_id;
if (!$db->getResult($queryStr))
@ -6765,7 +6766,7 @@ class SeedDMS_Core_DocumentFile { /* {{{ */
* @return integer either M_NONE or M_READ
*/
function getAccessMode($u) { /* {{{ */
$dms = $this->_document->_dms;
$dms = $this->_document->getDMS();
/* Check if 'onCheckAccessDocumentLink' callback is set */
if(isset($this->_dms->callbacks['onCheckAccessDocumentFile'])) {

View File

@ -85,30 +85,35 @@ class SeedDMS_Controller_Login extends SeedDMS_Controller_Common {
}
/* Deprecated: Run any additional authentication implemented in a hook */
if(!$user && isset($GLOBALS['SEEDDMS_HOOKS']['authentication'])) {
if(!is_object($user) && isset($GLOBALS['SEEDDMS_HOOKS']['authentication'])) {
foreach($GLOBALS['SEEDDMS_HOOKS']['authentication'] as $authObj) {
if(!$user && method_exists($authObj, 'authenticate')) {
$user = $authObj->authenticate($dms, $settings, $login, $pwd);
if(false === $user) {
if(empty($this->errormsg))
$this->setErrorMsg("authentication_failed");
return false;
}
}
}
}
/* Authenticate against LDAP server {{{ */
if (!$user && isset($settings->_ldapHost) && strlen($settings->_ldapHost)>0) {
if (!is_object($user) && isset($settings->_ldapHost) && strlen($settings->_ldapHost)>0) {
require_once("../inc/inc.ClassLdapAuthentication.php");
$authobj = new SeedDMS_LdapAuthentication($dms, $settings);
$user = $authobj->authenticate($login, $pwd);
} /* }}} */
/* Authenticate against SeedDMS database {{{ */
if(!$user) {
if(!is_object($user)) {
require_once("../inc/inc.ClassDbAuthentication.php");
$authobj = new SeedDMS_DbAuthentication($dms, $settings);
$user = $authobj->authenticate($login, $pwd);
} /* }}} */
/* If the user is still not authenticated, then exit with an error */
if(!$user) {
if(!is_object($user)) {
$this->callHook('loginFailed');
$this->setErrorMsg("login_error_text");
return false;

View File

@ -592,9 +592,8 @@ $(document).ready( function() {
else {
$document = $entry;
$owner = $document->getOwner();
$lc = $document->getLatestContent();
$version = $lc->getVersion();
$previewer->createPreview($lc);
if($lc = $document->getLatestContent())
$previewer->createPreview($lc);
if (in_array(3, $searchin))
$comment = $this->markQuery(htmlspecialchars($document->getComment()));
@ -609,7 +608,7 @@ $(document).ready( function() {
$belowtitle .= htmlspecialchars($path[$i]->getName())."/";
}
$belowtitle .= "</span>";
$lcattributes = $lc->getAttributes();
$lcattributes = $lc ? $lc->getAttributes() : null;
$attrstr = '';
if($lcattributes) {
$attrstr .= "<table class=\"table table-condensed\">\n";

View File

@ -1062,6 +1062,11 @@ class HTTP_WebDAV_Server_SeedDMS extends HTTP_WebDAV_Server
$objdest = $this->reverseLookup($options["dest"]);
$newdocname = '';
/* if the destіnation could not be found, then a folder/document shall
* be renamed. In that case the source object is moved into the ѕame
* or different folder under a new name.
* $objdest will store the new destination folder afterwards
*/
if(!$objdest) {
/* check if at least the dest directory exists */
$dirname = dirname($options['dest']);
@ -1112,13 +1117,17 @@ class HTTP_WebDAV_Server_SeedDMS extends HTTP_WebDAV_Server
/* Set the new Folder of the source object */
if(get_class($objsource) == $this->dms->getClassname('document')) {
/* Check if name already exists in the folder */
/*
if(!$settings->_enableDuplicateDocNames) {
if($objdest->hasDocumentByName($objsource->getName())) {
return "403 Forbidden";
if($newdocname) {
if($objdest->hasDocumentByName($newdocname)) {
return "403 Forbidden";
}
} else {
if($objdest->hasDocumentByName($objsource->getName())) {
return "403 Forbidden";
}
}
}
*/
$oldFolder = $objsource->getFolder();
if($objsource->setFolder($objdest)) {
@ -1153,8 +1162,14 @@ class HTTP_WebDAV_Server_SeedDMS extends HTTP_WebDAV_Server
} elseif(get_class($objsource) == $this->dms->getClassname('folder')) {
/* Check if name already exists in the folder */
if(!$settings->_enableDuplicateSubFolderNames) {
if($objdest->hasSubFolderByName($objsource->getName())) {
return "403 Forbidden";
if($newdocname) {
if($objdest->hasSubFolderByName($newdocname)) {
return "403 Forbidden";
}
} else {
if($objdest->hasSubFolderByName($objsource->getName())) {
return "403 Forbidden";
}
}
}
$oldFolder = $objsource->getParent();
@ -1176,7 +1191,7 @@ class HTTP_WebDAV_Server_SeedDMS extends HTTP_WebDAV_Server
$params['old_folder_path'] = $oldFolder->getFolderPathPlain();
$params['new_folder_path'] = $objdest->getFolderPathPlain();
$params['username'] = $this->user->getFullName();
$params['url'] = "http".((isset($_SERVER['HTTPS']) && (strcmp($_SERVER['HTTPS'],'off')!=0)) ? "s" : "")."://".$_SERVER['HTTP_HOST'].$settings->_httpRoot."out/out.ViewFolder.php?folderid=".$folder->getID();
$params['url'] = "http".((isset($_SERVER['HTTPS']) && (strcmp($_SERVER['HTTPS'],'off')!=0)) ? "s" : "")."://".$_SERVER['HTTP_HOST'].$settings->_httpRoot."out/out.ViewFolder.php?folderid=".$objsource->getID();
$params['sitename'] = $settings->_siteName;
$params['http_root'] = $settings->_httpRoot;
$this->notifier->toList($this->user, $nl["users"], $subject, $message, $params);