Browse Source

#209 Add setting for status sort to settings page

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

21
admin/admin_settings.php

@ -860,6 +860,27 @@ if ( defined('HESK_DEMO') )
?>
</div>
</div>
<div class="form-group">
<label for="statuses_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['status_sort']; ?>
<i class="fa fa-question-circle settingsquestionmark" data-toggle="htmlpopover"
title="<?php echo $hesklang['status_sort']; ?>"
data-content="<?php echo $hesklang['status_sort_help']; ?>"></i>
</label>
<div class="col-sm-6">
<?php
$on = $modsForHesk_settings['statuses_order_column'] == 'name' ? 'checked' : '';
$off = $modsForHesk_settings['statuses_order_column'] == 'name' ? '' : 'checked';
echo '
<div class="radio"><label><input type="radio" name="statuses_order_column" value="0" '.$off.'>'.$hesklang['sort_by_user_defined_order'].'</label></div>
<div class="radio"><label><input type="radio" name="statuses_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

@ -516,6 +516,7 @@ $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';
$set['statuses_order_column'] = empty($_POST['statuses_order_column']) ? 'sort' : 'name';
if ($set['customer-email-verification-required'])
{
@ -584,7 +585,10 @@ $modsForHesk_settings[\'show_number_merged\'] = '.$set['show_number_merged'].';
$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'].'\';';
$modsForHesk_settings[\'category_order_column\'] = \''.$set['category_order_column'].'\';
//-- Column to sort statuses by. Can be either \'sort\' or \'name\'
$modsForHesk_settings[\'statuses_order_column\'] = \''.$set['statuses_order_column'].'\';';
// Write the file
if ( ! file_put_contents(HESK_PATH . 'modsForHesk_settings.inc.php', $modsForHesk_file_content) )

2
language/en/text.php

@ -47,6 +47,8 @@ $hesklang['ticket_status_deleted'] = 'Ticket status deleted!';
$hesklang['confirm_delete_status_question'] = 'Delete status?';
$hesklang['confirm_delete_status'] = 'Are you sure you want to delete this status? This cannot be undone!';
$hesklang['status_sort_updated'] = 'Ticket status sort updated!';
$hesklang['status_sort'] = 'Status Sorting';
$hesklang['status_sort_help'] = 'Determines if statuses shown on the manage statuses 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';

Loading…
Cancel
Save