mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-14 05:31:42 +00:00
do not list users/groups in select menu which already has an access right
This commit is contained in:
parent
539b5d3223
commit
9a5d6c31ab
|
@ -189,11 +189,16 @@ $(document).ready( function() {
|
||||||
<input type="Hidden" name="documentid" value="<?php print $document->getId()?>">
|
<input type="Hidden" name="documentid" value="<?php print $document->getId()?>">
|
||||||
<input type="Hidden" name="action" value="addaccess">
|
<input type="Hidden" name="action" value="addaccess">
|
||||||
<?php
|
<?php
|
||||||
|
$memusers = array();
|
||||||
|
foreach ($accessList["users"] as $userAccess) {
|
||||||
|
$userObj = $userAccess->getUser();
|
||||||
|
$memusers[] = $userObj->getID();
|
||||||
|
}
|
||||||
$options = array();
|
$options = array();
|
||||||
$options[] = array(-1, getMLText('select_one'));
|
$options[] = array(-1, getMLText('select_one'));
|
||||||
foreach ($allUsers as $currUser) {
|
foreach ($allUsers as $currUser) {
|
||||||
if (!$currUser->isGuest())
|
if (!$currUser->isGuest() && !in_array($currUser->getID(), $memusers))
|
||||||
$options[] = array($currUser->getID(), htmlspecialchars($currUser->getLogin()), ($currUser->getID()==$user->getID()), array(array('data-subtitle', htmlspecialchars($currUser->getFullName()))));
|
$options[] = array($currUser->getID(), htmlspecialchars($currUser->getLogin()), false, array(array('data-subtitle', htmlspecialchars($currUser->getFullName()))));
|
||||||
}
|
}
|
||||||
$this->formField(
|
$this->formField(
|
||||||
getMLText("user"),
|
getMLText("user"),
|
||||||
|
@ -204,9 +209,15 @@ $(document).ready( function() {
|
||||||
'options'=>$options
|
'options'=>$options
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
$memgroups = array();
|
||||||
|
foreach ($accessList["groups"] as $groupAccess) {
|
||||||
|
$groupObj = $groupAccess->getGroup();
|
||||||
|
$memgroups[] = $groupObj->getID();
|
||||||
|
}
|
||||||
$options = array();
|
$options = array();
|
||||||
$options[] = array(-1, getMLText('select_one'));
|
$options[] = array(-1, getMLText('select_one'));
|
||||||
foreach ($allGroups as $groupObj) {
|
foreach ($allGroups as $groupObj) {
|
||||||
|
if(!in_array($groupObj->getID(), $memgroups))
|
||||||
$options[] = array($groupObj->getID(), htmlspecialchars($groupObj->getName()));
|
$options[] = array($groupObj->getID(), htmlspecialchars($groupObj->getName()));
|
||||||
}
|
}
|
||||||
$this->formField(
|
$this->formField(
|
||||||
|
|
Loading…
Reference in New Issue
Block a user