Browse Source

Update array instantiation syntax to support PHP 5.3.X

tags/2.6.2
Cody Mize 3 years ago
parent
commit
cd53a5812e

+ 1
- 1
admin/api_settings.php View File

@@ -141,7 +141,7 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
User Security
</div>
<?php
$users = [];
$users = array();
$userRs = hesk_dbQuery("SELECT `id`, `user`, `name` FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "users` WHERE `active` = '1'");
while ($row = hesk_dbFetchAssoc($userRs)) {
$row['number_of_tokens'] = 0;

+ 1
- 1
admin/calendar.php View File

@@ -59,7 +59,7 @@ if ($modsForHesk_settings['enable_calendar'] == '0') {
// Get categories for the dropdown
$order_by = $modsForHesk_settings['category_order_column'];
$rs = hesk_dbQuery("SELECT `id`, `name`, `color` FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "categories` WHERE `usage` <> 1 ORDER BY `" . hesk_dbEscape($order_by) . "`");
$categories = [];
$categories = array();
while ($row = hesk_dbFetchAssoc($rs)) {
if (!$_SESSION['isadmin'] && !in_array($row['id'], $_SESSION['categories'])) {
continue;

+ 1
- 1
api/businesslogic/ticket_retriever.php View File

@@ -10,7 +10,7 @@ function get_ticket_for_staff($hesk_settings, $user, $id = NULL) {

if ($id === NULL) {
$original_tickets = $tickets;
$tickets = [];
$tickets = array();
foreach ($original_tickets as $ticket) {
$ticket = remove_common_properties($ticket);
$ticket = convert_to_camel_case($ticket);

+ 1
- 1
api/businesslogic/user_retriever.php View File

@@ -6,7 +6,7 @@ function retrieve_user($hesk_settings, $id = NULL) {

if ($id === NULL) {
$original_users = $users;
$users = [];
$users = array();
foreach ($original_users as $user) {
$user = remove_unneeded_properties($user);
$user = convert_to_camel_case($user);

+ 1
- 1
api/dao/canned_dao.php View File

@@ -12,7 +12,7 @@ function get_canned_response($hesk_settings, $id = NULL) {
return NULL;
}

$results = [];
$results = array();
while ($row = hesk_dbFetchAssoc($response)) {
$row['id'] = intval($row['id']);


+ 1
- 1
api/dao/category_dao.php View File

@@ -12,7 +12,7 @@ function get_category($hesk_settings, $id = NULL) {
return NULL;
}

$results = [];
$results = array();
while ($row = hesk_dbFetchAssoc($response)) {
$row['id'] = intval($row['id']);
$row['displayOrder'] = intval($row['cat_order']);

+ 2
- 2
api/dao/status_dao.php View File

@@ -12,7 +12,7 @@ function get_status($hesk_settings, $id = NULL) {
return NULL;
}

$results = [];
$results = array();
while ($row = hesk_dbFetchAssoc($response)) {
$row['id'] = intval($row['ID']);
unset($row['ID']);
@@ -37,7 +37,7 @@ function get_status($hesk_settings, $id = NULL) {
$language_rs = hesk_dbQuery($language_sql);
if (hesk_dbNumRows($language_rs) > 0) {
$row['key'] = NULL;
$row['keys'] = [];
$row['keys'] = array();
}
while ($language_row = hesk_dbFetchAssoc($language_rs)) {
unset($language_row['id']);

+ 1
- 1
api/dao/ticket_dao.php View File

@@ -31,7 +31,7 @@ function get_ticket_for_id($hesk_settings, $user, $id = NULL) {
}

function build_results($response) {
$results = [];
$results = array();
while ($row = hesk_dbFetchAssoc($response)) {
$row['id'] = intval($row['id']);
$row['category'] = intval($row['category']);

+ 1
- 1
api/dao/ticket_template_dao.php View File

@@ -12,7 +12,7 @@ function get_ticket_template($hesk_settings, $id = NULL) {
return NULL;
}

$results = [];
$results = array();
while ($row = hesk_dbFetchAssoc($response)) {
$row['id'] = intval($row['id']);
$row['displayOrder'] = intval($row['tpl_order']);

+ 1
- 1
api/dao/user_dao.php View File

@@ -13,7 +13,7 @@ function get_user($hesk_settings, $id = NULL) {
return NULL;
}

$results = [];
$results = array();
while ($row = hesk_dbFetchAssoc($response)) {
$row['id'] = intval($row['id']);
$row['isadmin'] = get_boolean($row['isadmin']);

+ 1
- 1
api/priority/index.php View File

@@ -27,7 +27,7 @@ $request_method = $_SERVER['REQUEST_METHOD'];
* }
*/
if ($request_method == 'GET') {
$results = [];
$results = array();
$critical['id'] = 0;
$critical['key'] = 'critical';
$results[] = $critical;

+ 1
- 1
calendar.php View File

@@ -52,7 +52,7 @@ if ($modsForHesk_settings['enable_calendar'] != '1') {
hesk_error($hesklang['calendar_disabled']);
}

$categories = [];
$categories = array();
$orderBy = $modsForHesk_settings['category_order_column'];
$categorySql = "SELECT * FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "categories` WHERE `usage` <> 1 AND `type` = '0' ORDER BY '" . $orderBy . "'";
$categoryRs = hesk_dbQuery($categorySql);

+ 4
- 4
cron/calendar_reminders.php View File

@@ -67,8 +67,8 @@ $sql = "SELECT `reminder`.`id` AS `reminder_id`, `reminder`.`user_id` AS `user_i
AND `email_sent` = '0'";

$rs = hesk_dbQuery($sql);
$reminders_to_flag = [];
$tickets_to_flag = [];
$reminders_to_flag = array();
$tickets_to_flag = array();

$included_email_functions = false;
if (hesk_dbNumRows($rs) > 0 && !$skip_events) {
@@ -150,12 +150,12 @@ $user_rs = hesk_dbQuery("SELECT `id`, `isadmin`, `categories`, `email`,
FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "users` WHERE `notify_overdue_unassigned` = '1'
AND (`heskprivileges` LIKE '%can_view_tickets%' OR `isadmin` = '1')");

$users = [];
$users = array();
while ($row = hesk_dbFetchAssoc($user_rs)) {
$users[] = $row;
}

$tickets_to_flag = [];
$tickets_to_flag = array();
while ($row = hesk_dbFetchAssoc($rs)) {
if (mfh_sendOverdueTicketReminder($row, $users, $modsForHesk_settings)) {
$tickets_to_flag[] = $row['id'];

+ 1
- 1
inc/email_functions.inc.php View File

@@ -338,7 +338,7 @@ function mfh_sendOverdueTicketReminder($ticket, $users, $modsForHesk_settings) {
$htmlMessage = hesk_getHtmlMessage('overdue_ticket', NULL, $modsForHesk_settings, 1, 0, 1);
$htmlMessage = hesk_processMessage($htmlMessage, $ticket, 1, 1, 0, $modsForHesk_settings, 1);

$emails = [];
$emails = array();
if ($ticket['user_email'] != NULL) {
$emails[] = $ticket['user_email'];
}

+ 1
- 1
internal-api/dao/calendar_dao.php View File

@@ -26,7 +26,7 @@ function get_events($start, $end, $hesk_settings, $staff = true) {

$rs = hesk_dbQuery($sql);

$events = [];
$events = array();
while ($row = hesk_dbFetchAssoc($rs)) {
// Skip the event if the user does not have access to it
if ($staff && !$_SESSION['isadmin'] && !in_array($row['category'], $_SESSION['categories'])) {

+ 1
- 1
internal-api/dao/message_log_dao.php View File

@@ -26,7 +26,7 @@ function search_log($hesk_settings, $location, $from_date, $to_date, $severity_i

$rs = hesk_dbQuery($sql);

$results = [];
$results = array();
while ($row = hesk_dbFetchAssoc($rs)) {
$row['timestamp'] = hesk_date($row['timestamp'], true);
$results[] = $row;

Loading…
Cancel
Save