Browse Source

Closes #237 Add options to show # of merged tickets in ticket table

merge-requests/2/head
Mike Koch 7 years ago
parent
commit
7a9e20557b
  1. 30
      admin/admin_settings.php
  2. 6
      admin/admin_settings_save.php
  3. 3
      inc/print_tickets.inc.php
  4. 19
      inc/ticket_list.inc.php
  5. 6
      js/modsForHesk-javascript.js
  6. 5
      language/en/text.php
  7. 5
      modsForHesk_settings.inc.php

30
admin/admin_settings.php

@ -2049,8 +2049,8 @@ if ( defined('HESK_DEMO') )
<!-- Ticket List Tab -->
<div class="tab-pane fade in" id="ticket-list">
<div class="form-group">
<label for="s_open_only" class="col-sm-3 control-label"><?php echo $hesklang['fitl']; ?> <a href="Javascript:void(0)" onclick="Javascript:hesk_window('<?php echo $help_folder; ?>ticket_list.html#1','400','500')"><i class="fa fa-question-circle settingsquestionmark"></i></a></label>
<div class="col-sm-9">
<label for="s_open_only" class="col-sm-4 control-label"><?php echo $hesklang['fitl']; ?> <a href="Javascript:void(0)" onclick="Javascript:hesk_window('<?php echo $help_folder; ?>ticket_list.html#1','400','500')"><i class="fa fa-question-circle settingsquestionmark"></i></a></label>
<div class="col-sm-8">
<?php
// List available fields
foreach ($hesk_settings['possible_ticket_list'] as $key => $title)
@ -2064,10 +2064,28 @@ if ( defined('HESK_DEMO') )
?>
</div>
</div>
<div class="form-group">
<label for="show_number_merged" class="col-sm-4 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['show_number_merged']; ?>
<i class="fa fa-question-circle settingsquestionmark" data-toggle="popover"
title="<?php echo $hesklang['show_number_merged']; ?>"
data-content="<?php echo $hesklang['show_number_merged_help']; ?>"></i>
</label>
<div class="col-sm-8">
<div class="checkbox">
<label>
<input type="checkbox" name="show_number_merged" <?php if ($modsForHesk_settings['show_number_merged']) {echo 'checked';} ?>> <?php echo $hesklang['show_number_merged_descr']; ?>
</label>
</div>
</div>
</div>
<div class="blankSpace"></div>
<div class="form-group">
<label for="s_submittedformat" class="col-sm-3 control-label"><?php echo $hesklang['sdf']; ?> <a href="Javascript:void(0)" onclick="Javascript:hesk_window('<?php echo $help_folder; ?>ticket_list.html#2','400','500')"><i class="fa fa-question-circle settingsquestionmark"></i></a></label>
<div class="col-sm-9 form-inline">
<label for="s_submittedformat" class="col-sm-4 control-label"><?php echo $hesklang['sdf']; ?> <a href="Javascript:void(0)" onclick="Javascript:hesk_window('<?php echo $help_folder; ?>ticket_list.html#2','400','500')"><i class="fa fa-question-circle settingsquestionmark"></i></a></label>
<div class="col-sm-8 form-inline">
<?php
$off = $hesk_settings['new_top'] ? '' : 'checked="checked"';
echo '
@ -2078,8 +2096,8 @@ if ( defined('HESK_DEMO') )
</div>
</div>
<div class="form-group">
<label for="s_updatedformat" class="col-sm-3 control-label"><?php echo $hesklang['lcf']; ?> <a href="Javascript:void(0)" onclick="Javascript:hesk_window('<?php echo $help_folder; ?>ticket_list.html#2','400','500')"><i class="fa fa-question-circle settingsquestionmark"></i></a></label>
<div class="col-sm-9 form-inline">
<label for="s_updatedformat" class="col-sm-4 control-label"><?php echo $hesklang['lcf']; ?> <a href="Javascript:void(0)" onclick="Javascript:hesk_window('<?php echo $help_folder; ?>ticket_list.html#2','400','500')"><i class="fa fa-question-circle settingsquestionmark"></i></a></label>
<div class="col-sm-8 form-inline">
<?php
echo '

6
admin/admin_settings_save.php

