Skip to content

Commit

Permalink
Department admin: allow handling of user requests in relevant departm…
Browse files Browse the repository at this point in the history
…ents

--HG--
branch : 3.12
  • Loading branch information
adia committed Oct 22, 2021
1 parent d6a4903 commit 55b7f3f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
10 changes: 5 additions & 5 deletions modules/admin/listreq.php
Expand Up @@ -19,7 +19,7 @@
* e-mail: info@openeclass.org
* ======================================================================== */

$require_usermanage_user = TRUE;
$require_usermanage_user = true;

require_once '../../include/baseTheme.php';
require_once 'include/sendMail.inc.php';
Expand Down Expand Up @@ -54,8 +54,8 @@

$head_content .= "<script type='text/javascript'>
$(document).ready(function() {
$('#requests_table').DataTable ({
'columns': [ $columns ],
$('#requests_table').DataTable ({
'columns': [ $columns ],
'sPaginationType': 'full_numbers',
'bAutoWidth': true,
'searchDelay': 1000,
Expand Down Expand Up @@ -109,8 +109,8 @@
// department admin additional query where clause
$depqryadd = '';
if (isDepartmentAdmin()) {
$deps = $user->getDepartmentIds($uid);
$depqryadd = ' AND faculty_id IN (' . implode(', ', $deps) . ')';
$subtrees = $tree->buildSubtrees($user->getAdminDepartmentIds($uid));
$depqryadd = ' AND faculty_id IN (' . implode(', ', $subtrees) . ')';
}

// Display Actions Toolbar
Expand Down
5 changes: 2 additions & 3 deletions modules/admin/newuseradmin.php
Expand Up @@ -339,12 +339,11 @@
'params' => 'name="department"',
'defaults' => $depid,
'tree' => null,
'where' => "AND node.allow_user = true",
'multiple' => false);
if (isDepartmentAdmin()) {
$nodePickerParams['allowables'] = $user->getDepartmentIds($uid);
$nodePickerParams['allowables'] = $user->getAdminDepartmentIds($uid);
}
list($tree_js, $tree_html) = $tree->buildNodePicker($nodePickerParams);
list($tree_js, $tree_html) = $tree->buildUserNodePicker($nodePickerParams);
$head_content .= $tree_js;

if ($eclass_method_unique) {
Expand Down

0 comments on commit 55b7f3f

Please sign in to comment.