|
|
@@ -28,11 +28,410 @@ class Route_Users extends RouteBase {
|
|
|
public function menu() {
|
|
|
$usrLogin = User::getLogin();
|
|
|
?>
|
|
|
-<ul>
|
|
|
- <li><a href="index.php?_route=Users&_task=syncUser&usrLogin=<?php echo $usrLogin; ?>">Sync user <?php echo $usrLogin; ?></a></li>
|
|
|
- <li><a href="index.php?_route=Users&_task=userGroups&usrLogin=<?php echo $usrLogin; ?>">Add group <?php echo $usrLogin; ?></a></li>
|
|
|
-</ul>
|
|
|
+<div class="container">
|
|
|
+ <h3>Użytkownicy i grupy</h3>
|
|
|
+ <ul>
|
|
|
+ <li>
|
|
|
+ <form class="form-inline" action="index.php" method="GET">
|
|
|
+ <input type="hidden" name="_route" value="Users">
|
|
|
+ <input type="hidden" name="_task" value="syncUser">
|
|
|
+ <label for="usrLogin">login: </label>
|
|
|
+ <input type="text" name="usrLogin" value="<?php echo $usrLogin; ?>">
|
|
|
+ <input type="submit" value="Synchronizuj do bazy LDAP" class="btn btn-xs btn-default">
|
|
|
+ </form>
|
|
|
+ </li>
|
|
|
+ <li>
|
|
|
+ <form class="form-inline" action="index.php" method="GET">
|
|
|
+ <input type="hidden" name="_route" value="Users">
|
|
|
+ <input type="hidden" name="_task" value="userGroups">
|
|
|
+ <label for="usrLogin">login: </label>
|
|
|
+ <input type="text" name="usrLogin" value="<?php echo $usrLogin; ?>">
|
|
|
+ <input type="submit" value="Dodaj grupy" class="btn btn-xs btn-default">
|
|
|
+ </form>
|
|
|
+ </li>
|
|
|
+ <li>
|
|
|
+ <form class="form-inline" action="index.php" method="GET">
|
|
|
+ <input type="hidden" name="_route" value="Users">
|
|
|
+ <input type="hidden" name="_task" value="nestedGroups">
|
|
|
+ <label for="idGroup">id grupy: </label>
|
|
|
+ <input type="text" name="idGroup" value="">
|
|
|
+ <input type="submit" value="Grupy uprawnień" class="btn btn-xs btn-default">
|
|
|
+ </form>
|
|
|
+ </li>
|
|
|
+ </ul>
|
|
|
+</div>
|
|
|
+<?php
|
|
|
+ }
|
|
|
+
|
|
|
+ public function nestedGroupsAction() {
|
|
|
+ SE_Layout::gora();
|
|
|
+ SE_Layout::menu();
|
|
|
+ echo '<div class="container">';
|
|
|
+ try {
|
|
|
+ $idGroup = V::get('idGroup', 0, $_GET, 'int');
|
|
|
+ if (empty($idGroup)) throw new Exception("Empty group id");
|
|
|
+ $subTask = V::get('_subTask', '', $_POST);
|
|
|
+ $successMsg = null;
|
|
|
+ if ('removeParentGroup' == $subTask) {
|
|
|
+ $idParentGroupToRemove = V::get('idParentGroupToRemove', 0, $_POST, 'int');
|
|
|
+ $this->nestedGroupsRemoveParentGroup($idGroup, $idParentGroupToRemove);
|
|
|
+ $successMsg = "Usunięto grupę nadrzędną [{$idParentGroupToRemove}] do grupy [{$idGroup}]";
|
|
|
+ } else if ('removeNestedGroup' == $subTask) {
|
|
|
+ $idNestedGroupToRemove = V::get('idNestedGroupToRemove', 0, $_POST, 'int');
|
|
|
+ $this->nestedGroupsRemoveNestedGroup($idGroup, $idNestedGroupToRemove);
|
|
|
+ $successMsg = "Usunięto grupę zagnieżdżoną [{$idNestedGroupToRemove}] do grupy [{$idGroup}]";
|
|
|
+ } else if ('addParentGroup' == $subTask) {
|
|
|
+ $idParentGroupToAdd = V::get('idParentGroupToAdd', 0, $_POST, 'int');
|
|
|
+ $this->nestedGroupsAddParentGroup($idGroup, $idParentGroupToAdd);
|
|
|
+ $successMsg = "Dodano grupę nadrzędną [{$idParentGroupToAdd}] do grupy [{$idGroup}]";
|
|
|
+ } else if ('addNestedGroup' == $subTask) {
|
|
|
+ $idNestedGroupToAdd = V::get('idNestedGroupToAdd', 0, $_POST, 'int');
|
|
|
+ $this->nestedGroupsAddNestedGroup($idGroup, $idNestedGroupToAdd);
|
|
|
+ $successMsg = "Dodano grupę zagnieżdżoną [{$idNestedGroupToAdd}] do grupy [{$idGroup}]";
|
|
|
+ }
|
|
|
+ if (!empty($successMsg)) {
|
|
|
+ ?><div class="alert alert-success"><?php echo $successMsg; ?></div><?php
|
|
|
+ }
|
|
|
+ $this->printFormNestedGroups($idGroup);
|
|
|
+ } catch (Exception $e) {
|
|
|
+ ?><div class="alert alert-danger"><?php echo $e->getMessage(); ?>
|
|
|
+ <br><a href="index.php?_route=Users">wróć</a>
|
|
|
+</div><?php
|
|
|
+ echo UserActivity::showListInContainer();
|
|
|
+ }
|
|
|
+ echo '</div>';// .container
|
|
|
+ SE_Layout::dol();
|
|
|
+ }
|
|
|
+
|
|
|
+ public function nestedGroupsRemoveParentGroup($idGroup, $idParentGroupToRemove) {
|
|
|
+ if (!$idGroup) throw new Exception("Wrong param id group!");
|
|
|
+ if (!$idParentGroupToRemove) throw new Exception("Wrong param id parent group to remove!");
|
|
|
+ $usrStorageDB = UserStorageFactory::getStorage('DB');
|
|
|
+ if (!$usrStorageDB) throw new Exception("Error: storage db not exists!");
|
|
|
+ $group = $usrStorageDB->getGroupWithoutNested($idGroup);
|
|
|
+ if (!$group) throw new Exception("Error: group not exists!");
|
|
|
+ $parentGroup = $usrStorageDB->getGroupWithoutNested($idParentGroupToRemove);
|
|
|
+ if (!$parentGroup) throw new Exception("Error: parent group not exists!");
|
|
|
+ $usrStorageDB->removeParentGroup($idGroup, $idParentGroupToRemove);
|
|
|
+ }
|
|
|
+
|
|
|
+ public function nestedGroupsRemoveNestedGroup($idGroup, $idNestedGroupToRemove) {
|
|
|
+ if (!$idGroup) throw new Exception("Wrong param id group!");
|
|
|
+ if (!$idNestedGroupToRemove) throw new Exception("Wrong param id parent group to remove!");
|
|
|
+ $usrStorageDB = UserStorageFactory::getStorage('DB');
|
|
|
+ if (!$usrStorageDB) throw new Exception("Error: storage db not exists!");
|
|
|
+ $group = $usrStorageDB->getGroupWithoutNested($idGroup);
|
|
|
+ if (!$group) throw new Exception("Error: group not exists!");
|
|
|
+ $nestedGroup = $usrStorageDB->getGroupWithoutNested($idNestedGroupToRemove);
|
|
|
+ if (!$nestedGroup) throw new Exception("Error: nested group not exists!");
|
|
|
+ $usrStorageDB->removeNestedGroup($idGroup, $idNestedGroupToRemove);
|
|
|
+ }
|
|
|
+
|
|
|
+ public function nestedGroupsAddParentGroup($idGroup, $idParentGroupToAdd) {
|
|
|
+ if ($idGroup <= 0) throw new Exception("Wrong param id group");
|
|
|
+ if ($idParentGroupToAdd <= 0) throw new Exception("Wrong param id parent group to add");
|
|
|
+ $usrStorageDB = UserStorageFactory::getStorage('DB');
|
|
|
+ if (!$usrStorageDB) throw new Exception("Error: storage db not exists!");
|
|
|
+ $group = $usrStorageDB->getGroupWithoutNested($idGroup);
|
|
|
+ if (!$group) throw new Exception("Error: group [{$idGroup}] not exists!");
|
|
|
+ $parentGroup = $usrStorageDB->getGroupWithoutNested($idParentGroupToAdd);
|
|
|
+ if (!$parentGroup) throw new Exception("Error: parent group [{$idParentGroupToAdd}] not exists!");
|
|
|
+ $usrStorageDB->addParentGroup($idGroup, $idParentGroupToAdd);
|
|
|
+ }
|
|
|
+
|
|
|
+ public function nestedGroupsAddNestedGroup($idGroup, $idNestedGroupToAdd) {
|
|
|
+ if ($idGroup <= 0) throw new Exception("Wrong param id group");
|
|
|
+ if ($idNestedGroupToAdd <= 0) throw new Exception("Wrong param id parent group to add");
|
|
|
+ $usrStorageDB = UserStorageFactory::getStorage('DB');
|
|
|
+ if (!$usrStorageDB) throw new Exception("Error: storage db not exists!");
|
|
|
+ $group = $usrStorageDB->getGroupWithoutNested($idGroup);
|
|
|
+ if (!$group) throw new Exception("Error: group not exists!");
|
|
|
+ $nestedGroup = $usrStorageDB->getGroupWithoutNested($idNestedGroupToAdd);
|
|
|
+ if (!$nestedGroup) throw new Exception("Error: nested group [{$idNestedGroupToAdd}] not exists!");
|
|
|
+ $usrStorageDB->addNestedGroup($idGroup, $idNestedGroupToAdd);
|
|
|
+ }
|
|
|
+
|
|
|
+ public function printFormNestedGroups($idGroup) {
|
|
|
+ $linkTypeIdNestedGroups = 5;
|
|
|
+
|
|
|
+ if (!$idGroup) throw new Exception("Wrong param group id!");
|
|
|
+ $usrStorageDB = UserStorageFactory::getStorage('DB');
|
|
|
+ if (!$usrStorageDB) throw new Exception("Error storage not exists!");
|
|
|
+ $group = $usrStorageDB->getGroup($idGroup);
|
|
|
+ if (!$group) throw new Exception("Grupa {$idGroup} nie istnieje.");
|
|
|
+ DBG::_('DBG_SU', '>1', 'group', $group, __CLASS__, __FUNCTION__, __LINE__);
|
|
|
+
|
|
|
+ {
|
|
|
+ $idZasob = ProcesHelper::getZasobTableID('ITEM_LINKS');
|
|
|
+ if ($idZasob <= 0) throw new Exception("Brak zasobu dla tabeli 'ITEM_LINKS'");
|
|
|
+ $zasobObj = ProcesHelper::getZasobTableInfo($idZasob);
|
|
|
+ if (!$zasobObj) throw new Exception("Zasob TABELA ID={$idZasob} nie istnieje");
|
|
|
+ UserActivity::add($idZasob);
|
|
|
+ $userAcl = User::getAcl();
|
|
|
+ $userAcl->fetchGroups();
|
|
|
+ if (!$userAcl->hasTableAcl($zasobObj->ID)) throw new Exception("Brak uprawnień do tabeli ID={$zasobObj->ID}");
|
|
|
+ }
|
|
|
+
|
|
|
+ if (V::get('_testUsrGroupsLdapLvl0', '', $_GET)) {
|
|
|
+ $usrLogin = User::getLogin();
|
|
|
+ $groups = array(); $groupsLvl3 = array();
|
|
|
+ $groupsNetwork = UsersLdapHelper::getUserGroups($usrLogin, 0);
|
|
|
+ foreach ($groupsNetwork as $vGroup) {
|
|
|
+ $groups[$vGroup->cn] = $vGroup->appleUID;
|
|
|
+ }
|
|
|
+ DBG::_(true, true, "groups ldap lvl 0", $groups, __CLASS__, __FUNCTION__, __LINE__);
|
|
|
+ $groupsNetwork = UsersLdapHelper::getUserGroups($usrLogin, 3);
|
|
|
+ foreach ($groupsNetwork as $vGroup) {
|
|
|
+ $groupsLvl3[$vGroup->cn] = $vGroup->appleUID;
|
|
|
+ }
|
|
|
+ DBG::_(true, true, "groups ldap lvl 3", $groupsLvl3, __CLASS__, __FUNCTION__, __LINE__);
|
|
|
+ }
|
|
|
+
|
|
|
+ $group->getParentGroups();
|
|
|
+ DBG::_('DBG_NG', '>1', "group with nested", $group, __CLASS__, __FUNCTION__, __LINE__);
|
|
|
+
|
|
|
+ $typeSpecialNestedGroups = TypespecialVariable::getInstance(-1, '__NESTED_GROUPS');
|
|
|
+
|
|
|
+ $groupUsers = array();
|
|
|
+ $groupNestedUsers = array();
|
|
|
+ $idZasobTableUsers = ProcesHelper::getZasobTableID('ADMIN_USERS');
|
|
|
+ if ($group->zasobID > 0) {
|
|
|
+ $groupUsers = UsersHelper::getUsersByGroupId($idGroup);
|
|
|
+ $groupNestedUsers = UsersHelper::getUsersByGroupsIds(array_keys($group->nestedGroups), array_keys($groupUsers));
|
|
|
+ }
|
|
|
+
|
|
|
+?>
|
|
|
+<style type="text/css">
|
|
|
+.frm-groups .selectize-control { float:left; }
|
|
|
+.conn_groups {}
|
|
|
+ .conn_groups .conn_groups-list {}
|
|
|
+ .conn_groups .conn_groups-list .conn_groups-list_item { line-height:22px; }
|
|
|
+ .conn_groups .conn_groups-list .conn_groups-list_item form { display:inline; margin:0; }
|
|
|
+ .conn_groups .conn_groups-list_item-rmBtn { display:inline; margin:0; padding:0 6px; border:none; opacity:0.4; }
|
|
|
+ .conn_groups .conn_groups-list_item-editBtn { margin:0 6px; padding:0; border:none; opacity:0.4; }
|
|
|
+ .conn_groups .conn_groups-list_item:hover .conn_groups-list_item-rmBtn { display:inline; opacity:1; }
|
|
|
+ .conn_groups .conn_groups-list_item:hover .conn_groups-list_item-editBtn { opacity:1; }
|
|
|
+.users-with-perms {}
|
|
|
+ .users-with-perms address { padding:0 6px; border:1px solid #eee; }
|
|
|
+ .users-with-perms address:hover { border-color:#333; }
|
|
|
+</style>
|
|
|
+<div class="container conn_groups">
|
|
|
+ <h3>Grupy uprawnień
|
|
|
+ <!-- <em style="color:#ccc;">(Nested Groups)</em> -->
|
|
|
+ </h3>
|
|
|
+ <p>
|
|
|
+ <b>Zasób [<?php echo $idGroup; ?>]</b>: <?php echo $group->type; ?> <?php echo $group->zasobDESC; ?>
|
|
|
+ <a class="btn btn-xs btn-primary" href="index.php?MENU_INIT=SYNC_LDAP_PERMS&syncGroup=<?php echo $idGroup; ?>">synchronizuj do LDAP</a>
|
|
|
+ </p>
|
|
|
+
|
|
|
+ <br>
|
|
|
+
|
|
|
+ <div class="row">
|
|
|
+ <div class="col-md-6">
|
|
|
+<!-- <p><b>Grupy posiadające dostęp do rekordów grupy [<?php echo $group->zasobID; ?>] <?php echo $group->zasobDESC; ?></b> <em>(<?php echo (!empty($group->parentGroups))? count($group->parentGroups) : 0; ?>)</em>:
|
|
|
+ </p> -->
|
|
|
+ <blockquote>
|
|
|
+<!-- <h5>Ustal grupy, które będą miały uprawnienia do rekordów dostępnych dla
|
|
|
+ [<?php echo $group->zasobID; ?>] <?php echo $group->zasobDESC; ?>
|
|
|
+ </h5>
|
|
|
+ <small>np. grupy podrzędnych pracowników.</small> -->
|
|
|
+ <h5>Udostępnij rekordy innym grupom</h5>
|
|
|
+ <small>np. przełożonemu.</small>
|
|
|
+ </blockquote>
|
|
|
+ <ul class="conn_groups-list">
|
|
|
+ <?php if (!empty($group->nestedGroups)) : ?>
|
|
|
+ <?php foreach ($group->nestedGroups as $vNestedGroup) : ?>
|
|
|
+ <li class="conn_groups-list_item">
|
|
|
+ [<?php echo $vNestedGroup->zasobID; ?>]
|
|
|
+ <?php echo $vNestedGroup->type; ?>
|
|
|
+ <?php echo $vNestedGroup->zasobDESC; ?>
|
|
|
+ <a href="index.php?_route=Users&_task=nestedGroups&idGroup=<?php echo $vNestedGroup->zasobID; ?>" class="glyphicon glyphicon-pencil conn_groups-list_item-editBtn" title="Edytuj grupę"> </a>
|
|
|
+ <form action="" method="POST" class="form-inline frm-groups">
|
|
|
+ <input type="hidden" name="_subTask" value="removeNestedGroup">
|
|
|
+ <button name="idNestedGroupToRemove" value="<?php echo $vNestedGroup->zasobID; ?>" class="btn-link btn-sm conn_groups-list_item-rmBtn" title="usuń grupę"><i class="glyphicon glyphicon-remove"></i></button>
|
|
|
+ </form>
|
|
|
+ </li>
|
|
|
+ <?php endforeach; ?>
|
|
|
+ <?php endif; ?>
|
|
|
+ <?php if ($typeSpecialNestedGroups) : ?>
|
|
|
+ <li>
|
|
|
+ <form action="" method="POST" class="form-inline frm-groups">
|
|
|
+ <input type="hidden" name="_subTask" value="addNestedGroup">
|
|
|
+ <?php
|
|
|
+ $fName = 'idNestedGroupToAdd';
|
|
|
+ $fldParams = array();
|
|
|
+ $fldParams['allowCreate'] = false;
|
|
|
+ $fldParams['ajaxDataUrlBase'] = "index.php?_route=Users&_task=typeSpecialIdNestedGroup";
|
|
|
+ //$fldParams['ajaxDataUrlBase'] .= "&DBG_TS=3";
|
|
|
+ echo $typeSpecialNestedGroups->showFormItem($tblID = -1, $fName, $selValue = '', $fldParams);
|
|
|
+ ?>
|
|
|
+ <button class="btn">dodaj</button>
|
|
|
+ </form>
|
|
|
+ </li>
|
|
|
+ <?php endif; ?>
|
|
|
+ </ul>
|
|
|
+
|
|
|
+<!-- <p><b>Grupy do rekordów, których posiada dostęp grupa [<?php echo $group->zasobID; ?>] <?php echo $group->zasobDESC; ?></b> <em>(<?php echo (!empty($group->parentGroups))? count($group->parentGroups) : 0; ?>)</em>:
|
|
|
+ </p> -->
|
|
|
+ <blockquote>
|
|
|
+ <h5>Grupy, które udostępniają rekordy</h5>
|
|
|
+ <small>np. grupy podrzędnych pracowników lub dział, podmiot.</small>
|
|
|
+ </blockquote>
|
|
|
+ <ul class="conn_groups-list">
|
|
|
+ <?php if (!empty($group->parentGroups)) : ?>
|
|
|
+ <?php foreach ($group->parentGroups as $vParentGroup) : ?>
|
|
|
+ <li class="conn_groups-list_item">
|
|
|
+ [<?php echo $vParentGroup->zasobID; ?>]
|
|
|
+ <?php // if ('DZIAL' == $vParentGroup->type) : ?>
|
|
|
+ <?php echo $vParentGroup->type; ?>
|
|
|
+ <?php // endif; ?>
|
|
|
+ <?php echo $vParentGroup->zasobDESC; ?>
|
|
|
+ <a href="index.php?_route=Users&_task=nestedGroups&idGroup=<?php echo $vParentGroup->zasobID; ?>" class="glyphicon glyphicon-pencil conn_groups-list_item-editBtn" title="Edytuj grupę"> </a>
|
|
|
+ <form action="" method="POST" class="form-inline frm-groups">
|
|
|
+ <input type="hidden" name="_subTask" value="removeParentGroup">
|
|
|
+ <button name="idParentGroupToRemove" value="<?php echo $vParentGroup->zasobID; ?>" class="btn-link btn-sm conn_groups-list_item-rmBtn" title="usuń grupę"><i class="glyphicon glyphicon-remove"></i></button>
|
|
|
+ </form>
|
|
|
+ </li>
|
|
|
+ <?php endforeach; ?>
|
|
|
+ <?php endif; ?>
|
|
|
+
|
|
|
+ <?php if ($typeSpecialNestedGroups) : ?>
|
|
|
+ <li>
|
|
|
+ <form action="" method="POST" class="form-inline frm-groups">
|
|
|
+ <input type="hidden" name="_subTask" value="addParentGroup">
|
|
|
+ <?php
|
|
|
+ $fName = 'idParentGroupToAdd';
|
|
|
+ $fldParams = array();
|
|
|
+ $fldParams['allowCreate'] = false;
|
|
|
+ $fldParams['ajaxDataUrlBase'] = "index.php?_route=Users&_task=typeSpecialIdNestedGroup";
|
|
|
+ //$fldParams['ajaxDataUrlBase'] .= "&DBG_TS=3";
|
|
|
+ echo $typeSpecialNestedGroups->showFormItem($tblID = -1, $fName, $selValue = '', $fldParams);
|
|
|
+ ?>
|
|
|
+ <button class="btn">dodaj</button>
|
|
|
+ </form>
|
|
|
+ </li>
|
|
|
+ <?php endif; ?>
|
|
|
+ </ul>
|
|
|
+
|
|
|
+ </div>
|
|
|
+ <div class="col-md-6 users-with-perms">
|
|
|
+
|
|
|
+ <h5>Użytkownicy:</h5>
|
|
|
+ <?php if (empty($groupUsers)) : ?>
|
|
|
+ <div class="alert">Brak użytkowników przypisanych bezpośrednio do grupy</div>
|
|
|
+ <?php else : ?>
|
|
|
+ <div class="row">
|
|
|
+ <?php foreach ($groupUsers as $usr) : ?>
|
|
|
+ <div class="col-md-6">
|
|
|
+ <address>
|
|
|
+ <strong><?php echo $usr->ADM_NAME; ?></strong>
|
|
|
+ <a href="index.php?MENU_INIT=VIEWTABLE_AJAX&ZASOB_ID=<?php echo $idZasobTableUsers; ?>#EDIT/<?php echo $usr->ID; ?>" class="glyphicon glyphicon-pencil" title="Edytuj rekord"> </a>
|
|
|
+
|
|
|
+ <br><em><?php echo $usr->EMPLOYEE_TYPE; ?></em>
|
|
|
+
|
|
|
+ <?php if (!empty($usr->ADM_PHONE)) : ?>
|
|
|
+ <br><abbr title="Telefon">Tel.:</abbr> <?php echo $usr->ADM_PHONE; ?>
|
|
|
+ <?php endif; ?>
|
|
|
+
|
|
|
+ <?php if (!empty($usr->EMAIL)) : ?>
|
|
|
+ <br><a href="mailto:<?php echo $usr->EMAIL; ?>"><?php echo $usr->EMAIL; ?></a>
|
|
|
+ <?php endif; ?>
|
|
|
+ </address>
|
|
|
+ </div>
|
|
|
+ <?php endforeach; ?>
|
|
|
+ </div>
|
|
|
+ <?php endif; ?>
|
|
|
+
|
|
|
+ <h5>Użytwkonicy z uprawnieniami do rekordów</h5>
|
|
|
+ <?php if (empty($groupNestedUsers)) : ?>
|
|
|
+ <div class="alert">Brak</div>
|
|
|
+ <?php else : ?>
|
|
|
+ <div class="row">
|
|
|
+ <?php foreach ($groupNestedUsers as $usr) : ?>
|
|
|
+ <div class="col-md-6">
|
|
|
+ <address>
|
|
|
+ <strong><?php echo $usr->ADM_NAME; ?></strong>
|
|
|
+ <a href="index.php?MENU_INIT=VIEWTABLE_AJAX&ZASOB_ID=<?php echo $idZasobTableUsers; ?>#EDIT/<?php echo $usr->ID; ?>" class="glyphicon glyphicon-pencil" title="Edytuj rekord"> </a>
|
|
|
+
|
|
|
+ <br><em><?php echo $usr->EMPLOYEE_TYPE; ?></em>
|
|
|
+
|
|
|
+ <?php if (!empty($usr->ADM_PHONE)) : ?>
|
|
|
+ <br><abbr title="Telefon">Tel.:</abbr> <?php echo $usr->ADM_PHONE; ?>
|
|
|
+ <?php endif; ?>
|
|
|
+
|
|
|
+ <?php if (!empty($usr->EMAIL)) : ?>
|
|
|
+ <br><a href="mailto:<?php echo $usr->EMAIL; ?>"><?php echo $usr->EMAIL; ?></a>
|
|
|
+ <?php endif; ?>
|
|
|
+ </address>
|
|
|
+ </div>
|
|
|
+ <?php endforeach; ?>
|
|
|
+ </div>
|
|
|
+ <?php endif; ?>
|
|
|
+
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</div>
|
|
|
<?php
|
|
|
+ {// render table
|
|
|
+ $tblAcl = $userAcl->getTableAcl($zasobObj->ID);
|
|
|
+ $forceTblAclInit = ('1' == V::get('_force', '', $_GET));
|
|
|
+ $tblAcl->init($forceTblAclInit);
|
|
|
+ $forceFilterInit = array();
|
|
|
+ $filterInit = new stdClass();
|
|
|
+ $filterInit->currSortCol = 'ID';
|
|
|
+ $filterInit->currSortFlip = 'desc';
|
|
|
+ foreach ($_GET as $k => $v) {
|
|
|
+ if (strlen($k) > 3 && substr($k, 0, 2) == 'f_' && !empty($v)) {// filter prefix
|
|
|
+ $filterInit->$k = $v;
|
|
|
+ }
|
|
|
+ else if (strlen($k) > 4 && substr($k, 0, 3) == 'sf_' && !empty($v)) {// special filter prefix
|
|
|
+ $filterInit->$k = $v;
|
|
|
+ }
|
|
|
+ else if (strlen($k) > 4 && substr($k, 0, 3) == 'ff_' && !empty($v)) {// force filter prefix
|
|
|
+ $fldName = substr($k, 3);
|
|
|
+ $forceFilterInit[$fldName] = $v;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ $tblZasobyID = ProcesHelper::getZasobTableID('CRM_LISTA_ZASOBOW');
|
|
|
+ $forceFilterInit['TABLE_1_NAME'] = 'CRM_LISTA_ZASOBOW';
|
|
|
+ $forceFilterInit['TABLE_1_ZASOB_ID'] = $tblZasobyID;
|
|
|
+ $forceFilterInit['TABLE_1_ID'] = $group->zasobID;
|
|
|
+ $forceFilterInit['TABLE_2_NAME'] = 'CRM_LISTA_ZASOBOW';
|
|
|
+ $forceFilterInit['TABLE_2_ZASOB_ID'] = $tblZasobyID;
|
|
|
+ $forceFilterInit['LINKS_TYPE_ID'] = $linkTypeIdNestedGroups;
|
|
|
+
|
|
|
+ $tbl = new TableAjax($tblAcl);
|
|
|
+ $tbl->setLabel($zasobObj->OPIS);
|
|
|
+ $tbl->setFilterInit($filterInit);
|
|
|
+ if (!empty($forceFilterInit)) $tbl->setForceFilterInit($forceFilterInit);
|
|
|
+ $tbl->addRowFunction('edit');
|
|
|
+ $tbl->addRowFunction('hist');
|
|
|
+ $tbl->addRowFunction('files');
|
|
|
+ $tbl->addRowFunction('cp');
|
|
|
+ $tbl->showProcesInit(false);// hide Proces filter field
|
|
|
+ echo $tbl->render();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public function typeSpecialIdNestedGroupAction() {
|
|
|
+ header("Content-type: application/json");
|
|
|
+ $typeSpecialNestedGroups = TypespecialVariable::getInstance(-1, '__NESTED_GROUPS');
|
|
|
+
|
|
|
+ $query = V::get('q', '', $_REQUEST);
|
|
|
+ $rawRows = null;
|
|
|
+ $rows = $typeSpecialNestedGroups->getValuesWithExports($query);
|
|
|
+ DBG::_('DBG', '>0', "rows(q={$query})", $rows, __CLASS__, __FUNCTION__, __LINE__);
|
|
|
+ foreach ($rows as $kID => $vItem) {
|
|
|
+ $itemJson = new stdClass();
|
|
|
+ $itemJson->id = $vItem->id;
|
|
|
+ $itemJson->name = $vItem->param_out;
|
|
|
+ if (!empty($vItem->exports)) {
|
|
|
+ $itemJson->exports = $vItem->exports;
|
|
|
+ }
|
|
|
+ $jsonData[] = $itemJson;
|
|
|
+ }
|
|
|
+ echo json_encode($jsonData);
|
|
|
}
|
|
|
|
|
|
public function userGroupsAction() {
|
|
|
@@ -104,18 +503,6 @@ class Route_Users extends RouteBase {
|
|
|
<a href="index.php?_route=Users&_task=syncUser&usrLogin=<?php echo $usr->login; ?>"
|
|
|
class="btn btn-xs btn-link"><span class="glyphicon glyphicon-random"></span> synchronizuj do LDAP</a>
|
|
|
</blockquote>
|
|
|
- <?php if (!empty($taskErrors)) : ?>
|
|
|
- <div class="alert alert-danger">
|
|
|
- <button type="button" class="close" data-dismiss="alert">×</button>
|
|
|
- <?php echo implode('<br>', $taskErrors); ?>
|
|
|
- </div>
|
|
|
- <?php endif; ?>
|
|
|
- <?php if (!empty($taskMsgs)) : ?>
|
|
|
- <div class="alert alert-success">
|
|
|
- <button type="button" class="close" data-dismiss="alert">×</button>
|
|
|
- <?php echo implode('<br>', $taskMsgs); ?>
|
|
|
- </div>
|
|
|
- <?php endif; ?>
|
|
|
|
|
|
<h4>Przypisane grupy (<?php echo (!empty($stanowiska))? count($stanowiska) : 0; ?>):</h4>
|
|
|
<?php if (!empty($stanowiska)) : ?>
|
|
|
@@ -259,7 +646,6 @@ class Route_Users extends RouteBase {
|
|
|
|
|
|
public function typeSpecialIdGroupAction() {
|
|
|
header("Content-type: application/json");
|
|
|
- Lib::loadClass('TypespecialVariable');
|
|
|
$typeSpecialUserGroups = TypespecialVariable::getInstance(-1, '__USER_GROUPS');
|
|
|
|
|
|
$query = V::get('q', '', $_REQUEST);
|
|
|
@@ -281,7 +667,6 @@ class Route_Users extends RouteBase {
|
|
|
public function typeSpecialIdTelboxesAction() {
|
|
|
header("Content-type: application/json");
|
|
|
|
|
|
- Lib::loadClass('TypespecialVariable');
|
|
|
$typeSpecialTelboxes = TypespecialVariable::getInstance(-1, '__TELBOXES');
|
|
|
|
|
|
$query = V::get('q', '', $_REQUEST);
|