#105 Allow staff to indicate language when creating ticket and when editing

merge-requests/2/head
Mike Koch 9 years ago
parent 1aeb19539f
commit c184cc3c1b

@ -62,6 +62,9 @@ if ( empty($_POST) && ! empty($_SERVER['CONTENT_LENGTH']) )
$hesk_error_buffer = array(); $hesk_error_buffer = array();
if ($hesk_settings['can_sel_lang']) {
$tmpvar['language'] = hesk_POST('customerLanguage');
}
$tmpvar['name'] = hesk_input( hesk_POST('name') ) or $hesk_error_buffer['name']=$hesklang['enter_your_name']; $tmpvar['name'] = hesk_input( hesk_POST('name') ) or $hesk_error_buffer['name']=$hesklang['enter_your_name'];
$tmpvar['email'] = hesk_POST('email'); $tmpvar['email'] = hesk_POST('email');
$tmpvar['category'] = intval( hesk_POST('category') ) or $hesk_error_buffer['category']=$hesklang['sel_app_cat']; $tmpvar['category'] = intval( hesk_POST('category') ) or $hesk_error_buffer['category']=$hesklang['sel_app_cat'];

@ -658,6 +658,10 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
echo $trackingID.'<br/>'.$tmp;?> echo $trackingID.'<br/>'.$tmp;?>
</li> </li>
<li class="list-group-item">
<strong><?php echo $hesklang['lgs']; ?></strong><br>
<?php echo $ticket['language'] !== NULL ? $ticket['language'] : HESK_DEFAULT_LANGUAGE; ?>
</li>
<li class="list-group-item"> <li class="list-group-item">
<strong><?php echo $hesklang['replies']; ?></strong><br/> <strong><?php echo $hesklang['replies']; ?></strong><br/>
<?php echo $ticket['replies']; ?> <?php echo $ticket['replies']; ?>

@ -115,6 +115,7 @@ if (isset($_POST['save']))
} }
else else
{ {
$tmpvar['language'] = hesk_POST('customerLanguage');
$tmpvar['name'] = hesk_input( hesk_POST('name') ) or $hesk_error_buffer[]=$hesklang['enter_your_name']; $tmpvar['name'] = hesk_input( hesk_POST('name') ) or $hesk_error_buffer[]=$hesklang['enter_your_name'];
$tmpvar['email'] = hesk_validateEmail( hesk_POST('email'), 'ERR', 0); $tmpvar['email'] = hesk_validateEmail( hesk_POST('email'), 'ERR', 0);
$tmpvar['subject'] = hesk_input( hesk_POST('subject') ) or $hesk_error_buffer[]=$hesklang['enter_ticket_subject']; $tmpvar['subject'] = hesk_input( hesk_POST('subject') ) or $hesk_error_buffer[]=$hesklang['enter_ticket_subject'];
@ -191,7 +192,8 @@ if (isset($_POST['save']))
`custom17`='".hesk_dbEscape($tmpvar['custom17'])."', `custom17`='".hesk_dbEscape($tmpvar['custom17'])."',
`custom18`='".hesk_dbEscape($tmpvar['custom18'])."', `custom18`='".hesk_dbEscape($tmpvar['custom18'])."',
`custom19`='".hesk_dbEscape($tmpvar['custom19'])."', `custom19`='".hesk_dbEscape($tmpvar['custom19'])."',
`custom20`='".hesk_dbEscape($tmpvar['custom20'])."' `custom20`='".hesk_dbEscape($tmpvar['custom20'])."',
`language`='".hesk_dbEscape($tmpvar['language'])."'
WHERE `id`='".intval($ticket['id'])."' LIMIT 1"); WHERE `id`='".intval($ticket['id'])."' LIMIT 1");
} }
@ -225,7 +227,17 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
/* If it's not a reply edit all the fields */ /* If it's not a reply edit all the fields */
if (!$is_reply) if (!$is_reply)
{ {
?> if ($hesk_settings['can_sel_lang']) {
?>
<div class="form-group">
<label for="customerLanguage" class="col-sm-3 control-label"><?php echo $hesklang['chol']; ?>:</label>
<div class="col-sm-9">
<select name="customerLanguage" id="customerLanguage" class="form-control">
<?php hesk_listLanguages(); ?>
</select>
</div>
</div>
<?php } ?>
<div class="form-group"> <div class="form-group">
<label for="subject" class="col-sm-3 control-label"><?php echo $hesklang['subject']; ?>:</label> <label for="subject" class="col-sm-3 control-label"><?php echo $hesklang['subject']; ?>:</label>
<div class="col-sm-9"> <div class="col-sm-9">

@ -163,6 +163,16 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
<!-- START FORM --> <!-- START FORM -->
<form role="form" class="form-horizontal" method="post" action="admin_submit_ticket.php" name="form1" enctype="multipart/form-data"> <form role="form" class="form-horizontal" method="post" action="admin_submit_ticket.php" name="form1" enctype="multipart/form-data">
<?php if ($hesk_settings['can_sel_lang']) { ?>
<div class="form-group">
<label for="customerLanguage" class="col-sm-3 control-label"><?php echo $hesklang['chol']; ?>:&nbsp;<span class="important">*</span></label>
<div class="col-sm-9">
<select name="customerLanguage" id="customerLanguage" class="form-control">
<?php hesk_listLanguages(); ?>
</select>
</div>
</div>
<?php } ?>
<!-- Contact info --> <!-- Contact info -->
<?php if (in_array('name',$_SESSION['iserror'])) {echo '<div class="form-group has-error">';} else {echo '<div class="form-group">';} ?> <?php if (in_array('name',$_SESSION['iserror'])) {echo '<div class="form-group has-error">';} else {echo '<div class="form-group">';} ?>
<label for="name" class="col-sm-3 control-label"><?php echo $hesklang['name']; ?>: <font class="important">*</font></label> <label for="name" class="col-sm-3 control-label"><?php echo $hesklang['name']; ?>: <font class="important">*</font></label>

Loading…
Cancel
Save