2015-07-30 12:35:30 -04:00
|
|
|
<?php
|
2016-11-16 21:16:25 -05:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
* This file is part of HESK - PHP Help Desk Software.
|
|
|
|
*
|
|
|
|
* (c) Copyright Klemen Stirn. All rights reserved.
|
2016-11-18 12:57:17 -05:00
|
|
|
* https://www.hesk.com
|
2016-11-16 21:16:25 -05:00
|
|
|
*
|
|
|
|
* For the full copyright and license agreement information visit
|
2016-11-18 12:57:17 -05:00
|
|
|
* https://www.hesk.com/eula.php
|
2016-11-16 21:16:25 -05:00
|
|
|
*
|
|
|
|
*/
|
2015-07-30 12:35:30 -04:00
|
|
|
|
|
|
|
/* Check if this is a valid include */
|
2015-09-12 00:46:46 -04:00
|
|
|
if (!defined('IN_SCRIPT')) {
|
|
|
|
die('Invalid attempt');
|
|
|
|
}
|
2015-07-30 12:35:30 -04:00
|
|
|
|
|
|
|
|
2015-09-12 00:46:46 -04:00
|
|
|
function mfh_getAllStatuses()
|
|
|
|
{
|
2015-07-30 12:35:30 -04:00
|
|
|
global $hesk_settings, $modsForHesk_settings;
|
|
|
|
|
2015-09-12 00:46:46 -04:00
|
|
|
$statusesSql = 'SELECT * FROM `' . hesk_dbEscape($hesk_settings['db_pfix']) . 'statuses` ORDER BY `sort` ASC';
|
2015-07-30 12:35:30 -04:00
|
|
|
$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;
|
|
|
|
}
|