Now the ticket export honors the database
This commit is contained in:
parent
d8c9b169c9
commit
c6843787e9
@ -242,14 +242,13 @@ $fid = 1;
|
|||||||
require(HESK_PATH . 'inc/assignment_search.inc.php');
|
require(HESK_PATH . 'inc/assignment_search.inc.php');
|
||||||
|
|
||||||
// --> TICKET STATUS
|
// --> TICKET STATUS
|
||||||
$possible_status = array(
|
$possibleStatusSql = 'SELECT `ID`, `ShortNameContentKey` FROM `'.hesk_dbEscape($hesk_settings['db_pfix']).'statuses`';
|
||||||
0 => 'NEW',
|
$possibleStatusRS = hesk_dbQuery($possibleStatusSql);
|
||||||
1 => 'WAITING REPLY',
|
$possible_status = array();
|
||||||
2 => 'REPLIED',
|
while ($row = $possibleStatusRS->fetch_assoc())
|
||||||
3 => 'RESOLVED (CLOSED)',
|
{
|
||||||
4 => 'IN PROGRESS',
|
$possible_status[$row['ID']] = $hesklang[$row['ShortNameContentKey']];
|
||||||
5 => 'ON HOLD',
|
}
|
||||||
);
|
|
||||||
|
|
||||||
$status = $possible_status;
|
$status = $possible_status;
|
||||||
|
|
||||||
@ -262,10 +261,13 @@ foreach ($status as $k => $v)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// How many statuses are we pulling out of the database?
|
// 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'];
|
||||||
$tmp = count($status);
|
$tmp = count($status);
|
||||||
|
|
||||||
// Do we need to search by status?
|
// Do we need to search by status?
|
||||||
if ( $tmp < 6 )
|
if ( $tmp < $allStatusCount )
|
||||||
{
|
{
|
||||||
// If no statuses selected, show all
|
// If no statuses selected, show all
|
||||||
if ($tmp == 0)
|
if ($tmp == 0)
|
||||||
@ -498,27 +500,9 @@ if (isset($_GET['w']))
|
|||||||
$result = hesk_dbQuery($sql);
|
$result = hesk_dbQuery($sql);
|
||||||
while ($ticket=hesk_dbFetchAssoc($result))
|
while ($ticket=hesk_dbFetchAssoc($result))
|
||||||
{
|
{
|
||||||
|
$statusContentKeySql = 'SELECT `ShortNameContentKey` FROM `'.hesk_dbEscape($hesk_settings['db_pfix']).'statuses` WHERE `ID` = '.$ticket['status'];
|
||||||
switch ($ticket['status'])
|
$statusContentKeyRow = hesk_dbQuery($statusContentKeySql)->fetch_assoc();
|
||||||
{
|
$ticket['status'] = $hesklang[$statusContentKeyRow['ShortNameContentKey']];
|
||||||
case 0:
|
|
||||||
$ticket['status']=$hesklang['open'];
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
$ticket['status']=$hesklang['wait_reply'];
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
$ticket['status']=$hesklang['replied'];
|
|
||||||
break;
|
|
||||||
case 4:
|
|
||||||
$ticket['status']=$hesklang['in_progress'];
|
|
||||||
break;
|
|
||||||
case 5:
|
|
||||||
$ticket['status']=$hesklang['on_hold'];
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
$ticket['status']=$hesklang['closed'];
|
|
||||||
}
|
|
||||||
|
|
||||||
switch ($ticket['priority'])
|
switch ($ticket['priority'])
|
||||||
{
|
{
|
||||||
@ -787,30 +771,20 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
|
|||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="status" class="control-label col-sm-2"><?php echo $hesklang['status']; ?>:</label>
|
<label for="status" class="control-label col-sm-2"><?php echo $hesklang['status']; ?>:</label>
|
||||||
<div class="col-sm-10">
|
<div class="col-sm-10">
|
||||||
|
<?php
|
||||||
|
$getStatusCheckboxSql = 'SELECT `ID`, `ShortNameContentKey`, `TextColor` FROM `'.hesk_dbEscape($hesk_settings['db_pfix']).'statuses`';
|
||||||
|
$getStatusCheckboxRS = hesk_dbQuery($getStatusCheckboxSql);
|
||||||
|
while ($row = $getStatusCheckboxRS->fetch_assoc())
|
||||||
|
{
|
||||||
|
?>
|
||||||
<div class="col-xs-4">
|
<div class="col-xs-4">
|
||||||
<div class="checkbox">
|
<div class="checkbox">
|
||||||
<label><input type="checkbox" name="s0" value="1" <?php if (isset($status[0])) {echo 'checked="checked"';} ?> /> <span class="open"><?php echo $hesklang['open']; ?></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 $hesklang[$row['ShortNameContentKey']]; ?></span></label>
|
||||||
</div>
|
|
||||||
<div class="checkbox">
|
|
||||||
<label><input type="checkbox" name="s2" value="1" <?php if (isset($status[2])) {echo 'checked="checked"';} ?> /> <span class="replied"><?php echo $hesklang['replied']; ?></span></label>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="col-xs-4">
|
|
||||||
<div class="checkbox">
|
|
||||||
<label><input type="checkbox" name="s4" value="1" <?php if (isset($status[4])) {echo 'checked="checked"';} ?> /> <span class="inprogress"><?php echo $hesklang['in_progress']; ?></span></label>
|
|
||||||
</div>
|
|
||||||
<div class="checkbox">
|
|
||||||
<label><input type="checkbox" name="s1" value="1" <?php if (isset($status[1])) {echo 'checked="checked"';} ?> /> <span class="waitingreply"><?php echo $hesklang['wait_reply']; ?></span></label>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="col-xs-4">
|
|
||||||
<div class="checkbox">
|
|
||||||
<label><input type="checkbox" name="s3" value="1" <?php if (isset($status[3])) {echo 'checked="checked"';} ?> /> <span class="resolved"><?php echo $hesklang['closed']; ?></span></label>
|
|
||||||
</div>
|
|
||||||
<div class="checkbox">
|
|
||||||
<label><input type="checkbox" name="s5" value="1" <?php if (isset($status[5])) {echo 'checked="checked"';} ?> /> <span class="onhold"><?php echo $hesklang['on_hold']; ?></span></label>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user