mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-09 13:06:14 +00:00
take over mandatory reviewers and approvers
This commit is contained in:
parent
a7917dad35
commit
f8f1e3fd73
|
@ -716,6 +716,20 @@ class HTTP_WebDAV_Server_SeedDMS extends HTTP_WebDAV_Server
|
||||||
if($this->logger)
|
if($this->logger)
|
||||||
$this->logger->log('PUT: adding new version', PEAR_LOG_INFO);
|
$this->logger->log('PUT: adding new version', PEAR_LOG_INFO);
|
||||||
|
|
||||||
|
$reviewers = array('i'=>[], 'g'=>[]);
|
||||||
|
$approvers = array('i'=>[], 'g'=>[]);
|
||||||
|
$workflow = null;
|
||||||
|
if($settings->_workflowMode == 'traditional' || $settings->_workflowMode == 'traditional_only_approval') {
|
||||||
|
if($settings->_workflowMode == 'traditional') {
|
||||||
|
$reviewers = getMandatoryReviewers($document->getFolder(), $this->user);
|
||||||
|
}
|
||||||
|
$approvers = getMandatoryApprovers($document->getFolder(), $this->user);
|
||||||
|
} elseif($settings->_workflowMode == 'advanced') {
|
||||||
|
if($workflows = $user->getMandatoryWorkflows()) {
|
||||||
|
$workflow = array_shift($workflows);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$controller = Controller::factory('UpdateDocument');
|
$controller = Controller::factory('UpdateDocument');
|
||||||
$controller->setParam('dms', $this->dms);
|
$controller->setParam('dms', $this->dms);
|
||||||
$controller->setParam('user', $this->user);
|
$controller->setParam('user', $this->user);
|
||||||
|
@ -728,10 +742,10 @@ class HTTP_WebDAV_Server_SeedDMS extends HTTP_WebDAV_Server
|
||||||
$controller->setParam('userfilename', $name);
|
$controller->setParam('userfilename', $name);
|
||||||
$controller->setParam('filetype', $fileType);
|
$controller->setParam('filetype', $fileType);
|
||||||
$controller->setParam('userfiletype', $mimetype);
|
$controller->setParam('userfiletype', $mimetype);
|
||||||
$controller->setParam('reviewers', array());
|
$controller->setParam('reviewers', $reviewers);
|
||||||
$controller->setParam('approvers', array());
|
$controller->setParam('approvers', $approvers);
|
||||||
$controller->setParam('attributes', array());
|
$controller->setParam('attributes', array());
|
||||||
$controller->setParam('workflow', null);
|
$controller->setParam('workflow', $workflow);
|
||||||
|
|
||||||
if(!$content = $controller->run()) {
|
if(!$content = $controller->run()) {
|
||||||
// if(!$document->addContent('', $this->user, $tmpFile, $name, $fileType, $mimetype, array(), array(), 0)) {
|
// if(!$document->addContent('', $this->user, $tmpFile, $name, $fileType, $mimetype, array(), array(), 0)) {
|
||||||
|
@ -784,6 +798,20 @@ class HTTP_WebDAV_Server_SeedDMS extends HTTP_WebDAV_Server
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
$reviewers = array('i'=>[], 'g'=>[]);
|
||||||
|
$approvers = array('i'=>[], 'g'=>[]);
|
||||||
|
$workflow = null;
|
||||||
|
if($settings->_workflowMode == 'traditional' || $settings->_workflowMode == 'traditional_only_approval') {
|
||||||
|
if($settings->_workflowMode == 'traditional') {
|
||||||
|
$reviewers = getMandatoryReviewers($folder, $this->user);
|
||||||
|
}
|
||||||
|
$approvers = getMandatoryApprovers($folder, $this->user);
|
||||||
|
} elseif($settings->_workflowMode == 'advanced') {
|
||||||
|
if($workflows = $user->getMandatoryWorkflows()) {
|
||||||
|
$workflow = array_shift($workflows);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$controller = Controller::factory('AddDocument');
|
$controller = Controller::factory('AddDocument');
|
||||||
$controller->setParam('dms', $this->dms);
|
$controller->setParam('dms', $this->dms);
|
||||||
$controller->setParam('user', $this->user);
|
$controller->setParam('user', $this->user);
|
||||||
|
@ -805,13 +833,13 @@ class HTTP_WebDAV_Server_SeedDMS extends HTTP_WebDAV_Server
|
||||||
$controller->setParam('sequence', $minmax['min'] - 1);
|
$controller->setParam('sequence', $minmax['min'] - 1);
|
||||||
else
|
else
|
||||||
$controller->setParam('sequence', $minmax['max'] + 1);
|
$controller->setParam('sequence', $minmax['max'] + 1);
|
||||||
$controller->setParam('reviewers', array());
|
$controller->setParam('reviewers', $reviewers);
|
||||||
$controller->setParam('approvers', array());
|
$controller->setParam('approvers', $approvers);
|
||||||
$controller->setParam('reqversion', 0);
|
$controller->setParam('reqversion', 0);
|
||||||
$controller->setParam('versioncomment', '');
|
$controller->setParam('versioncomment', '');
|
||||||
$controller->setParam('attributes', array());
|
$controller->setParam('attributes', array());
|
||||||
$controller->setParam('attributesversion', array());
|
$controller->setParam('attributesversion', array());
|
||||||
$controller->setParam('workflow', null);
|
$controller->setParam('workflow', $workflow);
|
||||||
$controller->setParam('notificationgroups', array());
|
$controller->setParam('notificationgroups', array());
|
||||||
$controller->setParam('notificationusers', array());
|
$controller->setParam('notificationusers', array());
|
||||||
$controller->setParam('maxsizeforfulltext', $settings->_maxSizeForFullText);
|
$controller->setParam('maxsizeforfulltext', $settings->_maxSizeForFullText);
|
||||||
|
@ -1343,7 +1371,7 @@ class HTTP_WebDAV_Server_SeedDMS extends HTTP_WebDAV_Server
|
||||||
return "204 No Content";
|
return "204 No Content";
|
||||||
} elseif(get_class($objdest) == $this->dms->getClassname('folder')) {
|
} elseif(get_class($objdest) == $this->dms->getClassname('folder')) {
|
||||||
if($this->logger)
|
if($this->logger)
|
||||||
$this->logger->log('COPY: copy \''.$objdest->getName().'\' to folder '.$objdest->getName().'', PEAR_LOG_INFO);
|
$this->logger->log('COPY: copy \''.$objsource->getName().'\' to folder '.$objdest->getName().'', PEAR_LOG_INFO);
|
||||||
|
|
||||||
/* Currently no support for copying folders */
|
/* Currently no support for copying folders */
|
||||||
if(get_class($objsource) == $this->dms->getClassname('folder')) {
|
if(get_class($objsource) == $this->dms->getClassname('folder')) {
|
||||||
|
@ -1365,6 +1393,20 @@ class HTTP_WebDAV_Server_SeedDMS extends HTTP_WebDAV_Server
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
$reviewers = array('i'=>[], 'g'=>[]);
|
||||||
|
$approvers = array('i'=>[], 'g'=>[]);
|
||||||
|
$workflow = null;
|
||||||
|
if($settings->_workflowMode == 'traditional' || $settings->_workflowMode == 'traditional_only_approval') {
|
||||||
|
if($settings->_workflowMode == 'traditional') {
|
||||||
|
$reviewers = getMandatoryReviewers($objdest, $this->user);
|
||||||
|
}
|
||||||
|
$approvers = getMandatoryApprovers($objdest, $this->user);
|
||||||
|
} elseif($settings->_workflowMode == 'advanced') {
|
||||||
|
if($workflows = $user->getMandatoryWorkflows()) {
|
||||||
|
$workflow = array_shift($workflows);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* get the latest content of the source object */
|
/* get the latest content of the source object */
|
||||||
$content = $objsource->getLatestContent();
|
$content = $objsource->getLatestContent();
|
||||||
$fspath = $this->dms->contentDir.'/'.$content->getPath();
|
$fspath = $this->dms->contentDir.'/'.$content->getPath();
|
||||||
|
@ -1390,13 +1432,13 @@ class HTTP_WebDAV_Server_SeedDMS extends HTTP_WebDAV_Server
|
||||||
$controller->setParam('sequence', $minmax['min'] - 1);
|
$controller->setParam('sequence', $minmax['min'] - 1);
|
||||||
else
|
else
|
||||||
$controller->setParam('sequence', $minmax['max'] + 1);
|
$controller->setParam('sequence', $minmax['max'] + 1);
|
||||||
$controller->setParam('reviewers', array());
|
$controller->setParam('reviewers', $reviewers);
|
||||||
$controller->setParam('approvers', array());
|
$controller->setParam('approvers', $approvers);
|
||||||
$controller->setParam('reqversion', 0);
|
$controller->setParam('reqversion', 0);
|
||||||
$controller->setParam('versioncomment', '');
|
$controller->setParam('versioncomment', '');
|
||||||
$controller->setParam('attributes', array());
|
$controller->setParam('attributes', array());
|
||||||
$controller->setParam('attributesversion', array());
|
$controller->setParam('attributesversion', array());
|
||||||
$controller->setParam('workflow', null);
|
$controller->setParam('workflow', $workflow);
|
||||||
$controller->setParam('notificationgroups', array());
|
$controller->setParam('notificationgroups', array());
|
||||||
$controller->setParam('notificationusers', array());
|
$controller->setParam('notificationusers', array());
|
||||||
$controller->setParam('maxsizeforfulltext', $settings->_maxSizeForFullText);
|
$controller->setParam('maxsizeforfulltext', $settings->_maxSizeForFullText);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user