Browse Source

#208 Add permission for setting manager

merge-requests/2/head
Mike Koch 7 years ago
parent
commit
b4315dc62a
  1. 25
      admin/manage_categories.php
  2. 1
      admin/manage_users.php
  3. 2
      language/en/text.php

25
admin/manage_categories.php

@ -713,20 +713,29 @@ function toggle_type()
function output_user_dropdown($catId, $selectId, $userArray) {
global $hesklang;
$dropdownMarkup = '<select class="form-control input-sm" name="managerid">
<option value="0">'.$hesklang['select'].'</option>';
foreach ($userArray as $user) {
$select = $selectId == $user['id'] ? 'selected' : '';
$dropdownMarkup .= '<option value="'.$user['id'].'" '.$select.'>'.$user['name'].'</option>';
}
$dropdownMarkup .= '</select>';
if (!hesk_checkPermission('can_set_manager', 0)) {
foreach ($userArray as $user) {
if ($user['id'] == $selectId) {
return '<p>'.$user['name'].'</p>';
}
}
return '<p>'.$hesklang['no_manager'].'</p>';
} else {
$dropdownMarkup = '<select class="form-control input-sm" name="managerid">
<option value="0">'.$hesklang['no_manager'].'</option>';
foreach ($userArray as $user) {
$select = $selectId == $user['id'] ? 'selected' : '';
$dropdownMarkup .= '<option value="'.$user['id'].'" '.$select.'>'.$user['name'].'</option>';
}
$dropdownMarkup .= '</select>';
return '<form role="form" id="manager_form_'.$catId.'" action="manage_categories.php" method="post" class="form-inline" onchange="document.getElementById(\'manager_form_'.$catId.'\').submit();">
return '<form role="form" id="manager_form_'.$catId.'" action="manage_categories.php" method="post" class="form-inline" onchange="document.getElementById(\'manager_form_'.$catId.'\').submit();">
<input type="hidden" name="a" value="manager">
<input type="hidden" name="catid" value="'.$catId.'">
'.$dropdownMarkup.'
</form>';
}
}
function change_manager() {

1
admin/manage_users.php

@ -79,6 +79,7 @@ $hesk_settings['features'] = array(
'can_service_msg', /* User can manage service messages shown in customer interface */
'can_man_email_tpl', /* User can manage email templates */
'can_man_ticket_statuses', /* User can manage ticket statuses */
'can_set_manager', /* User can set category managers */
);
/* Set default values */

2
language/en/text.php

@ -68,6 +68,8 @@ $hesklang['unable_to_determine_location'] = 'Unable to determine your location,
$hesklang['save_to_see_updated_address'] = 'Save the new location to see the updated address';
$hesklang['manager'] = 'Manager';
$hesklang['manager_updated'] = 'Category manager has been updated.';
$hesklang['can_set_manager'] = 'Can set category managers';
$hesklang['no_manager'] = 'No manager';
// 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