set ind. revisors by group

This commit is contained in:
Uwe Steinmann 2017-12-18 08:42:13 +01:00
parent a320b3cc39
commit 8784b1224b

View File

@ -95,8 +95,20 @@ foreach ($revisionStatus as $i=>$rs) {
}
}
// Get the list of proposed recipients, stripping out any duplicates.
// Get the list of proposed revisors, stripping out any duplicates.
$pIndRev = (isset($_POST["indRevisors"]) ? array_values(array_unique($_POST["indRevisors"])) : array());
// Retrieve the list of revisor groups whose members become individual revisors
if (isset($_POST["grpIndRevisors"])) {
foreach ($_POST["grpIndRevisors"] as $grp) {
if($group = $dms->getGroup($grp)) {
$members = $group->getUsers();
foreach($members as $member) {
if(!in_array($member->getID(), $pIndRev))
$pIndRev[] = $member->getID();
}
}
}
}
$pGrpRev = (isset($_POST["grpRevisors"]) ? array_values(array_unique($_POST["grpRevisors"])) : array());
foreach ($pIndRev as $p) {
if (is_numeric($p)) {
@ -121,6 +133,7 @@ foreach ($pIndRev as $p) {
$params['folder_path'] = $folder->getFolderPathPlain();
$params['version'] = $content->_version;
$params['comment'] = $content->getComment();
$params['revisor'] = $accessIndex["i"][$p]->getFullName();
$params['username'] = $user->getFullName();
$params['url'] = "http".((isset($_SERVER['HTTPS']) && (strcmp($_SERVER['HTTPS'],'off')!=0)) ? "s" : "")."://".$_SERVER['HTTP_HOST'].$settings->_httpRoot."out/out.ViewDocument.php?documentid=".$document->getID();
$params['sitename'] = $settings->_siteName;
@ -146,8 +159,8 @@ foreach ($pIndRev as $p) {
}
else {
// Proposed recipient is already in the list of recipients.
// Remove recipient from the index of possible recipients. If there are
// any recipients left over in the list of possible recipients, they
// Remove revisor from the index of possible revisors. If there are
// any revisors left over in the list of possible revisors, they
// will be removed from the revision process for this document revision.
unset($revisionIndex["i"][$p]);
}
@ -179,6 +192,7 @@ if (count($revisionIndex["i"]) > 0) {
$params['folder_path'] = $folder->getFolderPathPlain();
$params['version'] = $content->_version;
$params['comment'] = $content->getComment();
$params['revisor'] = $accessIndex["i"][$rx]->getFullName();
$params['username'] = $user->getFullName();
$params['url'] = "http".((isset($_SERVER['HTTPS']) && (strcmp($_SERVER['HTTPS'],'off')!=0)) ? "s" : "")."://".$_SERVER['HTTP_HOST'].$settings->_httpRoot."out/out.ViewDocument.php?documentid=".$document->getID();
$params['sitename'] = $settings->_siteName;
@ -226,6 +240,7 @@ foreach ($pGrpRev as $p) {
$params['folder_path'] = $folder->getFolderPathPlain();
$params['version'] = $content->_version;
$params['comment'] = $content->getComment();
$params['revisor'] = $accessIndex["g"][$p]->getName();
$params['username'] = $user->getFullName();
$params['url'] = "http".((isset($_SERVER['HTTPS']) && (strcmp($_SERVER['HTTPS'],'off')!=0)) ? "s" : "")."://".$_SERVER['HTTP_HOST'].$settings->_httpRoot."out/out.ViewDocument.php?documentid=".$document->getID();
$params['sitename'] = $settings->_siteName;
@ -250,7 +265,7 @@ foreach ($pGrpRev as $p) {
}
}
else {
// Remove recipient from the index of possible recipients.
// Remove recipient from the index of possible revisors.
unset($revisionIndex["g"][$p]);
}
}
@ -280,6 +295,7 @@ if (count($revisionIndex["g"]) > 0) {
$params['folder_path'] = $folder->getFolderPathPlain();
$params['version'] = $content->_version;
$params['comment'] = $content->getComment();
$params['revisor'] = $accessIndex["g"][$rx]->getName();
$params['username'] = $user->getFullName();
$params['url'] = "http".((isset($_SERVER['HTTPS']) && (strcmp($_SERVER['HTTPS'],'off')!=0)) ? "s" : "")."://".$_SERVER['HTTP_HOST'].$settings->_httpRoot."out/out.ViewDocument.php?documentid=".$document->getID();
$params['sitename'] = $settings->_siteName;