Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LEAF-4572 - OOH Orgchart Permission - #2587

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion LEAF-Automated-Tests
29 changes: 28 additions & 1 deletion LEAF_Nexus/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,15 @@ function customTemplate($tpl)
$privilegesArray[$key] = array_map('App\Leaf\XSSHelpers::sanitizeHTML', $privilegesArray[$key]);
}

$memberships = $oc_login->getMembership();
$isAdmin = false;
if (isset($memberships['groupID'][1]))
{
$isAdmin = true;
}

$t_form->assign('is_admin', $isAdmin);

$t_form->assign('indicatorID', (int)$_GET['indicatorID']);
$t_form->assign('UID', (int)$_GET['UID']);
$t_form->assign('indicator', $indicatorArray);
Expand All @@ -382,7 +391,7 @@ function customTemplate($tpl)
break;
case 'view_group_permissions':
$group = new Orgchart\Group($oc_db, $oc_login);

$t_form = new \Smarty;
$t_form->left_delimiter = '<!--{';
$t_form->right_delimiter = '}-->';
Expand All @@ -401,6 +410,15 @@ function customTemplate($tpl)
'css/view_group.css', ));

$groupID = isset($_GET['groupID']) ? (int)$_GET['groupID'] : 0;

$memberships = $oc_login->getMembership();
$isAdmin = false;
if (isset($memberships['groupID'][1]))
{
$isAdmin = true;
}

$t_form->assign('is_admin', $isAdmin);
$t_form->assign('groupID', $groupID);
$t_form->assign('groupTitle', $group->getTitle($groupID));
$t_form->assign('permissions', $group->getPrivileges($groupID));
Expand Down Expand Up @@ -431,6 +449,15 @@ function customTemplate($tpl)
'css/view_group.css', ));

$positionID = isset($_GET['positionID']) ? (int)$_GET['positionID'] : 0;

$memberships = $oc_login->getMembership();
$isAdmin = false;
if (isset($memberships['groupID'][1]))
{
$isAdmin = true;
}

$t_form->assign('is_admin', $isAdmin);
$t_form->assign('positionID', $positionID);
$t_form->assign('positionTitle', $position->getTitle($positionID));
$t_form->assign('permissions', $position->getPrivileges($positionID));
Expand Down
2 changes: 1 addition & 1 deletion LEAF_Nexus/templates/view_group_permissions.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<td style="width: 100px" title="This allows permissions to be granted to others">Grant</td>
</tr>
<!--{foreach from=$permissions item=permission}-->
<!--{if $permission.UID == 2 || $permission.UID == 1}-->
<!--{if $is_admin == FALSE && ($permission.UID == 2 || $permission.UID == 1)}-->
<tr style="background-color: <!--{cycle values='#e0e0e0,#c4c4c4'}-->; opacity: 50%;">
<td id="<!--{$permission.categoryID|strip_tags}-->_<!--{$permission.UID|strip_tags}-->" style="font-size: 14px; font-weight: bold"><img src="images/largespinner.gif" alt="" /> Loading <!--{$permission.categoryID|strip_tags}-->...</td>
<td id="<!--{$permission.categoryID|strip_tags}-->_<!--{$permission.UID|strip_tags}-->_read" style="font-size: 14px">
Expand Down
4 changes: 3 additions & 1 deletion LEAF_Nexus/templates/view_permissions.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@
<td style="width: 100px" title="This allows permissions to be granted to others">Grant</td>
</tr>
<!--{foreach from=$permissions item=permission}-->
<!--{if $permission.UID == 2 || $permission.UID == 1}-->

<!--{if $is_admin == FALSE && ($permission.UID == 2 || $permission.UID == 1)}-->
<tr style="background-color: <!--{cycle values='#e0e0e0,#c4c4c4'}-->; opacity: 50%;">
<td id="<!--{$permission.categoryID|strip_tags}-->_<!--{$permission.UID|strip_tags}-->" style="font-size: 14px; font-weight: bold"><img src="images/largespinner.gif" alt="" /> Loading <!--{$permission.categoryID|strip_tags}-->...</td>
<td id="<!--{$permission.categoryID|strip_tags}-->_<!--{$permission.UID|strip_tags}-->_read" style="font-size: 14px">
Expand All @@ -49,6 +50,7 @@
</td>
<td id="<!--{$permission.categoryID|strip_tags}-->_<!--{$permission.UID|strip_tags}-->_write" style="font-size: 14px">
<div class="buttonNorm">

<!--{if $permission.write == 1}-->
<img src="dynicons/?img=gnome-emblem-default.svg&amp;w=32" alt="" /> Yes
<!--{else}-->
Expand Down
2 changes: 1 addition & 1 deletion LEAF_Nexus/templates/view_position_permissions.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<td style="width: 100px" title="This allows permissions to be granted to others">Grant</td>
</tr>
<!--{foreach from=$permissions item=permission}-->
<!--{if $permission.UID == 2 || $permission.UID == 1}-->
<!--{if $is_admin == FALSE && ($permission.UID == 2 || $permission.UID == 1)}-->
<tr style="background-color: <!--{cycle values='#e0e0e0,#c4c4c4'}-->; opacity: 50%;">
<td id="<!--{$permission.categoryID|strip_tags}-->_<!--{$permission.UID|strip_tags}-->" style="font-size: 14px; font-weight: bold"><img src="images/largespinner.gif" alt="" /> Loading <!--{$permission.categoryID|strip_tags}-->...</td>
<td id="<!--{$permission.categoryID|strip_tags}-->_<!--{$permission.UID|strip_tags}-->_read" style="font-size: 14px">
Expand Down
Loading