function hesk_printReplyForm() { global $hesklang, $hesk_settings, $ticket, $admins, $can_options, $options, $can_assign_self; ?> <!-- START REPLY FORM --> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="7" height="7"><img src="../img/roundcornerslt.jpg" width="7" height="7" alt="" /></td> <td class="roundcornerstop"></td> <td><img src="../img/roundcornersrt.jpg" width="7" height="7" alt="" /></td> </tr> <tr> <td class="roundcornersleft"> </td> <td> <h3 align="center"><?php echo $hesklang['add_reply']; ?> </h3> <form method="post" action="admin_reply_ticket.php" enctype="multipart/form-data" name="form1" onsubmit="javascript:force_stop();return true;"> <br /> <?php /* Ticket assigned to someone else? */ if ($ticket['owner'] && $ticket['owner'] != $_SESSION['id'] && isset($admins[$ticket['owner']])) { hesk_show_notice($hesklang['nyt'] . ' ' . $admins[$ticket['owner']]); } /* Ticket locked? */ if ($ticket['locked']) { hesk_show_notice($hesklang['tislock']); } // Track time worked? if ($hesk_settings['time_worked']) { ?> <div align="center"> <table class="white" style="min-width:600px;"> <tr> <td colspan="2"> » <?php echo $hesklang['ts']; ?> <input type="text" name="time_worked" id="time_worked" size="10" value="<?php echo isset($_SESSION['time_worked']) ? hesk_getTime($_SESSION['time_worked']) : '00:00:00'; ?> " /> <input type="button" class="orangebuttonsec" onmouseover="hesk_btn(this,'orangebuttonsecover');" onmouseout="hesk_btn(this,'orangebuttonsec');" onclick="ss()" id="startb" value="<?php echo $hesklang['start']; ?> " /> <input type="button" class="orangebuttonsec" onmouseover="hesk_btn(this,'orangebuttonsecover');" onmouseout="hesk_btn(this,'orangebuttonsec');" onclick="r()" value="<?php echo $hesklang['reset']; ?> " /> <br /> </td> </tr> </table> </div> <?php } /* Do we have any canned responses? */ if (strlen($can_options)) { ?> <div align="center"> <table class="white" style="min-width:600px;"> <tr> <td class="admin_gray" colspan="2"><b>» <?php echo $hesklang['saved_replies']; ?> </b></td> </tr> <tr> <td class="admin_gray"> <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> </td> <td class="admin_gray"> <?php echo $hesklang['select_saved']; ?> :<br /> <select name="saved_replies" onchange="setMessage(this.value)"> <option value="0"> - <?php echo $hesklang['select_empty']; ?> - </option> <?php echo $can_options; ?> </select> </td> </tr> </table> </div> <?php } ?> <p align="center"><?php echo $hesklang['message']; ?> : <font class="important">*</font><br /> <span id="HeskMsg"><textarea name="message" id="message" rows="12" cols="72"><?php // Do we have any message stored in session? if (isset($_SESSION['ticket_message'])) { echo stripslashes(hesk_input($_SESSION['ticket_message'])); } else { $res = hesk_dbQuery("SELECT `message` FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "reply_drafts` WHERE `owner`=" . intval($_SESSION['id']) . " AND `ticket`=" . intval($ticket['id']) . " LIMIT 1"); if (hesk_dbNumRows($res) == 1) { echo hesk_dbResult($res); } } ?> </textarea></span></p> <?php /* attachments */ if ($hesk_settings['attachments']['use']) { ?> <p align="center"> <?php echo $hesklang['attachments'] . ' (<a href="Javascript:void(0)" onclick="Javascript:hesk_window(\'../file_limits.php\',250,500);return false;">' . $hesklang['ful'] . '</a>):<br />'; for ($i = 1; $i <= $hesk_settings['attachments']['max_number']; $i++) { echo '<input type="file" name="attachment[' . $i . ']" size="50" /><br />'; } ?> </p> <?php } ?> <div align="center"> <center> <table> <tr> <td> <?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 />'; } } ?> <label><input type="checkbox" name="set_priority" value="1" /> <?php echo $hesklang['change_priority']; ?> </label> <select name="priority"> <?php echo implode('', $options); ?> </select><br /> <label><input type="checkbox" name="signature" value="1" checked="checked" /> <?php echo $hesklang['attach_sign']; ?> </label> (<a href="profile.php"><?php echo $hesklang['profile_settings']; ?> </a>)<br /> <label><input type="checkbox" name="no_notify" value="1" <?php echo $_SESSION['notify_customer_reply'] ? '' : 'checked="checked"'; ?> /> <?php echo $hesklang['dsen']; ?> </label> </td> </tr> </table> </center> </div> <p align="center"> <input type="hidden" name="orig_id" value="<?php echo $ticket['id']; ?> " /> <input type="hidden" name="token" value="<?php hesk_token_echo(); ?> " /> <input type="submit" value=" <?php echo $hesklang['submit_reply']; ?> " class="orangebutton" onmouseover="hesk_btn(this,'orangebuttonover');" onmouseout="hesk_btn(this,'orangebutton');" /> <input type="submit" name="save_reply" value="<?php echo $hesklang['sacl']; ?> " class="orangebuttonsec" onmouseover="hesk_btn(this,'orangebuttonsecover');" onmouseout="hesk_btn(this,'orangebuttonsec');" /> </p> <?php // If ticket is not locked, show additional submit options if (!$ticket['locked']) { ?> <p> </p> <p align="center"> <input type="submit" name="submit_as_customer" value="<?php echo $hesklang['sasc']; ?> " class="orangebuttonsec" onmouseover="hesk_btn(this,'orangebuttonsecover');" onmouseout="hesk_btn(this,'orangebuttonsec');" /> <input type="submit" name="submit_as_resolved" value="<?php echo $hesklang['submit_as'] . ' ' . $hesklang['closed']; ?> " class="orangebuttonsec" onmouseover="hesk_btn(this,'orangebuttonsecover');" onmouseout="hesk_btn(this,'orangebuttonsec');" /> <input type="submit" name="submit_as_in_progress" value="<?php echo $hesklang['submit_as'] . ' ' . $hesklang['in_progress']; ?> " class="orangebuttonsec" onmouseover="hesk_btn(this,'orangebuttonsecover');" onmouseout="hesk_btn(this,'orangebuttonsec');" /> <input type="submit" name="submit_as_on_hold" value="<?php echo $hesklang['submit_as'] . ' ' . $hesklang['on_hold']; ?> " class="orangebuttonsec" onmouseover="hesk_btn(this,'orangebuttonsecover');" onmouseout="hesk_btn(this,'orangebuttonsec');" /> </p> <?php } ?> </form> </td> <td class="roundcornersright"> </td> </tr> <tr> <td><img src="../img/roundcornerslb.jpg" width="7" height="7" alt="" /></td> <td class="roundcornersbottom"></td> <td width="7" height="7"><img src="../img/roundcornersrb.jpg" width="7" height="7" alt="" /></td> </tr> </table> <!-- END REPLY FORM --> <?php }
function show_new_form() { global $hesk_settings, $hesklang, $admins; ?> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="7" height="7"><img src="../img/roundcornerslt.jpg" width="7" height="7" alt="" /></td> <td class="roundcornerstop"></td> <td><img src="../img/roundcornersrt.jpg" width="7" height="7" alt="" /></td> </tr> <tr> <td class="roundcornersleft"> </td> <td> <form action="mail.php" method="post" name="form2"> <h3 align="center"><?php echo $hesklang['new_mail']; ?> </h3> <div align="center"> <table border="0"> <tr> <td> <table border="0"> <tr> <td><b><?php echo $hesklang['m_to']; ?> </b></td> <td> <select name="to"> <option value="" selected="selected"><?php echo $hesklang['select']; ?> </option> <?php foreach ($admins as $k => $v) { if ($k != $_SESSION['id']) { if (isset($_SESSION['mail']) && $k == $_SESSION['mail']['to']) { echo '<option value="' . $k . '" selected="selected">' . $v . '</option>'; } else { echo '<option value="' . $k . '">' . $v . '</option>'; } } } ?> </select> </td> </tr> <tr> <td><b><?php echo $hesklang['m_sub']; ?> </b></td> <td> <input type="text" name="subject" size="40" maxlength="50" <?php if (isset($_SESSION['mail']['subject'])) { echo ' value="' . stripslashes($_SESSION['mail']['subject']) . '" '; } ?> /> </td> </tr> </table> <p><b><?php echo $hesklang['message']; ?> :</b><br /> <textarea name="message" rows="15" cols="70"><?php if (isset($_SESSION['mail']['message'])) { echo stripslashes($_SESSION['mail']['message']); } ?> </textarea> </p> </td> </tr> </table> <label><input type="checkbox" name="signature" value="1" checked="checked" /> <?php echo $hesklang['attach_sign']; ?> </label> (<a href="profile.php"><?php echo $hesklang['profile_settings']; ?> </a>)<br /> <br /> </div> <p align="center"> <input type="hidden" name="token" value="<?php hesk_token_echo(); ?> " /> <input type="hidden" name="a" value="send" /> <input type="submit" value="<?php echo $hesklang['m_send']; ?> " class="orangebutton" onmouseover="hesk_btn(this,'orangebuttonover');" onmouseout="hesk_btn(this,'orangebutton');" /> </p> </form> </td> <td class="roundcornersright"> </td> </tr> <tr> <td><img src="../img/roundcornerslb.jpg" width="7" height="7" alt="" /></td> <td class="roundcornersbottom"></td> <td width="7" height="7"><img src="../img/roundcornersrb.jpg" width="7" height="7" alt="" /></td> </tr> </table> <?php }
function hesk_printCustomerReplyForm($reopen = 0) { global $hesklang, $hesk_settings, $trackingID, $my_email; // Already printed? if (defined('REPLY_FORM')) { return ''; } ?> <br /> <div class="col-sm-8 col-sm-offset-2" id="addreply-title"><?php echo $hesklang['add_reply']; ?> </div> <br/> <div class="conatiner col-sm-8 col-sm-offset-2 start-helpDesk-ticket"> <div class="row add-reply-ticket-ticketPhp"> <br/> <div class="container"> <form method="post" action="reply_ticket.php" enctype="multipart/form-data"> <div class="form-inline"> <label class="col-sm-2 control-label addreply-message"><?php echo $hesklang['message']; ?> : <span class="important">*</span></label> <textarea class="form-control" name="message" rows="12" cols="60" style="width: 443px; height: 246px;"><?php if (isset($_SESSION['ticket_message'])) { echo stripslashes(hesk_input($_SESSION['ticket_message'])); } ?> </textarea> </div> <br/> <?php /* attachments */ if ($hesk_settings['attachments']['use']) { ?> <div class="form-group attachments-support-request"> <div class="form-inline"> <label class="col-sm-2 control-label addreply-attachments"><?php echo $hesklang['attachments']; ?> :</label> <div class="form-group"> <?php for ($i = 1; $i <= $hesk_settings['attachments']['max_number']; $i++) { echo '<input type="file" name="attachment[' . $i . ']" size="50" ' . ' style="margin-bottom: 10px;"/>'; } ?> <a href="file_limits.php" target="_blank" onclick="Javascript:hesk_window('file_limits.php',250,500);return false;"><?php echo $hesklang['ful']; ?> </a> </div> </div> </div><!-- end attachments-support-request --> <br/><br/> <?php } if (isset($_SESSION['ticket_message'])) { echo stripslashes(hesk_input($_SESSION['ticket_message'])); } ?> <p align="center"> <input type="hidden" name="token" value="<?php hesk_token_echo(); ?> " /> <input type="hidden" name="orig_track" value="<?php echo $trackingID; ?> " /> <?php if ($hesk_settings['email_view_ticket']) { echo '<input type="hidden" name="e" value="' . $my_email . '" />'; } if ($reopen) { echo '<input type="hidden" name="reopen" value="1" />'; } ?> <input type="submit" value="<?php echo $hesklang['submit_reply']; ?> " class="btn btn-default" id="submit-addReply" /></p> </form> </div> </div><!-- end add-reply-ticket-ticketPhp --> </div> <?php // Make sure the form is only printed once per page define('REPLY_FORM', true); }
} else { $color = $i ? 'admin_white' : 'admin_gray'; } $tmp = $i ? 'White' : 'Blue'; $style = 'class="option' . $tmp . 'OFF" onmouseover="this.className=\'option' . $tmp . 'ON\'" onmouseout="this.className=\'option' . $tmp . 'OFF\'"'; $i = $i ? 0 : 1; echo ' <tr> <td class="' . $color . '" style="text-align:left">' . $ban['email'] . '</td> <td class="' . $color . '" style="text-align:left">' . (isset($admins[$ban['banned_by']]) ? $admins[$ban['banned_by']] : $hesklang['e_udel']) . '</td> <td class="' . $color . '" style="text-align:left">' . $ban['dt'] . '</td> '; if ($can_unban) { echo ' <td class="' . $color . '" style="text-align:center; white-space:nowrap;"> <a href="banned_emails.php?a=unban&id=' . $ban['id'] . '&token=' . hesk_token_echo(0) . '" onclick="return confirm_delete();"><img src="../img/delete.png" width="16" height="16" alt="' . $hesklang['delban'] . '" title="' . $hesklang['delban'] . '" ' . $style . ' /></a> </td> '; } echo '</tr>'; } // End while ?> </table><!-- end table-bordered table-responsive --> <?php } ?> </div><!-- end b-email --> </div><!-- end tools-tab --> <!-- TABS --> <?php
function print_add_ticket() { global $hesk_settings, $hesklang; // Auto-focus first empty or error field define('AUTOFOCUS', true); // Pre-populate fields // Customer name if (isset($_REQUEST['name'])) { $_SESSION['c_name'] = $_REQUEST['name']; } // Customer email address if (isset($_REQUEST['email'])) { $_SESSION['c_email'] = $_REQUEST['email']; $_SESSION['c_email2'] = $_REQUEST['email']; } // Category ID if (isset($_REQUEST['catid'])) { $_SESSION['c_category'] = intval($_REQUEST['catid']); } if (isset($_REQUEST['category'])) { $_SESSION['c_category'] = intval($_REQUEST['category']); } // Priority if (isset($_REQUEST['priority'])) { $_SESSION['c_priority'] = intval($_REQUEST['priority']); } // Subject if (isset($_REQUEST['subject'])) { $_SESSION['c_subject'] = $_REQUEST['subject']; } // Message if (isset($_REQUEST['message'])) { $_SESSION['c_message'] = $_REQUEST['message']; } // Custom fields foreach ($hesk_settings['custom_fields'] as $k => $v) { if ($v['use'] && isset($_REQUEST[$k])) { $_SESSION['c_' . $k] = $_REQUEST[$k]; } } // Varibles for coloring the fields in case of errors if (!isset($_SESSION['iserror'])) { $_SESSION['iserror'] = array(); } if (!isset($_SESSION['isnotice'])) { $_SESSION['isnotice'] = array(); } if (!isset($_SESSION['c_category']) && !$hesk_settings['select_cat']) { $_SESSION['c_category'] = 0; } hesk_cleanSessionVars('already_submitted'); // Tell header to load reCaptcha API if needed if ($hesk_settings['recaptcha_use'] == 2) { define('RECAPTCHA', 1); } // Print header $hesk_settings['tmp_title'] = $hesk_settings['hesk_title'] . ' - ' . $hesklang['submit_ticket']; require_once HESK_PATH . 'inc/header.inc.php'; //box hijau ?> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="3"><img src="img/headerleftsm.jpg" width="3" height="25" alt="" /></td> <td class="headersm"><?php hesk_showTopBar($hesklang['submit_ticket']); ?> </td> <td width="3"><img src="img/headerrightsm.jpg" width="3" height="25" alt="" /></td> </tr> </table> <table width="100%" border="0" cellspacing="0" cellpadding="3"> <tr> <td><span class="smaller"><a href="<?php echo $hesk_settings['site_url']; ?> " class="smaller"><?php echo $hesk_settings['site_title']; ?> </a> > <a href="<?php echo $hesk_settings['hesk_url']; ?> " class="smaller"><?php echo $hesk_settings['hesk_title']; ?> </a> > <?php echo $hesklang['submit_ticket']; ?> </span></td> </tr> </table> </td> </tr> <tr> <td> <?php // This will handle error, success and notice messages hesk_handle_messages(); //table ni yang box untuk form ?> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="7" height="7"><img src="img/roundcornerslt.jpg" width="7" height="7" alt="" /></td> <td class="roundcornerstop"></td> <td><img src="img/roundcornersrt.jpg" width="7" height="7" alt="" /></td> </tr> <tr> <td class="roundcornersleft"> </td> <td> <!-- START FORM --> <p style="text-align:center"><?php echo $hesklang['use_form_below']; ?> <font class="important"> *</font></p> <form method="post" action="submit_ticket.php?submit=1" name="form1" enctype="multipart/form-data"> <!-- Contact info --> <table border="0" width="100%"> <tr> <td style="text-align:right" width="150"><?php echo $hesklang['name']; ?> : <font class="important">*</font></td> <td width="80%"><input type="text" name="name" size="40" maxlength="30" value="<?php if (isset($_SESSION['c_name'])) { echo stripslashes(hesk_input($_SESSION['c_name'])); } ?> " <?php if (in_array('name', $_SESSION['iserror'])) { echo ' class="isError" '; } ?> /></td> </tr> <tr> <td style="text-align:right" width="150"><?php echo $hesklang['email']; ?> : <font class="important">*</font></td> <td width="80%"><input type="text" name="email" size="40" maxlength="1000" value="<?php if (isset($_SESSION['c_email'])) { echo stripslashes(hesk_input($_SESSION['c_email'])); } ?> " <?php if (in_array('email', $_SESSION['iserror'])) { echo ' class="isError" '; } elseif (in_array('email', $_SESSION['isnotice'])) { echo ' class="isNotice" '; } ?> <?php if ($hesk_settings['detect_typos']) { echo ' onblur="Javascript:hesk_suggestEmail(0)"'; } ?> /></td> </tr> <?php if ($hesk_settings['confirm_email']) { ?> <tr> <td style="text-align:right" width="150"><?php echo $hesklang['confemail']; ?> : <font class="important">*</font></td> <td width="80%"><input type="text" name="email2" size="40" maxlength="1000" value="<?php if (isset($_SESSION['c_email2'])) { echo stripslashes(hesk_input($_SESSION['c_email2'])); } ?> " <?php if (in_array('email2', $_SESSION['iserror'])) { echo ' class="isError" '; } ?> /></td> </tr> <?php } // End if $hesk_settings['confirm_email'] ?> </table> <div id="email_suggestions"></div> <hr /> <!-- Department and priority --> <?php $is_table = 0; hesk_load_database_functions(); // Get categories hesk_dbConnect(); $res = hesk_dbQuery("SELECT `id`, `name` FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "categories` WHERE `type`='0' ORDER BY `cat_order` ASC"); if (hesk_dbNumRows($res) == 1) { // Only 1 public category, no need for a select box $row = hesk_dbFetchAssoc($res); echo '<input type="hidden" name="category" value="' . $row['id'] . '" />'; } elseif (hesk_dbNumRows($res) < 1) { // No public categories, set it to default one echo '<input type="hidden" name="category" value="1" />'; } else { // List available categories $is_table = 1; ?> <table border="0" width="100%"> <tr> <td style="text-align:right" width="150"><?php echo $hesklang['category']; ?> : <font class="important">*</font></td> <td width="80%"><select name="category" <?php if (in_array('category', $_SESSION['iserror'])) { echo ' class="isError" '; } ?> > <?php // Show the "Click to select"? if ($hesk_settings['select_cat']) { echo '<option value="">' . $hesklang['select'] . '</option>'; } // List categories while ($row = hesk_dbFetchAssoc($res)) { echo '<option value="' . $row['id'] . '"' . ($_SESSION['c_category'] == $row['id'] ? ' selected="selected"' : '') . '>' . $row['name'] . '</option>'; } ?> </select></td> </tr> <?php } /* Can customer assign urgency? */ if ($hesk_settings['cust_urgency']) { if (!$is_table) { echo '<table border="0" width="100%">'; $is_table = 1; } ?> <tr> <td style="text-align:right" width="150"><?php echo $hesklang['priority']; ?> : <font class="important">*</font></td> <td width="80%"><select name="priority" <?php if (in_array('priority', $_SESSION['iserror'])) { echo ' class="isError" '; } ?> > <?php // Show the "Click to select"? if ($hesk_settings['select_pri']) { echo '<option value="">' . $hesklang['select'] . '</option>'; } ?> <option value="3" <?php if (isset($_SESSION['c_priority']) && $_SESSION['c_priority'] == 3) { echo 'selected="selected"'; } ?> ><?php echo $hesklang['low']; ?> </option> <option value="2" <?php if (isset($_SESSION['c_priority']) && $_SESSION['c_priority'] == 2) { echo 'selected="selected"'; } ?> ><?php echo $hesklang['medium']; ?> </option> <option value="1" <?php if (isset($_SESSION['c_priority']) && $_SESSION['c_priority'] == 1) { echo 'selected="selected"'; } ?> ><?php echo $hesklang['high']; ?> </option> </select></td> </tr> <?php } /* Need to close the table? */ if ($is_table) { echo '</table> <hr />'; } ?> <!-- START CUSTOM BEFORE --> <?php /* custom fields BEFORE comments */ $print_table = 0; foreach ($hesk_settings['custom_fields'] as $k => $v) { if ($v['use'] && $v['place'] == 0) { if ($print_table == 0) { echo '<table border="0" width="100%">'; $print_table = 1; } $v['req'] = $v['req'] ? '<font class="important">*</font>' : ''; if ($v['type'] == 'checkbox') { $k_value = array(); if (isset($_SESSION["c_{$k}"]) && is_array($_SESSION["c_{$k}"])) { foreach ($_SESSION["c_{$k}"] as $myCB) { $k_value[] = stripslashes(hesk_input($myCB)); } } } elseif (isset($_SESSION["c_{$k}"])) { $k_value = stripslashes(hesk_input($_SESSION["c_{$k}"])); } else { $k_value = ''; } switch ($v['type']) { /* Radio box */ case 'radio': echo ' <tr> <td style="text-align:right" width="150" valign="top">' . $v['name'] . ': ' . $v['req'] . '</td> <td width="80%">'; $options = explode('#HESK#', $v['value']); $cls = in_array($k, $_SESSION['iserror']) ? ' class="isError" ' : ''; foreach ($options as $option) { if (strlen($k_value) == 0 || $k_value == $option) { $k_value = $option; $checked = 'checked="checked"'; } else { $checked = ''; } echo '<label><input type="radio" name="' . $k . '" value="' . $option . '" ' . $checked . ' ' . $cls . ' /> ' . $option . '</label><br />'; } echo '</td> </tr> '; break; /* Select drop-down box */ /* Select drop-down box */ case 'select': $cls = in_array($k, $_SESSION['iserror']) ? ' class="isError" ' : ''; echo ' <tr> <td style="text-align:right" width="150">' . $v['name'] . ': ' . $v['req'] . '</td> <td width="80%"><select name="' . $k . '" ' . $cls . '>'; // Show "Click to select"? $v['value'] = str_replace('{HESK_SELECT}', '', $v['value'], $num); if ($num) { echo '<option value="">' . $hesklang['select'] . '</option>'; } $options = explode('#HESK#', $v['value']); foreach ($options as $option) { if ($k_value == $option) { $k_value = $option; $selected = 'selected="selected"'; } else { $selected = ''; } echo '<option ' . $selected . '>' . $option . '</option>'; } echo '</select></td> </tr> '; break; /* Checkbox */ /* Checkbox */ case 'checkbox': echo ' <tr> <td style="text-align:right" width="150" valign="top">' . $v['name'] . ': ' . $v['req'] . '</td> <td width="80%">'; $options = explode('#HESK#', $v['value']); $cls = in_array($k, $_SESSION['iserror']) ? ' class="isError" ' : ''; foreach ($options as $option) { if (in_array($option, $k_value)) { $checked = 'checked="checked"'; } else { $checked = ''; } echo '<label><input type="checkbox" name="' . $k . '[]" value="' . $option . '" ' . $checked . ' ' . $cls . ' /> ' . $option . '</label><br />'; } echo '</td> </tr> '; break; /* Large text box */ /* Large text box */ case 'textarea': $size = explode('#', $v['value']); $size[0] = empty($size[0]) ? 5 : intval($size[0]); $size[1] = empty($size[1]) ? 30 : intval($size[1]); $cls = in_array($k, $_SESSION['iserror']) ? ' class="isError" ' : ''; echo ' <tr> <td style="text-align:right" width="150" valign="top">' . $v['name'] . ': ' . $v['req'] . '</td> <td width="80%"><textarea name="' . $k . '" rows="' . $size[0] . '" cols="' . $size[1] . '" ' . $cls . '>' . $k_value . '</textarea></td> </tr> '; break; /* Default text input */ /* Default text input */ default: if (strlen($k_value) != 0) { $v['value'] = $k_value; } $cls = in_array($k, $_SESSION['iserror']) ? ' class="isError" ' : ''; echo ' <tr> <td style="text-align:right" width="150">' . $v['name'] . ': ' . $v['req'] . '</td> <td width="80%"><input type="text" name="' . $k . '" size="40" maxlength="' . $v['maxlen'] . '" value="' . $v['value'] . '" ' . $cls . ' /></td> </tr> '; } } } /* If table was started we need to close it */ if ($print_table) { echo '</table> <hr />'; $print_table = 0; } ?> <!-- END CUSTOM BEFORE --> <!-- ticket info --> <table border="0" width="100%"> <tr> <td style="text-align:right" width="150"><?php echo $hesklang['subject']; ?> : <font class="important">*</font></td> <td width="80%"><input type="text" name="subject" size="40" maxlength="40" value="<?php if (isset($_SESSION['c_subject'])) { echo stripslashes(hesk_input($_SESSION['c_subject'])); } ?> " <?php if (in_array('subject', $_SESSION['iserror'])) { echo ' class="isError" '; } ?> /></td> </tr> <tr> <td style="text-align:right" width="150" valign="top"><?php echo $hesklang['message']; ?> : <font class="important">*</font></td> <td width="80%"><textarea name="message" rows="12" cols="60" <?php if (in_array('message', $_SESSION['iserror'])) { echo ' class="isError" '; } ?> ><?php if (isset($_SESSION['c_message'])) { echo stripslashes(hesk_input($_SESSION['c_message'])); } ?> </textarea> <!-- START KNOWLEDGEBASE SUGGEST --> <?php if ($hesk_settings['kb_enable'] && $hesk_settings['kb_recommendanswers']) { ?> <div id="kb_suggestions" style="display:none"> <br /> <br /> <img src="img/loading.gif" width="24" height="24" alt="" border="0" style="vertical-align:text-bottom" /> <i><?php echo $hesklang['lkbs']; ?> </i> </div> <script language="Javascript" type="text/javascript"><!-- hesk_suggestKB(); //--> </script> <?php } ?> <!-- END KNOWLEDGEBASE SUGGEST --> </td> </tr> </table> <!-- START CUSTOM AFTER --> <?php /* custom fields AFTER comments */ $print_table = 0; foreach ($hesk_settings['custom_fields'] as $k => $v) { if ($v['use'] && $v['place']) { if ($print_table == 0) { echo ' <hr /> <table border="0" width="100%"> '; $print_table = 1; } $v['req'] = $v['req'] ? '<font class="important">*</font>' : ''; if ($v['type'] == 'checkbox') { $k_value = array(); if (isset($_SESSION["c_{$k}"]) && is_array($_SESSION["c_{$k}"])) { foreach ($_SESSION["c_{$k}"] as $myCB) { $k_value[] = stripslashes(hesk_input($myCB)); } } } elseif (isset($_SESSION["c_{$k}"])) { $k_value = stripslashes(hesk_input($_SESSION["c_{$k}"])); } else { $k_value = ''; } switch ($v['type']) { /* Radio box */ case 'radio': echo ' <tr> <td style="text-align:right" width="150" valign="top">' . $v['name'] . ': ' . $v['req'] . '</td> <td width="80%">'; $options = explode('#HESK#', $v['value']); $cls = in_array($k, $_SESSION['iserror']) ? ' class="isError" ' : ''; foreach ($options as $option) { if (strlen($k_value) == 0 || $k_value == $option) { $k_value = $option; $checked = 'checked="checked"'; } else { $checked = ''; } echo '<label><input type="radio" name="' . $k . '" value="' . $option . '" ' . $checked . ' ' . $cls . ' /> ' . $option . '</label><br />'; } echo '</td> </tr> '; break; /* Select drop-down box */ /* Select drop-down box */ case 'select': $cls = in_array($k, $_SESSION['iserror']) ? ' class="isError" ' : ''; echo ' <tr> <td style="text-align:right" width="150">' . $v['name'] . ': ' . $v['req'] . '</td> <td width="80%"><select name="' . $k . '" ' . $cls . '>'; // Show "Click to select"? $v['value'] = str_replace('{HESK_SELECT}', '', $v['value'], $num); if ($num) { echo '<option value="">' . $hesklang['select'] . '</option>'; } $options = explode('#HESK#', $v['value']); foreach ($options as $option) { if ($k_value == $option) { $k_value = $option; $selected = 'selected="selected"'; } else { $selected = ''; } echo '<option ' . $selected . '>' . $option . '</option>'; } echo '</select></td> </tr> '; break; /* Checkbox */ /* Checkbox */ case 'checkbox': echo ' <tr> <td style="text-align:right" width="150" valign="top">' . $v['name'] . ': ' . $v['req'] . '</td> <td width="80%">'; $options = explode('#HESK#', $v['value']); $cls = in_array($k, $_SESSION['iserror']) ? ' class="isError" ' : ''; foreach ($options as $option) { if (in_array($option, $k_value)) { $checked = 'checked="checked"'; } else { $checked = ''; } echo '<label><input type="checkbox" name="' . $k . '[]" value="' . $option . '" ' . $checked . ' ' . $cls . ' /> ' . $option . '</label><br />'; } echo '</td> </tr> '; break; /* Large text box */ /* Large text box */ case 'textarea': $size = explode('#', $v['value']); $size[0] = empty($size[0]) ? 5 : intval($size[0]); $size[1] = empty($size[1]) ? 30 : intval($size[1]); $cls = in_array($k, $_SESSION['iserror']) ? ' class="isError" ' : ''; echo ' <tr> <td style="text-align:right" width="150" valign="top">' . $v['name'] . ': ' . $v['req'] . '</td> <td width="80%"><textarea name="' . $k . '" rows="' . $size[0] . '" cols="' . $size[1] . '" ' . $cls . '>' . $k_value . '</textarea></td> </tr> '; break; /* Default text input */ /* Default text input */ default: if (strlen($k_value) != 0) { $v['value'] = $k_value; } $cls = in_array($k, $_SESSION['iserror']) ? ' class="isError" ' : ''; echo ' <tr> <td style="text-align:right" width="150">' . $v['name'] . ': ' . $v['req'] . '</td> <td width="80%"><input type="text" name="' . $k . '" size="40" maxlength="' . $v['maxlen'] . '" value="' . $v['value'] . '" ' . $cls . ' /></td> </tr> '; } } } /* If table was started we need to close it */ if ($print_table) { echo '</table>'; $print_table = 0; } ?> <!-- END CUSTOM AFTER --> <?php /* attachments */ if ($hesk_settings['attachments']['use']) { ?> <hr /> <table border="0" width="100%"> <tr> <td style="text-align:right" width="150" valign="top"><?php echo $hesklang['attachments']; ?> :</td> <td width="80%" valign="top"> <?php for ($i = 1; $i <= $hesk_settings['attachments']['max_number']; $i++) { $cls = $i == 1 && in_array('attachments', $_SESSION['iserror']) ? ' class="isError" ' : ''; echo '<input type="file" name="attachment[' . $i . ']" size="50" ' . $cls . ' /><br />'; } ?> <a href="file_limits.php" target="_blank" onclick="Javascript:hesk_window('file_limits.php',250,500);return false;"><?php echo $hesklang['ful']; ?> </a> </td> </tr> </table> <?php } if ($hesk_settings['question_use'] || $hesk_settings['secimg_use']) { ?> <hr /> <!-- Security checks --> <table border="0" width="100%"> <?php if ($hesk_settings['question_use']) { ?> <tr> <td style="text-align:right;vertical-align:top" width="150"><?php echo $hesklang['verify_q']; ?> <font class="important">*</font></td> <td width="80%"> <?php $value = ''; if (isset($_SESSION['c_question'])) { $value = stripslashes(hesk_input($_SESSION['c_question'])); } $cls = in_array('question', $_SESSION['iserror']) ? ' class="isError" ' : ''; echo $hesk_settings['question_ask'] . '<br /><input type="text" name="question" size="20" value="' . $value . '" ' . $cls . ' />'; ?> <br /> </td> </tr> <?php } if ($hesk_settings['secimg_use']) { ?> <tr> <td style="text-align:right;vertical-align:top" width="150"><?php echo $hesklang['verify_i']; ?> <font class="important">*</font></td> <td width="80%"> <?php // SPAM prevention verified for this session if (isset($_SESSION['img_verified'])) { echo '<img src="' . HESK_PATH . 'img/success.png" width="16" height="16" border="0" alt="" style="vertical-align:text-bottom" /> ' . $hesklang['vrfy']; } elseif ($hesk_settings['recaptcha_use'] == 1) { ?> <script type="text/javascript"> var RecaptchaOptions = { theme : '<?php echo isset($_SESSION['iserror']) && in_array('mysecnum', $_SESSION['iserror']) ? 'red' : 'white'; ?> ', custom_translations : { visual_challenge : "<?php echo hesk_slashJS($hesklang['visual_challenge']); ?> ", audio_challenge : "<?php echo hesk_slashJS($hesklang['audio_challenge']); ?> ", refresh_btn : "<?php echo hesk_slashJS($hesklang['refresh_btn']); ?> ", instructions_visual : "<?php echo hesk_slashJS($hesklang['instructions_visual']); ?> ", instructions_context : "<?php echo hesk_slashJS($hesklang['instructions_context']); ?> ", instructions_audio : "<?php echo hesk_slashJS($hesklang['instructions_audio']); ?> ", help_btn : "<?php echo hesk_slashJS($hesklang['help_btn']); ?> ", play_again : "<?php echo hesk_slashJS($hesklang['play_again']); ?> ", cant_hear_this : "<?php echo hesk_slashJS($hesklang['cant_hear_this']); ?> ", incorrect_try_again : "<?php echo hesk_slashJS($hesklang['incorrect_try_again']); ?> ", image_alt_text : "<?php echo hesk_slashJS($hesklang['image_alt_text']); ?> ", }, }; </script> <?php require HESK_PATH . 'inc/recaptcha/recaptchalib.php'; echo recaptcha_get_html($hesk_settings['recaptcha_public_key'], null, true); } elseif ($hesk_settings['recaptcha_use'] == 2) { ?> <div class="g-recaptcha" data-sitekey="<?php echo $hesk_settings['recaptcha_public_key']; ?> "></div> <?php } else { $cls = in_array('mysecnum', $_SESSION['iserror']) ? ' class="isError" ' : ''; echo $hesklang['sec_enter'] . '<br /> <br /><img src="print_sec_img.php?' . rand(10000, 99999) . '" width="150" height="40" alt="' . $hesklang['sec_img'] . '" title="' . $hesklang['sec_img'] . '" border="1" name="secimg" style="vertical-align:text-bottom" /> ' . '<a href="javascript:void(0)" onclick="javascript:document.form1.secimg.src=\'print_sec_img.php?\'+ ( Math.floor((90000)*Math.random()) + 10000);"><img src="img/reload.png" height="24" width="24" alt="' . $hesklang['reload'] . '" title="' . $hesklang['reload'] . '" border="0" style="vertical-align:text-bottom" /></a>' . '<br /> <br /><input type="text" name="mysecnum" size="20" maxlength="5" ' . $cls . ' />'; } ?> </td> </tr> <?php } ?> </table> <?php } ?> <!-- Submit --> <?php if ($hesk_settings['submit_notice']) { ?> <hr /> <div align="center"> <table border="0"> <tr> <td> <b><?php echo $hesklang['before_submit']; ?> </b> <ul> <li><?php echo $hesklang['all_info_in']; ?> .</li> <li><?php echo $hesklang['all_error_free']; ?> .</li> </ul> <b><?php echo $hesklang['we_have']; ?> :</b> <ul> <li><?php echo hesk_htmlspecialchars($_SERVER['REMOTE_ADDR']) . ' ' . $hesklang['recorded_ip']; ?> </li> <li><?php echo $hesklang['recorded_time']; ?> </li> </ul> <p align="center"><input type="hidden" name="token" value="<?php hesk_token_echo(); ?> " /> <input type="submit" value="<?php echo $hesklang['sub_ticket']; ?> " class="orangebutton" onmouseover="hesk_btn(this,'orangebuttonover');" onmouseout="hesk_btn(this,'orangebutton');" /></p> </td> </tr> </table> </div> <?php } else { ?> <br /> <br /> <table border="0" width="100%"> <tr> <td style="text-align:right" width="150"> </td> <td width="80%"><input type="hidden" name="token" value="<?php hesk_token_echo(); ?> " /> <input type="submit" value="<?php echo $hesklang['sub_ticket']; ?> " class="orangebutton" onmouseover="hesk_btn(this,'orangebuttonover');" onmouseout="hesk_btn(this,'orangebutton');" /><br /> <br /> </td> </tr> </table> <?php } // End ELSE submit_notice ?> <!-- Do not delete or modify the code below, it is used to detect simple SPAM bots --> <input type="hidden" name="hx" value="3" /><input type="hidden" name="hy" value="" /> <!-- > <input type="text" name="phone" value="3" /> < --> </form> <!-- END FORM --> </td> <td class="roundcornersright"> </td> </tr> <tr> <td><img src="img/roundcornerslb.jpg" width="7" height="7" alt="" /></td> <td class="roundcornersbottom"></td> <td width="7" height="7"><img src="img/roundcornersrb.jpg" width="7" height="7" alt="" /></td> </tr> </table> <?php hesk_cleanSessionVars('iserror'); hesk_cleanSessionVars('isnotice'); }
</table> </td> <td class="roundcornersright"> </td> </tr> <tr> <td><img src="../img/roundcornerslb.jpg" width="7" height="7" alt="" /></td> <td class="roundcornersbottom"></td> <td width="7" height="7"><img src="../img/roundcornersrb.jpg" width="7" height="7" alt="" /></td> </tr> </table> <!-- Submit --> <p align="center"><input type="hidden" name="action" value="update" /> <input type="hidden" name="token" value="<?php hesk_token_echo(); ?> " /> <input type="submit" value="<?php echo $hesklang['update_profile']; ?> " class="orangebutton" onmouseover="hesk_btn(this,'orangebuttonover');" onmouseout="hesk_btn(this,'orangebutton');" /></p> <p> </p> </form> <?php require_once HESK_PATH . 'inc/footer.inc.php'; exit; /*** START FUNCTIONS ***/ function update_profile()
function print_add_ticket() { global $hesk_settings, $hesklang, $modsForHesk_settings; // Auto-focus first empty or error field define('AUTOFOCUS', true); // Pre-populate fields // Customer name if (isset($_REQUEST['name'])) { $_SESSION['c_name'] = $_REQUEST['name']; } // Customer email address if (isset($_REQUEST['email'])) { $_SESSION['c_email'] = $_REQUEST['email']; $_SESSION['c_email2'] = $_REQUEST['email']; } // Category ID if (isset($_REQUEST['catid'])) { $_SESSION['c_category'] = intval($_REQUEST['catid']); } if (isset($_REQUEST['category'])) { $_SESSION['c_category'] = intval($_REQUEST['category']); } // Priority if (isset($_REQUEST['priority'])) { $_SESSION['c_priority'] = intval($_REQUEST['priority']); } // Subject if (isset($_REQUEST['subject'])) { $_SESSION['c_subject'] = $_REQUEST['subject']; } // Message if (isset($_REQUEST['message'])) { $_SESSION['c_message'] = $_REQUEST['message']; } // Custom fields foreach ($hesk_settings['custom_fields'] as $k => $v) { if ($v['use'] && isset($_REQUEST[$k])) { $_SESSION['c_' . $k] = $_REQUEST[$k]; } } // Variables for coloring the fields in case of errors if (!isset($_SESSION['iserror'])) { $_SESSION['iserror'] = array(); } if (!isset($_SESSION['isnotice'])) { $_SESSION['isnotice'] = array(); } if (!isset($_SESSION['c_category']) && !$hesk_settings['select_cat']) { $_SESSION['c_category'] = 0; } hesk_cleanSessionVars('already_submitted'); // Tell header to load reCaptcha API if needed if ($hesk_settings['recaptcha_use'] == 2) { define('RECAPTCHA', 1); } // Print header $hesk_settings['tmp_title'] = $hesk_settings['hesk_title'] . ' - ' . $hesklang['submit_ticket']; require_once HESK_PATH . 'inc/header.inc.php'; ?> <ol class="breadcrumb"> <li><a href="<?php echo $hesk_settings['site_url']; ?> "><?php echo $hesk_settings['site_title']; ?> </a></li> <li><a href="<?php echo $hesk_settings['hesk_url']; ?> "><?php echo $hesk_settings['hesk_title']; ?> </a></li> <li class="active"><?php echo $hesklang['sub_support']; ?> </li> </ol> <!-- START MAIN LAYOUT --> <?php $columnWidth = 'col-md-8'; hesk_dbConnect(); $showRs = hesk_dbQuery("SELECT `show` FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "quick_help_sections` WHERE `id` = 1"); $show = hesk_dbFetchAssoc($showRs); if (!$show['show']) { $columnWidth = 'col-md-10 col-md-offset-1'; } ?> <div class="row"> <?php if ($columnWidth == 'col-md-8') { ?> <div align="left" 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['quick_help_submit_ticket']; ?> </p> </div> </div> </div> <?php } ?> <div class="<?php echo $columnWidth; ?> "> <?php // This will handle error, success and notice messages hesk_handle_messages(); ?> <!-- START FORM --> <div class="form"> <h2><?php hesk_showTopBar($hesklang['submit_ticket']); ?> </h2> <small><?php echo $hesklang['use_form_below']; ?> </small> <div class="blankSpace"></div> <div align="left" class="h3"><?php echo $hesklang['add_ticket_general_information']; ?> </div> <div class="footerWithBorder"></div> <div class="blankSpace"></div> <form class="form-horizontal" role="form" method="post" action="submit_ticket.php?submit=1" name="form1" enctype="multipart/form-data"> <!-- Contact info --> <div class="form-group"> <label for="name" class="col-sm-3 control-label"><?php echo $hesklang['name']; ?> : <font class="important">*</font></label> <div class="col-sm-9"> <input type="text" class="form-control" id="name" name="name" size="40" maxlength="30" value="<?php if (isset($_SESSION['c_name'])) { echo stripslashes(hesk_input($_SESSION['c_name'])); } ?> " <?php if (in_array('name', $_SESSION['iserror'])) { echo ' class="isError" '; } ?> placeholder="<?php echo htmlspecialchars($hesklang['name']); ?> " /> </div> </div> <div class="form-group"> <label for="email" class="col-sm-3 control-label"><?php echo $hesklang['email']; ?> : <font class="important">*</font></label> <div class="col-sm-9"> <input type="text" class="form-control" id="email" name="email" size="40" maxlength="1000" value="<?php if (isset($_SESSION['c_email'])) { echo stripslashes(hesk_input($_SESSION['c_email'])); } ?> " <?php if (in_array('email', $_SESSION['iserror'])) { echo ' class="isError" '; } elseif (in_array('email', $_SESSION['isnotice'])) { echo ' class="isNotice" '; } ?> <?php if ($hesk_settings['detect_typos']) { echo ' onblur="Javascript:hesk_suggestEmail(0)"'; } ?> placeholder="<?php echo htmlspecialchars($hesklang['email']); ?> " /> </div> </div> <?php if ($hesk_settings['confirm_email']) { ?> <div class="form-group"> <label for="email2" class="col-sm-3 control-label"><?php echo $hesklang['confemail']; ?> : <font class="important">*</font></label> <div class="col-sm-9"> <input type="text" id="email2" class="form-control" name="email2" size="40" maxlength="1000" value="<?php if (isset($_SESSION['c_email2'])) { echo stripslashes(hesk_input($_SESSION['c_email2'])); } ?> " <?php if (in_array('email2', $_SESSION['iserror'])) { echo ' class="isError" '; } ?> placeholder="<?php echo htmlspecialchars($hesklang['confemail']); ?> " /> </div> </div> <?php } ?> <div id="email_suggestions"></div> <!-- Department and priority --> <?php $is_table = 0; // Get categories hesk_dbConnect(); $orderBy = $modsForHesk_settings['category_order_column']; $res = hesk_dbQuery("SELECT `id`, `name` FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "categories` WHERE `type`='0' ORDER BY `" . $orderBy . "` ASC"); if (hesk_dbNumRows($res) == 1) { // Only 1 public category, no need for a select box $row = hesk_dbFetchAssoc($res); echo '<input type="hidden" name="category" value="' . $row['id'] . '" />'; } elseif (hesk_dbNumRows($res) < 1) { // No public categories, set it to default one echo '<input type="hidden" name="category" value="1" />'; } else { // List available categories $is_table = 1; ?> <div class="form-group"> <label for="category" class="col-sm-3 control-label"><?php echo $hesklang['category']; ?> : <font class="important">*</font></label> <div class="col-sm-9"> <select name="category" id="category" class="form-control" <?php if (in_array('category', $_SESSION['iserror'])) { echo ' class="isError" '; } ?> ><?php // Show the "Click to select"? if ($hesk_settings['select_cat']) { echo '<option value="">' . $hesklang['select'] . '</option>'; } // List categories while ($row = hesk_dbFetchAssoc($res)) { echo '<option value="' . $row['id'] . '"' . ($_SESSION['c_category'] == $row['id'] ? ' selected="selected"' : '') . '>' . $row['name'] . '</option>'; } ?> </select> </div> </div> <?php } /* Can customer assign urgency? */ if ($hesk_settings['cust_urgency']) { ?> <div class="form-group"> <label for="priority" class="col-sm-3 control-label"><?php echo $hesklang['priority']; ?> : <font class="important">*</font></label> <div class="col-sm-9"> <select id="priority" class="form-control" name="priority" <?php if (in_array('priority', $_SESSION['iserror'])) { echo ' class="isError" '; } ?> > <?php // Show the "Click to select"? if ($hesk_settings['select_pri']) { echo '<option value="">' . $hesklang['select'] . '</option>'; } ?> <option value="3" <?php if (isset($_SESSION['c_priority']) && $_SESSION['c_priority'] == 3) { echo 'selected="selected"'; } ?> ><?php echo $hesklang['low']; ?> </option> <option value="2" <?php if (isset($_SESSION['c_priority']) && $_SESSION['c_priority'] == 2) { echo 'selected="selected"'; } ?> ><?php echo $hesklang['medium']; ?> </option> <option value="1" <?php if (isset($_SESSION['c_priority']) && $_SESSION['c_priority'] == 1) { echo 'selected="selected"'; } ?> ><?php echo $hesklang['high']; ?> </option> </select> </div> </div> <?php } ?> <!-- 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']) { $v['name'] = $hesklang[$v['name']]; } $v['req'] = $v['req'] ? '<font class="important">*</font>' : ''; if ($v['type'] == 'checkbox') { $k_value = array(); if (isset($_SESSION["c_{$k}"]) && is_array($_SESSION["c_{$k}"])) { foreach ($_SESSION["c_{$k}"] as $myCB) { $k_value[] = stripslashes(hesk_input($myCB)); } } } elseif (isset($_SESSION["c_{$k}"])) { $k_value = stripslashes(hesk_input($_SESSION["c_{$k}"])); } else { $k_value = ''; } switch ($v['type']) { /* Radio box */ case 'radio': //Clean up multiple dashes or whitespaces $formattedId = preg_replace("/[\\s-]+/", " ", $v['name']); $formattedId = preg_replace("/[\\s_]/", "-", $formattedId); echo '<div class="form-group"><label class="col-sm-3 control-label">' . $v['name'] . ': ' . $v['req'] . '</label><div align="left" class="col-sm-9">'; $options = explode('#HESK#', $v['value']); $cls = in_array($k, $_SESSION['iserror']) ? ' class="isError" ' : ''; foreach ($options as $option) { if (strlen($k_value) == 0 || $k_value == $option) { $k_value = $option; $checked = 'checked="checked"'; } else { $checked = ''; } echo '<label style="font-weight: normal;"><input type="radio" id="' . $formattedId . '" name="' . $k . '" value="' . $option . '" ' . $checked . ' ' . $cls . ' /> ' . $option . '</label><br />'; } echo '</div></div>'; break; /* Select drop-down box */ /* Select drop-down box */ case 'select': //Clean up multiple dashes or whitespaces $formattedId = preg_replace("/[\\s-]+/", " ", $v['name']); $formattedId = preg_replace("/[\\s_]/", "-", $formattedId); $cls = in_array($k, $_SESSION['iserror']) ? ' class="isError" ' : ''; echo '<div class="form-group"><label for="' . $v['name'] . '" class="col-sm-3 control-label">' . $v['name'] . ': ' . $v['req'] . '</label> <div class="col-sm-9"><select class="form-control" id="' . $formattedId . '" name="' . $k . '" ' . $cls . '>'; // Show "Click to select"? $v['value'] = str_replace('{HESK_SELECT}', '', $v['value'], $num); if ($num) { echo '<option value="">' . $hesklang['select'] . '</option>'; } $options = explode('#HESK#', $v['value']); foreach ($options as $option) { if ($k_value == $option) { $k_value = $option; $selected = 'selected="selected"'; } else { $selected = ''; } echo '<option ' . $selected . '>' . $option . '</option>'; } echo '</select></div></div>'; break; /* Checkbox */ /* Checkbox */ case 'checkbox': //Clean up multiple dashes or whitespaces $formattedId = preg_replace("/[\\s-]+/", " ", $v['name']); $formattedId = preg_replace("/[\\s_]/", "-", $formattedId); echo '<div class="form-group"><label class="col-sm-3 control-label">' . $v['name'] . ': ' . $v['req'] . '</label><div align="left" class="col-sm-9">'; $options = explode('#HESK#', $v['value']); $cls = in_array($k, $_SESSION['iserror']) ? ' class="isError" ' : ''; foreach ($options as $option) { if (in_array($option, $k_value)) { $checked = 'checked="checked"'; } else { $checked = ''; } echo '<label style="font-weight: normal;"><input id="' . $formattedId . '" type="checkbox" name="' . $k . '[]" value="' . $option . '" ' . $checked . ' ' . $cls . ' /> ' . $option . '</label><br />'; } echo '</div></div>'; break; /* Large text box */ /* Large text box */ case 'textarea': //Clean up multiple dashes or whitespaces $formattedId = preg_replace("/[\\s-]+/", " ", $v['name']); $formattedId = preg_replace("/[\\s_]/", "-", $formattedId); $size = explode('#', $v['value']); $size[0] = empty($size[0]) ? 5 : intval($size[0]); $size[1] = empty($size[1]) ? 30 : intval($size[1]); $cls = in_array($k, $_SESSION['iserror']) ? ' class="isError" ' : ''; echo '<div class="form-group"> <label for="' . $v['name'] . '" class="col-sm-3 control-label">' . $v['name'] . ': ' . $v['req'] . '</label> <div class="col-sm-9"><textarea class="form-control" id="' . $formattedId . '" name="' . $k . '" rows="' . $size[0] . '" cols="' . $size[1] . '" ' . $cls . '>' . $k_value . '</textarea></div> </div>'; break; case 'multiselect': //Clean up multiple dashes or whitespaces $formattedId = preg_replace("/[\\s-]+/", " ", $v['name']); $formattedId = preg_replace("/[\\s_]/", "-", $formattedId); $cls = in_array($k, $_SESSION['iserror']) ? ' class="isError" ' : ''; echo '<div class="form-group"><label for="' . $v['name'] . '[]" class="col-sm-3 control-label">' . $v['name'] . ': ' . $v['req'] . '</label> <div class="col-sm-9"><select class="form-control" id="' . $formattedId . '" name="' . $k . '[]" ' . $cls . ' multiple>'; $options = explode('#HESK#', $v['value']); foreach ($options as $option) { if ($k_value == $option) { $k_value = $option; $selected = 'selected="selected"'; } else { $selected = ''; } echo '<option ' . $selected . '>' . $option . '</option>'; } echo '</select> <div class="btn-group" role="group"> <button type="button" class="btn btn-default" onclick="selectAll(\'' . $formattedId . '\')">Select All</button> <button type="button" class="btn btn-default" onclick="deselectAll(\'' . $formattedId . '\')">Deselect All</button> </div> </div></div>'; break; case 'date': //Clean up multiple dashes or whitespaces $formattedId = preg_replace("/[\\s-]+/", " ", $v['name']); $formattedId = preg_replace("/[\\s_]/", "-", $formattedId); if (strlen($k_value) != 0) { $v['value'] = $k_value; } $cls = in_array($k, $_SESSION['iserror']) ? ' isError ' : ''; echo ' <div class="form-group"> <label for="' . $v['name'] . '" class="col-sm-3 control-label">' . $v['name'] . ': ' . $v['req'] . '</label> <div class="col-sm-9"> <input type="text" class="datepicker form-control white-readonly ' . $cls . '" placeholder="' . htmlspecialchars($v['name']) . '" id="' . $formattedId . '" name="' . $k . '" size="40" maxlength="' . $v['maxlen'] . '" value="' . $v['value'] . '" readonly/> <span class="help-block">' . $hesklang['date_format'] . '</span> </div> </div>'; break; case 'email': //Clean up multiple dashes or whitespaces $formattedId = preg_replace("/[\\s-]+/", " ", $v['name']); $formattedId = preg_replace("/[\\s_]/", "-", $formattedId); if (strlen($k_value) != 0) { $v['value'] = $k_value; } if ($v['value'] == 'cc' || $v['value'] == 'bcc') { // (b)cc isn't a valid email but is the "value" used by settings. Just remove it. $v['value'] = ''; } $cls = in_array($k, $_SESSION['iserror']) ? ' class="isError" ' : ''; echo '<div class="form-group"> <label for="' . $v['name'] . '" class="col-sm-3 control-label">' . $v['name'] . ': ' . $v['req'] . '</label> <div class="col-sm-9"><input type="text" class="form-control" id="' . $formattedId . '" name="' . $k . '" size="40" maxlength="' . $v['maxlen'] . '" value="' . $v['value'] . '" ' . $cls . ' /></div> </div>'; break; /* Default text input */ /* Default text input */ default: //Clean up multiple dashes or whitespaces $formattedId = preg_replace("/[\\s-]+/", " ", $v['name']); $formattedId = preg_replace("/[\\s_]/", "-", $formattedId); if (strlen($k_value) != 0) { $v['value'] = $k_value; } $cls = in_array($k, $_SESSION['iserror']) ? ' class="isError" ' : ''; echo '<div class="form-group"> <label for="' . $v['name'] . '" class="col-sm-3 control-label">' . $v['name'] . ': ' . $v['req'] . '</label> <div class="col-sm-9"><input type="text" class="form-control" id="' . $formattedId . '" name="' . $k . '" size="40" maxlength="' . $v['maxlen'] . '" value="' . $v['value'] . '" ' . $cls . ' /></div> </div>'; } } } ?> <!-- END CUSTOM BEFORE --> <div class="blankSpace"></div> <div align="left" class="h3"><?php echo $hesklang['add_ticket_your_message']; ?> </div> <div class="footerWithBorder"></div> <div class="blankSpace"></div> <!-- ticket info --> <div class="form-group"> <label for="subject" class="col-sm-3 control-label"><?php echo $hesklang['subject']; ?> : <font class="important">*</font></label> <div class="col-sm-9"> <input type="text" id="subject" class="form-control" name="subject" size="40" maxlength="40" value="<?php if (isset($_SESSION['c_subject'])) { echo stripslashes(hesk_input($_SESSION['c_subject'])); } ?> " <?php if (in_array('subject', $_SESSION['iserror'])) { echo ' class="isError" '; } ?> placeholder="<?php echo htmlspecialchars($hesklang['subject']); ?> "/> </div> </div> <div class="form-group"> <div class="col-sm-12"> <textarea placeholder="<?php echo htmlspecialchars($hesklang['message']); ?> " name="message" id="message" class="form-control" rows="12" cols="60" <?php if (in_array('message', $_SESSION['iserror'])) { echo ' class="isError" '; } ?> ><?php if (isset($_SESSION['c_message'])) { echo stripslashes(hesk_input($_SESSION['c_message'])); } ?> </textarea> </div> </div> <!-- START KNOWLEDGEBASE SUGGEST --> <?php if ($hesk_settings['kb_enable'] && $hesk_settings['kb_recommendanswers']) { ?> <div id="kb_suggestions" style="display:none"> <br /> <br /> <img src="img/loading.gif" width="24" height="24" alt="" border="0" style="vertical-align:text-bottom" /> <i><?php echo $hesklang['lkbs']; ?> </i> </div> <script language="Javascript" type="text/javascript"><!-- hesk_suggestKB(); //--> </script> <?php } ?> <!-- END KNOWLEDGEBASE SUGGEST --> <!-- START CUSTOM AFTER --> <?php /* custom fields AFTER comments */ foreach ($hesk_settings['custom_fields'] as $k => $v) { if ($v['use'] && $v['place']) { if ($modsForHesk_settings['custom_field_setting']) { $v['name'] = $hesklang[$v['name']]; } $v['req'] = $v['req'] ? '<font class="important">*</font>' : ''; if ($v['type'] == 'checkbox') { $k_value = array(); if (isset($_SESSION["c_{$k}"]) && is_array($_SESSION["c_{$k}"])) { foreach ($_SESSION["c_{$k}"] as $myCB) { $k_value[] = stripslashes(hesk_input($myCB)); } } } elseif (isset($_SESSION["c_{$k}"])) { $k_value = stripslashes(hesk_input($_SESSION["c_{$k}"])); } else { $k_value = ''; } switch ($v['type']) { /* Radio box */ case 'radio': //Clean up multiple dashes or whitespaces $formattedId = preg_replace("/[\\s-]+/", " ", $v['name']); $formattedId = preg_replace("/[\\s_]/", "-", $formattedId); echo '<div class="form-group"><label class="col-sm-3 control-label">' . $v['name'] . ': ' . $v['req'] . '</label><div align="left" class="col-sm-9">'; $options = explode('#HESK#', $v['value']); $cls = in_array($k, $_SESSION['iserror']) ? ' class="isError" ' : ''; foreach ($options as $option) { if (strlen($k_value) == 0 || $k_value == $option) { $k_value = $option; $checked = 'checked="checked"'; } else { $checked = ''; } echo '<label style="font-weight: normal;"><input type="radio" id="' . $formattedId . '" name="' . $k . '" value="' . $option . '" ' . $checked . ' ' . $cls . ' /> ' . $option . '</label><br />'; } echo '</div></div>'; break; /* Select drop-down box */ /* Select drop-down box */ case 'select': //Clean up multiple dashes or whitespaces $formattedId = preg_replace("/[\\s-]+/", " ", $v['name']); $formattedId = preg_replace("/[\\s_]/", "-", $formattedId); $cls = in_array($k, $_SESSION['iserror']) ? ' class="isError" ' : ''; echo '<div class="form-group"><label for="' . $v['name'] . '" class="col-sm-3 control-label">' . $v['name'] . ': ' . $v['req'] . '</label> <div class="col-sm-9"><select class="form-control" id="' . $formattedId . '" name="' . $k . '" ' . $cls . '>'; // Show "Click to select"? $v['value'] = str_replace('{HESK_SELECT}', '', $v['value'], $num); if ($num) { echo '<option value="">' . $hesklang['select'] . '</option>'; } $options = explode('#HESK#', $v['value']); foreach ($options as $option) { if ($k_value == $option) { $k_value = $option; $selected = 'selected="selected"'; } else { $selected = ''; } echo '<option ' . $selected . '>' . $option . '</option>'; } echo '</select></div></div>'; break; /* Checkbox */ /* Checkbox */ case 'checkbox': //Clean up multiple dashes or whitespaces $formattedId = preg_replace("/[\\s-]+/", " ", $v['name']); $formattedId = preg_replace("/[\\s_]/", "-", $formattedId); echo '<div class="form-group"><label class="col-sm-3 control-label">' . $v['name'] . ': ' . $v['req'] . '</label><div align="left" class="col-sm-9">'; $options = explode('#HESK#', $v['value']); $cls = in_array($k, $_SESSION['iserror']) ? ' class="isError" ' : ''; foreach ($options as $option) { if (in_array($option, $k_value)) { $checked = 'checked="checked"'; } else { $checked = ''; } echo '<label style="font-weight: normal;"><input id="' . $formattedId . '" type="checkbox" name="' . $k . '[]" value="' . $option . '" ' . $checked . ' ' . $cls . ' /> ' . $option . '</label><br />'; } echo '</div></div>'; break; /* Large text box */ /* Large text box */ case 'textarea': //Clean up multiple dashes or whitespaces $formattedId = preg_replace("/[\\s-]+/", " ", $v['name']); $formattedId = preg_replace("/[\\s_]/", "-", $formattedId); $size = explode('#', $v['value']); $size[0] = empty($size[0]) ? 5 : intval($size[0]); $size[1] = empty($size[1]) ? 30 : intval($size[1]); $cls = in_array($k, $_SESSION['iserror']) ? ' class="isError" ' : ''; echo '<div class="form-group"> <label for="' . $v['name'] . '" class="col-sm-3 control-label">' . $v['name'] . ': ' . $v['req'] . '</label> <div class="col-sm-9"><textarea class="form-control" id="' . $formattedId . '" name="' . $k . '" rows="' . $size[0] . '" cols="' . $size[1] . '" ' . $cls . '>' . $k_value . '</textarea></div> </div>'; break; case 'multiselect': //Clean up multiple dashes or whitespaces $formattedId = preg_replace("/[\\s-]+/", " ", $v['name']); $formattedId = preg_replace("/[\\s_]/", "-", $formattedId); $cls = in_array($k, $_SESSION['iserror']) ? ' class="isError" ' : ''; echo '<div class="form-group"><label for="' . $v['name'] . '[]" class="col-sm-3 control-label">' . $v['name'] . ': ' . $v['req'] . '</label> <div class="col-sm-9"><select class="form-control" id="' . $formattedId . '" name="' . $k . '[]" ' . $cls . ' multiple>'; $options = explode('#HESK#', $v['value']); foreach ($options as $option) { if ($k_value == $option) { $k_value = $option; $selected = 'selected="selected"'; } else { $selected = ''; } echo '<option ' . $selected . '>' . $option . '</option>'; } echo '</select> <div class="btn-group" role="group"> <button type="button" class="btn btn-default" onclick="selectAll(\'' . $formattedId . '\')">Select All</button> <button type="button" class="btn btn-default" onclick="deselectAll(\'' . $formattedId . '\')">Deselect All</button> </div></div></div>'; break; case 'date': //Clean up multiple dashes or whitespaces $formattedId = preg_replace("/[\\s-]+/", " ", $v['name']); $formattedId = preg_replace("/[\\s_]/", "-", $formattedId); if (strlen($k_value) != 0) { $v['value'] = $k_value; } $cls = in_array($k, $_SESSION['iserror']) ? ' isError ' : ''; echo ' <div class="form-group"> <label for="' . $v['name'] . '" class="col-sm-3 control-label">' . $v['name'] . ': ' . $v['req'] . '</label> <div class="col-sm-9"> <input type="text" class="datepicker form-control white-readonly ' . $cls . '" placeholder="' . htmlspecialchars($v['name']) . '" id="' . $formattedId . '" name="' . $k . '" size="40" maxlength="' . $v['maxlen'] . '" value="' . $v['value'] . '" readonly/> <span class="help-block">' . $hesklang['date_format'] . '</span> </div> </div>'; break; case 'email': //Clean up multiple dashes or whitespaces $formattedId = preg_replace("/[\\s-]+/", " ", $v['name']); $formattedId = preg_replace("/[\\s_]/", "-", $formattedId); if (strlen($k_value) != 0) { $v['value'] = $k_value; } if ($v['value'] == 'cc' || $v['value'] == 'bcc') { // (b)cc isn't a valid email but is the "value" used by settings. Just remove it. $v['value'] = ''; } $cls = in_array($k, $_SESSION['iserror']) ? ' class="isError" ' : ''; echo '<div class="form-group"> <label for="' . $v['name'] . '" class="col-sm-3 control-label">' . $v['name'] . ': ' . $v['req'] . '</label> <div class="col-sm-9"><input type="text" class="form-control" id="' . $formattedId . '" name="' . $k . '" size="40" maxlength="' . $v['maxlen'] . '" value="' . $v['value'] . '" ' . $cls . ' /></div> </div>'; break; /* Default text input */ /* Default text input */ default: //Clean up multiple dashes or whitespaces $formattedId = preg_replace("/[\\s-]+/", " ", $v['name']); $formattedId = preg_replace("/[\\s_]/", "-", $formattedId); if (strlen($k_value) != 0) { $v['value'] = $k_value; } $cls = in_array($k, $_SESSION['iserror']) ? ' class="isError" ' : ''; echo '<div class="form-group"> <label for="' . $v['name'] . '" class="col-sm-3 control-label">' . $v['name'] . ': ' . $v['req'] . '</label> <div class="col-sm-9"><input type="text" class="form-control" id="' . $formattedId . '" name="' . $k . '" size="40" maxlength="' . $v['maxlen'] . '" value="' . $v['value'] . '" ' . $cls . ' /></div> </div>'; } } } ?> <!-- END CUSTOM AFTER --> <?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 align="left" class="col-sm-9"> <?php for ($i = 1; $i <= $hesk_settings['attachments']['max_number']; $i++) { $cls = $i == 1 && in_array('attachments', $_SESSION['iserror']) ? ' class="isError" ' : ''; echo '<input type="file" name="attachment[' . $i . ']" size="50" ' . $cls . ' /><br />'; } ?> <a href="file_limits.php" target="_blank" onclick="Javascript:hesk_window('file_limits.php',250,500);return false;"><?php echo $hesklang['ful']; ?> </a> </div> </div> <?php } if ($hesk_settings['question_use'] || $hesk_settings['secimg_use']) { ?> <!-- Security checks --> <?php if ($hesk_settings['question_use']) { ?> <div class="form-group"> <label for="question" class="col-sm-3 control-label"><?php echo $hesklang['verify_q']; ?> <span class="important">*</span></label> <?php $value = ''; if (isset($_SESSION['c_question'])) { $value = stripslashes(hesk_input($_SESSION['c_question'])); } $cls = in_array('question', $_SESSION['iserror']) ? ' class="isError" ' : ''; echo '<div class="col-md-9">' . $hesk_settings['question_ask'] . '<br /><input class="form-control" id="question" type="text" name="question" size="20" value="' . $value . '" ' . $cls . ' /></div>'; ?> </div> <?php } if ($hesk_settings['secimg_use']) { ?> <div class="form-group"> <label for="secimage" class="col-sm-3 control-label"><?php echo $hesklang['verify_i']; ?> <font class="important">*</font></label> <?php // SPAM prevention verified for this session if (isset($_SESSION['img_verified'])) { echo '<img src="' . HESK_PATH . 'img/success.png" width="16" height="16" border="0" alt="" style="vertical-align:text-bottom" /> ' . $hesklang['vrfy']; } elseif ($hesk_settings['recaptcha_use'] == 1) { ?> <script type="text/javascript"> var RecaptchaOptions = { theme : '<?php echo isset($_SESSION['iserror']) && in_array('mysecnum', $_SESSION['iserror']) ? 'red' : 'white'; ?> ', custom_translations : { visual_challenge : "<?php echo hesk_slashJS($hesklang['visual_challenge']); ?> ", audio_challenge : "<?php echo hesk_slashJS($hesklang['audio_challenge']); ?> ", refresh_btn : "<?php echo hesk_slashJS($hesklang['refresh_btn']); ?> ", instructions_visual : "<?php echo hesk_slashJS($hesklang['instructions_visual']); ?> ", instructions_context : "<?php echo hesk_slashJS($hesklang['instructions_context']); ?> ", instructions_audio : "<?php echo hesk_slashJS($hesklang['instructions_audio']); ?> ", help_btn : "<?php echo hesk_slashJS($hesklang['help_btn']); ?> ", play_again : "<?php echo hesk_slashJS($hesklang['play_again']); ?> ", cant_hear_this : "<?php echo hesk_slashJS($hesklang['cant_hear_this']); ?> ", incorrect_try_again : "<?php echo hesk_slashJS($hesklang['incorrect_try_again']); ?> ", image_alt_text : "<?php echo hesk_slashJS($hesklang['image_alt_text']); ?> " } }; </script> <div class="col-md-9"> <?php require HESK_PATH . 'inc/recaptcha/recaptchalib.php'; echo recaptcha_get_html($hesk_settings['recaptcha_public_key'], null, true); ?> </div> <?php } elseif ($hesk_settings['recaptcha_use'] == 2) { ?> <div class="col-md-9"> <div class="g-recaptcha" data-sitekey="<?php echo $hesk_settings['recaptcha_public_key']; ?> "></div> </div> <?php } else { $cls = in_array('mysecnum', $_SESSION['iserror']) ? ' class="isError" ' : ''; echo '<div align="left" class="col-sm-9">'; echo $hesklang['sec_enter'] . '<br /> <br /><img src="print_sec_img.php?' . rand(10000, 99999) . '" width="150" height="40" alt="' . $hesklang['sec_img'] . '" title="' . $hesklang['sec_img'] . '" border="1" name="secimg" style="vertical-align:text-bottom" /> ' . '<a href="javascript:void(0)" onclick="javascript:document.form1.secimg.src=\'print_sec_img.php?\'+ ( Math.floor((90000)*Math.random()) + 10000);"><img src="img/reload.png" height="24" width="24" alt="' . $hesklang['reload'] . '" title="' . $hesklang['reload'] . '" border="0" style="vertical-align:text-bottom" /></a>' . '<br /> <br /><input type="text" name="mysecnum" size="20" maxlength="5" ' . $cls . ' />'; } echo '</div></div>'; } ?> <?php } if ($modsForHesk_settings['request_location']) { ?> <div class="form-group"> <label for="location" class="col-md-3 control-label"><?php echo $hesklang['location_colon']; ?> </label> <div class="col-sm-9"> <p id="console"><?php echo $hesklang['requesting_location_ellipsis']; ?> </p> <div id="map" style="height: 300px; display:none"> </div> </div> </div> <!-- Submit --> <?php } if ($hesk_settings['submit_notice']) { ?> <div class="row"> <div class="col-md-12"> <div class="alert alert-info"> <b><?php echo $hesklang['before_submit']; ?> </b> <ul> <li><?php echo $hesklang['all_info_in']; ?> .</li> <li><?php echo $hesklang['all_error_free']; ?> .</li> </ul> <b><?php echo $hesklang['we_have']; ?> :</b> <ul> <li><?php echo hesk_htmlspecialchars($_SERVER['REMOTE_ADDR']) . ' ' . $hesklang['recorded_ip']; ?> </li> <li><?php echo $hesklang['recorded_time']; ?> </li> </ul> </div> </div> </div> <div class="row"> <div class="col-md-9 col-md-offset-3"> <input type="hidden" id="latitude" name="latitude" value="E-0"> <input type="hidden" id="longitude" name="longitude" value="E-0"> <input type="hidden" name="token" value="<?php hesk_token_echo(); ?> "> <input type="submit" value="<?php echo $hesklang['sub_ticket']; ?> " class="btn btn-default"> </div> </div> <?php } else { ?> <div class="row"> <div class="col-md-9 col-md-offset-3"> <input type="hidden" id="latitude" name="latitude" value="E-0"> <input type="hidden" id="longitude" name="longitude" value="E-0"> <input type="hidden" name="token" value="<?php hesk_token_echo(); ?> "> <input class="btn btn-default" type="submit" value="<?php echo $hesklang['sub_ticket']; ?> "> </div> </div> <?php } // End ELSE submit_notice ?> <!-- Do not delete or modify the code below, it is used to detect simple SPAM bots --> <input type="hidden" name="hx" value="3" /><input type="hidden" name="hy" value="" /> <!-- > <input type="text" name="phone" value="3" /> < --> </form> </div> </div> <?php if ($columnWidth == 'col-md-10 col-md-offset-1') { ?> <div class="col-md-1"> </div></div> <?php } ?> <!-- END FORM --> <?php // Request for the users location if enabled if ($modsForHesk_settings['request_location']) { echo ' <script> requestUserLocation("' . $hesklang['your_current_location'] . '", "' . $hesklang['unable_to_determine_location'] . '"); </script> '; } hesk_cleanSessionVars('iserror'); hesk_cleanSessionVars('isnotice'); }
<td> <label><input type="checkbox" name="cot" value="1" <?php if ($cot) { echo 'checked="checked"'; } ?> /> <?php echo $hesklang['cot']; ?> </label><br /> <label><input type="checkbox" name="def" value="1" /> <?php echo $hesklang['def']; ?> </label> (<a href="admin_main.php?reset=1&token=<?php echo hesk_token_echo(0); ?> "><?php echo $hesklang['redv']; ?> </a>) </td> </table> <div class="btn-group"> <input class="btn btn-default" type="submit" value="<?php echo $hesklang['show_tickets']; ?> " />
function hesk_printReplyForm() { global $hesklang, $hesk_settings, $ticket, $admins, $can_options, $options, $can_assign_self; ?> <!-- START REPLY FORM --> <div class="container addReply-title"><?php echo $hesklang['add_reply']; ?> </div> <div class="container replyTicket-form"> <form method="post" action="admin_reply_ticket.php" enctype="multipart/form-data" name="form1" onsubmit="javascript:force_stop();return true;"> <br/> <?php /* Ticket assigned to someone else? */ /*if ($ticket['owner'] && $ticket['owner'] != $_SESSION['id'] && isset($admins[$ticket['owner']]) ) { hesk_show_notice($hesklang['nyt'] . ' ' . $admins[$ticket['owner']]); }*/ /* Ticket locked? */ if ($ticket['locked']) { hesk_show_notice($hesklang['tislock']); } // Track time worked? if ($hesk_settings['time_worked']) { ?> <div class="white table-track-time-worked"> <div class="form-inline time_worked"> <label class="col-sm-2"><?php echo $hesklang['ts']; ?> </label> <input class="form-control" type="text" name="time_worked" id="time_worked" size="10" value="<?php echo isset($_SESSION['time_worked']) ? hesk_getTime($_SESSION['time_worked']) : '00:00:00'; ?> " /> <button type="button" class="btn btn-default" onclick="ss()" id="startb"><?php echo $hesklang['start']; ?> </button> <button type="button" class="btn btn-default" onclick="r()"><?php echo $hesklang['reset']; ?> </button> </div> </div><!-- end table-track-time-worked--> <br/> <?php } /* Do we have any canned responses? */ if (strlen($can_options)) { ?> <div class="white table-track-time-worked"> <div class="form-inline" style=" margin-bottom: 10px;"> <span class="admin_gray"><b>» <?php echo $hesklang['saved_replies']; ?> </b></span> <div class="form-group admin_gray" style="vertical-align: top;"> <label for="modeadd"><input type="radio" name="mode" id="modeadd" value="1" checked="checked" /> <?php echo $hesklang['madd']; ?> </label><br /> <label for="moderep"><input type="radio" name="mode" id="moderep" value="0" /> <?php echo $hesklang['mrep']; ?> </label> </div> </div> <div class="form-inline admin_gray" style="margin-bottom: 10px;"> <label for="selec-canned-response"><?php echo $hesklang['select_saved']; ?> :</label> <select id="selec-canned-response" name="saved_replies" onchange="setMessage(this.value)"> <option value="0"> - <?php echo $hesklang['select_empty']; ?> - </option> <?php echo $can_options; ?> </select> </div> </div><!-- end table-track-time-worked--> <?php } ?> <div class="form-inline"> <span class="col-sm-2"><?php echo $hesklang['message']; ?> : <font class="important">*</font></span> <span id="HeskMsg"><textarea name="message" id="message" rows="12" cols="72" class="HeskMsg-addReply form-control"> <?php // Do we have any message stored in session? if (isset($_SESSION['ticket_message'])) { echo stripslashes(hesk_input($_SESSION['ticket_message'])); } else { $res = hesk_dbQuery("SELECT `message` FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "reply_drafts` WHERE `owner`=" . intval($_SESSION['id']) . " AND `ticket`=" . intval($ticket['id']) . " LIMIT 1"); if (hesk_dbNumRows($res) == 1) { echo hesk_dbResult($res); } } ?> </textarea></span></div> <br/> <div class="form-inline"> <?php /* attachments */ if ($hesk_settings['attachments']['use']) { ?> <?php echo '<span class="col-sm-2">' . $hesklang['attachments'] . ':' . '</span>'; echo '<div class="form-group" id="attachments-addReply">'; for ($i = 1; $i <= $hesk_settings['attachments']['max_number']; $i++) { echo '<input id="chooseFile-addReply" type="file" name="attachment[' . $i . ']" size="50" />'; } echo '<span>(<a href="Javascript:void(0)" onclick="Javascript:hesk_window(\'../file_limits.php\',250,500);return false;">' . $hesklang['ful'] . '</a>)</span>'; echo ' </div>'; ?> <?php } ?> </div> <br/> <div class="first-table"> <?php /*if ($ticket['owner'] != $_SESSION['id'] && $can_assign_self) { if (empty($ticket['owner'])) { echo '<label class="container"><input type="checkbox" name="assign_self" value="1" checked="checked" /> <b>'.$hesklang['asss2'].'</b></label><br />'; } else { echo '<label class="container"><input type="checkbox" name="assign_self" value="1" /> '.$hesklang['asss2'].'</label><br />'; } }*/ ?> <div class="form-inline"> <label class="col-sm-2 control-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 /> <!--<div class="form-inline"> <label class="col-sm-2"><input type="checkbox" name="signature" value="1" checked="checked" /> <?php //echo $hesklang['attach_sign']; ?> </label> <span>(<a href="profile.php"><?php //echo $hesklang['profile_settings']; ?> </a>)</span> </div>--> <label class="container"><input type="checkbox" name="no_notify" value="1" <?php echo $_SESSION['notify_customer_reply'] ? '' : 'checked="checked"'; ?> /> <?php echo $hesklang['dsen']; ?> </label> </div><!-- end first-table--> <br/> <div> <input type="hidden" name="orig_id" value="<?php echo $ticket['id']; ?> " /> <input type="hidden" name="token" value="<?php hesk_token_echo(); ?> " /> <input type="submit" value="<?php echo $hesklang['submit_reply']; ?> " class="btn btn-default submit_reply_btn" /> <input type="submit" name="save_reply" value="<?php echo $hesklang['sacl']; ?> " class="btn btn-default sacl_btn" /> </div> <br/> <?php // If ticket is not locked, show additional submit options if (!$ticket['locked']) { ?> <div> <input type="submit" name="submit_as_customer" value="<?php echo $hesklang['sasc']; ?> " class="btn btn-default sasc_btn" /> <input type="submit" name="submit_as_resolved" value="<?php echo $hesklang['submit_as'] . ' ' . $hesklang['closed']; ?> " class="btn btn-default submit_as_closed_btn" /> <input type="submit" name="submit_as_in_progress" value="<?php echo $hesklang['submit_as'] . ' ' . $hesklang['in_progress']; ?> " class="btn btn-default submit_as_in_progress_btn" /> <input type="submit" name="submit_as_on_hold" value="<?php echo $hesklang['submit_as'] . ' ' . $hesklang['on_hold']; ?> " class="btn btn-default submit_as_on_hold_btn" /> </div> <br/> <?php } ?> </form> </div><!-- end reply-form-admin-ticket --> <!-- END REPLY FORM --> <?php }
function hesk_printReplyForm() { global $hesklang, $hesk_settings, $ticket, $admins, $can_options, $options, $can_assign_self, $isManager; ?> <!-- START REPLY FORM --> <h3 class="text-left"><?php echo $hesklang['add_reply']; ?> </h3> <div class="footerWithBorder"></div> <div class="blankSpace"></div> <form role="form" class="form-horizontal" method="post" action="admin_reply_ticket.php" enctype="multipart/form-data" name="form1" onsubmit="javascript:force_stop();return true;"> <?php /* Ticket assigned to someone else? */ if ($ticket['owner'] && $ticket['owner'] != $_SESSION['id'] && isset($admins[$ticket['owner']])) { hesk_show_notice($hesklang['nyt'] . ' ' . $admins[$ticket['owner']]); } /* Ticket locked? */ if ($ticket['locked']) { hesk_show_notice($hesklang['tislock']); } // Track time worked? if ($hesk_settings['time_worked']) { ?> <div class="form-group"> <label for="time_worked" class="col-sm-3 control-label"><?php echo $hesklang['ts']; ?> :</label> <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"> <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> <?php } /* Do we have any canned responses? */ if (strlen($can_options)) { ?> <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> <?php } ?> <div class="form-group"> <label for="message" class="col-sm-3 control-label"><?php echo $hesklang['message']; ?> : <font class="important">*</font></label> <div class="col-sm-9"> <span id="HeskMsg"> <textarea class="form-control" name="message" id="message" rows="12" placeholder="<?php echo htmlspecialchars($hesklang['message']); ?> " cols="72"><?php // Do we have any message stored in session? if (isset($_SESSION['ticket_message'])) { echo stripslashes(hesk_input($_SESSION['ticket_message'])); } else { $res = hesk_dbQuery("SELECT `message` FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "reply_drafts` WHERE `owner`=" . intval($_SESSION['id']) . " AND `ticket`=" . intval($ticket['id']) . " LIMIT 1"); if (hesk_dbNumRows($res) == 1) { echo hesk_dbResult($res); } } ?> </textarea></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 for ($i = 1; $i <= $hesk_settings['attachments']['max_number']; $i++) { echo '<input type="file" name="attachment[' . $i . ']" size="50" /><br />'; } echo '<a href="Javascript:void(0)" onclick="Javascript:hesk_window(\'../file_limits.php\',250,500);return false;">' . $hesklang['ful'] . '</a>'; ?> </div> </div> <?php } ?> <div class="form-group"> <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 />'; } } $statusSql = 'SELECT `ID` FROM `' . hesk_dbEscape($hesk_settings['db_pfix']) . 'statuses` WHERE `IsStaffClosedOption` = 1'; $statusRow = hesk_dbQuery($statusSql)->fetch_assoc(); $staffClosedOptionStatus = array(); $staffClosedOptionStatus['ID'] = $statusRow['ID']; ?> <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> <input type="checkbox" name="signature" value="1" checked="checked" /> <?php echo $hesklang['attach_sign']; ?> </label> (<a href="profile.php"><?php echo $hesklang['profile_settings']; ?> </a>) <br /> <label> <input type="checkbox" name="no_notify" value="1" <?php echo $_SESSION['notify_customer_reply'] && !empty($ticket['email']) ? '' : 'checked="checked" '; ?> <?php if (empty($ticket['email'])) { echo 'disabled'; } ?> > <?php echo $hesklang['dsen']; ?> </label><br/><br/> <?php if (empty($ticket['email'])) { echo '<input type="hidden" name="no_notify" value="1">'; } ?> <input type="hidden" name="orig_id" value="<?php echo $ticket['id']; ?> " /> <input type="hidden" name="token" value="<?php hesk_token_echo(); ?> " /> <div class="btn-group"> <input class="btn btn-primary" type="submit" value="<?php echo $hesklang['submit_reply']; ?> "> <button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown" aria-expanded="false"> <span class="caret"></span> <span class="sr-only">Toggle Dropdown</span> </button> <ul class="dropdown-menu" role="menu"> <li><a> <button class="dropdown-submit" type="submit" name="submit_as_customer"> <?php echo $hesklang['sasc']; ?> </button> </a></li> <li class="divider"></li> <?php $allStatusesRs = hesk_dbQuery('SELECT `ID`, `Key`, `TextColor` FROM `' . hesk_dbEscape($hesk_settings['db_pfix']) . 'statuses`'); $statuses = array(); while ($row = hesk_dbFetchAssoc($allStatusesRs)) { array_push($statuses, $row); } foreach ($statuses as $status) { echo '<li><a> <button class="dropdown-submit" type="submit" name="submit_as_status" value="' . $status['ID'] . '""> ' . $hesklang['submit_reply'] . ' ' . $hesklang['and_change_status_to'] . ' <b> <span style="color:' . $status['TextColor'] . '">' . $hesklang[$status['Key']] . '</span></b> </button> </a></li>'; } ?> </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 } ?> </div> </div> </form> <!-- END REPLY FORM --> <?php }
function hesk_printCustomerReplyForm($reopen = 0) { global $hesklang, $hesk_settings, $trackingID, $my_email; // Already printed? if (defined('REPLY_FORM')) { return ''; } ?> <h3 class="text-left"><?php echo $hesklang['add_reply']; ?> </h3> <div class="footerWithBorder"></div> <div class="blankSpace"></div> <form role="form" class="form-horizontal" method="post" action="reply_ticket.php" enctype="multipart/form-data"> <div class="form-group"> <label for="message" class="col-sm-3 control-label"><?php echo $hesklang['message']; ?> : <span class="important">*</span></label> <div class="col-sm-9"> <textarea name="message" class="form-control" rows="12" cols="60"><?php if (isset($_SESSION['ticket_message'])) { echo stripslashes(hesk_input($_SESSION['ticket_message'])); } ?> </textarea> </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 text-left"> <?php for ($i = 1; $i <= $hesk_settings['attachments']['max_number']; $i++) { echo '<input type="file" name="attachment[' . $i . ']" size="50" /><br />'; } echo '<a href="file_limits.php" target="_blank" onclick="Javascript:hesk_window(\'file_limits.php\',250,500);return false;">' . $hesklang['ful'] . '</a>'; ?> </div> </div> <?php } ?> <input type="hidden" name="token" value="<?php hesk_token_echo(); ?> " /> <input type="hidden" name="orig_track" value="<?php echo $trackingID; ?> " /> <?php if ($hesk_settings['email_view_ticket']) { echo '<input type="hidden" name="e" value="' . $my_email . '" />'; } if ($reopen) { echo '<input type="hidden" name="reopen" value="1" />'; } ?> <input type="submit" value="<?php echo $hesklang['submit_reply']; ?> " class="btn btn-default" /> </form> <?php // Make sure the form is only printed once per page define('REPLY_FORM', true); }
if ($hesk_settings['autoassign']) { if ($myuser['autoassign']) { $autoassign_code = '<a href="manage_users.php?a=autoassign&s=0&id=' . $myuser['id'] . '&token=' . hesk_token_echo(0) . '"><i style="color: orange; font-size: 16px" class="fa fa-bolt" data-toggle="tooltip" data-placement="top" title="' . $hesklang['aaon'] . '"></i></a>'; } else { $autoassign_code = '<a href="manage_users.php?a=autoassign&s=1&id=' . $myuser['id'] . '&token=' . hesk_token_echo(0) . '"><i style="color: gray; font-size: 16px" class="fa fa-bolt" data-toggle="tooltip" data-placement="top" title="' . $hesklang['aaoff'] . '"></i></a>'; } } else { $autoassign_code = ''; } $activeMarkup = ''; if ($myuser['id'] != $_SESSION['id'] && $myuser['id'] != 1) { /* Is the user active? */ if ($myuser['active']) { $activeMarkup = '<a href="manage_users.php?a=active&s=0&id=' . $myuser['id'] . '&token=' . hesk_token_echo(0) . '"><i style="color: green; font-size: 16px" class="fa fa-user" data-toggle="tooltip" data-placement="top" title="' . $hesklang['disable_user'] . '"></i></a>'; } else { $activeMarkup = '<a href="manage_users.php?a=active&s=1&id=' . $myuser['id'] . '&token=' . hesk_token_echo(0) . '"><i style="color: gray; font-size: 16px" class="fa fa-user" data-toggle="tooltip" data-placement="top" title="' . $hesklang['enable_user'] . '"></i></a>'; } } $templateName = $hesklang['custom']; if ($myuser['permission_template'] != -1) { $result = hesk_dbQuery("SELECT `name` FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "permission_templates` WHERE `id` = " . intval($myuser['permission_template'])); $row = hesk_dbFetchAssoc($result); $templateName = $row['name']; } echo <<<EOC <tr> <td>{$myuser['name']}</td> <td><a href="mailto:{$myuser['email']}">{$myuser['email']}</a></td> <td>{$myuser['user']}</td> <td>{$templateName}</td>
function edit_clients() { global $hesk_settings, $hesklang, $default_userdata; $id = intval(hesk_GET('id')) or hesk_error("{$hesklang['int_error']}: {$hesklang['no_valid_id']}"); /* To edit self fore using "Profile" page */ if ($id == $_SESSION['id']) { hesk_process_messages($hesklang['eyou'], 'profile.php', 'NOTICE'); } $_SESSION['edit_userdata'] = TRUE; if (!isset($_SESSION['save_userdata'])) { $result = hesk_dbQuery('SELECT * from `' . hesk_dbEscape($hesk_settings['db_pfix']) . 'clients` WHERE `id`=' . $id); $row = mysqli_fetch_array($result); $_SESSION['userdata']['name'] = $row['name']; $_SESSION['userdata']['email'] = $row['email']; $_SESSION['userdata']['user'] = $row['user']; $_SESSION['userdata']['address'] = $row['address']; $_SESSION['userdata']['phonenumber'] = $row['phonenumber']; $_SESSION['userdata']['poz_detyres'] = $row['poz_detyres']; $_SESSION['userdata']['company_id'] = $row['company_id']; $_SESSION['userdata']['active'] = $row['active']; /* Store original username for display until changes are saved successfully */ $_SESSION['original_user'] = $_SESSION['userdata']['user']; } /* Print header */ require_once HESK_PATH . 'inc/header.inc.php'; /* Print main manage users page */ require_once HESK_PATH . 'inc/show_admin_nav.inc.php'; ?> <div class="container manage-users-title"><a href="manage_users.php" class="smaller"><?php echo '<b>' . $hesklang['manage_users'] . '</b>'; ?> </a> > <?php echo $hesklang['editing_user'] . ' ' . $_SESSION['original_user']; ?> </div> <?php /* This will handle error, success and notice messages */ hesk_handle_messages(); ?> <div class="container editing-users-title"><?php echo '<b>' . $hesklang['editing_user'] . ' ' . $_SESSION['original_user'] . '</b>'; ?> </div> <div class="container"><?php echo $hesklang['req_marked_with']; ?> <font class="important">*</font></div> <script language="Javascript" type="text/javascript"><!-- var tabberOptions = { 'cookie':"tabbereu", 'onLoad': function(argsObj) { var t = argsObj.tabber; var i; if (t.id) { t.cookie = t.id + t.cookie; } i = parseInt(getCookie(t.cookie)); if (isNaN(i)) { return; } t.tabShow(i); }, 'onClick':function(argsObj) { var c = argsObj.tabber.cookie; var i = argsObj.index; setCookie(c, i); } }; //--> </script> <script language="Javascript" type="text/javascript" src="<?php echo HESK_PATH; ?> inc/tabs/tabber-minimized.js"></script> <form name="form1" method="post" action="manage_users.php?a=update_client"> <?php hesk_profile_tab('userdata', false); ?> <!-- Submit --> <div class="container"><input type="hidden" name="a" value="save" /> <input type="hidden" name="userid" value="<?php echo $id; ?> " /> <input type="hidden" name="token" value="<?php hesk_token_echo(); ?> " /> <input type="submit" value="<?php echo $hesklang['save_changes']; ?> " class="btn btn-default" /> | <a href="manage_users.php"><?php echo $hesklang['dich']; ?> </a> </div> </form> <p> </p> <p> </p> <?php require_once HESK_PATH . 'inc/footer.inc.php'; exit; }
function edit_user() { global $hesk_settings, $hesklang, $default_userdata; $id = intval(hesk_GET('id')) or hesk_error("{$hesklang['int_error']}: {$hesklang['no_valid_id']}"); /* To edit self fore using "Profile" page */ if ($id == $_SESSION['id']) { hesk_process_messages($hesklang['eyou'], 'profile.php', 'NOTICE'); } $_SESSION['edit_userdata'] = TRUE; if (!isset($_SESSION['save_userdata'])) { $res = hesk_dbQuery("SELECT `user`,`pass`,`isadmin`,`name`,`email`,`signature`,`categories`,`autoassign`,`heskprivileges` AS `features` FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "users` WHERE `id`='" . intval($id) . "' LIMIT 1"); $_SESSION['userdata'] = hesk_dbFetchAssoc($res); /* Store original username for display until changes are saved successfully */ $_SESSION['original_user'] = $_SESSION['userdata']['user']; /* A few variables need special attention... */ if ($_SESSION['userdata']['isadmin']) { $_SESSION['userdata']['features'] = $default_userdata['features']; $_SESSION['userdata']['categories'] = $default_userdata['categories']; } else { $_SESSION['userdata']['features'] = explode(',', $_SESSION['userdata']['features']); $_SESSION['userdata']['categories'] = explode(',', $_SESSION['userdata']['categories']); } $_SESSION['userdata']['cleanpass'] = ''; } /* Make sure we have permission to edit this user */ if (!compare_user_permissions($id, $_SESSION['userdata']['isadmin'], $_SESSION['userdata']['categories'], $_SESSION['userdata']['features'])) { hesk_process_messages($hesklang['npea'], 'manage_users.php'); } /* Print header */ require_once HESK_PATH . 'inc/header.inc.php'; /* Print main manage users page */ require_once HESK_PATH . 'inc/show_admin_nav.inc.php'; ?> </td> </tr> <tr> <td> <?php /* This will handle error, success and notice messages */ hesk_handle_messages(); ?> <p class="smaller"> <a href="manage_users.php" class="smaller"><?php echo $hesklang['manage_users']; ?> </a> > <?php echo $hesklang['editing_user'] . ' ' . $_SESSION['original_user']; ?> </p> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="7" height="7"><img src="../img/roundcornerslt.jpg" width="7" height="7" alt="" /></td> <td class="roundcornerstop"></td> <td><img src="../img/roundcornersrt.jpg" width="7" height="7" alt="" /></td> </tr> <tr> <td class="roundcornersleft"> </td> <td> <h3 align="center"><?php echo $hesklang['editing_user'] . ' ' . $_SESSION['original_user']; ?> </h3> <p align="center"><?php echo $hesklang['req_marked_with']; ?> <font class="important">*</font></p> <form name="form1" method="post" action="manage_users.php"> <!-- Contact info --> <table border="0" width="100%"> <tr> <td width="200" style="text-align:right"><?php echo $hesklang['real_name']; ?> : <font class="important">*</font></td> <td align="left"><input type="text" name="name" size="40" maxlength="50" value="<?php echo $_SESSION['userdata']['name']; ?> " /></td> </tr> <tr> <td width="200" style="text-align:right"><?php echo $hesklang['email']; ?> : <font class="important">*</font></td> <td align="left"><input type="text" name="email" size="40" maxlength="255" value="<?php echo $_SESSION['userdata']['email']; ?> " /></td> </tr> <tr> <td width="200" style="text-align:right"><?php echo $hesklang['username']; ?> : <font class="important">*</font></td> <td><input type="text" name="user" size="40" maxlength="20" value="<?php echo $_SESSION['userdata']['user']; ?> " /></td> </tr> <tr> <td width="200" style="text-align:right"><?php echo $hesklang['pass']; ?> :</td> <td><input type="password" name="newpass" autocomplete="off" size="40" maxlength="20" value="<?php echo $_SESSION['userdata']['cleanpass']; ?> " onkeyup="javascript:hesk_checkPassword(this.value)" /></td> </tr> <tr> <td width="200" style="text-align:right"><?php echo $hesklang['confirm_pass']; ?> :</td> <td><input type="password" name="newpass2" autocomplete="off" size="40" maxlength="20" value="<?php echo $_SESSION['userdata']['cleanpass']; ?> " /></td> </tr> <tr> <td width="200" style="text-align:right"><?php echo $hesklang['pwdst']; ?> :</td> <td> <div style="border: 1px solid gray; width: 100px;"> <div id="progressBar" style="font-size: 1px; height: 14px; width: 0px; border: 1px solid white;"> </div> </div> </td> </tr> <tr> <td valign="top" width="200" style="text-align:right"><?php echo $hesklang['administrator']; ?> : <font class="important">*</font></td> <td valign="top"> <?php /* Only administrators can create new administrator accounts */ if ($_SESSION['isadmin']) { ?> <label><input type="radio" name="isadmin" value="1" onchange="Javascript:hesk_toggleLayerDisplay('options')" <?php if ($_SESSION['userdata']['isadmin']) { echo 'checked="checked"'; } ?> /> <?php echo $hesklang['yes'] . ' ' . $hesklang['admin_can']; ?> </label><br /> <label><input type="radio" name="isadmin" value="0" onchange="Javascript:hesk_toggleLayerDisplay('options')" <?php if (!$_SESSION['userdata']['isadmin']) { echo 'checked="checked"'; } ?> /> <?php echo $hesklang['no'] . ' ' . $hesklang['staff_can']; ?> </label> <?php } else { echo $hesklang['no'] . ' ' . $hesklang['staff_can']; } ?> <div id="options" style="display: <?php echo $_SESSION['isadmin'] && $_SESSION['userdata']['isadmin'] ? 'none' : 'block'; ?> ;"> <table width="100%" border="0"> <tr> <td valign="top" width="100" style="text-align:right;white-space:nowrap;"><?php echo $hesklang['allowed_cat']; ?> : <font class="important">*</font></td> <td valign="top"> <?php foreach ($hesk_settings['categories'] as $catid => $catname) { echo '<label><input type="checkbox" name="categories[]" value="' . $catid . '" '; if (in_array($catid, $_SESSION['userdata']['categories'])) { echo ' checked="checked" '; } echo ' />' . $catname . '</label><br /> '; } ?> </td> </tr> <tr> <td valign="top" width="100" style="text-align:right;white-space:nowrap;"><?php echo $hesklang['allow_feat']; ?> : <font class="important">*</font></td> <td valign="top"> <?php foreach ($hesk_settings['features'] as $k) { echo '<label><input type="checkbox" name="features[]" value="' . $k . '" '; if (in_array($k, $_SESSION['userdata']['features'])) { echo ' checked="checked" '; } echo ' />' . $hesklang[$k] . '</label><br /> '; } ?> </td> </tr> </table> </div> </td> </tr> <?php if ($hesk_settings['autoassign']) { ?> <tr> <td width="200" style="text-align:right"><?php echo $hesklang['opt']; ?> :</td> <td><label><input type="checkbox" name="autoassign" value="Y" <?php if (isset($_SESSION['userdata']['autoassign']) && $_SESSION['userdata']['autoassign'] == 1) { echo 'checked="checked"'; } ?> /> <?php echo $hesklang['user_aa']; ?> </label></td> </tr> <?php } ?> <tr> <td valign="top" width="200" style="text-align:right"><?php echo $hesklang['signature_max']; ?> :</td> <td><textarea name="signature" rows="6" cols="40"><?php echo $_SESSION['userdata']['signature']; ?> </textarea><br /> <?php echo $hesklang['sign_extra']; ?> </td> </tr> </table> <!-- Submit --> <p align="center"><input type="hidden" name="a" value="save" /> <input type="hidden" name="userid" value="<?php echo $id; ?> " /> <input type="hidden" name="token" value="<?php hesk_token_echo(); ?> " /> <input type="submit" value="<?php echo $hesklang['save_changes']; ?> " class="orangebutton" onmouseover="hesk_btn(this,'orangebuttonover');" onmouseout="hesk_btn(this,'orangebutton');" /> | <a href="manage_users.php"><?php echo $hesklang['dich']; ?> </a></p> </form> <script language="Javascript" type="text/javascript"><!-- hesk_checkPassword(document.form1.newpass.value); //--> </script> </td> <td class="roundcornersright"> </td> </tr> <tr> <td><img src="../img/roundcornerslb.jpg" width="7" height="7" alt="" /></td> <td class="roundcornersbottom"></td> <td width="7" height="7"><img src="../img/roundcornersrb.jpg" width="7" height="7" alt="" /></td> </tr> </table> <?php require_once HESK_PATH . 'inc/footer.inc.php'; exit; }
function show_new_form() { global $hesk_settings, $hesklang, $admins; ?> <br/> <form action="mail.php" method="post" name="form2" class="form-horizontal" role="form"> <h3><?php echo $hesklang['new_mail']; ?> </h3> <div class="footerWithBorder blankSpace"></div> <div class="form-group"> <label for="to" class="col-sm-3 control-label"><?php echo $hesklang['m_to']; ?> </label> <div class="col-sm-9"> <select class="form-control" name="to"> <option value="" selected="selected"><?php echo $hesklang['select']; ?> </option> <?php foreach ($admins as $k => $v) { if ($k != $_SESSION['id']) { if (isset($_SESSION['mail']) && $k == $_SESSION['mail']['to']) { echo '<option value="' . $k . '" selected="selected">' . $v . '</option>'; } else { echo '<option value="' . $k . '">' . $v . '</option>'; } } } ?> </select> </div> </div> <div class="form-group"> <label for="subject" class="col-sm-3 control-label"><?php echo $hesklang['m_sub']; ?> </label> <div class="col-sm-9"> <input type="text" class="form-control" placeholder="<?php echo htmlspecialchars($hesklang['subject']); ?> " name="subject" size="40" maxlength="50" <?php if (isset($_SESSION['mail']['subject'])) { echo ' value="' . stripslashes($_SESSION['mail']['subject']) . '" '; } ?> /> </div> </div> <div class="form-group"> <label for="message" class="col-sm-3 control-label"><?php echo $hesklang['message']; ?> :</label> <div class="col-sm-9"> <textarea name="message" class="form-control" placeholder="<?php echo htmlspecialchars($hesklang['message']); ?> " rows="15" cols="70"><?php if (isset($_SESSION['mail']['message'])) { echo stripslashes($_SESSION['mail']['message']); } ?> </textarea> <div class="checkbox"> <label> <input type="checkbox" name="signature" value="1" checked> <?php echo $hesklang['attach_sign']; ?> </label> (<a href="profile.php"><?php echo $hesklang['profile_settings']; ?> </a>) </div> </div> </div> <div class="form-group"> <div class="col-sm-9 col-sm-offset-3"> <input type="hidden" name="token" value="<?php hesk_token_echo(); ?> " /> <input type="hidden" name="a" value="send" /> <input type="submit" value="<?php echo $hesklang['m_send']; ?> " class="btn btn-default" /> </div> </div> <?php }
function manage_category() { global $hesk_settings, $hesklang; $catid = intval(hesk_GET('catid')) or hesk_error($hesklang['kb_cat_inv']); $result = hesk_dbQuery('SELECT * FROM `' . hesk_dbEscape($hesk_settings['db_pfix']) . 'kb_categories` ORDER BY `parent` ASC, `cat_order` ASC'); $kb_cat = array(); while ($cat = hesk_dbFetchAssoc($result)) { $kb_cat[] = $cat; if ($cat['id'] == $catid) { $this_cat = $cat; } } if (isset($_SESSION['manage_cat'])) { $_SESSION['manage_cat'] = hesk_stripArray($_SESSION['manage_cat']); $this_cat['type'] = $_SESSION['manage_cat']['type']; $this_cat['parent'] = $_SESSION['manage_cat']['parent']; $this_cat['name'] = $_SESSION['manage_cat']['title']; } /* Translate main category "Knowledgebase" if needed */ $kb_cat[0]['name'] = $hesklang['kb_text']; require HESK_PATH . 'inc/treemenu/TreeMenu.php'; $icon = HESK_PATH . 'img/folder.gif'; $expandedIcon = HESK_PATH . 'img/folder-expanded.gif'; $menu = new HTML_TreeMenu(); $thislevel = array('0'); $nextlevel = array(); $i = 1; $j = 1; while (count($kb_cat) > 0) { foreach ($kb_cat as $k => $cat) { if (in_array($cat['parent'], $thislevel)) { $up = $cat['parent']; $my = $cat['id']; $type = $cat['type'] ? '*' : ''; $text_short = $cat['name'] . $type . ' (' . $cat['articles'] . ', ' . $cat['articles_private'] . ', ' . $cat['articles_draft'] . ')'; if (isset($node[$up])) { $node[$my] =& $node[$up]->addItem(new HTML_TreeNode(array('hesk_parent' => $this_cat['parent'], 'text' => 'Text', 'text_short' => $text_short, 'hesk_catid' => $cat['id'], 'hesk_select' => 'option' . $j, 'icon' => $icon, 'expandedIcon' => $expandedIcon, 'expanded' => true))); } else { $node[$my] = new HTML_TreeNode(array('hesk_parent' => $this_cat['parent'], 'text' => 'Text', 'text_short' => $text_short, 'hesk_catid' => $cat['id'], 'hesk_select' => 'option' . $j, 'icon' => $icon, 'expandedIcon' => $expandedIcon, 'expanded' => true)); } $nextlevel[] = $cat['id']; $j++; unset($kb_cat[$k]); } } $thislevel = $nextlevel; $nextlevel = array(); /* Break after 20 recursions to avoid hang-ups in case of any problems */ if ($i > 20) { break; } $i++; } $menu->addItem($node[1]); // Create the presentation class $listBox =& ref_new(new HTML_TreeMenu_Listbox($menu)); /* Print header */ require_once HESK_PATH . 'inc/header.inc.php'; /* Print main manage users page */ require_once HESK_PATH . 'inc/show_admin_nav.inc.php'; ?> <div class="container manage-kb-category-title"><a href="manage_knowledgebase.php" class="smaller"><b><?php echo $hesklang['kb']; ?> </b></a> > <?php echo $hesklang['kb_cat_man']; ?> </div> <!-- SUB NAVIGATION --> <?php show_subnav('', $catid); ?> <!-- SUB NAVIGATION --> <?php if (!isset($_SESSION['hide']['article_list'])) { ?> <div class="container category-kb"><?php echo $hesklang['category']; ?> : <span class="black"><?php echo $this_cat['name']; ?> </span></div> <br /> <?php $result = hesk_dbQuery("SELECT * FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "kb_articles` WHERE `catid`='{$catid}' ORDER BY `sticky` DESC, `art_order` ASC"); $num = hesk_dbNumRows($result); if ($num == 0) { echo '<div class="container kb_no_article">' . $hesklang['kb_no_art'] . ' <br/><br/> <a href="manage_knowledgebase.php?a=add_article&catid=' . $catid . '"><img src="../img/add_article.png" width="16" height="16" alt="' . $hesklang['kb_i_art2'] . '" title="' . $hesklang['kb_i_art2'] . '" border="0" style="border:none;vertical-align:text-bottom" /></a>' . '<a href="manage_knowledgebase.php?a=add_article&catid=' . $catid . '"><b>' . $hesklang['kb_i_art2'] . '</b></a></div>'; } else { /* Get number of sticky articles */ $res2 = hesk_dbQuery("SELECT COUNT(*) FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "kb_articles` WHERE `catid`='{$catid}' AND `sticky` = '1' "); $num_sticky = hesk_dbResult($res2); $num_nosticky = $num - $num_sticky; ?> <div class="container insertArticle"> <?php echo '<a href="manage_knowledgebase.php?a=add_article&catid=' . $catid . '"><img src="../img/add_article.png" width="16" height="16" alt="' . $hesklang['kb_i_art2'] . '" title="' . $hesklang['kb_i_art2'] . '" border="0" style="border:none;vertical-align:text-bottom" /></a> <a href="manage_knowledgebase.php?a=add_article&catid=' . $catid . '"><b>' . $hesklang['kb_i_art2'] . '</b></a>'; ?> </div> <div class="container kb_cat_art_title"><?php echo $hesklang['kb_cat_art']; ?> </div> <div class="container"> <table class="table table-bordered table-responsive kb_cat_art_table"> <tr> <th class="admin_white"> </th> <th class="admin_white"><b><i><?php echo $hesklang['kb_subject']; ?> </i></b></th> <th class="admin_white"><b><i><?php echo $hesklang['kb_type']; ?> </i></b></th> <th class="admin_white"><b><i><?php echo $hesklang['views']; ?> </i></b></th> <?php if ($hesk_settings['kb_rating']) { ?> <th class="admin_white" style="white-space:nowrap" nowrap="nowrap" width="130"><b><i><?php echo $hesklang['rating'] . ' (' . $hesklang['votes'] . ')'; ?> </i></b></th> <?php } ?> <th class="admin_white" style="width:120px"><b><i> <?php echo $hesklang['opt']; ?> </i></b></th> </tr> <?php $i = 1; $j = 1; $k = 1; $previous_sticky = 1; $num = $num_sticky; while ($article = hesk_dbFetchAssoc($result)) { if ($previous_sticky != $article['sticky']) { $k = 1; $num = $num_nosticky; $previous_sticky = $article['sticky']; } if (isset($_SESSION['artord']) && $article['id'] == $_SESSION['artord']) { $color = 'admin_green'; unset($_SESSION['artord']); } elseif ($article['sticky']) { $color = 'admin_yellow'; } else { $color = $i ? 'admin_white' : 'admin_gray'; } $tmp = $i ? 'White' : 'Blue'; $style = 'class="option' . $tmp . 'OFF" onmouseover="this.className=\'option' . $tmp . 'ON\'" onmouseout="this.className=\'option' . $tmp . 'OFF\'"'; $i = $i ? 0 : 1; switch ($article['type']) { case '1': $type = '<span class="kb_private">' . $hesklang['kb_private'] . '</span>'; break; case '2': $type = '<span class="kb_draft">' . $hesklang['kb_draft'] . '</span>'; break; default: $type = '<span class="kb_published">' . $hesklang['kb_published'] . '</span>'; } if ($hesk_settings['kb_rating']) { $alt = $article['rating'] ? sprintf($hesklang['kb_rated'], sprintf("%01.1f", $article['rating'])) : $hesklang['kb_not_rated']; $rat = '<td class="' . $color . '" style="white-space:nowrap;"><img src="../img/star_' . hesk_round_to_half($article['rating']) * 10 . '.png" width="85" height="16" alt="' . $alt . '" title="' . $alt . '" border="0" style="vertical-align:text-bottom" /> (' . $article['votes'] . ') </td>'; } else { $rat = ''; } ?> <tr> <td class="<?php echo $color; ?> "><?php echo $j; ?> .</td> <td class="<?php echo $color; ?> "><?php echo $article['subject']; ?> </td> <td class="<?php echo $color; ?> "><?php echo $type; ?> </td> <td class="<?php echo $color; ?> "><?php echo $article['views']; ?> </td> <?php echo $rat; ?> <td class="<?php echo $color; ?> " style="text-align:center; white-space:nowrap;"> <?php if ($num > 1) { if ($k == 1) { ?> <img src="../img/blank.gif" width="16" height="16" alt="" style="padding:3px;border:none;" /> <a href="manage_knowledgebase.php?a=order_article&id=<?php echo $article['id']; ?> &catid=<?php echo $catid; ?> &move=15&token=<?php hesk_token_echo(); ?> "><img src="../img/move_down.png" width="16" height="16" alt="<?php echo $hesklang['move_dn']; ?> " title="<?php echo $hesklang['move_dn']; ?> " <?php echo $style; ?> /></a> <?php } elseif ($k == $num) { ?> <a href="manage_knowledgebase.php?a=order_article&id=<?php echo $article['id']; ?> &catid=<?php echo $catid; ?> &move=-15&token=<?php hesk_token_echo(); ?> "><img src="../img/move_up.png" width="16" height="16" alt="<?php echo $hesklang['move_up']; ?> " title="<?php echo $hesklang['move_up']; ?> " <?php echo $style; ?> /></a> <img src="../img/blank.gif" width="16" height="16" alt="" style="padding:3px;border:none;" /> <?php } else { ?> <a href="manage_knowledgebase.php?a=order_article&id=<?php echo $article['id']; ?> &catid=<?php echo $catid; ?> &move=-15&token=<?php hesk_token_echo(); ?> "><img src="../img/move_up.png" width="16" height="16" alt="<?php echo $hesklang['move_up']; ?> " title="<?php echo $hesklang['move_up']; ?> " <?php echo $style; ?> /></a> <a href="manage_knowledgebase.php?a=order_article&id=<?php echo $article['id']; ?> &catid=<?php echo $catid; ?> &move=15&token=<?php hesk_token_echo(); ?> "><img src="../img/move_down.png" width="16" height="16" alt="<?php echo $hesklang['move_dn']; ?> " title="<?php echo $hesklang['move_dn']; ?> " <?php echo $style; ?> /></a> <?php } } elseif ($num_sticky > 1 || $num_nosticky > 1) { echo '<img src="../img/blank.gif" width="16" height="16" alt="" style="padding:3px;border:none;vertical-align:text-bottom;" /> <img src="../img/blank.gif" width="16" height="16" alt="" style="padding:3px;border:none;vertical-align:text-bottom;" />'; } ?> <a href="manage_knowledgebase.php?a=sticky&s=<?php echo $article['sticky'] ? 0 : 1; ?> &id=<?php echo $article['id']; ?> &catid=<?php echo $catid; ?> &token=<?php hesk_token_echo(); ?> "><img src="../img/sticky<?php if (!$article['sticky']) { echo '_off'; } ?> .png" width="16" height="16" alt="<?php echo $article['sticky'] ? $hesklang['stickyoff'] : $hesklang['stickyon']; ?> " title="<?php echo $article['sticky'] ? $hesklang['stickyoff'] : $hesklang['stickyon']; ?> " <?php echo $style; ?> /></a> <a href="knowledgebase_private.php?article=<?php echo $article['id']; ?> &back=1<?php if ($article['type'] == 2) { echo '&draft=1'; } ?> " target="_blank"><img src="../img/article_text.png" width="16" height="16" alt="<?php echo $hesklang['viewart']; ?> " title="<?php echo $hesklang['viewart']; ?> " <?php echo $style; ?> /></a> <a href="manage_knowledgebase.php?a=edit_article&id=<?php echo $article['id']; ?> "><img src="../img/edit.png" width="16" height="16" alt="<?php echo $hesklang['edit']; ?> " title="<?php echo $hesklang['edit']; ?> " <?php echo $style; ?> /></a> <a href="manage_knowledgebase.php?a=remove_article&id=<?php echo $article['id']; ?> &token=<?php hesk_token_echo(); ?> " onclick="return hesk_confirmExecute('<?php echo hesk_makeJsString($hesklang['del_art']); ?> ');"><img src="../img/delete.png" width="16" height="16" alt="<?php echo $hesklang['delete']; ?> " title="<?php echo $hesklang['delete']; ?> " <?php echo $style; ?> /></a> </td> </tr> <?php $j++; $k++; } // End while ?> </table> </div> <?php } } // END if hide article list /* Manage Category (except the default one) */ if ($catid != 1) { ?> <br /> <div class="container insertCategory"> <?php echo '<a href="manage_knowledgebase.php?a=add_category&parent=' . $catid . '"><img src="../img/add_category.png" width="16" height="16" alt="' . $hesklang['kb_i_cat2'] . '" title="' . $hesklang['kb_i_cat2'] . '" border="0" style="border:none;vertical-align:text-bottom" /></a> <a href="manage_knowledgebase.php?a=add_category&parent=' . $catid . '"><b>' . $hesklang['kb_i_cat2'] . '</b></a>'; ?> </div> <div class="container category-settings-title"><?php echo $hesklang['catset']; ?> </div> <div class="container category-settings-form"> <br/> <form action="manage_knowledgebase.php" method="post" name="form1" onsubmit="Javascript:return hesk_deleteIfSelected('dodelete','<?php echo hesk_makeJsString($hesklang['kb_delcat']); ?> ')"> <div class="form-inline"> <span class="col-sm-2"><b><?php echo $hesklang['kb_cat_title']; ?> :</b></span> <span><input class="form-control" type="text" name="title" size="70" maxlength="255" value="<?php echo $this_cat['name']; ?> " /></span> </div> <br/> <div class="form-inline"> <span class="col-sm-2"><b><?php echo $hesklang['kb_cat_parent']; ?> :</b></span> <span><select class="form-control" name="parent"><?php $listBox->printMenu(); ?> </select></span> </div> <br/> <div class="form-inline"> <span class="col-sm-2"><b><?php echo $hesklang['kb_type']; ?> :</b></span> <div class="form-group"> <label><input type="radio" name="type" value="0" <?php if (!$this_cat['type']) { echo 'checked="checked"'; } ?> /> <b><i><?php echo $hesklang['kb_published']; ?> </i></b></label><br /> <span><?php echo $hesklang['kb_cat_published']; ?> </span><br/><br/> <label><input type="radio" name="type" value="1" <?php if ($this_cat['type']) { echo 'checked="checked"'; } ?> /> <b><i><?php echo $hesklang['kb_private']; ?> </i></b></label><br /> <span><?php echo $hesklang['kb_cat_private']; ?> </span> </div> </div> <br/> <div class="form-inline"> <span class="col-sm-2"><b><?php echo $hesklang['opt']; ?> :</b></span> <div class="form-group"> <label><input type="checkbox" name="dodelete" id="dodelete" value="Y" onclick="Javascript:hesk_toggleLayerDisplay('deleteoptions')" /> <i><?php echo $hesklang['delcat']; ?> </i></label> <div id="deleteoptions" style="display: none;"> <label><input type="radio" name="movearticles" value="Y" checked="checked" /> <?php echo $hesklang['move1']; ?> </label><br /> <label><input type="radio" name="movearticles" value="N" /> <?php echo $hesklang['move2']; ?> </label> </div> </div> </div> <br/> </div> <br/> <div class="col-sm-6 col-sm-offset-6"> <input type="hidden" name="a" value="edit_category" /> <input type="hidden" name="token" value="<?php hesk_token_echo(); ?> " /> <input type="hidden" name="catid" value="<?php echo $catid; ?> " /><input type="submit" value="<?php echo $hesklang['save_changes']; ?> " class="btn btn-default save-cat-changes-btn" /> </div> </form> <?php } // END if $catid != 1 /* Clean unneeded session variables */ hesk_cleanSessionVars(array('hide', 'manage_cat', 'edit_article')); require_once HESK_PATH . 'inc/footer.inc.php'; exit; }
function edit_user() { global $hesk_settings, $hesklang, $default_userdata; $id = intval(hesk_GET('id')) or hesk_error("{$hesklang['int_error']}: {$hesklang['no_valid_id']}"); /* To edit self fore using "Profile" page */ if ($id == $_SESSION['id']) { hesk_process_messages($hesklang['eyou'], 'profile.php', 'NOTICE'); } $_SESSION['edit_userdata'] = TRUE; if (!isset($_SESSION['save_userdata'])) { $res = hesk_dbQuery("SELECT *,`heskprivileges` AS `features` FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "users` WHERE `id`='" . intval($id) . "' LIMIT 1"); $_SESSION['userdata'] = hesk_dbFetchAssoc($res); /* Store original username for display until changes are saved successfully */ $_SESSION['original_user'] = $_SESSION['userdata']['user']; /* A few variables need special attention... */ if ($_SESSION['userdata']['isadmin']) { $_SESSION['userdata']['features'] = $default_userdata['features']; $_SESSION['userdata']['categories'] = $default_userdata['categories']; } else { $_SESSION['userdata']['features'] = explode(',', $_SESSION['userdata']['features']); $_SESSION['userdata']['categories'] = explode(',', $_SESSION['userdata']['categories']); } $_SESSION['userdata']['cleanpass'] = ''; } /* Make sure we have permission to edit this user */ if (!compare_user_permissions($id, $_SESSION['userdata']['isadmin'], $_SESSION['userdata']['categories'], $_SESSION['userdata']['features'])) { hesk_process_messages($hesklang['npea'], 'manage_users.php'); } /* Print header */ require_once HESK_PATH . 'inc/header.inc.php'; /* Print main manage users page */ require_once HESK_PATH . 'inc/show_admin_nav.inc.php'; ?> </td> </tr> <tr> <td> <span class="smaller"><a href="manage_users.php" class="smaller"><?php echo $hesklang['manage_users']; ?> </a> > <?php echo $hesklang['editing_user'] . ' ' . $_SESSION['original_user']; ?> </span> <br /> <?php /* This will handle error, success and notice messages */ hesk_handle_messages(); ?> <h3><?php echo $hesklang['editing_user'] . ' ' . $_SESSION['original_user']; ?> </h3> <p><?php echo $hesklang['req_marked_with']; ?> <font class="important">*</font><br /> </p> <script language="Javascript" type="text/javascript"><!-- var tabberOptions = { 'cookie':"tabbereu", 'onLoad': function(argsObj) { var t = argsObj.tabber; var i; if (t.id) { t.cookie = t.id + t.cookie; } i = parseInt(getCookie(t.cookie)); if (isNaN(i)) { return; } t.tabShow(i); }, 'onClick':function(argsObj) { var c = argsObj.tabber.cookie; var i = argsObj.index; setCookie(c, i); } }; //--> </script> <script language="Javascript" type="text/javascript" src="<?php echo HESK_PATH; ?> inc/tabs/tabber-minimized.js"></script> <form name="form1" method="post" action="manage_users.php"> <?php hesk_profile_tab('userdata', false); ?> <!-- Submit --> <p align="center"><input type="hidden" name="a" value="save" /> <input type="hidden" name="userid" value="<?php echo $id; ?> " /> <input type="hidden" name="token" value="<?php hesk_token_echo(); ?> " /> <input type="submit" value="<?php echo $hesklang['save_changes']; ?> " class="orangebutton" onmouseover="hesk_btn(this,'orangebuttonover');" onmouseout="hesk_btn(this,'orangebutton');" /> | <a href="manage_users.php"><?php echo $hesklang['dich']; ?> </a></p> </form> <p> </p> <p> </p> <?php require_once HESK_PATH . 'inc/footer.inc.php'; exit; }
function show_new_form() { global $hesk_settings, $hesklang, $admins; ?> <div class="container mail-new-text-message-table"> <div> <form action="mail.php" method="post" name="form2"> <div class="container"><h3><?php echo $hesklang['new_mail']; ?> </h3></div><br/> <div > <div class="mail-new-message"> <div> <div class="form-group mail-new-message-to-subject"> <div class="form-inline" style="margin-bottom: 5px;" > <label class="col-sm-2 control-label" for="mail-to"><b><?php echo $hesklang['m_to']; ?> </b></label> <select class="form-control" id="mail-to" name="to"> <option value="" selected="selected"><?php echo $hesklang['select']; ?> </option> <?php foreach ($admins as $k => $v) { if ($k != $_SESSION['id']) { if (isset($_SESSION['mail']) && $k == $_SESSION['mail']['to']) { echo '<option value="' . $k . '" selected="selected">' . $v . '</option>'; } else { echo '<option value="' . $k . '">' . $v . '</option>'; } } } ?> </select> </div> <div class="form-inline"> <label class="col-sm-2 control-label" for="mail-subject"><b><?php echo $hesklang['m_sub']; ?> </b></label> <input class="form-control" type="text" id="mail-subject" name="subject" size="40" maxlength="50" <?php if (isset($_SESSION['mail']['subject'])) { echo ' value="' . stripslashes($_SESSION['mail']['subject']) . '" '; } ?> /> </div> </div><!-- end mail-new-message-to-subject --> <div class="form-inline"> <label class="col-sm-2 control-label"><b><?php echo $hesklang['message']; ?> :</b></label> <textarea class="form-control" name="message" rows="15" cols="70"><?php if (isset($_SESSION['mail']['message'])) { echo stripslashes($_SESSION['mail']['message']); } ?> </textarea> </div> </div> </div><!-- end mail-new-message--> </div> <div class="col-sm-12"> <input type="hidden" name="token" value="<?php hesk_token_echo(); ?> " /> <input type="hidden" name="a" value="send" /> <input type="submit" value="<?php echo $hesklang['m_send']; ?> " class="btn btn-default mail-btn" /> </div> </form> <br/> </div> </div><!-- end mail-new-text-message-table --> <?php }
while ($ban = hesk_dbFetchAssoc($res)) { $color = ''; if (isset($_SESSION['ban_email']['id']) && $ban['id'] == $_SESSION['ban_email']['id']) { $color = 'success'; unset($_SESSION['ban_email']['id']); } echo ' <tr> <td class="' . $color . '" style="text-align:left">' . $ban['email'] . '</td> <td class="' . $color . '" style="text-align:left">' . (isset($admins[$ban['banned_by']]) ? $admins[$ban['banned_by']] : $hesklang['e_udel']) . '</td> <td class="' . $color . '" style="text-align:left">' . $ban['dt'] . '</td> '; if ($can_unban) { echo ' <td class="' . $color . '" style="text-align:left;"> <a href="banned_emails.php?a=unban&id=' . $ban['id'] . '&token=' . hesk_token_echo(0) . '" onclick="return confirm_delete();"> <i class="fa fa-times" style="color: red; font-size: 16px;"data-toggle="tooltip" data-placement="top" data-original-title="' . $hesklang['delban'] . '"></i> </a> </td> '; } echo '</tr>'; } // End while ?> </tbody> </table> <div align="center"> <table border="0" cellspacing="1" cellpadding="3" class="white" width="100%"> <?php ?>
</div> </td> <td>' . output_user_dropdown($mycat['id'], $mycat['manager'], $users) . '</td> <td> <a href="Javascript:void(0)" onclick="Javascript:hesk_window(\'manage_categories.php?a=linkcode&catid=' . $mycat['id'] . '&p=' . $mycat['type'] . '\',\'200\',\'500\')" id="tooltip"><i class="fa fa-code" style="font-size: 14px; color: ' . ($mycat['type'] ? 'gray' : 'green') . '" data-toggle="tooltip" data-placement="top" title="' . $hesklang['geco'] . '"></i></a> ' . $autoassign_code . ' ' . $type_code . ' '; if ($orderBy != 'name' && $num > 1) { if ($j == 1) { echo '<img src="../img/blank.gif" width="16" height="16" alt="" style="padding:3px;border:none;" /> <a href="manage_categories.php?a=order&catid=' . $mycat['id'] . '&move=15&token=' . hesk_token_echo(0) . '"><i class="fa fa-arrow-down" style="font-size: 14px; color: green" data-toggle="tooltip" data-placement="top" title="' . $hesklang['move_dn'] . '"></i></a>'; } elseif ($j == $num) { echo '<a href="manage_categories.php?a=order&catid=' . $mycat['id'] . '&move=-15&token=' . hesk_token_echo(0) . '"><i class="fa fa-arrow-up" style="font-size: 14px; color: green" data-toggle="tooltip" data-placement="top" title="' . $hesklang['move_up'] . '"></i></a> <img src="../img/blank.gif" width="16" height="16" alt="" style="padding:3px;border:none;" />'; } else { echo ' <a href="manage_categories.php?a=order&catid=' . $mycat['id'] . '&move=-15&token=' . hesk_token_echo(0) . '"><i class="fa fa-arrow-up" style="font-size: 14px; color: green" data-toggle="tooltip" data-placement="top" title="' . $hesklang['move_up'] . '"></i></a> <a href="manage_categories.php?a=order&catid=' . $mycat['id'] . '&move=15&token=' . hesk_token_echo(0) . '"><i class="fa fa-arrow-down" style="font-size: 14px; color: green" data-toggle="tooltip" data-placement="top" title="' . $hesklang['move_dn'] . '"></i></a> '; } } echo $remove_code . '</td> </tr> '; } // End while ?> </table> </div> </div> <?php require_once HESK_PATH . 'inc/footer.inc.php';
function print_add_ticket() { global $hesk_settings, $hesklang; // Auto-focus first empty or error field define('AUTOFOCUS', true); // Pre-populate fields // Customer name if (isset($_REQUEST['name'])) { $_SESSION['c_name'] = $_REQUEST['name']; } // Customer email address if (isset($_REQUEST['email'])) { $_SESSION['c_email'] = $_REQUEST['email']; $_SESSION['c_email2'] = $_REQUEST['email']; } // Category ID if (isset($_REQUEST['catid'])) { $_SESSION['c_category'] = intval($_REQUEST['catid']); } if (isset($_REQUEST['category'])) { $_SESSION['c_category'] = intval($_REQUEST['category']); } // Priority if (isset($_REQUEST['priority'])) { $_SESSION['c_priority'] = intval($_REQUEST['priority']); } // Subject if (isset($_REQUEST['subject'])) { $_SESSION['c_subject'] = $_REQUEST['subject']; } // Message if (isset($_REQUEST['message'])) { $_SESSION['c_message'] = $_REQUEST['message']; } // Custom fields foreach ($hesk_settings['custom_fields'] as $k => $v) { if ($v['use'] && isset($_REQUEST[$k])) { $_SESSION['c_' . $k] = $_REQUEST[$k]; } } // Varibles for coloring the fields in case of errors if (!isset($_SESSION['iserror'])) { $_SESSION['iserror'] = array(); } if (!isset($_SESSION['isnotice'])) { $_SESSION['isnotice'] = array(); } if (!isset($_SESSION['c_category']) && !$hesk_settings['select_cat']) { $_SESSION['c_category'] = 0; } // Tell header to load reCaptcha API if needed if ($hesk_settings['recaptcha_use'] == 2) { define('RECAPTCHA', 1); } // Print header $hesk_settings['tmp_title'] = $hesk_settings['hesk_title'] . ' - ' . $hesklang['submit_ticket']; require_once HESK_PATH . 'inc/header.inc.php'; ?> <nav class="row navbar navbar-default" id="showTopBar-indexPhp"> <div class="menu-wrapper"> <div class="container showTopBar"><?php hesk_showTopBar($hesk_settings['hesk_title']); ?> </div> </div><!-- end showTopBar-indexPhp --> </nav> <nav class="row navbar userMenu"> <div class="container"> <div class="collapse navbar-collapse"> <ul class="nav navbar-nav"> <li id="userMenu-home"><a href="index.php"><?php echo $hesklang['main_page']; ?> </a></li> <li id="userMenu-submitTicket"><a href="index.php?a=add"><?php echo $hesklang['submit_tick']; ?> </a></li> <li id="client-username"><a href="client_profile.php"><?php echo $hesklang['hello']; if (isset($_SESSION['id']['user']) && $_SESSION['id']['user']) { echo $_SESSION['id']['user']; } ?> </a></li> <li id="userMenu-logout"><a href="logout.php"><?php echo $hesklang['logout']; ?> </a></li> </ul> </div><!--/.nav-collapse --> </div> </nav> <div class="container siteUrl-title-indexPhp"> <div class="container form-inline"> <span><a href="<?php echo $hesk_settings['site_url']; ?> " class="smaller" style="text-decoration: none;"><?php echo $hesk_settings['site_title']; ?> </a> > <a href="<?php echo $hesk_settings['hesk_url']; ?> " class="smaller"><?php echo 'Help Desk'; ?> </a> > <?php echo $hesklang['submit_ticket']; ?> </span> </div> </div><!-- end siteUrl-title-indexPhp --> <br/> <br/> <!--</td> </tr>--> <!--start in this page end in line 947 <tr> <td>--> <?php // This will handle error, success and notice messages hesk_handle_messages(); ?> <div class="container" id="view-submitTicket"> <img src="img/existingticket.jpg" alt="existingticket"/><span><?php echo $hesklang['submit_ticket']; ?> </span></div> <br/> <div class="container form-submit-support-request"> <br/> <div><?php echo $hesklang['use_form_below']; ?> <font class="important"> *</font></div><br/> <!-- START FORM --> <form class="form-horizontal" method="post" action="submit_ticket.php?submit=1" name="form1" enctype="multipart/form-data" autocomplete="off"> <!-- Contact info --> <div class="form-group" style="margin-bottom: 5px;"> <label class="col-sm-2" for="name-contact-info-support-request"><?php echo $hesklang['name']; ?> : <font class="important">*</font></label> <div class="col-sm-4"><input type="text" class="form-control contact-support-request" id="name-contact-info-support-request" name="name" value="<?php if (isset($_SESSION['id']['user'])) { echo $_SESSION['id']['user']; } ?> " <?php if (in_array('name', $_SESSION['iserror'])) { echo ' class="isError" '; } ?> readonly></div> </div> <div class="form-group" style="margin-bottom: 5px;"> <label class="col-sm-2" for="email-contact-info-support-request"><?php echo $hesklang['email']; ?> : <font class="important">*</font></label> <div class="col-sm-4"><input type="text" class="form-control contact-support-request" id="email-contact-info-support-request" name="email" value="<?php if (isset($_SESSION['id']['email'])) { echo $_SESSION['id']['email']; } ?> " <?php if (in_array('email', $_SESSION['iserror'])) { echo ' class="isError" '; } elseif (in_array('email', $_SESSION['isnotice'])) { echo ' class="isNotice" '; } ?> <?php if ($hesk_settings['detect_typos']) { echo ' onblur="Javascript:hesk_suggestEmail(0)"'; } ?> readonly></div> </div> <?php if ($hesk_settings['confirm_email']) { ?> <div class="form-group" style="margin-bottom: 5px;"> <label class="col-sm-2" for="confemail-contact-info-support-request"><?php echo $hesklang['confemail']; ?> : <font class="important">*</font></label> <div class="col-sm-4"><input type="text" class="form-control contact-support-request" id="confemail-contact-info-support-request" name="email2" value="<?php if (isset($_SESSION['c_email2'])) { echo stripslashes(hesk_input($_SESSION['c_email2'])); } ?> " <?php if (in_array('email2', $_SESSION['iserror'])) { echo ' class="isError" '; } ?> /></div> </div> <?php } // End if $hesk_settings['confirm_email'] ?> <?php hesk_load_database_functions(); hesk_dbConnect(); ?> <div class="form-group" style="margin-bottom: 5px;"> <label class="col-sm-2" for="select-cont"><?php echo $hesklang['contract']; ?> : <font class="important">*</font></label> <div class="col-sm-4"><select class="form-control contact-support-request" required="required" title="Required field" id="select-cont" name="contract_name"> <option></option> <?php $res_client = hesk_dbQuery('SELECT contract_Id FROM `' . hesk_dbEscape($hesk_settings['db_pfix']) . 'contractforclient` WHERE `client_Id`=' . $_SESSION["id"]["id"]); $i = 1; while ($row_client = mysqli_fetch_array($res_client)) { $result_contract = hesk_dbQuery('SELECT id, contract_name FROM `' . hesk_dbEscape($hesk_settings['db_pfix']) . 'contracts` WHERE id=' . $row_client['contract_Id']); $cont_result = mysqli_fetch_array($result_contract); echo '<option value="' . $cont_result['id'] . '">' . $cont_result['contract_name'] . '</option>'; } ?> </select></div> <?php ?> </div> <?php $result_client = hesk_dbQuery('SELECT contract_Id FROM `' . hesk_dbEscape($hesk_settings['db_pfix']) . "contractforclient` WHERE `client_Id`='" . $_SESSION["id"]["id"] . "' LIMIT 1"); $row_client = mysqli_fetch_array($result_client); $result_client = hesk_dbQuery('SELECT company_id FROM `' . hesk_dbEscape($hesk_settings['db_pfix']) . "contracts` WHERE `id`='" . $row_client['contract_Id'] . "' LIMIT 1"); if ($row_client = mysqli_fetch_array($result_client)) { $result_company = hesk_dbQuery('SELECT id, company_name FROM `' . hesk_dbEscape($hesk_settings['db_pfix']) . 'companies` WHERE id=' . $row_client['company_id']); $company_result = mysqli_fetch_array($result_company); echo '<input type="hidden" class="form-control" name="company_name" value="' . $company_result['id'] . '" size="40" maxlength="1000" />'; } ?> <!-- Department and priority --> <?php $is_table = 0; // Get categories $res = hesk_dbQuery("SELECT `id`, `categ_impro_id`, `name` FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "categories` WHERE `type`='0' AND `active`='1' ORDER BY `cat_order` ASC"); /*if (hesk_dbNumRows($res) == 1) { // Only 1 public category, no need for a select box $row = hesk_dbFetchAssoc($res); echo '<input type="hidden" name="category" value="'.$row['id'].'" />'; } /*elseif (hesk_dbNumRows($res) < 1) { // No public categories, set it to default one echo '<input type="hidden" name="category" value="1" />'; }*/ /*else {*/ // List available categories $is_table = 1; ?> <!-- start table here end in line 304 --> <div class="form-group" style="margin-bottom: 5px;"> <label class="col-sm-2" for="category-department-priority-support-request"><?php echo $hesklang['category']; ?> : <font class="important">*</font></label> <div class="col-sm-4"><select class="form-control contact-support-request" required="required" title="Required field" id="category-department-priority-support-request" name="category" <?php if (in_array('category', $_SESSION['iserror'])) { echo ' class="isError" '; } ?> > <option></option> <?php // Show the "Click to select"? if ($hesk_settings['select_cat']) { echo '<option value="">' . $hesklang['select'] . '</option>'; } // List categories while ($row = hesk_dbFetchAssoc($res)) { echo '<option value="' . $row['id'] . '"' . ($_SESSION['c_category'] == $row['id'] ? ' selected="selected"' : '') . '>' . $row['name'] . '</option>'; } ?> </select></div> </div> <?php /*}*/ /* Can customer assign urgency? */ if ($hesk_settings['cust_urgency']) { if (!$is_table) { echo '<div class="form-group department-priority-support-request">'; $is_table = 1; } ?> <div class="form-group" style="margin-bottom: 5px;"> <label class="col-sm-2" for="priority-department-priority-support-request"><?php echo $hesklang['priority']; ?> : <font class="important">*</font></label> <div class="col-sm-4"><select class="form-control contact-support-request" required="required" title="Required field" id="priority-department-priority-support-request" name="priority" <?php if (in_array('priority', $_SESSION['iserror'])) { echo ' class="isError" '; } ?> > <option></option> <?php // Show the "Click to select"? if ($hesk_settings['select_pri']) { echo '<option value="">' . $hesklang['select'] . '</option>'; } ?> <option value="3" <?php if (isset($_SESSION['c_priority']) && $_SESSION['c_priority'] == 3) { echo 'selected="selected"'; } ?> ><?php echo $hesklang['low']; ?> </option> <option value="2" <?php if (isset($_SESSION['c_priority']) && $_SESSION['c_priority'] == 2) { echo 'selected="selected"'; } ?> ><?php echo $hesklang['medium']; ?> </option> <option value="1" <?php if (isset($_SESSION['c_priority']) && $_SESSION['c_priority'] == 1) { echo 'selected="selected"'; } ?> ><?php echo $hesklang['high']; ?> </option> </select></div> </div> <?php } /* Need to close the table? */ if ($is_table) { echo ''; } ?> <!-- START CUSTOM BEFORE --> <?php /* custom fields BEFORE comments */ $print_table = 0; foreach ($hesk_settings['custom_fields'] as $k => $v) { if ($v['use'] && $v['place'] == 0) { if ($print_table == 0) { echo '<div class="custom-before-support-request">'; /* start table in line 317-486*/ $print_table = 1; } $v['req'] = $v['req'] ? '<font class="important">*</font>' : ''; if ($v['type'] == 'checkbox') { $k_value = array(); if (isset($_SESSION["c_{$k}"]) && is_array($_SESSION["c_{$k}"])) { foreach ($_SESSION["c_{$k}"] as $myCB) { $k_value[] = stripslashes(hesk_input($myCB)); } } } elseif (isset($_SESSION["c_{$k}"])) { $k_value = stripslashes(hesk_input($_SESSION["c_{$k}"])); } else { $k_value = ''; } switch ($v['type']) { /* Radio box */ case 'radio': /*start tr in line 348-375*/ echo ' <div class="form-inline "> <label>' . $v['name'] . ': ' . $v['req'] . '</label> '; $options = explode('#HESK#', $v['value']); $cls = in_array($k, $_SESSION['iserror']) ? ' class="isError" ' : ''; foreach ($options as $option) { if (strlen($k_value) == 0 || $k_value == $option) { $k_value = $option; $checked = 'checked="checked"'; } else { $checked = ''; } echo '<label><input type="radio" name="' . $k . '" value="' . $option . '" ' . $checked . ' ' . $cls . ' /> ' . $option . '</label><br />'; } echo ' </div> '; break; /* Select drop-down box */ /* Select drop-down box */ case 'select': $cls = in_array($k, $_SESSION['iserror']) ? ' class="isError" ' : ''; /*start tr in line 382-414*/ echo ' <div class="form-inline"> <label>' . $v['name'] . ': ' . $v['req'] . '</label> <select name="' . $k . '" ' . $cls . '>'; // Show "Click to select"? $v['value'] = str_replace('{HESK_SELECT}', '', $v['value'], $num); if ($num) { echo '<option value="">' . $hesklang['select'] . '</option>'; } $options = explode('#HESK#', $v['value']); foreach ($options as $option) { if ($k_value == $option) { $k_value = $option; $selected = 'selected="selected"'; } else { $selected = ''; } echo '<option ' . $selected . '>' . $option . '</option>'; } echo '</select> </div> '; break; /* Checkbox */ /* Checkbox */ case 'checkbox': /*start tr in line 418-444*/ echo ' <div class="form-inline"> <label>' . $v['name'] . ': ' . $v['req'] . '</label> '; $options = explode('#HESK#', $v['value']); $cls = in_array($k, $_SESSION['iserror']) ? ' class="isError" ' : ''; foreach ($options as $option) { if (in_array($option, $k_value)) { $checked = 'checked="checked"'; } else { $checked = ''; } echo '<label><input type="checkbox" name="' . $k . '[]" value="' . $option . '" ' . $checked . ' ' . $cls . ' /> ' . $option . '</label><br />'; } echo ' </div> '; break; /* Large text box */ /* Large text box */ case 'textarea': $size = explode('#', $v['value']); $size[0] = empty($size[0]) ? 5 : intval($size[0]); $size[1] = empty($size[1]) ? 30 : intval($size[1]); $cls = in_array($k, $_SESSION['iserror']) ? ' class="isError" ' : ''; /*start tr in line 454-460*/ echo ' <div class="form-inline"> <label>' . $v['name'] . ': ' . $v['req'] . '</label> <textarea name="' . $k . '" rows="' . $size[0] . '" cols="' . $size[1] . '" ' . $cls . '>' . $k_value . '</textarea> </div> '; break; /* Default text input */ /* Default text input */ default: if (strlen($k_value) != 0) { $v['value'] = $k_value; } $cls = in_array($k, $_SESSION['iserror']) ? ' class="isError" ' : ''; /*start tr in line 471-477*/ echo ' <div class="form-inline"> <label>' . $v['name'] . ': ' . $v['req'] . '</label> <input type="text" name="' . $k . '" size="40" maxlength="' . $v['maxlen'] . '" value="' . $v['value'] . '" ' . $cls . ' /> </div> '; } } } /* If table was started we need to close it */ if ($print_table) { echo '</div> <br/><br/>'; /*end custom-before-support-request table*/ $print_table = 0; } ?> <!-- END CUSTOM BEFORE --> <!-- ticket info --> <div class=""> <div class="form-group" style="padding-right: 0px; margin-bottom: 5px;"> <label class="col-sm-2" for="subject-ticket-info-support-request"><?php echo $hesklang['subject']; ?> : <font class="important">*</font></label> <div class="col-sm-4"><input class="form-control contact-support-request" required="required" title="Required field" type="text" id="subject-ticket-info-support-request" name="subject" size="40" maxlength="40" value="<?php if (isset($_SESSION['c_subject'])) { echo stripslashes(hesk_input($_SESSION['c_subject'])); } ?> " <?php if (in_array('subject', $_SESSION['iserror'])) { echo ' class="isError" '; } ?> /></div> </div> <div class="form-group" style="margin-bottom: 5px;"> <div> <label class="col-sm-2" for="message-ticket-info-support-request" ><?php echo $hesklang['message']; ?> : <font class="important">*</font></label> <div class="col-sm-4"><textarea class="form-control contact-support-request" required="required" title="Required field" id="message-ticket-info-support-request" name="message" rows="12" cols="60" <?php if (in_array('message', $_SESSION['iserror'])) { echo ' class="isError" '; } ?> ><?php if (isset($_SESSION['c_message'])) { echo stripslashes(hesk_input($_SESSION['c_message'])); } ?> </textarea></div> </div> </div> </div><!-- ticket-info-support-request --> <!-- START CUSTOM AFTER --> <?php /* custom fields AFTER comments */ $print_table = 0; foreach ($hesk_settings['custom_fields'] as $k => $v) { if ($v['use'] && $v['place']) { if ($print_table == 0) { /*start table in line 534-705*/ echo ' <br/><br/> <div class="custom-after-support-request"> '; $print_table = 1; } $v['req'] = $v['req'] ? '<font class="important">*</font>' : ''; if ($v['type'] == 'checkbox') { $k_value = array(); if (isset($_SESSION["c_{$k}"]) && is_array($_SESSION["c_{$k}"])) { foreach ($_SESSION["c_{$k}"] as $myCB) { $k_value[] = stripslashes(hesk_input($myCB)); } } } elseif (isset($_SESSION["c_{$k}"])) { $k_value = stripslashes(hesk_input($_SESSION["c_{$k}"])); } else { $k_value = ''; } switch ($v['type']) { /* Radio box */ case 'radio': /*start tr in line 567-594*/ echo ' <div class="form-inline"> <label>' . $v['name'] . ': ' . $v['req'] . '</label> '; $options = explode('#HESK#', $v['value']); $cls = in_array($k, $_SESSION['iserror']) ? ' class="isError" ' : ''; foreach ($options as $option) { if (strlen($k_value) == 0 || $k_value == $option) { $k_value = $option; $checked = 'checked="checked"'; } else { $checked = ''; } echo '<label><input type="radio" name="' . $k . '" value="' . $option . '" ' . $checked . ' ' . $cls . ' /> ' . $option . '</label><br />'; } echo ' </div> '; break; /* Select drop-down box */ /* Select drop-down box */ case 'select': $cls = in_array($k, $_SESSION['iserror']) ? ' class="isError" ' : ''; /*start tr in line 601-633*/ echo ' <div class="form-inline"> <label>' . $v['name'] . ': ' . $v['req'] . '</label> <select name="' . $k . '" ' . $cls . '>'; // Show "Click to select"? $v['value'] = str_replace('{HESK_SELECT}', '', $v['value'], $num); if ($num) { echo '<option value="">' . $hesklang['select'] . '</option>'; } $options = explode('#HESK#', $v['value']); foreach ($options as $option) { if ($k_value == $option) { $k_value = $option; $selected = 'selected="selected"'; } else { $selected = ''; } echo '<option ' . $selected . '>' . $option . '</option>'; } echo '</select> </div> '; break; /* Checkbox */ /* Checkbox */ case 'checkbox': /*start tr in line 637-663*/ echo ' <div class="form-inline"> <label>' . $v['name'] . ': ' . $v['req'] . '</label> '; $options = explode('#HESK#', $v['value']); $cls = in_array($k, $_SESSION['iserror']) ? ' class="isError" ' : ''; foreach ($options as $option) { if (in_array($option, $k_value)) { $checked = 'checked="checked"'; } else { $checked = ''; } echo '<label><input type="checkbox" name="' . $k . '[]" value="' . $option . '" ' . $checked . ' ' . $cls . ' /> ' . $option . '</label><br />'; } echo ' </div> '; break; /* Large text box */ /* Large text box */ case 'textarea': $size = explode('#', $v['value']); $size[0] = empty($size[0]) ? 5 : intval($size[0]); $size[1] = empty($size[1]) ? 30 : intval($size[1]); $cls = in_array($k, $_SESSION['iserror']) ? ' class="isError" ' : ''; /*start tr in line 673-679*/ echo ' <div class="form-inline"> <label>' . $v['name'] . ': ' . $v['req'] . '</label> <textarea name="' . $k . '" rows="' . $size[0] . '" cols="' . $size[1] . '" ' . $cls . '>' . $k_value . '</textarea> </div> '; break; /* Default text input */ /* Default text input */ default: if (strlen($k_value) != 0) { $v['value'] = $k_value; } $cls = in_array($k, $_SESSION['iserror']) ? ' class="isError" ' : ''; /*start tr in line 690-696*/ echo ' <div> <label>' . $v['name'] . ': ' . $v['req'] . '</label> <input type="text" name="' . $k . '" size="40" maxlength="' . $v['maxlen'] . '" value="' . $v['value'] . '" ' . $cls . ' /> </div> '; } } } /* If table was started we need to close it */ if ($print_table) { echo '</div>'; /*end custom-after-support-request*/ $print_table = 0; } ?> <!-- END CUSTOM AFTER --> <?php /* attachments */ if ($hesk_settings['attachments']['use']) { ?> <br/><br/> <div class=""> <div class="form-group"> <label class="col-sm-2" style="vertical-align: top;"><?php echo $hesklang['attachments']; ?> :</label> <div class="col-sm-4 contact-support-request"> <?php for ($i = 1; $i <= $hesk_settings['attachments']['max_number']; $i++) { $cls = $i == 1 && in_array('attachments', $_SESSION['iserror']) ? ' class="isError" ' : ''; echo '<input type="file" name="attachment[' . $i . ']" size="50" ' . $cls . ' style="margin-bottom: 10px;"/>'; } ?> <a href="file_limits.php" target="_blank" onclick="Javascript:hesk_window('file_limits.php',250,500);return false;"><?php echo $hesklang['ful']; ?> </a> </div> </div> </div><!-- end attachments-support-request --> <?php } if ($hesk_settings['question_use'] || $hesk_settings['secimg_use']) { ?> <br/><br/> <!-- Security checks --> <div class="security-checks-support-request"> <?php if ($hesk_settings['question_use']) { ?> <div class="form-group"> <label class="col-sm-2 control-label" style="text-align:right;vertical-align:top" width="150"><?php echo $hesklang['verify_q']; ?> <font class="important">*</font></label> <?php $value = ''; if (isset($_SESSION['c_question'])) { $value = stripslashes(hesk_input($_SESSION['c_question'])); } $cls = in_array('question', $_SESSION['iserror']) ? ' class="isError" ' : ''; echo $hesk_settings['question_ask'] . '<br /><input class="form-control" type="text" name="question" size="20" value="' . $value . '" ' . $cls . ' />'; ?> <br /> </div> <?php } if ($hesk_settings['secimg_use']) { ?> <div class="form-group"> <label class="col-sm-2 control-label" style="text-align:right;vertical-align:top" width="150"><?php echo $hesklang['verify_i']; ?> <font class="important">*</font></label> <?php // SPAM prevention verified for this session if (isset($_SESSION['img_verified'])) { echo '<img src="' . HESK_PATH . 'img/success.png" width="16" height="16" border="0" alt="" style="vertical-align:text-bottom" /> ' . $hesklang['vrfy']; } elseif ($hesk_settings['recaptcha_use'] == 1) { ?> <script type="text/javascript"> var RecaptchaOptions = { theme : '<?php echo isset($_SESSION['iserror']) && in_array('mysecnum', $_SESSION['iserror']) ? 'red' : 'white'; ?> ', custom_translations : { visual_challenge : "<?php echo hesk_slashJS($hesklang['visual_challenge']); ?> ", audio_challenge : "<?php echo hesk_slashJS($hesklang['audio_challenge']); ?> ", refresh_btn : "<?php echo hesk_slashJS($hesklang['refresh_btn']); ?> ", instructions_visual : "<?php echo hesk_slashJS($hesklang['instructions_visual']); ?> ", instructions_context : "<?php echo hesk_slashJS($hesklang['instructions_context']); ?> ", instructions_audio : "<?php echo hesk_slashJS($hesklang['instructions_audio']); ?> ", help_btn : "<?php echo hesk_slashJS($hesklang['help_btn']); ?> ", play_again : "<?php echo hesk_slashJS($hesklang['play_again']); ?> ", cant_hear_this : "<?php echo hesk_slashJS($hesklang['cant_hear_this']); ?> ", incorrect_try_again : "<?php echo hesk_slashJS($hesklang['incorrect_try_again']); ?> ", image_alt_text : "<?php echo hesk_slashJS($hesklang['image_alt_text']); ?> ", }, }; </script> <?php require HESK_PATH . 'inc/recaptcha/recaptchalib.php'; echo recaptcha_get_html($hesk_settings['recaptcha_public_key'], null, true); } elseif ($hesk_settings['recaptcha_use'] == 2) { ?> <div class="g-recaptcha" data-sitekey="<?php echo $hesk_settings['recaptcha_public_key']; ?> "></div> <?php } else { $cls = in_array('mysecnum', $_SESSION['iserror']) ? ' class="isError" ' : ''; echo $hesklang['sec_enter'] . '<br /> <br /><img src="print_sec_img.php?' . rand(10000, 99999) . '" width="150" height="40" alt="' . $hesklang['sec_img'] . '" title="' . $hesklang['sec_img'] . '" border="1" name="secimg" style="vertical-align:text-bottom" /> ' . '<a href="javascript:void(0)" onclick="javascript:document.form1.secimg.src=\'print_sec_img.php?\'+ ( Math.floor((90000)*Math.random()) + 10000);"><img src="img/reload.png" height="24" width="24" alt="' . $hesklang['reload'] . '" title="' . $hesklang['reload'] . '" border="0" style="vertical-align:text-bottom" /></a>' . '<br /> <br /><input type="text" name="mysecnum" size="20" maxlength="5" ' . $cls . ' />'; } ?> </div> <?php } ?> </div><!-- end security-checks-support-request --> <?php } ?> <!-- Submit --> <?php /*if ($hesk_settings['submit_notice']) { ?> <br/><br/> <div align="center"> <div class="submit-notice-support-request"> <div> <div> <b><?php echo $hesklang['before_submit']; ?></b> <ul> <li><?php echo $hesklang['all_info_in']; ?>.</li> <li><?php echo $hesklang['all_error_free']; ?>.</li> </ul> <b><?php echo $hesklang['we_have']; ?>:</b> <ul> <li><?php echo hesk_htmlspecialchars($_SERVER['REMOTE_ADDR']).' '.$hesklang['recorded_ip']; ?></li> <li><?php echo $hesklang['recorded_time']; ?></li> </ul> <div class="col-sm-7 col-sm-offset-5"><input type="hidden" name="token" value="<?php hesk_token_echo(); ?>" /> <input type="submit" value="<?php echo $hesklang['sub_ticket']; ?>" class="btn btn-default submit-ticket-btn" /></div> </div> </div> </div><!-- end submit-notice-support-request --> </div> <?php } // End IF submit_notice else {*/ ?> <div class="else-submit-notice-support-request form-group"> <div class="col-sm-offset-2 col-sm-3"> <input type="hidden" name="token" value="<?php hesk_token_echo(); ?> " /> <input type="submit" value="<?php echo $hesklang['sub_ticket']; ?> " class="btn btn-default submit-ticket-btn" /> </div> </div><!-- end else-submit-notice-support-request --> <?php /*}*/ // End ELSE submit_notice ?> <!-- Do not delete or modify the code below, it is used to detect simple SPAM bots --> <input type="hidden" name="hx" value="3" /><input type="hidden" name="hy" value="" /> <!-- > <input type="text" name="phone" value="3" /> < --> </form> <!-- END FORM --> </div><!-- end form-submit-support-request --> <!-- Go back --> <div class="container"><a href="javascript:history.go(-1)"> <button type="submit" class="btn btn-default goback-btn"><?php echo $hesklang['back']; ?> </button></a></div> <?php hesk_cleanSessionVars('iserror'); hesk_cleanSessionVars('isnotice'); }
function hesk_printCustomerReplyForm($reopen = 0) { global $hesklang, $hesk_settings, $trackingID, $my_email; // Already printed? if (defined('REPLY_FORM')) { return ''; } ?> <br /> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="7" height="7"><img src="img/roundcornerslt.jpg" width="7" height="7" alt="" /></td> <td class="roundcornerstop"></td> <td><img src="img/roundcornersrt.jpg" width="7" height="7" alt="" /></td> </tr> <tr> <td class="roundcornersleft"> </td> <td> <h3 style="text-align:center"><?php echo $hesklang['add_reply']; ?> </h3> <form method="post" action="reply_ticket.php" enctype="multipart/form-data"> <p align="center"><?php echo $hesklang['message']; ?> : <span class="important">*</span><br /> <textarea name="message" rows="12" cols="60"><?php if (isset($_SESSION['ticket_message'])) { echo stripslashes(hesk_input($_SESSION['ticket_message'])); } ?> </textarea></p> <?php /* attachments */ if ($hesk_settings['attachments']['use']) { ?> <p align="center"> <?php echo $hesklang['attachments'] . ' (<a href="file_limits.php" target="_blank" onclick="Javascript:hesk_window(\'file_limits.php\',250,500);return false;">' . $hesklang['ful'] . '</a>):<br />'; for ($i = 1; $i <= $hesk_settings['attachments']['max_number']; $i++) { echo '<input type="file" name="attachment[' . $i . ']" size="50" /><br />'; } ?> </p> <?php } ?> <p align="center"> <input type="hidden" name="token" value="<?php hesk_token_echo(); ?> " /> <input type="hidden" name="orig_track" value="<?php echo $trackingID; ?> " /> <?php if ($hesk_settings['email_view_ticket']) { echo '<input type="hidden" name="e" value="' . $my_email . '" />'; } if ($reopen) { echo '<input type="hidden" name="reopen" value="1" />'; } ?> <input type="submit" value="<?php echo $hesklang['submit_reply']; ?> " class="orangebutton" onmouseover="hesk_btn(this,'orangebuttonover');" onmouseout="hesk_btn(this,'orangebutton');" /></p> </form> </td> <td class="roundcornersright"> </td> </tr> <tr> <td><img src="img/roundcornerslb.jpg" width="7" height="7" alt="" /></td> <td class="roundcornersbottom"></td> <td width="7" height="7"><img src="img/roundcornersrb.jpg" width="7" height="7" alt="" /></td> </tr> </table> <?php // Make sure the form is only printed once per page define('REPLY_FORM', true); }
function hesk_profile_tab($session_array = 'new', $is_profile_page = true, $action = 'profile_page') { global $hesk_settings, $hesklang, $can_reply_tickets, $can_view_tickets, $can_view_unassigned; ?> <div role="tabpanel"> <!-- Nav tabs --> <ul class="nav nav-tabs" role="tablist"> <li role="presentation" class="active"><a href="#profile-info" aria-controls="profile-info" role="tab" data-toggle="tab"><?php echo $hesklang['pinfo']; ?> </a></li> <?php if (!$is_profile_page) { ?> <li role="presentation"><a href="#permissions" aria-controls="permissions" role="tab" data-toggle="tab"><?php echo $hesklang['permissions']; ?> </a></li> <?php } ?> <li role="presentation"><a href="#signature" aria-controls="signature" role="tab" data-toggle="tab"><?php echo $hesklang['sig']; ?> </a></li> <li role="presentation"><a href="#preferences" aria-controls="preferences" role="tab" data-toggle="tab"><?php echo $hesklang['pref']; ?> </a></li> <li role="presentation"><a href="#notifications" aria-controls="notifications" role="tab" data-toggle="tab"><?php echo $hesklang['notn']; ?> </a></li> </ul> <!-- Tab panes --> <div class="tab-content summaryList tabPadding"> <div role="tabpanel" class="tab-pane fade in active" id="profile-info"> <div class="form-group"> <label for="name" class="col-md-3 control-label"><?php echo $hesklang['real_name']; ?> : <font class="important">*</font></label> <div class="col-md-9"> <input type="text" class="form-control" name="name" size="40" maxlength="50" value="<?php echo $_SESSION[$session_array]['name']; ?> " placeholder="<?php echo htmlspecialchars($hesklang['real_name']); ?> " /> </div> </div> <div class="form-group"> <label for="email" class="col-md-3 control-label"><?php echo $hesklang['email']; ?> : <font class="important">*</font></label> <div class="col-md-9"> <input type="text" class="form-control" name="email" size="40" maxlength="255" placeholder="<?php echo htmlspecialchars($hesklang['email']); ?> " value="<?php echo $_SESSION[$session_array]['email']; ?> " /> </div> </div> <?php if (!$is_profile_page || $_SESSION['isadmin']) { ?> <div class="form-group"> <label for="user" class="col-md-3 control-label"><?php echo $hesklang['username']; ?> : <font class="important">*</font></label> <div class="col-md-9"> <input type="text" class="form-control" name="user" size="40" maxlength="20" value="<?php echo $_SESSION[$session_array]['user']; ?> " placeholder="<?php echo htmlspecialchars($hesklang['username']); ?> "/> </div> </div> <?php } $passwordRequiredSpan = $action == 'create_user' ? '' : 'display:none'; ?> <div class="form-group"> <label for="pass" class="col-md-3 control-label"><?php echo $is_profile_page ? $hesklang['new_pass'] : $hesklang['pass']; ?> : <span class="important" style="<?php echo $passwordRequiredSpan; ?> ">*</span></label> <div class="col-md-9"> <input type="password" class="form-control" name="newpass" autocomplete="off" size="40" placeholder="<?php echo htmlspecialchars($hesklang['pass']); ?> " value="<?php echo isset($_SESSION[$session_array]['cleanpass']) ? $_SESSION[$session_array]['cleanpass'] : ''; ?> " onkeyup="javascript:hesk_checkPassword(this.value)" /> </div> </div> <div class="form-group"> <label for="confirmPass" class="col-md-3 control-label"><?php echo $hesklang['confirm_pass']; ?> : <span class="important" style="<?php echo $passwordRequiredSpan; ?> ">*</span></label> <div class="col-md-9"> <input type="password" name="newpass2" class="form-control" autocomplete="off" placeholder="<?php echo htmlspecialchars($hesklang['confirm_pass']); ?> " size="40" value="<?php echo isset($_SESSION[$session_array]['cleanpass']) ? $_SESSION[$session_array]['cleanpass'] : ''; ?> " /> </div> </div> <div class="form-group"> <label for="pwStrength" class="col-md-3 control-label"><?php echo $hesklang['pwdst']; ?> :</label> <div class="col-md-9"> <div class="progress"> <div id="progressBar" class="progress-bar progress-bar-danger" role="progressbar" aria-valuemin="0" aria-valuemax="100" style="width: 0%"> </div> </div> </div> </div> <?php if (!$is_profile_page) { ?> <div class="blankSpace"></div> <div class="form-group"> <div class="col-md-9 col-md-offset-3"> <?php if ($hesk_settings['autoassign']) { ?> <div class="checkbox"> <label><input type="checkbox" name="autoassign" value="Y" <?php if (!isset($_SESSION[$session_array]['autoassign']) || $_SESSION[$session_array]['autoassign'] == 1) { echo 'checked="checked"'; } ?> /> <?php echo $hesklang['user_aa']; ?> </label> </div> <?php } ?> </div> </div> <?php } ?> </div> <?php if (!$is_profile_page) { ?> <div role="tabpanel" class="tab-pane fade" id="permissions"> <div class="form-group"> <label for="administrator" class="col-md-3 control-label"><?php echo $hesklang['permission_template_colon']; ?> </label> <div class="col-md-9"> <?php // Get list of permission templates. If current user is not admin, exclude permission tpl 1 $excludeSql = $_SESSION['isadmin'] ? '' : " WHERE `heskprivileges` <> 'ALL'"; $res = hesk_dbQuery("SELECT * FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "permission_templates`" . $excludeSql); $templates = array(); echo '<select name="template" id="permission-tpl" class="form-control" onchange="updateCheckboxes()">'; while ($row = hesk_dbFetchAssoc($res)) { array_push($templates, $row); $selected = $_SESSION[$session_array]['permission_template'] == $row['id'] ? 'selected' : ''; echo '<option value="' . $row['id'] . '" ' . $selected . '>' . htmlspecialchars($row['name']) . '</option>'; } $selected = $_SESSION[$session_array]['permission_template'] == '-1' ? 'selected' : ''; echo '<option value="-1" ' . $selected . '>' . htmlspecialchars($hesklang['custom']) . '</option>'; echo '</select>'; outputCheckboxJavascript(); ?> </div> </div> <div id="options"> <div class="form-group"> <label for="categories[]" class="col-md-3 control-label"><?php echo $hesklang['allowed_cat']; ?> : <font class="important">*</font></label> <div class="col-md-9"> <?php foreach ($hesk_settings['categories'] as $catid => $catname) { echo '<div class="checkbox"><label><input id="cat-' . $catid . '" class="cat-checkbox" type="checkbox" name="categories[]" onchange="setTemplateToCustom()" value="' . $catid . '" '; if (in_array($catid, $_SESSION[$session_array]['categories'])) { echo ' checked="checked" '; } echo ' />' . $catname . '</label></div> '; } ?> </div> </div> <div class="form-group"> <label for="features[]" class="col-md-3 control-label"><?php echo $hesklang['allow_feat']; ?> : <font class="important">*</font></label> <div class="col-md-9"> <?php foreach ($hesk_settings['features'] as $k) { echo '<div class="checkbox"><label><input id="feat-' . $k . '" class="feat-checkbox" type="checkbox" name="features[]" onchange="setTemplateToCustom()" value="' . $k . '" '; if (in_array($k, $_SESSION[$session_array]['features'])) { echo ' checked="checked" '; } echo ' />' . $hesklang[$k] . '</label></div> '; } ?> </div> </div> </div> </div> <?php } ?> <div role="tabpanel" class="tab-pane fade" id="signature"> <div class="form-group"> <label for="signature" class="col-md-3 control-label"><?php echo $hesklang['signature_max']; ?> :</label> <div class="col-md-9"> <textarea class="form-control" name="signature" rows="6" placeholder="<?php echo htmlspecialchars($hesklang['sig']); ?> " cols="40"><?php echo $_SESSION[$session_array]['signature']; ?> </textarea> <?php echo $hesklang['sign_extra']; ?> </div> </div> </div> <div role="tabpanel" class="tab-pane fade" id="preferences"> <?php if (!$is_profile_page || $can_reply_tickets) { ?> <div class="form-group"> <label for="afterreply" class="col-sm-3 control-label"><?php echo $hesklang['aftrep']; ?> :</label> <div class="col-sm-9"> <div class="radio"> <label><input type="radio" name="afterreply" value="0" <?php if (!$_SESSION[$session_array]['afterreply']) { echo 'checked="checked"'; } ?> /> <?php echo $hesklang['showtic']; ?> </label> </div> <div class="radio"> <label><input type="radio" name="afterreply" value="1" <?php if ($_SESSION[$session_array]['afterreply'] == 1) { echo 'checked="checked"'; } ?> /> <?php echo $hesklang['gomain']; ?> </label> </div> <div class="radio"> <label><input type="radio" name="afterreply" value="2" <?php if ($_SESSION[$session_array]['afterreply'] == 2) { echo 'checked="checked"'; } ?> /> <?php echo $hesklang['shownext']; ?> </label> </div> </div> </div> <div class="form-group"> <label class="col-sm-3 control-label"><?php echo $hesklang['defaults']; ?> :</label> <div class="col-sm-9"> <?php if ($hesk_settings['time_worked']) { ?> <div class="checkbox"> <label><input type="checkbox" name="autostart" value="1" <?php if (!empty($_SESSION[$session_array]['autostart'])) { echo 'checked="checked"'; } ?> /> <?php echo $hesklang['autoss']; ?> </label> </div> <?php } ?> <div class="checkbox"> <label><input type="checkbox" name="notify_customer_new" value="1" <?php if (!empty($_SESSION[$session_array]['notify_customer_new'])) { echo 'checked="checked"'; } ?> /> <?php echo $hesklang['pncn']; ?> </label><br /> </div> <div class="checkbox"> <label><input type="checkbox" name="notify_customer_reply" value="1" <?php if (!empty($_SESSION[$session_array]['notify_customer_reply'])) { echo 'checked="checked"'; } ?> /> <?php echo $hesklang['pncr']; ?> </label><br /> </div> <div class="checkbox"> <label><input type="checkbox" name="show_suggested" value="1" <?php if (!empty($_SESSION[$session_array]['show_suggested'])) { echo 'checked="checked"'; } ?> /> <?php echo $hesklang['pssy']; ?> </label><br /> </div> </div> </div> <?php } ?> <div class="form-group"> <label for="autoRefresh" class="col-sm-3 control-label"><?php echo $hesklang['ticket_auto_refresh']; ?> </label> <div class="col-sm-9"> <input type="text" class="form-control" id="autorefresh" name="autorefresh" value="<?php echo $_SESSION[$session_array]['autorefresh']; ?> "> <span class="help-block"><?php echo $hesklang['autorefresh_restrictions']; ?> </span> </div> </div> </div> <div role="tabpanel" class="tab-pane fade" id="notifications"> <?php $disabledText = !$_SESSION[$session_array]['isadmin'] && strpos($_SESSION[$session_array]['heskprivileges'], 'can_change_notification_settings') === false ? 'disabled' : ''; if (!$is_profile_page) { $disabledText = ''; } if ($disabledText == 'disabled') { ?> <div class="alert alert-info"><?php echo $hesklang['notifications_disabled_info']; ?> </div> <?php } ?> <div class="form-group"> <?php if (!$is_profile_page || $can_view_tickets) { if (!$is_profile_page || $can_view_unassigned) { ?> <div class="col-md-9 col-md-offset-3"><div class="checkbox"><label><input type="checkbox" name="notify_new_unassigned" value="1" <?php if (!empty($_SESSION[$session_array]['notify_new_unassigned'])) { echo 'checked="checked"'; } echo ' ' . $disabledText; ?> /> <?php echo $hesklang['nwts']; ?> <?php echo $hesklang['unas']; ?> </label></div></div> <?php if ($disabledText == 'disabled') { ?> <input type="hidden" name="notify_new_unassigned" value="<?php echo !empty($_SESSION[$session_array]['notify_new_unassigned']) ? '1' : '0'; ?> "> <?php } } else { ?> <input type="hidden" name="notify_new_unassigned" value="0" /> <?php } ?> <div class="col-md-9 col-md-offset-3"><div class="checkbox"><label><input type="checkbox" name="notify_new_my" value="1" <?php if (!empty($_SESSION[$session_array]['notify_new_my'])) { echo 'checked="checked"'; } echo ' ' . $disabledText; ?> /> <?php echo $hesklang['nwts']; ?> <?php echo $hesklang['s_my']; ?> </label></div></div> <?php if ($disabledText == 'disabled') { ?> <input type="hidden" name="notify_new_my" value="<?php echo !empty($_SESSION[$session_array]['notify_new_my']) ? '1' : '0'; ?> "> <?php } if (!$is_profile_page || $can_view_unassigned) { ?> <div class="col-md-9 col-md-offset-3"><div class="checkbox"><label><input type="checkbox" name="notify_reply_unassigned" value="1" <?php if (!empty($_SESSION[$session_array]['notify_reply_unassigned'])) { echo 'checked="checked"'; } echo ' ' . $disabledText; ?> /> <?php echo $hesklang['ncrt']; ?> <?php echo $hesklang['unas']; ?> </label></div></div> <?php if ($disabledText == 'disabled') { ?> <input type="hidden" name="notify_reply_unassigned" value="<?php echo !empty($_SESSION[$session_array]['notify_reply_unassigned']) ? '1' : '0'; ?> "> <?php } } else { ?> <input type="hidden" name="notify_reply_unassigned" value="0" /> <?php } ?> <div class="col-md-9 col-md-offset-3"><div class="checkbox"><label><input type="checkbox" name="notify_reply_my" value="1" <?php if (!empty($_SESSION[$session_array]['notify_reply_my'])) { echo 'checked="checked"'; } echo ' ' . $disabledText; ?> /> <?php echo $hesklang['ncrt']; ?> <?php echo $hesklang['s_my']; ?> </label></div></div> <div class="col-md-9 col-md-offset-3"><div class="checkbox"><label><input type="checkbox" name="notify_assigned" value="1" <?php if (!empty($_SESSION[$session_array]['notify_assigned'])) { echo 'checked="checked"'; } echo ' ' . $disabledText; ?> /> <?php echo $hesklang['ntam']; ?> </label></div></div> <div class="col-md-9 col-md-offset-3"><div class="checkbox"><label><input type="checkbox" name="notify_note" value="1" <?php if (!empty($_SESSION[$session_array]['notify_note'])) { echo 'checked="checked"'; } echo ' ' . $disabledText; ?> /> <?php echo $hesklang['ntnote']; ?> </label></div></div> <div class="col-md-9 col-md-offset-3"><div class="checkbox"><label><input type="checkbox" name="notify_pm" value="1" <?php if (!empty($_SESSION[$session_array]['notify_pm'])) { echo 'checked="checked"'; } echo ' ' . $disabledText; ?> /> <?php echo $hesklang['npms']; ?> </label></div></div> <?php if ($disabledText == 'disabled') { ?> <input type="hidden" name="notify_reply_my" value="<?php echo !empty($_SESSION[$session_array]['notify_reply_my']) ? '1' : '0'; ?> "> <input type="hidden" name="notify_assigned" value="<?php echo !empty($_SESSION[$session_array]['notify_assigned']) ? '1' : '0'; ?> "> <input type="hidden" name="notify_note" value="<?php echo !empty($_SESSION[$session_array]['notify_note']) ? '1' : '0'; ?> "> <input type="hidden" name="notify_pm" value="<?php echo !empty($_SESSION[$session_array]['notify_pm']) ? '1' : '0'; ?> "> <?php } if ($_SESSION['isadmin']) { ?> <div class="col-md-9 col-md-offset-3"><div class="checkbox"><label><input type="checkbox" name="notify_note_unassigned" value="1" <?php if (!empty($_SESSION[$session_array]['notify_note_unassigned'])) { echo 'checked="checked"'; } ?> > <?php echo $hesklang['notify_note_unassigned']; ?> </label></div> </div> <?php } } ?> </div> </div> <div class="form-group"> <div class="col-md-9 col-md-offset-3"> <?php if ($action == 'profile_page') { ?> <input type="hidden" name="action" value="update"> <input type="hidden" name="token" value="<?php hesk_token_echo(); ?> "> <input type="submit" class="btn btn-default" value="<?php echo $hesklang['update_profile']; ?> "> <?php } elseif ($action == 'create_user') { ?> <input type="hidden" name="a" value="new" /> <input type="hidden" name="token" value="<?php hesk_token_echo(); ?> " /> <input type="submit" value="<?php echo $hesklang['create_user']; ?> " class="btn btn-default"> <a href="manage_users.php?a=reset_form" class="btn btn-danger"><?php echo $hesklang['refi']; ?> </a></p> <?php } elseif ($action == 'edit_user') { ?> <input type="hidden" name="a" value="save" /> <input type="hidden" name="userid" value="<?php echo intval(hesk_GET('id')); ?> " /> <input type="hidden" name="token" value="<?php hesk_token_echo(); ?> " /> <input type="hidden" name="active" value="<?php echo $_SESSION[$session_array]['active']; ?> "> <input class="btn btn-default" type="submit" value="<?php echo $hesklang['save_changes']; ?> " /> <a class="btn btn-danger" href="manage_users.php"><?php echo $hesklang['dich']; ?> </a> <?php } ?> </div> </div> </div> </div> <script language="Javascript" type="text/javascript"><!-- hesk_checkPassword(document.form1.newpass.value); //--> </script> <?php }