function hesk_mergeTickets($merge_these, $merge_into) { global $hesk_settings, $hesklang, $hesk_db_link; /* Target ticket must not be in the "merge these" list */ if (in_array($merge_into, $merge_these)) { $merge_these = array_diff($merge_these, array($merge_into)); } /* At least 1 ticket needs to be merged with target ticket */ if (count($merge_these) < 1) { $_SESSION['error'] = $hesklang['merr1']; return false; } /* Make sure target ticket exists */ $res = hesk_dbQuery("SELECT `id`,`trackid`,`category` FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "tickets` WHERE `id`='" . intval($merge_into) . "' LIMIT 1"); if (hesk_dbNumRows($res) != 1) { $_SESSION['error'] = $hesklang['merr2']; return false; } $ticket = hesk_dbFetchAssoc($res); /* Make sure user has access to ticket category */ if (!hesk_okCategory($ticket['category'], 0)) { $_SESSION['error'] = $hesklang['merr3']; return false; } /* Set some variables for later */ $merge['attachments'] = ''; $merge['replies'] = array(); $merge['notes'] = array(); $sec_worked = 0; $history = ''; $merged = ''; /* Get messages, replies, notes and attachments of tickets that will be merged */ foreach ($merge_these as $this_id) { /* Validate ID */ if (is_array($this_id)) { continue; } $this_id = intval($this_id) or hesk_error($hesklang['id_not_valid']); /* Get required ticket information */ $res = hesk_dbQuery("SELECT `id`,`trackid`,`category`,`name`,`message`,`dt`,`time_worked`,`attachments` FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "tickets` WHERE `id`='" . intval($this_id) . "' LIMIT 1"); if (hesk_dbNumRows($res) != 1) { continue; } $row = hesk_dbFetchAssoc($res); /* Has this user access to the ticket category? */ if (!hesk_okCategory($row['category'], 0)) { continue; } /* Insert ticket message as a new reply to target ticket */ hesk_dbQuery("INSERT INTO `" . hesk_dbEscape($hesk_settings['db_pfix']) . "replies` (`replyto`,`name`,`message`,`dt`,`attachments`) VALUES ('" . intval($ticket['id']) . "','" . hesk_dbEscape($row['name']) . "','" . hesk_dbEscape($row['message']) . "','" . hesk_dbEscape($row['dt']) . "','" . hesk_dbEscape($row['attachments']) . "')"); /* Update attachments */ hesk_dbQuery("UPDATE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "attachments` SET `ticket_id`='" . hesk_dbEscape($ticket['trackid']) . "' WHERE `ticket_id`='" . hesk_dbEscape($row['trackid']) . "'"); /* Get old ticket replies and insert them as new replies */ $res = hesk_dbQuery("SELECT * FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "replies` WHERE `replyto`='" . intval($row['id']) . "' ORDER BY `id` ASC"); while ($reply = hesk_dbFetchAssoc($res)) { hesk_dbQuery("INSERT INTO `" . hesk_dbEscape($hesk_settings['db_pfix']) . "replies` (`replyto`,`name`,`message`,`dt`,`attachments`,`staffid`,`rating`,`read`) VALUES ('" . intval($ticket['id']) . "','" . hesk_dbEscape($reply['name']) . "','" . hesk_dbEscape($reply['message']) . "','" . hesk_dbEscape($reply['dt']) . "','" . hesk_dbEscape($reply['attachments']) . "','" . intval($reply['staffid']) . "','" . intval($reply['rating']) . "','" . intval($reply['read']) . "')"); } /* Delete replies to the old ticket */ hesk_dbQuery("DELETE FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "replies` WHERE `replyto`='" . intval($row['id']) . "'"); /* Get old ticket notes and insert them as new notes */ $res = hesk_dbQuery("SELECT * FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "notes` WHERE `ticket`='" . intval($row['id']) . "' ORDER BY `id` ASC"); while ($note = hesk_dbFetchAssoc($res)) { hesk_dbQuery("INSERT INTO `" . hesk_dbEscape($hesk_settings['db_pfix']) . "notes` (`ticket`,`who`,`dt`,`message`,`attachments`) VALUES ('" . intval($ticket['id']) . "','" . intval($note['who']) . "','" . hesk_dbEscape($note['dt']) . "','" . hesk_dbEscape($note['message']) . "','" . hesk_dbEscape($note['attachments']) . "')"); } /* Delete replies to the old ticket */ hesk_dbQuery("DELETE FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "notes` WHERE `ticket`='" . intval($row['id']) . "'"); /* Delete old ticket */ hesk_dbQuery("DELETE FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "tickets` WHERE `id`='" . intval($row['id']) . "'"); /* Log that ticket has been merged */ $history .= sprintf($hesklang['thist13'], hesk_date(), $row['trackid'], $_SESSION['name'] . ' (' . $_SESSION['user'] . ')'); /* Add old ticket ID to target ticket "merged" field */ $merged .= '#' . $row['trackid']; /* Convert old ticket "time worked" to seconds and add to $sec_worked variable */ list($hr, $min, $sec) = explode(':', $row['time_worked']); $sec_worked += (int) $hr * 3600 + (int) $min * 60 + (int) $sec; } /* Convert seconds to HHH:MM:SS */ $sec_worked = hesk_getTime('0:' . $sec_worked); // Get number of replies $total = 0; $staffreplies = 0; $res = hesk_dbQuery("SELECT COUNT(*) as `cnt`, `staffid` FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "replies` WHERE `replyto`=" . intval($ticket['id']) . " GROUP BY CASE WHEN `staffid` = 0 THEN 0 ELSE 1 END ASC"); while ($row = hesk_dbFetchAssoc($res)) { $total += $row['cnt']; $staffreplies += $row['staffid'] ? $row['cnt'] : 0; } $replies_sql = " `replies`={$total}, `staffreplies`={$staffreplies} , "; // Get first staff reply if ($staffreplies) { $res = hesk_dbQuery("SELECT `dt`, `staffid` FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "replies` WHERE `replyto`=" . intval($ticket['id']) . " AND `staffid`>0 ORDER BY `dt` ASC LIMIT 1"); $reply = hesk_dbFetchAssoc($res); $replies_sql .= " `firstreply`='" . hesk_dbEscape($reply['dt']) . "', `firstreplyby`=" . intval($reply['staffid']) . " , "; } /* Update history (log) and merged IDs of target ticket */ hesk_dbQuery("UPDATE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "tickets` SET {$replies_sql} `time_worked`=ADDTIME(`time_worked`, '" . hesk_dbEscape($sec_worked) . "'), `merged`=CONCAT(`merged`,'" . hesk_dbEscape($merged . '#') . "'), `history`=CONCAT(`history`,'" . hesk_dbEscape($history) . "') WHERE `id`='" . intval($merge_into) . "' LIMIT 1"); return true; }
$hesk_error_buffer[] = $hesklang['enter_message']; } /* Attachments */ if ($hesk_settings['attachments']['use']) { require HESK_PATH . 'inc/attachments.inc.php'; $attachments = array(); for ($i = 1; $i <= $hesk_settings['attachments']['max_number']; $i++) { $att = hesk_uploadFile($i); if ($att !== false && !empty($att)) { $attachments[$i] = $att; } } } $myattachments = ''; /* Time spent working on ticket */ $time_worked = hesk_getTime(hesk_POST('time_worked')); /* Any errors? */ if (count($hesk_error_buffer) != 0) { $_SESSION['ticket_message'] = hesk_POST('message'); $_SESSION['time_worked'] = $time_worked; // Remove any successfully uploaded attachments if ($hesk_settings['attachments']['use']) { hesk_removeAttachments($attachments); } $tmp = ''; foreach ($hesk_error_buffer as $error) { $tmp .= "<li>{$error}</li>\n"; } $hesk_error_buffer = $tmp; $hesk_error_buffer = $hesklang['pcer'] . '<br /><br /><ul>' . $hesk_error_buffer . '</ul>'; hesk_process_messages($hesk_error_buffer, 'admin_ticket.php?track=' . $ticket['trackid'] . '&Refresh=' . rand(10000, 99999));
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_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 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 }