#218 Utilize quick help section settings on actual pages

merge-requests/2/head
Mike Koch 9 years ago
parent 5c3fca0682
commit 43d00943c6

@ -42,6 +42,7 @@ require(HESK_PATH . 'inc/common.inc.php');
// Are we in maintenance mode?
hesk_check_maintenance();
hesk_load_database_functions();
// Are we in "Knowledgebase only" mode?
hesk_check_kb_only();
@ -166,7 +167,17 @@ if ( ! isset($_SESSION['c_category']) && ! $hesk_settings['select_cat'])
</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>
@ -175,7 +186,8 @@ if ( ! isset($_SESSION['c_category']) && ! $hesk_settings['select_cat'])
</div>
</div>
</div>
<div class="col-md-8">
<?php endif; ?>
<div class="<?php echo $columnWidth; ?>">
<?php
// This will handle error, success and notice messages
hesk_handle_messages();
@ -220,8 +232,6 @@ if ( ! isset($_SESSION['c_category']) && ! $hesk_settings['select_cat'])
<?php
$is_table = 0;
hesk_load_database_functions();
// Get categories
hesk_dbConnect();
$orderBy = $modsForHesk_settings['category_order_column'];
@ -1038,6 +1048,9 @@ if ( ! isset($_SESSION['c_category']) && ! $hesk_settings['select_cat'])
</form>
</div>
</div>
<?php if ($columnWidth == 'col-md-10 col-md-offset-1'): ?>
<div class="col-md-1">&nbsp;</div></div>
<?php endif; ?>
<!-- END FORM -->
@ -1069,7 +1082,6 @@ function print_start()
}
// Connect to database
hesk_load_database_functions();
hesk_dbConnect();
/* Print header */
@ -1243,7 +1255,6 @@ function forgot_tid()
require(HESK_PATH . 'inc/email_functions.inc.php');
/* Get ticket(s) from database */
hesk_load_database_functions();
hesk_dbConnect();
$email = hesk_validateEmail( hesk_POST('email'), 'ERR' ,0) or hesk_process_messages($hesklang['enter_valid_email'],'ticket.php?remind=1');

@ -155,7 +155,16 @@ function hesk_kb_header($kb_link) {
<li class="active"><?php echo $hesklang['kb_text']; ?></li>
</ol>
<?php
$columnWidth = 'col-md-8';
$showRs = hesk_dbQuery("SELECT `show` FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."quick_help_sections` WHERE `id` = 4");
$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 class="col-md-4">
<div class="panel panel-default">
<div class="panel-heading">
@ -166,7 +175,8 @@ function hesk_kb_header($kb_link) {
</div>
</div>
</div>
<div class="col-md-8">
<?php endif; ?>
<div class="<?php echo $columnWidth; ?>">
<?php
/* Print small search box */
hesk_kbSearchSmall();
@ -417,6 +427,7 @@ function hesk_show_kb_article($artid)
<?php } ?>
</div>
<?php
hesk_kbFooter();
} // END hesk_show_kb_article()
@ -618,5 +629,16 @@ function hesk_show_kb_category($catid, $is_search = 0) {
/* Get list of latest articles */
hesk_kbLatestArticles($hesk_settings['kb_latest'], 0);
}
hesk_kbFooter();
} // END hesk_show_kb_category()
function hesk_kbFooter() {
global $hesk_settings;
$showRs = hesk_dbQuery("SELECT `show` FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."quick_help_sections` WHERE `id` = 4");
$show = hesk_dbFetchAssoc($showRs);
if (!$show['show']) {
echo '<div class="col-md-1">&nbsp;</div></div>';
}
}
?>

@ -217,7 +217,16 @@ require_once(HESK_PATH . 'inc/header.inc.php');
<li class="active"><?php hesk_showTopBar($hesklang['cid'].': '.$trackingID); ?></li>
</ol>
<?php
$columnWidth = 'col-md-8';
$showRs = hesk_dbQuery("SELECT `show` FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."quick_help_sections` WHERE `id` = 3");
$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>
@ -226,7 +235,8 @@ require_once(HESK_PATH . 'inc/header.inc.php');
</div>
</div>
</div>
<div class="col-md-8">
<?php endif; ?>
<div class="<?php echo $columnWidth; ?>">
<?php
/* This will handle error, success and notice messages */
hesk_handle_messages();
@ -457,9 +467,19 @@ function print_form()
<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['view_ticket_nav']; ?></li>
</ol>
</ol>
<?php
hesk_dbConnect();
$columnWidth = 'col-md-8';
$showRs = hesk_dbQuery("SELECT `show` FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."quick_help_sections` WHERE `id` = 2");
$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">
@ -470,7 +490,8 @@ function print_form()
</div>
</div>
</div>
<div class="col-md-8">
<?php endif; ?>
<div class="<?php echo $columnWidth; ?>">
<?php
/* This will handle error, success and notice messages */
hesk_handle_messages();

Loading…
Cancel
Save