Create ticket page uses new UI

merge-requests/27/head
Mike Koch 8 years ago
parent 6d6fe67c53
commit f23ca3598e

@ -122,41 +122,52 @@ require_once(HESK_PATH . 'inc/headerAdmin.inc.php');
/* Print admin navigation */
require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
$columnWidth = 'col-md-8';
$showRs = hesk_dbQuery("SELECT `show` FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "quick_help_sections` WHERE `id` = 5");
$show = hesk_dbFetchAssoc($showRs);
if (!$show['show']) {
$columnWidth = 'col-md-10 col-md-offset-1';
}
$show_quick_help = $show['show'];
?>
<ol class="breadcrumb">
<li><a href="admin_main.php"><?php echo $hesk_settings['hesk_title']; ?></a></li>
<li class="active"><?php echo $hesklang['nti2']; ?></li>
</ol>
<div class="row move-down-20">
<?php if ($columnWidth == 'col-md-8'): ?>
<div class="col-md-4">
<div class="panel panel-default">
<div class="panel-heading"><?php echo $hesklang['quick_help']; ?></div>
<div class="panel-body">
<p><?php echo $hesklang['nti3']; ?></p>
<br/>
<p><?php echo $hesklang['req_marked_with']; ?> <font class="important">*</font></p>
</div>
</div>
</div>
<?php endif; ?>
<div class="<?php echo $columnWidth; ?>">
<section class="content">
<?php
/* This will handle error, success and notice messages */
hesk_handle_messages();
?>
<h3><?php echo $hesklang['nti2']; ?></h3>
<div class="footerWithBorder blankSpace"></div>
if ($show_quick_help): ?>
<div class="box">
<div class="box-header with-border">
<h1 class="box-title">
<?php echo $hesklang['quick_help']; ?>
</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">
<p><?php echo $hesklang['nti3']; ?></p>
<br>
<p><?php echo $hesklang['req_marked_with']; ?> <span class="important">*</span></p>
</div>
</div>
<?php endif; ?>
<div class="box">
<div class="box-header with-border">
<h1 class="box-title">
<?php echo $hesklang['nti2']; ?>
</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">
<!-- START FORM -->
<?php if ($modsForHesk_settings['rich_text_for_tickets']): ?>
<script type="text/javascript">
@ -201,11 +212,12 @@ if (!$show['show']) {
</div>
<?php } ?>
<!-- Contact info -->
<?php if (in_array('name', $_SESSION['iserror'])) {
echo '<div class="form-group has-error">';
} else {
echo '<div class="form-group">';
<?php
$has_error = '';
if (in_array('name', $_SESSION['iserror'])) {
$has_error = 'has-error';
}?>
<div class="form-group <?php echo $has_error; ?>">
<label for="name" class="col-sm-3 control-label"><?php echo $hesklang['name']; ?><span
class="important">*</span></label>
@ -221,68 +233,12 @@ if (!$show['show']) {
<div class="help-block with-errors"></div>
</div>
</div>
<div class="form-group">
<label for="email" class="col-sm-3 control-label"><?php echo $hesklang['email']; ?></label>
<div class="col-sm-9">
<input type="text" class="form-control" name="email" size="40" maxlength="1000" id="email-input"
value="<?php if (isset($_SESSION['as_email'])) {
echo stripslashes(hesk_input($_SESSION['as_email']));
} else if (isset($_GET['email'])) {
echo hesk_GET('email');
} ?>" <?php if ($hesk_settings['detect_typos']) {
echo ' onblur="Javascript:hesk_suggestEmail(1)"';
} ?>
placeholder="<?php echo htmlspecialchars($hesklang['email']); ?>"
onkeyup="disableIfEmpty('email-input','notify-email')">
</div>
</div>
<div id="email_suggestions"></div>
<hr/>
<!-- Department and Priority -->
<?php if (in_array('category', $_SESSION['iserror'])) {
echo '<div class="form-group has-error">';
} elseif (in_array('category', $_SESSION['isnotice'])) {
echo '<div class="form-group has-warning">';
} else {
echo '<div class="form-group">';
} ?>
<label for="category" class="col-sm-3 control-label"><?php echo $hesklang['category']; ?><span
class="important">*</span></label>
<div class="col-sm-9">
<select name="category" class="form-control"
pattern="[0-9]+"
data-error="<?php echo htmlspecialchars($hesklang['sel_app_cat']); ?>"
required>
<?php
// Show the "Click to select"?
if ($hesk_settings['select_cat']) {
echo '<option value="">' . $hesklang['select'] . '</option>';
}
// List categories
$orderByColumn = $modsForHesk_settings['category_order_column'];
$result = hesk_dbQuery('SELECT * FROM `' . hesk_dbEscape($hesk_settings['db_pfix']) . 'categories` WHERE `usage` <> 2 ORDER BY `' . $orderByColumn . '` ASC');
while ($row = hesk_dbFetchAssoc($result)) {
if (isset($_SESSION['as_category']) && $_SESSION['as_category'] == $row['id']) {
$selected = ' selected="selected"';
} else {
$selected = '';
}
echo '<option value="' . $row['id'] . '"' . $selected . '>' . $row['name'] . '</option>';
}
?>
</select>
<div class="help-block with-errors"></div>
</div>
</div>
<?php if (in_array('priority', $_SESSION['iserror'])) {
echo '<div class="form-group has-error">';
} else {
echo '<div class="form-group">';
$has_error = '';
if (in_array('priority', $_SESSION['iserror'])) {
$has_error = 'has-error';
} ?>
<div class="form-group <?php echo $has_error; ?>">
<label for="priority" class="col-sm-3 control-label"><?php echo $hesklang['priority']; ?><span
class="important">*</span></label>
<div class="col-sm-9">
@ -324,11 +280,8 @@ if (!$show['show']) {
<div class="help-block with-errors"></div>
</div>
</div>
<!-- Start Custom Before -->
<?php
/* custom fields BEFORE comments */
foreach ($hesk_settings['custom_fields'] as $k => $v) {
if ($v['use'] && $v['place'] == 0) {
if ($modsForHesk_settings['custom_field_setting']) {
@ -379,7 +332,7 @@ foreach ($hesk_settings['custom_fields'] as $k => $v) {
$formattedId = preg_replace("/[\s-]+/", " ", $v['name']);
$formattedId = preg_replace("/[\s_]/", "-", $v['name']);
echo '<label style="font-weight: normal;"><input type="radio" id="' . $formattedId . '" name="' . $k . '" value="' . $option . '" ' . $checked . ' ' . $cls . ' /> ' . $option . '</label><br />';
echo '<label style="font-weight: normal;"><input type="radio" id="' . $formattedId . '" name="' . $k . '" value="' . $option . '" ' . $checked . ' ' . $cls . ' /> ' . $option . '</label><br>';
}
echo '</div></div>';
@ -469,7 +422,7 @@ foreach ($hesk_settings['custom_fields'] as $k => $v) {
$checked = '';
}
echo '<label style="font-weight: normal;"><input id="' . $formattedId . '" type="checkbox" name="' . $k . '[]" value="' . $option . '" ' . $checked . ' ' . $cls . ' /> ' . $option . '</label><br />';
echo '<label style="font-weight: normal;"><input id="' . $formattedId . '" type="checkbox" name="' . $k . '[]" value="' . $option . '" ' . $checked . ' ' . $cls . ' /> ' . $option . '</label><br>';
}
echo '</div></div>';
break;
@ -589,10 +542,7 @@ foreach ($hesk_settings['custom_fields'] as $k => $v) {
}
}
}
?>
<!-- End custom before -->
<!-- Ticket Info -->
<?php
// Lets handle ticket templates
$can_options = '';
@ -730,7 +680,6 @@ elseif (hesk_checkPermission('can_man_ticket_tpl', 0)) {
<?php
}
?>
<div class="form-group">
<label for="due-date" class="col-sm-3 control-label"><?php echo $hesklang['due_date']; ?></label>
<div class="col-sm-9">
@ -739,12 +688,12 @@ elseif (hesk_checkPermission('can_man_ticket_tpl', 0)) {
<span class="help-block"><?php echo $hesklang['date_format']; ?></span>
</div>
</div>
<?php if (in_array('subject', $_SESSION['iserror'])) {
echo '<div class="form-group has-error">';
} else {
echo '<div class="form-group">';
<?php
$has_error = '';
if (in_array('subject', $_SESSION['iserror'])) {
$has_error = 'has-error';
}?>
<div class="form-group <?php echo $has_error; ?>">
<label for="subject" class="col-sm-3 control-label"><?php echo $hesklang['subject']; ?><span
class="important">*</span></label>
<div class="col-sm-9">
@ -757,11 +706,12 @@ elseif (hesk_checkPermission('can_man_ticket_tpl', 0)) {
<div class="help-block with-errors"></div>
</div>
</div>
<?php if (in_array('message', $_SESSION['iserror'])) {
echo '<div class="form-group has-error" id="message-group">';
} else {
echo '<div class="form-group" id="message-group">';
<?php
$has_error = '';
if (in_array('message', $_SESSION['iserror'])) {
$has_error = 'has-error';
} ?>
<div class="form-group <?php echo $has_error; ?>" id="message-group">
<label for="subject" class="col-sm-3 control-label"><?php echo $hesklang['message']; ?><span
class="important">*</span></label>
<div class="col-sm-9">
@ -776,8 +726,6 @@ elseif (hesk_checkPermission('can_man_ticket_tpl', 0)) {
<div class="help-block with-errors" id="message-help-block"></div>
</div>
</div>
<hr/>
<!-- Custom After -->
<?php
/* custom fields AFTER comments */
@ -826,7 +774,7 @@ foreach ($hesk_settings['custom_fields'] as $k => $v) {
$checked = '';
}
echo '<label style="font-weight: normal;"><input type="radio" id="' . $formattedId . '" name="' . $k . '" value="' . $option . '" ' . $checked . ' ' . $cls . ' /> ' . $option . '</label><br />';
echo '<label style="font-weight: normal;"><input type="radio" id="' . $formattedId . '" name="' . $k . '" value="' . $option . '" ' . $checked . ' ' . $cls . ' /> ' . $option . '</label><br>';
}
echo '</div></div>';
@ -885,7 +833,7 @@ foreach ($hesk_settings['custom_fields'] as $k => $v) {
$checked = '';
}
echo '<label style="font-weight: normal;"><input id="' . $formattedId . '" type="checkbox" name="' . $k . '[]" value="' . $option . '" ' . $checked . ' ' . $cls . ' /> ' . $option . '</label><br />';
echo '<label style="font-weight: normal;"><input id="' . $formattedId . '" type="checkbox" name="' . $k . '[]" value="' . $option . '" ' . $checked . ' ' . $cls . ' /> ' . $option . '</label><br>';
}
echo '</div></div>';
break;
@ -1048,13 +996,10 @@ if ($hesk_settings['attachments']['use']) {
<?php build_dropzone_markup(true); ?>
</div>
</div>
<hr/>
<?php
display_dropzone_field($hesk_settings['hesk_url'] . '/internal-api/ticket/upload-attachment.php');
}
?>
<!-- Admin options -->
<?php
if (!isset($_SESSION['as_notify'])) {
$_SESSION['as_notify'] = $_SESSION['notify_customer_new'] ? 1 : 0;
}
@ -1065,17 +1010,21 @@ if (!isset($_SESSION['as_notify'])) {
<div class="col-sm-9">
<label><input type="checkbox" id="notify-email" name="notify"
value="1" <?php echo empty($_SESSION['as_notify']) ? '' : 'checked="checked"'; ?> /> <?php echo $hesklang['seno']; ?>
</label><br/>
</label><br>
<label><input type="checkbox" name="show"
value="1" <?php echo (!isset($_SESSION['as_show']) || !empty($_SESSION['as_show'])) ? 'checked="checked"' : ''; ?> /> <?php echo $hesklang['otas']; ?>
</label><br/>
<hr/>
</label>
</div>
</div>
<?php
if (hesk_checkPermission('can_assign_others',0))
{
if (in_array('owner',$_SESSION['iserror'])) {echo '<div class="form-group has-error">';} else {echo '<div class="form-group">';} ?>
$has_error = '';
if (in_array('owner',$_SESSION['iserror'])) {
$has_error = 'has-error';
}
?>
<div class="form-group <?php echo $has_error; ?>">
<label for="owner" class="col-sm-3 control-label"><?php echo $hesklang['asst2']; ?>:</label>
<div class="col-sm-9">
<select class="form-control" name="owner" >
@ -1142,6 +1091,10 @@ if ($modsForHesk_settings['request_location']):
</div>
</div>
</form>
</div>
</div>
</section>
<script>
buildValidatorForTicketSubmission("form1",
"<?php echo addslashes($hesklang['select_at_least_one_value']); ?>");

@ -111,21 +111,6 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
</div>
</div>
</section>
<div class="row">
<div class="col-md-12 move-down-20">
<?php
/* This will handle error, success and notice messages */
hesk_handle_messages();
?>
<div class="panel panel-default">
<div class="panel-heading">
<h4><?php echo $hesklang['tickets']; ?> <span class="nu-floatRight panel-button"><a
href="new_ticket.php" class="btn btn-success"><span
class="glyphicon glyphicon-plus-sign"></span> <?php echo $hesklang['nti']; ?></a></span></h4>
</div>
</div>
</div>
<?php

@ -122,3 +122,13 @@
.timeline > .today-top {
margin-bottom: 60px;
}
.white-readonly {
cursor: text !important;
background-color: #fff !important;
}
button.dropdown-submit {
background: none !important;
border: none;
}
Loading…
Cancel
Save