View ticket and edit post on admin-side restyled

merge-requests/27/head
Mike Koch 8 years ago
parent 03765bb798
commit 8b14ef19cd

@ -1133,7 +1133,12 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
<?php } ?>
</div>
</div>
<?php endwhile; endif; ?>
<?php
endwhile;
else:
?>
<?php echo $hesklang['no_notes_for_this_ticket']; ?>
<?php endif; ?>
</div>
<?php if ($can_reply): ?>
<div class="box-footer">
@ -1189,11 +1194,26 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
if ($can_reply && $hesk_settings['reply_top'] == 1) {
hesk_printReplyForm();
}
/* Do we need or have any canned responses? */
$can_options = hesk_printCanned();
hesk_printTicketReplies();
echo '<br>';
/* Reply form on bottom? */
if ($can_reply && !$hesk_settings['reply_top']) {
hesk_printReplyForm();
}
/* Display ticket history */
if (strlen($ticket['history'])) {
?>
<div class="box">
<div class="box-header with-border">
<h1 class="box-title">
<?php echo $hesklang['message']; ?>
<?php echo $hesklang['thist']; ?>
</h1>
<div class="box-tools pull-right">
<button type="button" class="btn btn-box-tool" data-widget="collapse">
@ -1202,139 +1222,12 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
</div>
</div>
<div class="box-body">
<?php
/* Do we need or have any canned responses? */
$can_options = hesk_printCanned();
?>
<div class="row">
<div class="col-md-3 text-right">
<strong><?php echo $hesklang['m_sub']; ?></strong>
</div>
<div class="col-md-9">
<?php echo $ticket['subject']; ?>
<?php echo $ticket['history']; ?>
</div>
</div>
<?php foreach ($hesk_settings['custom_fields'] as $k => $v) {
if ($v['use'] && $v['place'] == 0) {
if ($modsForHesk_settings['custom_field_setting']) {
$v['name'] = $hesklang[$v['name']];
}
echo '<div class="row">';
echo '<div class="col-md-3 text-right"><strong>' . $v['name'] . ':</strong></div>';
if ($v['type'] == 'date' && !empty($ticket[$k])) {
$dt = date('Y-m-d h:i:s', $ticket[$k]);
echo '<div class="col-md-9">' . hesk_dateToString($dt, 0) . '</div>';
} else {
echo '<div class="col-md-9">' . $ticket[$k] . '</div>';
}
echo '</div>';
}
}
?>
<div class="row push-down-10">
<div class="col-md-3 text-right">
<strong><?php echo $hesklang['message_colon']; ?></strong>
</div>
<div class="col-md-9">
<?php if ($ticket['html']) {
echo hesk_html_entity_decode($ticket['message']);
} else {
echo $ticket['message'];
} ?>
</div>
</div>
<?php
foreach ($hesk_settings['custom_fields'] as $k => $v) {
if ($v['use'] && $v['place']) {
if ($modsForHesk_settings['custom_field_setting']) {
$v['name'] = $hesklang[$v['name']];
}
echo '<div class="row">';
echo '<div class="col-md-3 text-right"><strong>' . $v['name'] . ':</strong></div>';
if ($v['type'] == 'date' && !empty($ticket[$k])) {
$dt = date('Y-m-d h:i:s', $ticket[$k]);
echo '<div class="col-md-9">' . hesk_dateToString($dt, 0) . '</div>';
} else {
echo '<div class="col-md-9">' . $ticket[$k] . '</div>';
}
echo '</div>';
}
}
?>
</div>
<?php if (($hesk_settings['attachments']['use'] && strlen($ticket['attachments']))
|| ($hesk_settings['kb_enable'] && $hesk_settings['kb_recommendanswers'] && strlen($ticket['articles']))): ?>
<div class="box-footer">
<?php
/* Attachments */
mfh_listAttachments($ticket['attachments'], 0, true);
// Show suggested KB articles
if ($hesk_settings['kb_enable'] && $hesk_settings['kb_recommendanswers'] && strlen($ticket['articles'])) {
$suggested = array();
$suggested_list = '';
// Get article info from the database
$articles = hesk_dbQuery("SELECT `id`,`subject` FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "kb_articles` WHERE `id` IN (" . preg_replace('/[^0-9\,]/', '', $ticket['articles']) . ")");
while ($article = hesk_dbFetchAssoc($articles)) {
$suggested[$article['id']] = '<a href="../knowledgebase.php?article=' . $article['id'] . '">' . $article['subject'] . '</a><br />';
}
// Loop through the IDs to preserve the order they were suggested in
$articles = explode(',', $ticket['articles']);
foreach ($articles as $article) {
if (isset($suggested[$article])) {
$suggested_list .= $suggested[$article];
}
}
// Finally print suggested articles
if (strlen($suggested_list)) {
$suggested_list = '<hr /><i>' . $hesklang['taws'] . '</i><br />' . $suggested_list . '&nbsp;';
echo $_SESSION['show_suggested'] ? $suggested_list : '<a href="Javascript:void(0)" onclick="Javascript:hesk_toggleLayerDisplay(\'suggested_articles\')">' . $hesklang['sska'] . '</a><span id="suggested_articles" style="display:none">' . $suggested_list . '</span>';
}
}
?>
</div>
<?php endif; ?>
<div class="box-footer">
<?php echo hesk_getAdminButtonsInTicket(0, $i); ?>
</div>
</div>
</section>
<div class="row" style="padding: 20px">
<div class="col-md-10">
<?php
if ($hesk_settings['new_top']) {
hesk_printTicketReplies() ? 0 : 1;
}
/* Make sure original message is in correct color if newest are on top */
$color = 'class="ticketMessageContainer"';
?>
<?php
if (!$hesk_settings['new_top']) {
hesk_printTicketReplies();
}
?>
<?php
/* Reply form on bottom? */
if ($can_reply && !$hesk_settings['reply_top']) {
hesk_printReplyForm();
}
/* Display ticket history */
if (strlen($ticket['history'])) {
?>
<h3><?php echo $hesklang['thist']; ?></h3>
<div class="footerWithBorder blankSpace"></div>
<ul><?php echo $ticket['history']; ?></ul>
<?php }
?>
</div>
</div>
</section>
<div style="display: none">
<p id="lang_ticket_due_date_updated"><?php echo $hesklang['ticket_due_date_updated']; ?></p>
<p id="lang_none"><?php echo $hesklang['none']; ?></p>
@ -1660,24 +1553,137 @@ function print_form()
exit();
} // End print_form()
function mfh_print_message() {
global $ticket, $hesklang, $hesk_settings, $modsForHesk_settings;
?>
<li><i class="fa fa-comment bg-red" data-toggle="tooltip" title="<?php echo $hesklang['original_message']; ?>"></i>
<div class="timeline-item">
<span class="time"><i class="fa fa-clock-o"></i> <?php echo $ticket['dt']; ?></span>
<h3 class="timeline-header"><?php echo $ticket['name']; ?></h3>
<div class="timeline-body">
<div class="row">
<div class="col-md-3 text-right">
<strong><?php echo $hesklang['m_sub']; ?></strong>
</div>
<div class="col-md-9">
<?php echo $ticket['subject']; ?>
</div>
</div>
<?php foreach ($hesk_settings['custom_fields'] as $k => $v) {
if ($v['use'] && $v['place'] == 0) {
if ($modsForHesk_settings['custom_field_setting']) {
$v['name'] = $hesklang[$v['name']];
}
echo '<div class="row">';
echo '<div class="col-md-3 text-right"><strong>' . $v['name'] . ':</strong></div>';
if ($v['type'] == 'date' && !empty($ticket[$k])) {
$dt = hesk_date($ticket[$k], false, false);
echo '<div class="col-md-9">' . hesk_dateToString($dt, 0) . '</div>';
} else {
echo '<div class="col-md-9">' . $ticket[$k] . '</div>';
}
echo '</div>';
}
}
?>
<div class="row push-down-10">
<div class="col-md-3 text-right">
<strong><?php echo $hesklang['message_colon']; ?></strong>
</div>
<div class="col-md-9">
<?php if ($ticket['html']) {
echo hesk_html_entity_decode($ticket['message']);
} else {
echo $ticket['message'];
} ?>
</div>
</div>
<?php
foreach ($hesk_settings['custom_fields'] as $k => $v) {
if ($v['use'] && $v['place']) {
if ($modsForHesk_settings['custom_field_setting']) {
$v['name'] = $hesklang[$v['name']];
}
echo '<div class="row">';
echo '<div class="col-md-3 text-right"><strong>' . $v['name'] . ':</strong></div>';
if ($v['type'] == 'date' && !empty($ticket[$k])) {
$dt = hesk_date($ticket[$k], false, false);
echo '<div class="col-md-9">' . hesk_dateToString($dt, 0) . '</div>';
} else {
echo '<div class="col-md-9">' . $ticket[$k] . '</div>';
}
echo '</div>';
}
}
?>
</div>
<?php if (($hesk_settings['attachments']['use'] && strlen($ticket['attachments']))
|| ($hesk_settings['kb_enable'] && $hesk_settings['kb_recommendanswers'] && strlen($ticket['articles']))): ?>
<div class="timeline-footer">
<?php
/* Attachments */
mfh_listAttachments($ticket['attachments'], 0, true);
// Show suggested KB articles
if ($hesk_settings['kb_enable'] && $hesk_settings['kb_recommendanswers'] && strlen($ticket['articles'])) {
$suggested = array();
$suggested_list = '';
// Get article info from the database
$articles = hesk_dbQuery("SELECT `id`,`subject` FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "kb_articles` WHERE `id` IN (" . preg_replace('/[^0-9\,]/', '', $ticket['articles']) . ")");
while ($article = hesk_dbFetchAssoc($articles)) {
$suggested[$article['id']] = '<a href="../knowledgebase.php?article=' . $article['id'] . '">' . $article['subject'] . '</a><br />';
}
// Loop through the IDs to preserve the order they were suggested in
$articles = explode(',', $ticket['articles']);
foreach ($articles as $article) {
if (isset($suggested[$article])) {
$suggested_list .= $suggested[$article];
}
}
// Finally print suggested articles
if (strlen($suggested_list)) {
$suggested_list = '<hr /><i>' . $hesklang['taws'] . '</i><br />' . $suggested_list . '&nbsp;';
echo $_SESSION['show_suggested'] ? $suggested_list : '<a href="Javascript:void(0)" onclick="Javascript:hesk_toggleLayerDisplay(\'suggested_articles\')">' . $hesklang['sska'] . '</a><span id="suggested_articles" style="display:none">' . $suggested_list . '</span>';
}
}
?>
</div>
<?php endif; ?>
<div class="timeline-footer">
<div class="row">
<div class="col-md-12 text-right">
<?php echo hesk_getAdminButtonsInTicket(0); ?>
</div>
</div>
</div>
</div>
</li>
<?php
}
function hesk_printTicketReplies()
{
global $hesklang, $hesk_settings, $result, $reply, $isManager, $modsForHesk_settings;
global $hesklang, $hesk_settings, $result, $reply;
if ($reply === false) {
return;
echo '<ul class="timeline">';
if (!$hesk_settings['new_top']) {
mfh_print_message();
} else {
echo '<li class="today-top"><i class="fa fa-clock-o bg-gray" data-toggle="tooltip" title="' . $hesklang['timeline_today'] . '"></i></li>';
}
echo '<ul class="timeline">';
while ($reply = hesk_dbFetchAssoc($result)) {
$reply['dt'] = hesk_date($reply['dt'], true);
?>
<li>
<?php if ($reply['staffid']): ?>
<i class="fa fa-reply bg-orange"></i>
<i class="fa fa-reply bg-orange" data-toggle="tooltip" title="<?php echo $hesklang['reply_by_staff']; ?>"></i>
<?php else: ?>
<i class="fa fa-share bg-blue"></i>
<i class="fa fa-share bg-blue" data-toggle="tooltip" title="<?php echo $hesklang['reply_by_customer']; ?>"></i>
<?php endif; ?>
<div class="timeline-item">
<span class="time"><i class="fa fa-clock-o"></i> <?php echo $reply['dt']; ?></span>
@ -1724,7 +1730,12 @@ function hesk_printTicketReplies()
</li>
<?php
}
echo '<li><i class="fa fa-clock-o bg-gray"></i></li>';
if ($hesk_settings['new_top']) {
mfh_print_message();
} else {
echo '<li><i class="fa fa-clock-o bg-gray" data-toggle="tooltip" title="' . $hesklang['timeline_today'] . '"></i></li>';
}
echo '</ul>';
return;

@ -36,6 +36,7 @@ define('WYSIWYG', 1);
require(HESK_PATH . 'hesk_settings.inc.php');
require(HESK_PATH . 'inc/common.inc.php');
require(HESK_PATH . 'inc/admin_functions.inc.php');
require(HESK_PATH . 'inc/mail_functions.inc.php');
hesk_load_database_functions();
hesk_session_start();
@ -207,12 +208,19 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
<li class="active"><?php echo $hesklang['edtt']; ?></li>
</ol>
<div class="row">
<div class="col-md-8 col-md-offset-2">
<h3><?php echo $hesklang['edtt']; ?></h3>
<div class="footerWithBorder blankSpace"></div>
<section class="content">
<div class="box">
<div class="box-header with-border">
<h1 class="box-title">
<?php echo $hesklang['edtt']; ?>
</h1>
<div class="box-tools pull-right">
<button type="button" class="btn btn-box-tool" data-widget="collapse">
<i class="fa fa-minus"></i>
</button>
</div>
</div>
<div class="box-body">
<form role="form" class="form-horizontal" method="post" action="edit_post.php" name="form1">
<?php
/* If it's not a reply edit all the fields */
@ -478,20 +486,25 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
}
?>
</div>
<div class="form-group" style="text-align: center">
<div class="form-group">
<div class="col-md-9 col-md-offset-3">
<?php
$html = $modsForHesk_settings['rich_text_for_tickets'] ? 1 : 0;
?>
<input type="hidden" name="html" value="<?php echo $html; ?>">
<input type="submit" value="<?php echo $hesklang['save_changes']; ?>" class="btn btn-default"/>
<?php if (isset($_REQUEST['isManager']) && $_REQUEST['isManager']): ?>
<input type="hidden" name="isManager" value="1">
<?php endif; ?>
<div class="btn-group">
<input type="submit" value="<?php echo $hesklang['save_changes']; ?>" class="btn btn-primary"/>
<a class="btn btn-default" href="javascript:history.go(-1)"><?php echo $hesklang['back']; ?></a>
</div>
</div>
</div>
</form>
</div>
</div>
</section>
<?php if ($modsForHesk_settings['rich_text_for_tickets']): ?>
<script type="text/javascript">
/* <![CDATA[ */

@ -118,3 +118,7 @@
.timeline-footer {
border-top: 1px solid #f4f4f4;
}
.timeline > .today-top {
margin-bottom: 60px;
}

@ -41,6 +41,11 @@ $hesklang['last_replier_colon'] = 'Last replier:';
$hesklang['click_to_edit'] = 'Click to edit';
$hesklang['no_device_information'] = 'No device information';
$hesklang['message_colon'] = 'Message:';
$hesklang['original_message'] = 'Original message';
$hesklang['reply_by_customer'] = 'Reply by customer';
$hesklang['reply_by_staff'] = 'Reply by staff';
$hesklang['timeline_today'] = 'Today';
$hesklang['no_notes_for_this_ticket'] = 'No notes for this ticket';
// ADDED OR MODIFIED IN Mods for HESK 2.6.0
$hesklang['search_logs'] = 'Search Logs';

Loading…
Cancel
Save