@ -505,6 +505,7 @@ $set['html_emails'] = empty($_POST['html_emails']) ? 0 : 1;
$set['use_bootstrap_theme'] = empty($_POST['use_bootstrap_theme']) ? 0 : 1;
$set['new_kb_article_visibility'] = hesk_checkMinMax( intval( hesk_POST('new_kb_article_visibility') ) , 0, 2, 2);
$set['mfh_attachments'] = empty($_POST['email_attachments']) ? 0 : 1;
$set['show_number_merged'] = empty($_POST['show_number_merged']) ? 0 : 1;
if ($set['customer-email-verification-required'])
{
@ -564,7 +565,10 @@ $modsForHesk_settings[\'use_bootstrap_theme\'] = '.$set['use_bootstrap_theme'].'
$modsForHesk_settings[\'new_kb_article_visibility\'] = '.$set['new_kb_article_visibility'].';
//-- Setting for adding attachments to email messages. Either 0 for default-HESK behavior, or 1 to send as attachments
$modsForHesk_settings[\'attachments\'] = '.$set['mfh_attachments'].';';
$modsForHesk_settings[\'attachments\'] = '.$set['mfh_attachments'].';
//-- Setting for showing number of merged tickets in the ticket search screen. 0 = Disable, 1 = Enable
$modsForHesk_settings[\'show_number_merged\'] = '.$set['show_number_merged'].';';
// Write the file
if ( ! file_put_contents(HESK_PATH . 'modsForHesk_settings.inc.php', $modsForHesk_file_content) )

3
inc/print_tickets.inc.php

@ -60,7 +60,8 @@ LEFT(`message`, 400) AS `message`,
`lastreplier`,
`replierid`,
`archive`,
`locked`
`locked`,
`merged`
";
foreach ($hesk_settings['custom_fields'] as $k=>$v)

19
inc/ticket_list.inc.php

@ -321,7 +321,24 @@ if ($total > 0)
// Print tracking ID and link it to the ticket page
if ( hesk_show_column('trackid') )
{
echo '<td class="'.$color.'" style="text-align:left; white-space:nowrap;"><a href="admin_ticket.php?track='.$ticket['trackid'].'&amp;Refresh='.$random.'">'.$ticket['trackid'].'</a></td>';
echo '<td class="'.$color.'" style="text-align:left; white-space:nowrap;">
<a href="admin_ticket.php?track='.$ticket['trackid'].'&amp;Refresh='.$random.'">'.$ticket['trackid'].'</a>';
if ($modsForHesk_settings['show_number_merged'] && $ticket['merged'] != '') {
$tooltipMarkup = $hesklang['merged_tickets'];
$mergedIds = explode('#', $ticket['merged']);
$mergedTickets = '';
$numberOfTickets = 0;
foreach ($mergedIds as $mergeId) {
if ($mergeId != '') {
$numberOfTickets++;
$mergedTickets .= '<li>' . $mergeId . '</li>';
}
}
$tooltipMarkup .= '<ul>'.$mergedTickets.'</ul>';
$output = sprintf($hesklang['x_merged'], $numberOfTickets);
echo '&nbsp;&nbsp;<span data-toggle="htmlpopover-onclick" data-content="'.$tooltipMarkup.'" style="cursor: pointer;color: #666">'.$output.'</span>';
}
echo '</td>';
}
// Print date submitted

6
js/modsForHesk-javascript.js

@ -19,6 +19,12 @@ var loadJquery = function()
html: 'true'
});
//-- Activate HTML on-click popovers
$('[data-toggle="htmlpopover-onclick"]').popover({
container: 'body',
html: 'true'
});
//-- Activate jQuery's date picker
$(function() {
$('.datepicker').datepicker({

5
language/en/text.php

@ -36,6 +36,11 @@ $hesklang['language_key'] = 'Language Key';
$hesklang['language_key_description'] = 'This is the language file \'key\' that contains the text you want to display';
$hesklang['can_man_ticket_statuses'] = 'Can manage ticket statuses';
$hesklang['key_required'] = 'Keys are required for all statuses';
$hesklang['x_merged'] = '(+%s merged)'; // %s number of tickets merged
$hesklang['merged_tickets'] = 'Merged tickets: ';
$hesklang['show_number_merged'] = 'Show number of tickets merged';
$hesklang['show_number_merged_descr'] = 'Show number of tickets merged next to Tracking ID';
$hesklang['show_number_merged_help'] = 'If enabled, the user will be able to see which tickets were merged into the other on the ticket serarch screen.';
// 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 (:)

5
modsForHesk_settings.inc.php

@ -40,4 +40,7 @@ $modsForHesk_settings['use_bootstrap_theme'] = 1;
$modsForHesk_settings['new_kb_article_visibility'] = 0;
//-- Setting for adding attachments to email messages. Either 0 for default-HESK behavior, or 1 to send as attachments
$modsForHesk_settings['attachments'] = 0;
$modsForHesk_settings['attachments'] = 0;
//-- Setting for showing number of merged tickets in the ticket search screen. 0 = Disable, 1 = Enable
$modsForHesk_settings['show_number_merged'] = 1;
Loading…
Cancel
Save