add new config flag which allows doc reception by owner

This commit is contained in:
Uwe Steinmann 2016-10-27 12:17:04 +02:00
parent ba5a73df45
commit e10b6974ae
7 changed files with 18 additions and 8 deletions

View File

@ -139,6 +139,8 @@ class Settings { /* {{{ */
var $_enableOwnerRevApp = false;
// enable/disable listing logged in user as reviewer/approver
var $_enableSelfRevApp = false;
// enable/disable listing owner as recipient
var $_enableOwnerReceipt = false;
// enable/disable default notification for owner
var $_enableOwnerNotification = false;
// enable/disable deleting of versions for regular users
@ -577,6 +579,7 @@ class Settings { /* {{{ */
$this->_enableAdminRevApp = Settings::boolval($tab["enableAdminRevApp"]);
$this->_enableOwnerRevApp = Settings::boolval($tab["enableOwnerRevApp"]);
$this->_enableSelfRevApp = Settings::boolval($tab["enableSelfRevApp"]);
$this->_enableOwnerReceipt = Settings::boolval($tab["enableOwnerReceipt"]);
$this->_presetExpirationDate = strval($tab["presetExpirationDate"]);
$this->_initialDocumentStatus = intval($tab["initialDocumentStatus"]);
$this->_versioningFileName = strval($tab["versioningFileName"]);
@ -885,6 +888,7 @@ class Settings { /* {{{ */
$this->setXMLAttributValue($node, "enableAdminRevApp", $this->_enableAdminRevApp);
$this->setXMLAttributValue($node, "enableOwnerRevApp", $this->_enableOwnerRevApp);
$this->setXMLAttributValue($node, "enableSelfRevApp", $this->_enableSelfRevApp);
$this->setXMLAttributValue($node, "enableOwnerReceipt", $this->_enableOwnerReceipt);
$this->setXMLAttributValue($node, "presetExpirationDate", $this->_presetExpirationDate);
$this->setXMLAttributValue($node, "initialDocumentStatus", $this->_initialDocumentStatus);
$this->setXMLAttributValue($node, "versioningFileName", $this->_versioningFileName);

View File

@ -167,6 +167,7 @@ if ($action == "saveSettings")
$settings->_enableAdminRevApp = getBoolValue("enableAdminRevApp");
$settings->_enableOwnerRevApp = getBoolValue("enableOwnerRevApp");
$settings->_enableSelfRevApp = getBoolValue("enableSelfRevApp");
$settings->_enableOwnerReceipt = getBoolValue("enableOwnerReceipt");
$settings->_enableVersionDeletion = getBoolValue("enableVersionDeletion");
$settings->_enableVersionModification = getBoolValue("enableVersionModification");
$settings->_enableDuplicateDocNames = getBoolValue("enableDuplicateDocNames");

View File

@ -66,9 +66,7 @@ if($view) {
$view->setParam('folder', $folder);
$view->setParam('document', $document);
$view->setParam('version', $content);
$view->setParam('enableadminrevapp', $settings->_enableAdminRevApp);
$view->setParam('enableownerrevapp', $settings->_enableOwnerRevApp);
$view->setParam('enableselfrevapp', $settings->_enableSelfRevApp);
$view->setParam('enableownerreceipt', $settings->_enableOwnerReceipt);
$view->setParam('accessobject', $accessop);
$view($_GET);
exit;

View File

@ -75,6 +75,7 @@ if($view) {
$view->setParam('accessobject', $accessop);
$view->setParam('viewonlinefiletypes', $settings->_viewOnlineFileTypes);
$view->setParam('enableownerrevapp', $settings->_enableOwnerRevApp);
$view->setParam('enableownerreceipt', $settings->_enableOwnerReceipt);
$view->setParam('cachedir', $settings->_cacheDir);
$view->setParam('workflowmode', $settings->_workflowMode);
$view->setParam('previewWidthList', $settings->_previewWidthList);

View File

@ -37,6 +37,7 @@ class SeedDMS_View_SetRecipients extends SeedDMS_Bootstrap_Style {
$folder = $this->params['folder'];
$document = $this->params['document'];
$content = $this->params['version'];
$enableownerreceipt = $this->params['enableownerreceipt'];
$overallStatus = $content->getStatus();
@ -47,7 +48,7 @@ class SeedDMS_View_SetRecipients extends SeedDMS_Bootstrap_Style {
$this->contentHeading(getMLText("change_recipients"));
// Retrieve a list of all users and groups that have receipt privileges.
$docAccess = $document->getReadAccessList(true, true);
$docAccess = $document->getReadAccessList(true, $enableownerreceipt);
// Retrieve list of currently assigned recipients, along with
// their latest status.

View File

@ -629,6 +629,10 @@ if(!is_writeable($settings->_configFilePath)) {
<td><?php printMLText("settings_enableSelfRevApp");?>:</td>
<td><input name="enableSelfRevApp" type="checkbox" <?php if ($settings->_enableSelfRevApp) echo "checked" ?> /></td>
</tr>
<tr title="<?php printMLText("settings_enableOwnerReceipt_desc");?>">
<td><?php printMLText("settings_enableOwnerReceipt");?>:</td>
<td><input name="enableOwnerReceipt" type="checkbox" <?php if ($settings->_enableOwnerReceipt) echo "checked" ?> /></td>
</tr>
<tr title="<?php printMLText("settings_enableVersionDeletion_desc");?>">
<td><?php printMLText("settings_enableVersionDeletion");?>:</td>
<td><input name="enableVersionDeletion" type="checkbox" <?php if ($settings->_enableVersionDeletion) echo "checked" ?> /></td>

View File

@ -195,6 +195,7 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
$accessop = $this->params['accessobject'];
$viewonlinefiletypes = $this->params['viewonlinefiletypes'];
$enableownerrevapp = $this->params['enableownerrevapp'];
$enableownerreceipt = $this->params['enableownerreceipt'];
$workflowmode = $this->params['workflowmode'];
$cachedir = $this->params['cachedir'];
$previewwidthlist = $this->params['previewWidthList'];
@ -1055,7 +1056,7 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
$is_recipient = false;
$stat[''.$r['status']]++;
switch ($r["type"]) {
case 0: // Reviewer is an individual.
case 0: // Recipient is an individual.
$required = $dms->getUser($r["required"]);
if (!is_object($required)) {
$reqName = getMLText("unknown_user")." '".$r["required"]."'";
@ -1063,17 +1064,17 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
else {
$reqName = htmlspecialchars($required->getFullName()." (".$required->getLogin().")");
}
if($r["required"] == $user->getId() && ($user->getId() != $owner->getId() || $enableownerrevapp == 1))
if($r["required"] == $user->getId() && ($user->getId() != $owner->getId() || $enableownerreceipt == 1))
$is_recipient = true;
break;
case 1: // Reviewer is a group.
case 1: // Recipient is a group.
$required = $dms->getGroup($r["required"]);
if (!is_object($required)) {
$reqName = getMLText("unknown_group")." '".$r["required"]."'";
}
else {
$reqName = "<i>".htmlspecialchars($required->getName())."</i>";
if($required->isMember($user) && ($user->getId() != $owner->getId() || $enableownerrevapp == 1))
if($required->isMember($user) && ($user->getId() != $owner->getId() || $enableownerreceipt == 1))
$is_recipient = true;
}
break;