}) </script> </div> <div class="col-md-8"> <?php /* This will handle error, success and notice messages */ hesk_handle_messages(); if ($hesk_settings['cust_urgency']) { hesk_show_notice($hesklang['cat_pri_info'] . ' ' . $hesklang['cpri']); } ?> <h3><?php echo $hesklang['manage_cat']; ?> <a href="javascript:void(0)" onclick="javascript:alert('<?php echo hesk_makeJsString($hesklang['cat_intro']); ?> ')"><i class="fa fa-question-circle settingsquestionmark"></i></a></h3> <div class="footerWithBorder blankSpace"></div> <table class="table table-hover"> <tr> <th><?php echo $hesklang['id']; ?> </th> <th><?php echo $hesklang['cat_name']; ?> </th> <th><?php echo $hesklang['priority'];
')"><?php echo $hesklang['ticket_tpl']; ?> [?]</a></li> </ul> </div> <!-- TABS --> <br /> <script language="javascript" type="text/javascript"><!-- function confirm_delete() { if (confirm('<?php echo hesk_makeJsString($hesklang['delete_tpl']); ?> ')) {return true;} else {return false;} } //--> </script> <?php /* This will handle error, success and notice messages */ hesk_handle_messages(); // Get canned responses from database $result = hesk_dbQuery('SELECT * FROM `' . hesk_dbEscape($hesk_settings['db_pfix']) . 'ticket_templates` ORDER BY `tpl_order` ASC'); $options = ''; $javascript_messages = ''; $javascript_titles = '';
<!-- TABS --> <div id="tab1" class="tabberlive" style="margin-top:0px"> <ul class="tabbernav"> <?php // Show a link to reports.php if user has permission to do so if (hesk_checkPermission('can_run_reports', 0)) { echo '<li class=""><a title="' . $hesklang['reports_tab'] . '" href="reports.php">' . $hesklang['reports_tab'] . '</a></li>'; } ?> <li class="tabberactive"><a title="<?php echo $hesklang['export']; ?> " href="javascript:void(null);" onclick="javascript:alert('<?php echo hesk_makeJsString($hesklang['export_intro']); ?> ')"><?php echo $hesklang['export']; ?> [?]</a></li> </ul> <div class="tabbertab"> <!-- ** START EXPORT FORM ** --> <form name="showt" action="export.php" method="get">
</b> (<?php echo $hesklang['max_chars']; ?> )<b>:</b><br /><input type="text" name="name" size="40" maxlength="40" <?php if (isset($_SESSION['catname'])) { echo ' value="' . hesk_input($_SESSION['catname']) . '" '; } ?> /></p> <p><b><?php echo $hesklang['def_pri']; ?> </b> [<b><a href="javascript:void(0)" onclick="javascript:alert('<?php echo hesk_makeJsString($hesklang['cat_pri']); ?> ')">?</a></b>]<br /> <select name="priority"> <?php // Default priority: low if (!isset($_SESSION['cat_priority'])) { $_SESSION['cat_priority'] = 3; } // List possible priorities foreach ($priorities as $value => $info) { echo '<option value="' . $value . '"' . ($_SESSION['cat_priority'] == $value ? ' selected="selected"' : '') . '>' . $info['text'] . '</option>'; } ?> </select></p>
function mail_list_messages() { global $hesk_settings, $hesklang, $admins; $href = 'mail.php'; $query = ''; if ($hesk_settings['mailtmp']['folder'] == 'outbox') { $query .= 'folder=outbox&'; } $query .= 'page='; $maxresults = 30; $tmp = intval(hesk_POST('page', 1)); $page = $tmp > 1 ? $tmp : 1; /* List of private messages */ $res = hesk_dbQuery("SELECT COUNT(*) FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "mail` WHERE `" . hesk_dbEscape($hesk_settings['mailtmp']['this']) . "`='" . intval($_SESSION['id']) . "' AND `deletedby`!='" . intval($_SESSION['id']) . "'"); $total = hesk_dbResult($res, 0, 0); if ($total > 0) { $pages = ceil($total / $maxresults) or $pages = 1; if ($page > $pages) { $page = $pages; } $limit_down = $page * $maxresults - $maxresults; $prev_page = $page - 1 <= 0 ? 0 : $page - 1; $next_page = $page + 1 > $pages ? 0 : $page + 1; if ($pages > 1) { echo $hesklang['pg'] . ': '; /* List pages */ if ($pages >= 7) { if ($page > 2) { echo '<a href="' . $href . '?' . $query . '1"><b>«</b></a> '; } if ($prev_page) { echo '<a href="' . $href . '?' . $query . $prev_page . '"><b>‹</b></a> '; } } for ($i = 1; $i <= $pages; $i++) { if ($i <= $page + 5 && $i >= $page - 5) { if ($i == $page) { echo ' <b>' . $i . '</b> '; } else { echo ' <a href="' . $href . '?' . $query . $i . '">' . $i . '</a> '; } } } if ($pages >= 7) { if ($next_page) { echo ' <a href="' . $href . '?' . $query . $next_page . '"><b>›</b></a> '; } if ($page < $pages - 1) { echo ' <a href="' . $href . '?' . $query . $pages . '"><b>»</b></a>'; } } echo '<br /> '; } // end PAGES > 1 // Get messages from the database $res = hesk_dbQuery("SELECT `id`, `from`, `to`, `subject`, `dt`, `read` FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "mail` WHERE `" . hesk_dbEscape($hesk_settings['mailtmp']['this']) . "`='" . intval($_SESSION['id']) . "' AND `deletedby`!='" . intval($_SESSION['id']) . "' ORDER BY `id` DESC LIMIT " . intval($limit_down) . " , " . intval($maxresults) . " "); ?> <form action="mail.php<?php if ($hesk_settings['mailtmp']['folder'] == 'outbox') { echo '?folder=outbox'; } ?> " name="form1" method="post"> <div class="container table-responsive"> <table class="table table-bordered table-hover" style="background: #E0EEEE;"> <tr> <th class="admin_white" style="width:1px"><input type="checkbox" name="checkall" value="2" onclick="hesk_changeAll(this)" /></th> <th class="admin_white" style="text-align:left; white-space:nowrap;"><?php echo $hesklang['m_sub']; ?> </th> <th class="admin_white" style="text-align:left; white-space:nowrap;"><?php echo $hesk_settings['mailtmp']['m_from']; ?> </th> <th class="admin_white" style="text-align:left; white-space:nowrap;"><?php echo $hesklang['date']; ?> </th> </tr> <?php $i = 0; while ($pm = hesk_dbFetchAssoc($res)) { if ($i) { $color = "admin_gray"; $i = 0; } else { $color = "admin_white"; $i = 1; } $pm['subject'] = '<a href="mail.php?a=read&id=' . $pm['id'] . '">' . $pm['subject'] . '</a>'; if ($hesk_settings['mailtmp']['this'] == 'to' && !$pm['read']) { $pm['subject'] = '<b>' . $pm['subject'] . '</b>'; } $pm['name'] = isset($admins[$pm[$hesk_settings['mailtmp']['other']]]) ? '<a href="mail.php?a=new&id=' . $pm[$hesk_settings['mailtmp']['other']] . '">' . $admins[$pm[$hesk_settings['mailtmp']['other']]] . '</a>' : ($pm['from'] == 9999 ? '<a href="http://www.hesk.com" target="_blank">HESK.com</a>' : $hesklang['e_udel']); $pm['dt'] = hesk_dateToString($pm['dt'], 0, 0, 0, true); echo <<<EOC \t\t\t\t\t<tr> \t\t\t\t\t<td class="{$color}" style="text-align:left; white-space:nowrap;"><input type="checkbox" name="id[]" value="{$pm['id']}" /> </td> \t\t\t\t\t<td class="{$color}">{$pm['subject']}</td> \t\t\t\t\t<td class="{$color}">{$pm['name']}</td> \t\t\t\t\t<td class="{$color}">{$pm['dt']}</td> \t\t\t\t\t</tr> EOC; } // End while ?> </table><!-- end table table-bordered table-hover table-responsive --> </div> <div class="container" align="right"><select name="a"> <?php if ($hesk_settings['mailtmp']['this'] == 'to') { ?> <option value="mark_read" selected="selected"><?php echo $hesklang['mo1']; ?> </option> <option value="mark_unread"><?php echo $hesklang['mo2']; ?> </option> <?php } ?> <option value="delete"><?php echo $hesklang['mo3']; ?> </option> </select> <input type="hidden" name="token" value="<?php hesk_token_echo(); ?> " /> <input type="submit" value="<?php echo $hesklang['execute']; ?> " onclick="Javascript:if (document.form1.a.value=='delete') return hesk_confirmExecute('<?php echo hesk_makeJsString($hesklang['mo3']); ?> ?');" class="btn btn-default" /> </form> <br/><br/> </div> <?php } else { echo '<div class="container"><i>' . $hesklang['npm'] . '</i></div><br/>'; } }
function hesk_getAdminButtons($reply = 0, $white = 1) { global $hesk_settings, $hesklang, $ticket, $reply, $trackingID, $can_edit, $can_archive, $can_delete, $isManager; $options = '<div class="btn-group" style="width: 100%">'; /* Style and mousover/mousout */ $tmp = $white ? 'White' : 'Blue'; $style = 'class="option' . $tmp . 'OFF" onmouseover="this.className=\'option' . $tmp . 'ON\'" onmouseout="this.className=\'option' . $tmp . 'OFF\'"'; /* Lock ticket button */ if ($can_edit) { if ($ticket['locked']) { $des = $hesklang['tul'] . ' - ' . $hesklang['isloc']; $options .= '<a class="btn btn-default" href="lock.php?track=' . $trackingID . '&locked=0&Refresh=' . mt_rand(10000, 99999) . '&token=' . hesk_token_echo(0) . '"><i class="fa fa-unlock"></i> ' . $hesklang['tul'] . '</a> '; } else { $des = $hesklang['tlo'] . ' - ' . $hesklang['isloc']; $options .= '<a class="btn btn-default" href="lock.php?track=' . $trackingID . '&locked=1&Refresh=' . mt_rand(10000, 99999) . '&token=' . hesk_token_echo(0) . '"><i class="fa fa-lock"></i> ' . $hesklang['tlo'] . '</a> '; } } /* Tag ticket button */ if ($can_archive) { if ($ticket['archive']) { $options .= '<a class="btn btn-default" href="archive.php?track=' . $trackingID . '&archived=0&Refresh=' . mt_rand(10000, 99999) . '&token=' . hesk_token_echo(0) . '"><i class="fa fa-tag"></i>' . $hesklang['remove_archive'] . '</a> '; } else { $options .= '<a class="btn btn-default" href="archive.php?track=' . $trackingID . '&archived=1&Refresh=' . mt_rand(10000, 99999) . '&token=' . hesk_token_echo(0) . '"><i class="fa fa-tag"></i> ' . $hesklang['add_archive'] . '</a> '; } } /* Import to knowledgebase button */ if ($hesk_settings['kb_enable'] && hesk_checkPermission('can_man_kb', 0)) { $options .= '<a class="btn btn-default" href="manage_knowledgebase.php?a=import_article&track=' . $trackingID . '"><i class="fa fa-lightbulb-o"></i> ' . $hesklang['import_kb'] . '</a> '; } /* Print ticket button */ $options .= '<a class="btn btn-default" href="../print.php?track=' . $trackingID . '"><i class="fa fa-print"></i> ' . $hesklang['printer_friendly'] . '</a> '; /* Edit post */ if ($can_edit) { $tmp = $reply ? '&reply=' . $reply['id'] : ''; $mgr = $isManager ? '&isManager=true' : ''; $options .= '<a class="btn btn-default" href="edit_post.php?track=' . $trackingID . $tmp . $mgr . '"><i class="fa fa-pencil"></i> ' . $hesklang['edtt'] . '</a> '; } /* Delete ticket */ if ($can_delete) { if ($reply) { $url = 'admin_ticket.php'; $tmp = 'delete_post=' . $reply['id']; $img = 'delete.png'; $txt = $hesklang['delt']; } else { $url = 'delete_tickets.php'; $tmp = 'delete_ticket=1'; $img = 'delete_ticket.png'; $txt = $hesklang['dele']; } $options .= '<a class="btn btn-default" href="' . $url . '?track=' . $trackingID . '&' . $tmp . '&Refresh=' . mt_rand(10000, 99999) . '&token=' . hesk_token_echo(0) . '" onclick="return hesk_confirmExecute(\'' . hesk_makeJsString($txt) . '?\');"><i class="fa fa-ban"></i> ' . $txt . '</a> '; } /* Return generated HTML */ $options .= '</div>'; return $options; }
<td> <?php /* This will handle error, success and notice messages */ hesk_handle_messages(); ?> <!-- TABS --> <div id="tab1" class="tabberlive" style="margin-top:0px"> <ul class="tabbernav"> <li class="tabberactive"><a title="<?php echo $hesklang['reports_tab']; ?> " href="javascript:void(null);" onclick="javascript:alert('<?php echo hesk_makeJsString($hesklang['reports_intro']); ?> ')"><?php echo $hesklang['reports_tab']; ?> [?]</a></li> <?php // Show a link to export.php if user has permission to do so if (hesk_checkPermission('can_export', 0)) { echo '<li class=""><a title="' . $hesklang['export'] . '" href="export.php">' . $hesklang['export'] . '</a></li>'; } ?> </ul> <div class="tabbertab">
')) {return true;} else {return false;} } //--> </script> <?php /* This will handle error, success and notice messages */ hesk_handle_messages(); ?> <h3 style="padding-bottom:5px"><?php echo $hesklang['manage_users']; ?> [<a href="javascript:void(0)" onclick="javascript:alert('<?php echo hesk_makeJsString($hesklang['users_intro']); ?> ')">?</a>]</h3> <br /> <div align="center"> <table border="0" width="100%" cellspacing="1" cellpadding="3" class="white"> <tr> <th class="admin_white" style="text-align:left"><b><i><?php echo $hesklang['name']; ?> </i></b></th> <th class="admin_white" style="text-align:left"><b><i><?php echo $hesklang['email']; ?>
#$query .= '&asc='.$asc; $query .= '&limit=' . $maxresults; $query .= '&archive=' . $archive[2]; $query .= '&s_my=' . $s_my[2]; $query .= '&s_ot=' . $s_ot[2]; $query .= '&s_un=' . $s_un[2]; $query .= '&page=1'; #$query .= '&sort='; } $query .= '&asc='; /* Print the table with tickets */ $random = rand(10000, 99999); ?> <form role="form" class="form-inline" name="form1" action="delete_tickets.php" method="post" onsubmit="return hesk_confirmExecute('<?php echo hesk_makeJsString($hesklang['confirm_execute']); ?> ')"> <?php if (empty($group)) { hesk_print_list_head(); } $i = 0; $group_tmp = ''; $is_table = 0; $space = 0; while ($ticket = hesk_dbFetchAssoc($result)) { // Are we grouping tickets? if ($group) { require HESK_PATH . 'inc/print_group.inc.php';
} ?> </div> </div> </div> <div class="col-md-8"> <?php /* This will handle error, success and notice messages */ hesk_handle_messages(); ?> <form class="form-horizontal" action="manage_ticket_templates.php" method="post" name="form1" role="form"> <h3><?php echo $hesklang['new_ticket_tpl']; ?> <a href="javascript:void(0)" onclick="javascript:alert('<?php echo hesk_makeJsString($hesklang['ticket_tpl_intro']); ?> ')"><i class="fa fa-question-circle settingsquestionmark"></i></a></h3> <div class="footerWithBorder blankSpace"></div> <?php if ($num > 0) { ?> <div class="form-group"> <div class="col-sm-12"> <div class="radio"> <label> <input type="radio" name="a" value="new" <?php echo !isset($_SESSION['canned']['what']) || $_SESSION['canned']['what'] != 'EDIT' ? 'checked=' : ''; ?> > <?php
function hesk_getAdminButtons($reply = 0, $white = 1) { global $hesk_settings, $hesklang, $ticket, $reply, $trackingID, $can_edit, $can_archive, $can_delete; $options = ''; /* Style and mousover/mousout */ $tmp = $white ? 'White' : 'Blue'; $style = 'class="option' . $tmp . 'OFF" onmouseover="this.className=\'option' . $tmp . 'ON\'" onmouseout="this.className=\'option' . $tmp . 'OFF\'"'; /* Lock ticket button */ if ($can_edit) { if ($ticket['locked']) { $des = $hesklang['tul'] . ' - ' . $hesklang['isloc']; $options .= '<a href="lock.php?track=' . $trackingID . '&locked=0&Refresh=' . mt_rand(10000, 99999) . '&token=' . hesk_token_echo(0) . '"><img src="../img/unlock.png" width="16" height="16" alt="' . $des . '" title="' . $des . '" ' . $style . ' /></a> '; } else { $des = $hesklang['tlo'] . ' - ' . $hesklang['isloc']; $options .= '<a href="lock.php?track=' . $trackingID . '&locked=1&Refresh=' . mt_rand(10000, 99999) . '&token=' . hesk_token_echo(0) . '"><img src="../img/lock.png" width="16" height="16" alt="' . $des . '" title="' . $des . '" ' . $style . ' /></a> '; } } /* Tag ticket button */ if ($can_archive) { if ($ticket['archive']) { $options .= '<a href="archive.php?track=' . $trackingID . '&archived=0&Refresh=' . mt_rand(10000, 99999) . '&token=' . hesk_token_echo(0) . '"><img src="../img/tag.png" width="16" height="16" alt="' . $hesklang['remove_archive'] . '" title="' . $hesklang['remove_archive'] . '" ' . $style . ' /></a> '; } else { $options .= '<a href="archive.php?track=' . $trackingID . '&archived=1&Refresh=' . mt_rand(10000, 99999) . '&token=' . hesk_token_echo(0) . '"><img src="../img/tag_off.png" width="16" height="16" alt="' . $hesklang['add_archive'] . '" title="' . $hesklang['add_archive'] . '" ' . $style . ' /></a> '; } } /* Import to knowledgebase button */ if ($hesk_settings['kb_enable'] && hesk_checkPermission('can_man_kb', 0)) { $options .= '<a href="manage_knowledgebase.php?a=import_article&track=' . $trackingID . '"><img src="../img/import_kb.png" width="16" height="16" alt="' . $hesklang['import_kb'] . '" title="' . $hesklang['import_kb'] . '" ' . $style . ' /></a> '; } /* Print ticket button */ $options .= '<a href="../print.php?track=' . $trackingID . '"><img src="../img/print.png" width="16" height="16" alt="' . $hesklang['printer_friendly'] . '" title="' . $hesklang['printer_friendly'] . '" ' . $style . ' /></a> '; /* Edit post */ if ($can_edit) { $tmp = $reply ? '&reply=' . $reply['id'] : ''; $options .= '<a href="edit_post.php?track=' . $trackingID . $tmp . '"><img src="../img/edit.png" width="16" height="16" alt="' . $hesklang['edtt'] . '" title="' . $hesklang['edtt'] . '" ' . $style . ' /></a> '; } /* Delete ticket */ if ($can_delete) { if ($reply) { $url = 'admin_ticket.php'; $tmp = 'delete_post=' . $reply['id']; $img = 'delete.png'; $txt = $hesklang['delt']; } else { $url = 'delete_tickets.php'; $tmp = 'delete_ticket=1'; $img = 'delete_ticket.png'; $txt = $hesklang['dele']; } $options .= '<a href="' . $url . '?track=' . $trackingID . '&' . $tmp . '&Refresh=' . mt_rand(10000, 99999) . '&token=' . hesk_token_echo(0) . '" onclick="return hesk_confirmExecute(\'' . hesk_makeJsString($txt) . '?\');"><img src="../img/' . $img . '" width="16" height="16" alt="' . $txt . '" title="' . $txt . '" ' . $style . ' /></a> '; } /* Return generated HTML */ return $options; }
// Show a link to banned_ips.php if user has permission to do so if (hesk_checkPermission('can_ban_ips', 0)) { echo '<li id="banned-ips"><a title="' . $hesklang['banip'] . '" href="banned_ips.php">' . $hesklang['banip'] . '</a></li> '; } // Show a link to status_message.php if user has permission to do so if (hesk_checkPermission('can_service_msg', 0)) { echo '<li id="service-msg-tools"><a title="' . $hesklang['sm_title'] . '" href="service_messages.php">' . $hesklang['sm_title'] . '</a></li> '; } ?> </ul> <script language="javascript" type="text/javascript"><!-- function confirm_delete() { if (confirm('<?php echo hesk_makeJsString($hesklang['delban_confirm']); ?> ')) {return true;} else {return false;} } //--> </script> <div class="container tab-pane active" role="tabpanel" id="b-email"> <?php /* This will handle error, success and notice messages */ hesk_handle_messages(); ?> <form action="banned_emails.php" method="post" name="form1">
if (hesk_checkPermission('can_man_ticket_tpl', 0)) { echo '<li class=""><a title="' . $hesklang['ticket_tpl'] . '" href="manage_ticket_templates.php">' . $hesklang['ticket_tpl'] . '</a></li>'; } ?> </ul> </div> <!-- TABS --> <br /> <script language="javascript" type="text/javascript"><!-- function confirm_delete() { if (confirm('<?php echo hesk_makeJsString($hesklang['delete_saved']); ?> ')) {return true;} else {return false;} } function hesk_insertTag(tag) { var text_to_insert = '%%'+tag+'%%'; hesk_insertAtCursor(document.form1.msg, text_to_insert); document.form1.msg.focus(); } function hesk_insertAtCursor(myField, myValue) { if (document.selection) { myField.focus(); sel = document.selection.createRange();
myField.value += myValue; } } //--> </script> <?php /* This will handle error, success and notice messages */ hesk_handle_messages(); ?> <h3 style="padding-bottom:5px"><?php echo $hesklang['manage_saved']; ?> [<a href="javascript:void(0)" onclick="javascript:alert('<?php echo hesk_makeJsString($hesklang['manage_intro']); ?> ')">?</a>]</h3> <br /> <?php $result = hesk_dbQuery('SELECT * FROM `' . hesk_dbEscape($hesk_settings['db_pfix']) . 'std_replies` ORDER BY `reply_order` ASC'); $options = ''; $javascript_messages = ''; $javascript_titles = ''; $i = 1; $j = 0; $num = hesk_dbNumRows($result); if ($num < 1) { echo '<p>' . $hesklang['no_saved'] . '</p>';
</td> </tr> <tr> <td> <?php /* This will handle error, success and notice messages */ hesk_handle_messages(); ?> <h3><?php echo $hesklang['settings']; ?> [<a href="javascript:void(0)" onclick="javascript:alert('<?php echo hesk_makeJsString($hesklang['settings_intro']) . '\\n\\n' . hesk_makeJsString($hesklang['all_req']); ?> ')">?</a>]</h3> <?php $hesklang['err_custname'] = addslashes($hesklang['err_custname']); ?> <script language="javascript" type="text/javascript"><!-- function hesk_checkFields() { d=document.form1; // GENERAL
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; }
?> " title="<?php echo $hesklang['edit']; ?> " <?php echo $style; ?> /></a> <a href="service_messages.php?a=remove_sm&id=<?php echo $sm['id']; ?> &token=<?php hesk_token_echo(); ?> " onclick="return hesk_confirmExecute('<?php echo hesk_makeJsString($hesklang['del_sm']); ?> ');"><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++;
toggleAdmin(true); } elseif ($action == 'deladmin') { toggleAdmin(false); } } /* Print header */ require_once HESK_PATH . 'inc/headerAdmin.inc.php'; /* Print main manage users page */ require_once HESK_PATH . 'inc/show_admin_nav.inc.php'; ?> <script language="Javascript" type="text/javascript"><!-- function confirm_delete() { if (confirm('<?php echo hesk_makeJsString($hesklang['confirm_del_cat']); ?> ')) {return true;} else {return false;} } //--> </script> <?php $res = hesk_dbQuery("SELECT * FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "permission_templates` ORDER BY `name` ASC"); $templates = array(); while ($row = hesk_dbFetchAssoc($res)) { array_push($templates, $row); } $featureArray = hesk_getFeatureArray(); $orderBy = $modsForHesk_settings['category_order_column'];