#209 Everything uses the new status_functions
This commit is contained in:
parent
a131b7842e
commit
9db20734ca
@ -40,8 +40,10 @@ if (is_dir(HESK_PATH . 'install')) {die('Please delete the <b>install</b> folder
|
||||
|
||||
/* Get all the required files and functions */
|
||||
require(HESK_PATH . 'hesk_settings.inc.php');
|
||||
require(HESK_PATH . 'modsForHesk_settings.inc.php');
|
||||
require(HESK_PATH . 'inc/common.inc.php');
|
||||
require(HESK_PATH . 'inc/admin_functions.inc.php');
|
||||
require(HESK_PATH . 'inc/status_functions.inc.php');
|
||||
hesk_load_database_functions();
|
||||
|
||||
hesk_session_start();
|
||||
|
@ -40,6 +40,7 @@ require(HESK_PATH . 'hesk_settings.inc.php');
|
||||
require(HESK_PATH . 'modsForHesk_settings.inc.php');
|
||||
require(HESK_PATH . 'inc/common.inc.php');
|
||||
require(HESK_PATH . 'inc/admin_functions.inc.php');
|
||||
require(HESK_PATH . 'inc/status_functions.inc.php');
|
||||
hesk_load_database_functions();
|
||||
|
||||
hesk_session_start();
|
||||
@ -1079,8 +1080,8 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
|
||||
|
||||
echo '<div class="col-md-3 col-sm-12 ticket-cell-admin"><p class="ticketPropertyTitle">'.$hesklang['status'].'</p>';
|
||||
$status_options = array();
|
||||
$results = hesk_dbQuery("SELECT `ID`FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."statuses`");
|
||||
while ($row = hesk_dbFetchAssoc($results))
|
||||
$results = mfh_getAllStatuses();
|
||||
foreach ($results as $row)
|
||||
{
|
||||
$selected = $ticket['status'] == $row['ID'] ? 'selected' : '';
|
||||
$status_options[$row['ID']] = '<option value="'.$row['ID'].'" '.$selected.'>'.mfh_getDisplayTextForStatusId($row['ID']).'</option>';
|
||||
@ -1991,11 +1992,6 @@ function hesk_printReplyForm() {
|
||||
}
|
||||
}
|
||||
|
||||
$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>
|
||||
@ -2033,12 +2029,7 @@ function hesk_printReplyForm() {
|
||||
</a></li>
|
||||
<li class="divider"></li>
|
||||
<?php
|
||||
$allStatusesRs = hesk_dbQuery('SELECT `ID`, `TextColor` FROM `'.hesk_dbEscape($hesk_settings['db_pfix']).'statuses`');
|
||||
$statuses = array();
|
||||
while ($row = hesk_dbFetchAssoc($allStatusesRs)) {
|
||||
array_push($statuses, $row);
|
||||
}
|
||||
|
||||
$statuses = mfh_getAllStatuses();
|
||||
foreach ($statuses as $status) {
|
||||
echo '<li><a>
|
||||
<button class="dropdown-submit" type="submit" name="submit_as_status" value="'.$status['ID'].'"">
|
||||
|
@ -40,6 +40,7 @@ require(HESK_PATH . 'modsForHesk_settings.inc.php');
|
||||
require(HESK_PATH . 'inc/common.inc.php');
|
||||
require(HESK_PATH . 'inc/admin_functions.inc.php');
|
||||
require(HESK_PATH . 'inc/reporting_functions.inc.php');
|
||||
require(HESK_PATH . 'inc/status_functions.inc.php');
|
||||
hesk_load_database_functions();
|
||||
|
||||
hesk_session_start();
|
||||
@ -243,10 +244,9 @@ $fid = 1;
|
||||
require(HESK_PATH . 'inc/assignment_search.inc.php');
|
||||
|
||||
// --> TICKET STATUS
|
||||
$possibleStatusSql = 'SELECT `ID` FROM `'.hesk_dbEscape($hesk_settings['db_pfix']).'statuses`';
|
||||
$possibleStatusRS = hesk_dbQuery($possibleStatusSql);
|
||||
$statuses = mfh_getAllStatuses();
|
||||
$possible_status = array();
|
||||
while ($row = $possibleStatusRS->fetch_assoc())
|
||||
foreach ($statuses as $row)
|
||||
{
|
||||
$possible_status[$row['ID']] = mfh_getDisplayTextForStatusId($row['ID']);
|
||||
}
|
||||
@ -262,9 +262,7 @@ foreach ($status as $k => $v)
|
||||
}
|
||||
|
||||
// How many statuses are we pulling out of the database?
|
||||
$allStatusCountSql = 'SELECT COUNT(*) AS `Count` FROM `'.hesk_dbEscape($hesk_settings['db_pfix']).'statuses`';
|
||||
$allStatusCountRow = hesk_dbQuery($allStatusCountSql)->fetch_assoc();
|
||||
$allStatusCount = $allStatusCountRow['Count'];
|
||||
$allStatusCount = count($statuses);
|
||||
$tmp = count($status);
|
||||
|
||||
// Do we need to search by status?
|
||||
@ -779,14 +777,13 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
|
||||
<label for="status" class="control-label col-sm-2"><?php echo $hesklang['status']; ?>:</label>
|
||||
<div class="col-sm-10">
|
||||
<?php
|
||||
$getStatusCheckboxSql = 'SELECT `ID`, `Key`, `TextColor` FROM `'.hesk_dbEscape($hesk_settings['db_pfix']).'statuses`';
|
||||
$getStatusCheckboxRS = hesk_dbQuery($getStatusCheckboxSql);
|
||||
while ($row = $getStatusCheckboxRS->fetch_assoc())
|
||||
$statuses = mfh_getAllStatuses();
|
||||
foreach ($statuses as $row)
|
||||
{
|
||||
?>
|
||||
<div class="col-xs-4">
|
||||
<div class="checkbox">
|
||||
<label><input type="checkbox" name="s<?php echo $row['ID']; ?>" value="1" <?php if (isset($status[$row['ID']])) {echo 'checked="checked"';} ?> /> <span style="color: <?php echo $row['TextColor']; ?>"><?php echo mfh_getDisplayTextForStatusId($row['ID']); ?></span></label>
|
||||
<label><input type="checkbox" name="s<?php echo $row['ID']; ?>" value="1" <?php if (isset($status[$row['ID']])) {echo 'checked="checked"';} ?> /> <span style="color: <?php echo $row['TextColor']; ?>"><?php echo $row['text']; ?></span></label>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
|
@ -8,6 +8,7 @@ require(HESK_PATH . 'hesk_settings.inc.php');
|
||||
require(HESK_PATH . 'modsForHesk_settings.inc.php');
|
||||
require(HESK_PATH . 'inc/common.inc.php');
|
||||
require(HESK_PATH . 'inc/admin_functions.inc.php');
|
||||
require(HESK_PATH . 'inc/status_functions.inc.php');
|
||||
hesk_load_database_functions();
|
||||
|
||||
hesk_session_start();
|
||||
@ -85,18 +86,7 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
|
||||
$numOfStatusesRS = hesk_dbQuery('SELECT 1 FROM `'.hesk_dbEscape($hesk_settings['db_pfix']).'statuses`');
|
||||
$numberOfStatuses = hesk_dbNumRows($numOfStatusesRS);
|
||||
|
||||
$statusesSql = 'SELECT * FROM `'.hesk_dbEscape($hesk_settings['db_pfix']).'statuses` ORDER BY `sort` ASC';
|
||||
$statusesRS = hesk_dbQuery($statusesSql);
|
||||
$statuses = array();
|
||||
while ($row = hesk_dbFetchAssoc($statusesRS)) {
|
||||
$row['text'] = mfh_getDisplayTextForStatusId($row['ID']);
|
||||
$statuses[$row['text']] = $row;
|
||||
}
|
||||
|
||||
if ($modsForHesk_settings['statuses_order_column'] == 'name') {
|
||||
ksort($statuses);
|
||||
}
|
||||
|
||||
$statuses = mfh_getAllStatuses();
|
||||
?>
|
||||
<form class="form-horizontal" method="post" action="manage_statuses.php" role="form">
|
||||
<div class="panel panel-default">
|
||||
|
@ -37,8 +37,10 @@ define('HESK_PATH','../');
|
||||
|
||||
/* Get all the required files and functions */
|
||||
require(HESK_PATH . 'hesk_settings.inc.php');
|
||||
require(HESK_PATH . 'modsForHesk_settings.inc.php');
|
||||
require(HESK_PATH . 'inc/common.inc.php');
|
||||
require(HESK_PATH . 'inc/admin_functions.inc.php');
|
||||
require(HESK_PATH . 'inc/status_functions.inc.php');
|
||||
hesk_load_database_functions();
|
||||
|
||||
hesk_session_start();
|
||||
|
@ -112,11 +112,10 @@ $fid = 1;
|
||||
require(HESK_PATH . 'inc/assignment_search.inc.php');
|
||||
|
||||
// --> TICKET STATUS
|
||||
$statusSql = "SELECT `ID` FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."statuses`";
|
||||
$statuses = mfh_getAllStatuses();
|
||||
$totalStatuses = 0;
|
||||
$possible_status = array();
|
||||
$results = hesk_dbQuery($statusSql);
|
||||
while ($row = $results->fetch_assoc())
|
||||
foreach ($statuses as $row)
|
||||
{
|
||||
$possible_status[$row['ID']] = $row['ID'];
|
||||
$totalStatuses++;
|
||||
@ -144,10 +143,12 @@ if ( $tmp < $totalStatuses )
|
||||
if ($tmp == 0)
|
||||
{
|
||||
$status = $possible_status;
|
||||
$resolvedSql = "SELECT `ID` FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."statuses` WHERE `IsClosed` = 1";
|
||||
$resolvedRS = hesk_dbQuery($resolvedSql);
|
||||
while ($row = $resolvedRS->fetch_assoc())
|
||||
foreach ($statuses as $row)
|
||||
{
|
||||
if ($row['IsClosed'] == 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
unset($status[$row['ID']]);
|
||||
}
|
||||
}
|
||||
|
@ -37,10 +37,14 @@ if (!defined('IN_SCRIPT')) {die('Invalid attempt');}
|
||||
if ( ! isset($status) )
|
||||
{
|
||||
$status = array();
|
||||
$allStatuses = mfh_getAllStatuses();
|
||||
//-- We don't want to check statuses that are considered "closed"
|
||||
$statusRS = hesk_dbQuery('SELECT `ID` FROM `'.hesk_dbEscape($hesk_settings['db_pfix']).'statuses` WHERE `IsClosed` = 0');
|
||||
while ($row = $statusRS->fetch_assoc())
|
||||
foreach ($allStatuses as $row)
|
||||
{
|
||||
if ($status['IsClosed'] == 1) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$status[$row['ID']] = mfh_getDisplayTextForStatusId($row['ID']);
|
||||
}
|
||||
}
|
||||
@ -131,8 +135,8 @@ $more2 = empty($_GET['more2']) ? 0 : 1;
|
||||
<tr>
|
||||
<?php
|
||||
$rowCounter = 1;
|
||||
$statusRS = hesk_dbQuery('SELECT `ID`, `TextColor` FROM `'.hesk_dbEscape($hesk_settings['db_pfix']).'statuses`');
|
||||
while ($row = hesk_dbFetchAssoc($statusRS))
|
||||
$statuses = mfh_getAllStatuses();
|
||||
foreach ($statuses as $row)
|
||||
{
|
||||
if ($rowCounter > 3)
|
||||
{
|
||||
|
55
inc/status_functions.inc.php
Normal file
55
inc/status_functions.inc.php
Normal file
@ -0,0 +1,55 @@
|
||||
<?php
|
||||
/*******************************************************************************
|
||||
* Title: Help Desk Software HESK
|
||||
* Version: 2.6.4 from 22nd June 2015
|
||||
* Author: Klemen Stirn
|
||||
* Website: http://www.hesk.com
|
||||
********************************************************************************
|
||||
* COPYRIGHT AND TRADEMARK NOTICE
|
||||
* Copyright 2005-2015 Klemen Stirn. All Rights Reserved.
|
||||
* HESK is a registered trademark of Klemen Stirn.
|
||||
|
||||
* The HESK may be used and modified free of charge by anyone
|
||||
* AS LONG AS COPYRIGHT NOTICES AND ALL THE COMMENTS REMAIN INTACT.
|
||||
* By using this code you agree to indemnify Klemen Stirn from any
|
||||
* liability that might arise from it's use.
|
||||
|
||||
* Selling the code for this program, in part or full, without prior
|
||||
* written consent is expressly forbidden.
|
||||
|
||||
* Using this code, in part or full, to create derivate work,
|
||||
* new scripts or products is expressly forbidden. Obtain permission
|
||||
* before redistributing this software over the Internet or in
|
||||
* any other medium. In all cases copyright and header must remain intact.
|
||||
* This Copyright is in full effect in any country that has International
|
||||
* Trade Agreements with the United States of America or
|
||||
* with the European Union.
|
||||
|
||||
* Removing any of the copyright notices without purchasing a license
|
||||
* is expressly forbidden. To remove HESK copyright notice you must purchase
|
||||
* a license for this script. For more information on how to obtain
|
||||
* a license please visit the page below:
|
||||
* https://www.hesk.com/buy.php
|
||||
*******************************************************************************/
|
||||
|
||||
/* Check if this is a valid include */
|
||||
if (!defined('IN_SCRIPT')) {die('Invalid attempt');}
|
||||
|
||||
|
||||
function mfh_getAllStatuses() {
|
||||
global $hesk_settings, $modsForHesk_settings;
|
||||
|
||||
$statusesSql = 'SELECT * FROM `'.hesk_dbEscape($hesk_settings['db_pfix']).'statuses` ORDER BY `sort` ASC';
|
||||
$statusesRS = hesk_dbQuery($statusesSql);
|
||||
$statuses = array();
|
||||
while ($row = hesk_dbFetchAssoc($statusesRS)) {
|
||||
$row['text'] = mfh_getDisplayTextForStatusId($row['ID']);
|
||||
$statuses[$row['text']] = $row;
|
||||
}
|
||||
|
||||
if ($modsForHesk_settings['statuses_order_column'] == 'name') {
|
||||
ksort($statuses);
|
||||
}
|
||||
|
||||
return $statuses;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user