Browse Source

#196 Add icon for designating permission template as admin template

merge-requests/2/head
Mike Koch 7 years ago
parent
commit
8328d206fc
  1. 89
      admin/manage_permission_templates.php
  2. 4
      css/hesk_newStyle.php
  3. 4
      css/hesk_newStyleRTL.php
  4. 3
      language/en/text.php

89
admin/manage_permission_templates.php

@ -104,6 +104,13 @@ else {return false;}
<a href="#" data-toggle="modal" data-target="#modal-template-<?php echo $row['id'] ?>">
<i class="fa fa-pencil icon-link" data-toggle="tooltip"
title="<?php echo $hesklang['view_permissions_for_this_template'] ?>"></i></a>
<?php if ($row['heskprivileges'] == 'ALL' && $row['categories'] == 'ALL'): ?>
<i class="fa fa-star icon-link orange" data-toggle="tooltip"
title="<?php echo $hesklang['template_has_admin_privileges']; ?>"></i>
<?php else: ?>
<i class="fa fa-star-o icon-link gray" data-toggle="tooltip"
title="<?php echo $hesklang['template_has_no_admin_privileges']; ?>"></i>
<?php endif; ?>
<i class="fa fa-times icon-link red" data-toggle="tooltip"
title="<?php echo $hesklang['delete']; ?>"></i>
</td>
@ -133,38 +140,70 @@ function getNumberOfUsersWithPermissionGroup($templateId) {
function createModal($template, $features, $categories) {
global $hesklang;
$showNotice = true;
$disabled = 'checked="checked" disabled';
$enabledFeatures = array();
$enabledCategories = array();
if ($template['heskprivileges'] != 'ALL') {
$showNotice = false;
$disabled = '';
$enabledFeatures = explode(',', $template['heskprivileges']);
$enabledCategories = explode(',', $template['categories']);
}
?>
<div class="modal fade" id="modal-template-<?php echo $template['id'] ?>" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title"><?php echo sprintf($hesklang['permissions_for_template'], $template['name']); ?></h4>
</div>
<div class="modal-body">
<div class="row">
<div class="col-md-6 col-sm-12">
<h4><?php echo $hesklang['menu_cat']; ?></h4>
<div class="footerWithBorder blankSpace"></div>
<?php foreach ($categories as $category): ?>
<p><?php echo $category['name']; ?></p>
<?php endforeach; ?>
</div>
<div class="col-md-6 col-sm-12">
<h4><?php echo $hesklang['allow_feat']; ?></h4>
<div class="footerWithBorder blankSpace"></div>
<?php foreach ($features as $feature): ?>
<p><?php echo $feature; ?></p>
<?php endforeach; ?>
<form action="manage_permission_templates.php" role="form">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title"><?php echo sprintf($hesklang['permissions_for_template'], $template['name']); ?></h4>
</div>
<div class="modal-body">
<div class="row">
<?php if ($showNotice): ?>
<div class="alert alert-info">
<i class="fa fa-info-circle"></i> <?php echo $hesklang['template_is_admin_cannot_change']; ?>
</div>
<?php endif; ?>
<div class="col-md-6 col-sm-12">
<h4><?php echo $hesklang['menu_cat']; ?></h4>
<div class="footerWithBorder blankSpace"></div>
<?php foreach ($categories as $category): ?>
<div class="form-group">
<div class="checkbox">
<label>
<input type="checkbox" name="cat-<?php echo $category['id']; ?>" <?php echo $disabled; ?>>
<?php echo $category['name']; ?>
</label>
</div>
</div>
<?php endforeach; ?>
</div>
<div class="col-md-6 col-sm-12">
<h4><?php echo $hesklang['allow_feat']; ?></h4>
<div class="footerWithBorder blankSpace"></div>
<?php foreach ($features as $feature): ?>
<div class="form-group">
<div class="checkbox">
<label>
<input type="checkbox" name="<?php echo $feature; ?>" <?php echo $disabled; ?>>
<?php echo $hesklang[$feature]; ?>
</label>
</div>
</div>
<?php endforeach; ?>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<div class="btn-group">
<button type="button" class="btn btn-primary"><?php echo $hesklang['save_changes']; ?></button>
<button type="button" class="btn btn-default" data-dismiss="modal"><?php echo $hesklang['close_modal']; ?></button>
<div class="modal-footer">
<div class="btn-group">
<input type="submit" class="btn btn-primary" value="<?php echo $hesklang['save_changes']; ?>">
<button type="button" class="btn btn-default" data-dismiss="modal"><?php echo $hesklang['close_modal']; ?></button>
</div>
</div>
</div>
</form>
</div>
</div>
</div>

4
css/hesk_newStyle.php

@ -395,4 +395,8 @@ button.dropdown-submit {
.red {
color: #FF0000;
}
.gray {
color: gray;
}

4
css/hesk_newStyleRTL.php

@ -389,4 +389,8 @@ button.dropdown-submit {
.red {
color: #FF0000;
}
.gray {
color: gray;
}

3
language/en/text.php

@ -76,6 +76,9 @@ $hesklang['actions'] = 'Actions';
$hesklang['view_permissions_for_this_template'] = 'View/edit permissions for this template';
$hesklang['permission'] = 'Permission';
$hesklang['permissions_for_template'] = 'Permissions for template <code>%s</code>'; // %s template name
$hesklang['template_has_admin_privileges'] = 'Permission template has admin privileges. Click to set as non-admin';
$hesklang['template_has_no_admin_privileges'] = 'Permission template does not have admin privileges. Click to set as admin';
$hesklang['template_is_admin_cannot_change'] = 'The permission group currently has admin privileges, so you cannot set specific permissions here.';
// ADDED OR MODIFIED IN Mods for HESK 2.2.1
$hesklang['popart_no_colon']='Top Knowledgebase Articles'; // same as $hesklang['popart'] but without a colon (:)

Loading…
Cancel
Save