mirror of
				https://git.code.sf.net/p/seeddms/code
				synced 2025-10-30 20:51:22 +00:00 
			
		
		
		
	do not add empty groups as mandatory approver/reviewer
This commit is contained in:
		
							parent
							
								
									17dbfcf2c7
								
							
						
					
					
						commit
						c5d44c3674
					
				|  | @ -1044,6 +1044,7 @@ function cmp_user_fullname($a, $b) { /* {{{ */ | |||
|  * on the folder containing the document. It also checks if the | ||||
|  * mandatory reviewer is an admin or the uploading user and if | ||||
|  * those are allowed to review/approve a document. | ||||
|  * Mandatory groups will only be added if they are not empty | ||||
|  * | ||||
|  * @param $folder folder where document is located | ||||
|  * @param $document document which is updated, null when adding a new document | ||||
|  | @ -1096,7 +1097,11 @@ function getMandatoryReviewers($folder, $document, $user) { /* {{{ */ | |||
| 	foreach($revi as $uid) { | ||||
| 		if($u = $dms->getUser($uid)) { | ||||
| 			/* need at least read access on parent folder */ | ||||
| 			if($folder->getAccessMode($u) < M_READ) | ||||
| 			if($document) | ||||
| 				$accessmode = $document->getAccessMode($u); | ||||
| 			else | ||||
| 				$accessmode = $folder->getAccessMode($u); | ||||
| 			if($accessmode < M_READ) | ||||
| 				$reviewers["ni"][] = $u->getId(); | ||||
| 			/* admins as reviewers must be enabled */ | ||||
| 			elseif(!$settings->_enableAdminRevApp && $u->isAdmin()) | ||||
|  | @ -1113,7 +1118,11 @@ function getMandatoryReviewers($folder, $document, $user) { /* {{{ */ | |||
| 	} | ||||
| 	foreach($revg as $gid) { | ||||
| 		if($g = $dms->getGroup($gid)) { | ||||
| 			if($folder->getGroupAccessMode($g) < M_READ) | ||||
| 			if($document) | ||||
| 				$accessmode = $document->getGroupAccessMode($u); | ||||
| 			else | ||||
| 				$accessmode = $folder->getGroupAccessMode($u); | ||||
| 			if($accessmode < M_READ || !$g->getUsers()) | ||||
| 				$reviewers["ng"][] = $g->getId(); | ||||
| 			else | ||||
| 				$reviewers["g"][] = $g->getId(); | ||||
|  | @ -1130,6 +1139,7 @@ function getMandatoryReviewers($folder, $document, $user) { /* {{{ */ | |||
|  * on the folder containing the document. It also checks if the | ||||
|  * mandatory approver is an admin or the uploading user and if | ||||
|  * those are allowed to review/approve a document. | ||||
|  * Mandatory groups will only be added if they are not empty | ||||
|  * | ||||
|  * @param $folder folder where document is located | ||||
|  * @param $document document which is updated, null when adding a new document | ||||
|  | @ -1182,7 +1192,11 @@ function getMandatoryApprovers($folder, $document, $user) { /* {{{ */ | |||
| 	foreach($appi as $uid) { | ||||
| 		if($u = $dms->getUser($uid)) { | ||||
| 			/* need at least read access on parent folder */ | ||||
| 			if($folder->getAccessMode($u) < M_READ) | ||||
| 			if($document) | ||||
| 				$accessmode = $document->getAccessMode($u); | ||||
| 			else | ||||
| 				$accessmode = $folder->getAccessMode($u); | ||||
| 			if($accessmode < M_READ) | ||||
| 				$approvers["ni"][] = $u->getId(); | ||||
| 			/* admins as approvers must be enabled */ | ||||
| 			elseif(!$settings->_enableAdminRevApp && $u->isAdmin()) | ||||
|  | @ -1199,7 +1213,11 @@ function getMandatoryApprovers($folder, $document, $user) { /* {{{ */ | |||
| 	} | ||||
| 	foreach($appg as $gid) { | ||||
| 		if($g = $dms->getGroup($gid)) { | ||||
| 			if($folder->getGroupAccessMode($g) < M_READ) | ||||
| 			if($document) | ||||
| 				$accessmode = $document->getGroupAccessMode($u); | ||||
| 			else | ||||
| 				$accessmode = $folder->getGroupAccessMode($u); | ||||
| 			if($accessmode < M_READ || !$g->getUsers()) | ||||
| 				$approvers["ng"][] = $g->getId(); | ||||
| 			else | ||||
| 				$approvers["g"][] = $g->getId(); | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 Uwe Steinmann
						Uwe Steinmann