More admin ticket changes

merge-requests/27/head
Mike Koch 8 years ago
parent 3eb1cdaffb
commit b2f1ff3419

@ -1056,6 +1056,12 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
?> ?>
</div> </div>
</div> </div>
<?php
/* Reply form on top? */
if ($can_reply && $hesk_settings['reply_top'] == 1) {
hesk_printReplyForm();
}
?>
<div class="box"> <div class="box">
<div class="box-header with-border"> <div class="box-header with-border">
<h1 class="box-title"> <h1 class="box-title">
@ -1073,10 +1079,10 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
$can_options = hesk_printCanned(); $can_options = hesk_printCanned();
?> ?>
<div class="row"> <div class="row">
<div class="col-md-2 text-right"> <div class="col-md-3 text-right">
<strong><?php echo $hesklang['m_sub']; ?></strong> <strong><?php echo $hesklang['m_sub']; ?></strong>
</div> </div>
<div class="col-md-10"> <div class="col-md-9">
<?php echo $ticket['subject']; ?> <?php echo $ticket['subject']; ?>
</div> </div>
</div> </div>
@ -1086,25 +1092,47 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
$v['name'] = $hesklang[$v['name']]; $v['name'] = $hesklang[$v['name']];
} }
echo '<div class="row">'; echo '<div class="row">';
echo '<div class="col-md-2 text-right"><strong>' . $v['name'] . ':</strong></div>'; echo '<div class="col-md-3 text-right"><strong>' . $v['name'] . ':</strong></div>';
if ($v['type'] == 'date' && !empty($ticket[$k])) { if ($v['type'] == 'date' && !empty($ticket[$k])) {
$dt = date('Y-m-d h:i:s', $ticket[$k]); $dt = date('Y-m-d h:i:s', $ticket[$k]);
echo '<div class="col-md-10">' . hesk_dateToString($dt, 0) . '</div>'; echo '<div class="col-md-9">' . hesk_dateToString($dt, 0) . '</div>';
} else { } else {
echo '<div class="col-md-10">' . $ticket[$k] . '</div>'; echo '<div class="col-md-9">' . $ticket[$k] . '</div>';
} }
echo '</div>'; echo '</div>';
} }
} }
?> ?>
<div class="row push-down-10"> <div class="row push-down-10">
<div class="col-md-2 text-right"> <div class="col-md-3 text-right">
<strong><?php echo $hesklang['message_colon']; ?></strong> <strong><?php echo $hesklang['message_colon']; ?></strong>
</div> </div>
<div class="col-md-10"> <div class="col-md-9">
<?php echo $ticket['subject']; ?> <?php if ($ticket['html']) {
echo hesk_html_entity_decode($ticket['message']);
} else {
echo $ticket['message'];
} ?>
</div> </div>
</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> </div>
<div class="box-footer"> <div class="box-footer">
<?php echo hesk_getAdminButtonsInTicket(0, $i); ?> <?php echo hesk_getAdminButtonsInTicket(0, $i); ?>
@ -1223,18 +1251,6 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
</div> </div>
</div> </div>
</div> </div>
<div class="blankSpace"></div>
<!-- END TICKET HEAD -->
<?php
/* Reply form on top? */
if ($can_reply && $hesk_settings['reply_top'] == 1) {
hesk_printReplyForm();
echo '<br />';
}
?>
<!-- START TICKET REPLIES -->
<?php <?php
if ($hesk_settings['new_top']) { if ($hesk_settings['new_top']) {
@ -1248,43 +1264,10 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
?> ?>
<div class="row ticketMessageContainer"> <div class="row ticketMessageContainer">
<div class="col-md-9 col-xs-12 pushMarginLeft"> <div class="col-md-9 col-xs-12 pushMarginLeft">
<div class="ticketMessageTop withBorder">
<!-- Action Buttons -->
<!-- Custom Fields Before Message -->
</div>
<div class="ticketMessageBottom">
<!-- Message -->
<p><b><?php echo $hesklang['message']; ?>:</b></p>
<div class="message">
<?php if ($ticket['html']) {
echo hesk_html_entity_decode($ticket['message']);
} else {
echo $ticket['message'];
} ?>
</div>
</div>
<div class="ticketMessageTop"> <div class="ticketMessageTop">
<!-- Custom Fields after Message --> <!-- Custom Fields after Message -->
<?php <?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 '<p>' . $v['name'] . ': ';
if ($v['type'] == 'date' && !empty($ticket[$k])) {
$dt = date('Y-m-d h:i:s', $ticket[$k]);
echo hesk_dateToString($dt, 0);
} else {
echo $ticket[$k];
}
echo '</p>';
}
}
/* Attachments */ /* Attachments */
mfh_listAttachments($ticket['attachments'], 0, true); mfh_listAttachments($ticket['attachments'], 0, true);
@ -1752,78 +1735,86 @@ function hesk_printReplyForm()
}); });
/* ]]> */ /* ]]> */
</script> </script>
<?php endif; ?> <?php endif; ?>
<h3 class="text-left"><?php echo $hesklang['add_reply']; ?></h3> <div class="box">
<div class="footerWithBorder"></div> <div class="box-header with-border">
<div class="blankSpace"></div> <h1 class="box-title">
<?php echo $hesklang['add_reply']; ?>
<?php </h1>
$onsubmit = 'onsubmit="force_stop();"'; <div class="box-tools pull-right">
if ($modsForHesk_settings['rich_text_for_tickets']) { <button type="button" class="btn btn-box-tool" data-widget="collapse">
$onsubmit = 'onsubmit="force_stop();return validateRichText(\'message-help-block\', \'message-group\', \'message\', \''.htmlspecialchars($hesklang['this_field_is_required']).'\')"'; <i class="fa fa-minus"></i>
} </button>
?> </div>
<form role="form" data-toggle="validator" class="form-horizontal" method="post" action="admin_reply_ticket.php" </div>
enctype="multipart/form-data" name="form1" <?php echo $onsubmit; ?>> <div class="box-body">
<?php <?php
$onsubmit = 'onsubmit="force_stop();"';
/* Ticket assigned to someone else? */ if ($modsForHesk_settings['rich_text_for_tickets']) {
if ($ticket['owner'] && $ticket['owner'] != $_SESSION['id'] && isset($admins[$ticket['owner']])) { $onsubmit = 'onsubmit="force_stop();return validateRichText(\'message-help-block\', \'message-group\', \'message\', \''.htmlspecialchars($hesklang['this_field_is_required']).'\')"';
hesk_show_notice($hesklang['nyt'] . ' ' . $admins[$ticket['owner']]);
} }
?>
<form role="form" data-toggle="validator" class="form-horizontal" method="post" action="admin_reply_ticket.php"
enctype="multipart/form-data" name="form1" <?php echo $onsubmit; ?>>
<?php
/* Ticket locked? */ /* Ticket assigned to someone else? */
if ($ticket['locked']) { if ($ticket['owner'] && $ticket['owner'] != $_SESSION['id'] && isset($admins[$ticket['owner']])) {
hesk_show_notice($hesklang['tislock']); hesk_show_notice($hesklang['nyt'] . ' ' . $admins[$ticket['owner']]);
} }
// Track time worked? /* Ticket locked? */
if ($hesk_settings['time_worked']) { if ($ticket['locked']) {
?> hesk_show_notice($hesklang['tislock']);
}
<div class="form-group"> // Track time worked?
<label for="time_worked" class="col-sm-3 control-label"><?php echo $hesklang['ts']; ?></label> if ($hesk_settings['time_worked']) {
?>
<div class="col-sm-6"> <div class="form-group">
<input type="text" class="form-control" name="time_worked" id="time_worked" size="10" <label for="time_worked" class="col-sm-3 control-label"><?php echo $hesklang['ts']; ?></label>
value="<?php echo(isset($_SESSION['time_worked']) ? hesk_getTime($_SESSION['time_worked']) : '00:00:00'); ?>"/>
<div class="col-sm-6">
<input type="text" class="form-control" name="time_worked" id="time_worked" size="10"
value="<?php echo(isset($_SESSION['time_worked']) ? hesk_getTime($_SESSION['time_worked']) : '00:00:00'); ?>"/>
</div>
<div class="col-sm-3 text-right">
<div class="btn-group">
<input type="button" class="btn btn-success" onclick="ss()" id="startb"
value="<?php echo $hesklang['start']; ?>"/>
<input type="button" class="btn btn-danger" onclick="r()"
value="<?php echo $hesklang['reset']; ?>"/>
</div>
</div>
</div> </div>
<div class="col-sm-3 text-right"> <?php
<div class="btn-group"> }
<input type="button" class="btn btn-success" onclick="ss()" id="startb" /* Do we have any canned responses? */
value="<?php echo $hesklang['start']; ?>"/> if (strlen($can_options)) {
<input type="button" class="btn btn-danger" onclick="r()" ?>
value="<?php echo $hesklang['reset']; ?>"/> <div class="form-group">
<label for="saved_replies" class="col-sm-3 control-label"><?php echo $hesklang['saved_replies']; ?></label>
<div class="col-sm-9">
<label><input type="radio" name="mode" id="modeadd" value="1"
checked="checked"/> <?php echo $hesklang['madd']; ?></label><br/>
<label><input type="radio" name="mode" id="moderep" value="0"/> <?php echo $hesklang['mrep']; ?>
</label>
<select class="form-control" name="saved_replies" onchange="setMessage(this.value)">
<option value="0"> - <?php echo $hesklang['select_empty']; ?> -</option>
<?php echo $can_options; ?>
</select>
</div> </div>
</div> </div>
</div> <?php
<?php }
}
/* Do we have any canned responses? */
if (strlen($can_options)) {
?> ?>
<div class="form-group"> <div class="form-group" id="message-group">
<label for="saved_replies" class="col-sm-3 control-label"><?php echo $hesklang['saved_replies']; ?></label> <label for="message" class="col-sm-3 control-label"><?php echo $hesklang['message']; ?><span
<div class="col-sm-9"> class="important">*</span></label>
<label><input type="radio" name="mode" id="modeadd" value="1"
checked="checked"/> <?php echo $hesklang['madd']; ?></label><br/>
<label><input type="radio" name="mode" id="moderep" value="0"/> <?php echo $hesklang['mrep']; ?>
</label>
<select class="form-control" name="saved_replies" onchange="setMessage(this.value)">
<option value="0"> - <?php echo $hesklang['select_empty']; ?> -</option>
<?php echo $can_options; ?>
</select>
</div>
</div>
<?php
}
?>
<div class="form-group" id="message-group">
<label for="message" class="col-sm-3 control-label"><?php echo $hesklang['message']; ?><span
class="important">*</span></label>
<div class="col-sm-9"> <div class="col-sm-9">
<span id="HeskMsg"> <span id="HeskMsg">
<textarea class="form-control htmlEditor" name="message" id="message" rows="12" <textarea class="form-control htmlEditor" name="message" id="message" rows="12"
placeholder="<?php echo htmlspecialchars($hesklang['message']); ?>" cols="72" placeholder="<?php echo htmlspecialchars($hesklang['message']); ?>" cols="72"
@ -1843,100 +1834,101 @@ function hesk_printReplyForm()
?></textarea> ?></textarea>
<div class="help-block with-errors" id="message-help-block"></div></span> <div class="help-block with-errors" id="message-help-block"></div></span>
</div>
</div>
<?php
/* attachments */
if ($hesk_settings['attachments']['use']) {
?>
<div class="form-group">
<label for="attachments" class="col-sm-3 control-label"><?php echo $hesklang['attachments']; ?>:</label>
<div class="col-sm-9">
<?php build_dropzone_markup(true); ?>
</div> </div>
</div> </div>
<?php <?php
display_dropzone_field($hesk_settings['hesk_url'] . '/internal-api/ticket/upload-attachment.php'); /* attachments */
} if ($hesk_settings['attachments']['use']) {
?> ?>
<div class="form-group"> <div class="form-group">
<label for="options" class="col-sm-3 control-label"><?php echo $hesklang['addop']; ?>:</label> <label for="attachments" class="col-sm-3 control-label"><?php echo $hesklang['attachments']; ?>:</label>
<div class="col-sm-9"> <div class="col-sm-9">
<?php build_dropzone_markup(true); ?>
</div>
</div>
<?php <?php
if ($ticket['owner'] != $_SESSION['id'] && $can_assign_self) { display_dropzone_field($hesk_settings['hesk_url'] . '/internal-api/ticket/upload-attachment.php');
if (empty($ticket['owner'])) { }
echo '<label><input type="checkbox" name="assign_self" value="1" checked="checked" /> <b>' . $hesklang['asss2'] . '</b></label><br />'; ?>
} else { <div class="form-group">
echo '<label><input type="checkbox" name="assign_self" value="1" /> ' . $hesklang['asss2'] . '</label><br />'; <label for="options" class="col-sm-3 control-label"><?php echo $hesklang['addop']; ?>:</label>
<div class="col-sm-9">
<?php
if ($ticket['owner'] != $_SESSION['id'] && $can_assign_self) {
if (empty($ticket['owner'])) {
echo '<label><input type="checkbox" name="assign_self" value="1" checked="checked" /> <b>' . $hesklang['asss2'] . '</b></label><br />';
} else {
echo '<label><input type="checkbox" name="assign_self" value="1" /> ' . $hesklang['asss2'] . '</label><br />';
}
} }
}
?> ?>
<div class="form-inline"> <div class="form-inline">
<label>
<input type="checkbox" name="set_priority"
value="1"/> <?php echo $hesklang['change_priority']; ?>
</label>
<select class="form-control" name="priority">
<?php echo implode('', $options); ?>
</select>
</div>
<br/>
<label> <label>
<input type="checkbox" name="set_priority" <input type="checkbox" name="signature" value="1"
value="1"/> <?php echo $hesklang['change_priority']; ?> checked="checked"/> <?php echo $hesklang['attach_sign']; ?>
</label> </label>
<select class="form-control" name="priority"> (<a href="profile.php"><?php echo $hesklang['profile_settings']; ?></a>)
<?php echo implode('', $options); ?> <br/>
</select> <label>
</div> <input type="checkbox" name="no_notify"
<br/> value="1" <?php echo ($_SESSION['notify_customer_reply'] && !empty($ticket['email'])) ? '' : 'checked="checked" '; ?> <?php if (empty($ticket['email'])) {
<label> echo 'disabled';
<input type="checkbox" name="signature" value="1" } ?>> <?php echo $hesklang['dsen']; ?>
checked="checked"/> <?php echo $hesklang['attach_sign']; ?> </label><br/><br/>
</label> <?php if (empty($ticket['email'])) {
(<a href="profile.php"><?php echo $hesklang['profile_settings']; ?></a>) echo '<input type="hidden" name="no_notify" value="1">';
<br/> } ?>
<label> <input type="hidden" name="orig_id" value="<?php echo $ticket['id']; ?>"/>
<input type="checkbox" name="no_notify" <input type="hidden" name="token" value="<?php hesk_token_echo(); ?>"/>
value="1" <?php echo ($_SESSION['notify_customer_reply'] && !empty($ticket['email'])) ? '' : 'checked="checked" '; ?> <?php if (empty($ticket['email'])) {
echo 'disabled'; <div class="btn-group">
} ?>> <?php echo $hesklang['dsen']; ?> <input class="btn btn-primary" type="submit" value="<?php echo $hesklang['submit_reply']; ?>">
</label><br/><br/> <button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown"
<?php if (empty($ticket['email'])) { aria-expanded="false">
echo '<input type="hidden" name="no_notify" value="1">'; <span class="caret"></span>
} ?> <span class="sr-only">Toggle Dropdown</span>
<input type="hidden" name="orig_id" value="<?php echo $ticket['id']; ?>"/> </button>
<input type="hidden" name="token" value="<?php hesk_token_echo(); ?>"/> <ul class="dropdown-menu" role="menu">
<li><a>
<div class="btn-group"> <button class="dropdown-submit" type="submit" name="submit_as_customer">
<input class="btn btn-primary" type="submit" value="<?php echo $hesklang['submit_reply']; ?>"> <?php echo $hesklang['sasc']; ?>
<button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown" </button>
aria-expanded="false"> </a></li>
<span class="caret"></span> <li class="divider"></li>
<span class="sr-only">Toggle Dropdown</span> <?php
</button> $statuses = mfh_getAllStatuses();
<ul class="dropdown-menu" role="menu"> foreach ($statuses as $status) {
<li><a> echo '<li><a>
<button class="dropdown-submit" type="submit" name="submit_as_customer">
<?php echo $hesklang['sasc']; ?>
</button>
</a></li>
<li class="divider"></li>
<?php
$statuses = mfh_getAllStatuses();
foreach ($statuses as $status) {
echo '<li><a>
<button class="dropdown-submit" type="submit" name="submit_as_status" value="' . $status['ID'] . '""> <button class="dropdown-submit" type="submit" name="submit_as_status" value="' . $status['ID'] . '"">
' . $hesklang['submit_reply'] . ' ' . $hesklang['and_change_status_to'] . ' <b> ' . $hesklang['submit_reply'] . ' ' . $hesklang['and_change_status_to'] . ' <b>
<span style="color:' . $status['TextColor'] . '">' . mfh_getDisplayTextForStatusId($status['ID']) . '</span></b> <span style="color:' . $status['TextColor'] . '">' . mfh_getDisplayTextForStatusId($status['ID']) . '</span></b>
</button> </button>
</a></li>'; </a></li>';
} }
?> ?>
</ul> </ul>
</div>
<input class="btn btn-default" type="submit" name="save_reply" value="<?php echo $hesklang['sacl']; ?>">
<?php if ($isManager): ?>
<input type="hidden" name="isManager" value="1">
<?php endif; ?>
</div> </div>
<input class="btn btn-default" type="submit" name="save_reply" value="<?php echo $hesklang['sacl']; ?>">
<?php if ($isManager): ?>
<input type="hidden" name="isManager" value="1">
<?php endif; ?>
</div> </div>
</div> </form>
</form> </div>
</div>
<!-- END REPLY FORM --> <!-- END REPLY FORM -->
<?php <?php
} // End hesk_printReplyForm() } // End hesk_printReplyForm()

Loading…
Cancel
Save