Browse Source

Closes #274 Add setting for setting category sort

merge-requests/2/head
Mike Koch 7 years ago
parent
commit
7afb51164a
  1. 21
      admin/admin_settings.php
  2. 6
      admin/admin_settings_save.php
  3. 7
      language/en/text.php

21
admin/admin_settings.php

@ -839,6 +839,27 @@ if ( defined('HESK_DEMO') )
?>
</div>
</div>
<div class="form-group">
<label for="category_order_column" class="col-sm-6 control-label">
<span class="label label-primary"
data-toggle="tooltip"
title="<?php echo $hesklang['added_in_mods_for_hesk']; ?>"><?php echo $hesklang['mods_for_hesk_acronym']; ?></span>
<?php echo $hesklang['category_sort']; ?>
<i class="fa fa-question-circle settingsquestionmark" data-toggle="htmlpopover"
title="<?php echo $hesklang['category_sort']; ?>"
data-content="<?php echo $hesklang['category_sort_help']; ?>"></i>
</label>
<div class="col-sm-6">
<?php
$on = $modsForHesk_settings['category_order_column'] == 'name' ? 'checked' : '';
$off = $modsForHesk_settings['category_order_column'] == 'name' ? '' : 'checked';
echo '
<div class="radio"><label><input type="radio" name="category_order_column" value="0" '.$off.'>'.$hesklang['sort_by_user_defined_order'].'</label></div>
<div class="radio"><label><input type="radio" name="category_order_column" value="1" '.$on.'>'.$hesklang['sort_alphabetically'].'</label></div>
';
?>
</div>
</div>
</div>
<!-- Second column -->
<div class="col-md-6">

6
admin/admin_settings_save.php

@ -507,6 +507,7 @@ $set['new_kb_article_visibility'] = hesk_checkMinMax( intval( hesk_POST('new_kb_
$set['mfh_attachments'] = empty($_POST['email_attachments']) ? 0 : 1;
$set['show_number_merged'] = empty($_POST['show_number_merged']) ? 0 : 1;
$set['request_location'] = empty($_POST['request_location']) ? 0 : 1;
$set['category_order_column'] = empty($_POST['category_order_column']) ? 'cat_order' : 'name';
if ($set['customer-email-verification-required'])
{
@ -572,7 +573,10 @@ $modsForHesk_settings[\'attachments\'] = '.$set['mfh_attachments'].';
$modsForHesk_settings[\'show_number_merged\'] = '.$set['show_number_merged'].';
//-- Setting for requesting user\'s location. 0 = Disable, 1 = Enable
$modsForHesk_settings[\'request_location\'] = '.$set['request_location'].';';
$modsForHesk_settings[\'request_location\'] = '.$set['request_location'].';
//-- Column to sort categories by. Can be either \'name\' or \'cat_order\'
$modsForHesk_settings[\'category_order_column\'] = \''.$set['category_order_column'].'\';';
// Write the file
if ( ! file_put_contents(HESK_PATH . 'modsForHesk_settings.inc.php', $modsForHesk_file_content) )

7
language/en/text.php

@ -21,6 +21,13 @@ $hesklang['_COLLATE']='utf8_unicode_ci';
// This is the email break line that will be used in email piping
$hesklang['EMAIL_HR']='------ Reply above this line ------';
// ADDED OR MODIFIED IN Mods for HESK 2.4.0
$hesklang['sort_by_user_defined_order'] = 'Sort by user-defined order';
$hesklang['sort_alphabetically'] = 'Sort alphabetically';
$hesklang['category_sort'] = 'Category Sorting';
$hesklang['category_sort_help'] = 'Determines if categories shown on the manage categories page and all dropdowns are sorted by the user-defined order (default), or
sorted alphabetically.';
// ADDED OR MODIFIED IN Mods for HESK 2.3.0
$hesklang['sm_icon'] = 'Icon';
$hesklang['sm_icon_type'] = 'Icon Type';

Loading…
Cancel
Save