diff --git a/admin/admin_reply_ticket.php b/admin/admin_reply_ticket.php index 1ca12166..5a422efe 100644 --- a/admin/admin_reply_ticket.php +++ b/admin/admin_reply_ticket.php @@ -258,7 +258,7 @@ elseif (isset($_POST['submit_as_status'])) if ($ticket['status'] != $new_status) { // Does this status close the ticket? - $newStatusRs = hesk_dbQuery('SELECT `IsClosed`, `ShortNameContentKey` FROM `'.hesk_dbEscape($hesk_settings['db_pfix']).'statuses` WHERE `ID` = '.hesk_dbEscape($new_status)); + $newStatusRs = hesk_dbQuery('SELECT `IsClosed`, `Key` FROM `'.hesk_dbEscape($hesk_settings['db_pfix']).'statuses` WHERE `ID` = '.hesk_dbEscape($new_status)); $newStatus = hesk_dbFetchAssoc($newStatusRs); if ($newStatus['IsClosed']) @@ -274,7 +274,7 @@ elseif (isset($_POST['submit_as_status'])) } else { // Ticket isn't being closed, just add the history to the sql query - $revision = sprintf($hesklang['thist9'],hesk_date(),$hesklang[$newStatus['ShortNameContentKey']],$_SESSION['name'].' ('.$_SESSION['user'].')'); + $revision = sprintf($hesklang['thist9'],hesk_date(),$hesklang[$newStatus['Key']],$_SESSION['name'].' ('.$_SESSION['user'].')'); $sql_status = " , `history`=CONCAT(`history`,'".hesk_dbEscape($revision)."') "; } } diff --git a/admin/admin_settings.php b/admin/admin_settings.php index 39a5f035..9bc09b85 100644 --- a/admin/admin_settings.php +++ b/admin/admin_settings.php @@ -517,7 +517,6 @@ if ( defined('HESK_DEMO') ) @@ -2212,221 +2211,6 @@ if ( defined('HESK_DEMO') ) - -
-
-
- -
- - - - - - - - - - - - - - fetch_assoc()) - { - $checkedEcho = ($row['IsClosed'] == 1) ? 'checked="checked"' : ''; - $isDisabled = false; - if ($row['IsNewTicketStatus'] || $row['IsClosedByClient'] || $row['IsCustomerReplyStatus'] || - $row['IsStaffClosedOption'] || $row['IsStaffReopenedStatus'] || $row['IsDefaultStaffReplyStatus'] || - $row['LockedTicketStatus'] || $row['IsAutocloseOption']) - { - $isDisabled = true; - } - - $yesSelected = $customersOnlySelected = $staffOnlySelected = $noSelected = ''; - if ($row['Closable'] == 'yes') { $yesSelected = 'selected'; } - elseif ($row['Closable'] == 'conly') { $customersOnlySelected = 'selected'; } - elseif ($row['Closable'] == 'sonly') { $staffOnlySelected = 'selected'; } - else { $noSelected = 'selected'; } - - echo ''; - echo ''; //Name - echo ''; // Short Name Language File - echo ''; // Long Name Language File - echo ''; // Text Color - echo ''; - echo ''; // Resolved Status? - echo ''; //Delete status? - echo ''; - } - - //Print out an additional blank space for adding a status - echo ''; - echo ''; - echo ''; // Short Name Language File - echo ''; // Long Name Language File - echo ''; // Text Color - echo ''; - echo ''; // Resolved Status? - echo ''; //Empty placeholder where the delete row is. - echo ''; - ?> - -
'.$hesklang[$row['ShortNameContentKey']].' - - '; - if ($isDisabled) - { - echo ''; - } else - { - echo ''; - } - echo '
'.$hesklang['addNew'].' - -
-
-
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
diff --git a/admin/admin_settings_save.php b/admin/admin_settings_save.php index 20e13c16..0786116f 100644 --- a/admin/admin_settings_save.php +++ b/admin/admin_settings_save.php @@ -510,106 +510,6 @@ for ($i=1;$i<=20;$i++) } } -//-- Update the statuses -hesk_dbConnect(); -$wasStatusDeleted = false; -//-- Get all the status IDs -$statusesSql = 'SELECT * FROM `'.$hesk_settings['db_pfix'].'statuses`'; -$results = hesk_dbQuery($statusesSql); -while ($row = $results->fetch_assoc()) -{ - //-- If the status is marked for deletion, delete it and skip everything below. - if (isset($_POST['s'.$row['ID'].'_delete'])) - { - $delete = "DELETE FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."statuses` WHERE `ID` = ?"; - $stmt = hesk_dbConnect()->prepare($delete); - $stmt->bind_param('i', $row['ID']); - $stmt->execute(); - $wasStatusDeleted = true; - } else - { - //-- Update the information in the database with what is on the page - $query = "UPDATE `".hesk_dbEscape($hesk_settings['db_pfix'])."statuses` SET `ShortNameContentKey` = ?, `TicketViewContentKey` = ?, `TextColor` = ?, `IsClosed` = ?, `Closable` = ? WHERE `ID` = ?"; - $stmt = hesk_dbConnect()->prepare($query); - $isStatusClosed = (isset($_POST['s'.$row['ID'].'_isClosed']) ? 1 : 0); - $stmt->bind_param('sssisi', $_POST['s'.$row['ID'].'_shortName'], $_POST['s'.$row['ID'].'_longName'], $_POST['s'.$row['ID'].'_textColor'], $isStatusClosed, $_POST['s'.$row['ID'].'_closable'], $row['ID']); - $stmt->execute(); - } -} - -//-- If any statuses were deleted, re-index them before adding a new one -if ($wasStatusDeleted) { - //-- First drop and re-add the ID column - hesk_dbQuery("ALTER TABLE `".hesk_dbEscape($hesk_settings['db_pfix'])."statuses` DROP COLUMN `ID`"); - hesk_dbQuery("ALTER TABLE `".hesk_dbEscape($hesk_settings['db_pfix'])."statuses` ADD `ID` INT NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST"); - - //-- Since statuses should be zero-based, but are now one-based, subtract one from each ID - hesk_dbQuery("UPDATE `".hesk_dbEscape($hesk_settings['db_pfix'])."statuses` SET `ID` = `ID`-1"); -} - -//-- Insert the addition if there is anything to add -if ($_POST['sN_shortName'] != null && $_POST['sN_longName'] != null && $_POST['sN_textColor'] != null) -{ - //-- The next ID is equal to the number of rows, since the IDs are zero-indexed. - $nextValue = hesk_dbQuery('SELECT * FROM `'.hesk_dbEscape($hesk_settings['db_pfix']).'statuses`')->num_rows; - $isClosed = isset($_POST['sN_isClosed']) ? 1 : 0; - $insert = "INSERT INTO `".hesk_dbEscape($hesk_settings['db_pfix'])."statuses` (`ID`, `ShortNameContentKey`, `TicketViewContentKey`, `TextColor`, `IsClosed`, `Closable`) - VALUES (".$nextValue.", '".hesk_dbEscape($_POST['sN_shortName'])."', '".hesk_dbEscape($_POST['sN_longName'])."', '".hesk_dbEscape($_POST['sN_textColor'])."', ".$isClosed.", '".hesk_dbEscape($_POST['sN_closable'])."')"; - hesk_dbQuery($insert); -} - -//-- Update default status for actions -$defaultQuery = "UPDATE `".hesk_dbEscape($hesk_settings['db_pfix'])."statuses` SET "; - -hesk_dbConnect()->query($defaultQuery . "`IsNewTicketStatus` = 0"); -$updateQuery = $defaultQuery . "`IsNewTicketStatus` = 1 WHERE `ID` = ?"; -$stmt = hesk_dbConnect()->prepare($updateQuery); -$stmt->bind_param('i', $_POST['newTicket']); -$stmt->execute(); - - -hesk_dbConnect()->query($defaultQuery . "`IsClosedByClient` = 0"); -$updateQuery = $defaultQuery . "`IsClosedByClient` = 1 WHERE `ID` = ?"; -$stmt = hesk_dbConnect()->prepare($updateQuery); -$stmt->bind_param('i', $_POST['closedByClient']); -$stmt->execute(); - -hesk_dbConnect()->query($defaultQuery . "`IsCustomerReplyStatus` = 0"); -$updateQuery = $defaultQuery . "`IsCustomerReplyStatus` = 1 WHERE `ID` = ?"; -$stmt = hesk_dbConnect()->prepare($updateQuery); -$stmt->bind_param('i', $_POST['replyFromClient']); -$stmt->execute(); - -hesk_dbConnect()->query($defaultQuery . "`IsStaffClosedOption` = 0"); -$updateQuery = $defaultQuery . "`IsStaffClosedOption` = 1 WHERE `ID` = ?"; -$stmt = hesk_dbConnect()->prepare($updateQuery); -$stmt->bind_param('i', $_POST['staffClosedOption']); -$stmt->execute(); - -hesk_dbConnect()->query($defaultQuery . "`IsStaffReopenedStatus` = 0"); -$updateQuery = $defaultQuery . "`IsStaffReopenedStatus` = 1 WHERE `ID` = ?"; -$stmt = hesk_dbConnect()->prepare($updateQuery); -$stmt->bind_param('i', $_POST['staffReopenedStatus']); -$stmt->execute(); - -hesk_dbConnect()->query($defaultQuery . "`IsDefaultStaffReplyStatus` = 0"); -$updateQuery = $defaultQuery . "`IsDefaultStaffReplyStatus` = 1 WHERE `ID` = ?"; -$stmt = hesk_dbConnect()->prepare($updateQuery); -$stmt->bind_param('i', $_POST['defaultStaffReplyStatus']); -$stmt->execute(); - -hesk_dbConnect()->query($defaultQuery . "`LockedTicketStatus` = 0"); -$updateQuery = $defaultQuery . "`LockedTicketStatus` = 1 WHERE `ID` = ?"; -$stmt = hesk_dbConnect()->prepare($updateQuery); -$stmt->bind_param('i', $_POST['lockedTicketStatus']); -$stmt->execute(); - -hesk_dbConnect()->query($defaultQuery . "`IsAutocloseOption` = 0"); -$updateQuery = $defaultQuery . "`IsAutocloseOption` = 1 WHERE `ID` = ?"; -$stmt = hesk_dbConnect()->prepare($updateQuery); -$stmt->bind_param('i', $_POST['autocloseTicketOption']); -$stmt->execute(); - $set['hesk_version'] = $hesk_settings['hesk_version']; // Save the modsForHesk_settings.inc.php file diff --git a/admin/admin_ticket.php b/admin/admin_ticket.php index 8b0b6902..d7918c2f 100644 --- a/admin/admin_ticket.php +++ b/admin/admin_ticket.php @@ -663,7 +663,7 @@ if($ticket['email'] != '') { $newRecentTicket = $recentTicket; $thisTicketStatusRS = hesk_dbQuery("SELECT * FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "statuses` WHERE `ID` = " . intval($recentTicket['status'])); $theStatusRow = hesk_dbFetchAssoc($thisTicketStatusRS); - $newRecentTicket['statusText'] = $hesklang[$theStatusRow['ShortNameContentKey']]; + $newRecentTicket['statusText'] = $hesklang[$theStatusRow['Key']]; $newRecentTicket['statusColor'] = $theStatusRow['TextColor']; array_push($recentTicketsWithStatuses, $newRecentTicket); } @@ -876,7 +876,7 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');

'.$hesklang['status'].'

'; $status_options = array(); - $results = hesk_dbQuery("SELECT `ID`, `ShortNameContentKey` FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."statuses`"); + $results = hesk_dbQuery("SELECT `ID`, `Key` FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."statuses`"); while ($row = $results->fetch_assoc()) { $selected = $ticket['status'] == $row['ID'] ? 'selected' : ''; - $status_options[$row['ID']] = ''; + $status_options[$row['ID']] = ''; } echo ' @@ -1969,7 +1969,7 @@ function hesk_printReplyForm() {
  • '; } diff --git a/admin/change_status.php b/admin/change_status.php index 2071f222..1949719d 100644 --- a/admin/change_status.php +++ b/admin/change_status.php @@ -56,13 +56,13 @@ hesk_token_check(); $trackingID = hesk_cleanID() or die($hesklang['int_error'].': '.$hesklang['no_trackID']); /* Valid statuses */ -$statusSql = "SELECT `ID`, `ShortNameContentKey` FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."statuses`"; +$statusSql = "SELECT `ID`, `Key` FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."statuses`"; $status_options = array(); $results = hesk_dbQuery($statusSql); while ($row = $results->fetch_assoc()) { - $status_options[$row['ID']] = $hesklang[$row['ShortNameContentKey']]; + $status_options[$row['ID']] = $hesklang[$row['Key']]; } /* New status */ diff --git a/admin/export.php b/admin/export.php index fbe98b2a..1c63ad4e 100644 --- a/admin/export.php +++ b/admin/export.php @@ -242,12 +242,12 @@ $fid = 1; require(HESK_PATH . 'inc/assignment_search.inc.php'); // --> TICKET STATUS -$possibleStatusSql = 'SELECT `ID`, `ShortNameContentKey` FROM `'.hesk_dbEscape($hesk_settings['db_pfix']).'statuses`'; +$possibleStatusSql = 'SELECT `ID`, `Key` FROM `'.hesk_dbEscape($hesk_settings['db_pfix']).'statuses`'; $possibleStatusRS = hesk_dbQuery($possibleStatusSql); $possible_status = array(); while ($row = $possibleStatusRS->fetch_assoc()) { - $possible_status[$row['ID']] = $hesklang[$row['ShortNameContentKey']]; + $possible_status[$row['ID']] = $hesklang[$row['Key']]; } $status = $possible_status; @@ -505,9 +505,9 @@ if (isset($_GET['w'])) $result = hesk_dbQuery($sql); while ($ticket=hesk_dbFetchAssoc($result)) { - $statusContentKeySql = 'SELECT `ShortNameContentKey` FROM `'.hesk_dbEscape($hesk_settings['db_pfix']).'statuses` WHERE `ID` = '.$ticket['status']; + $statusContentKeySql = 'SELECT `Key` FROM `'.hesk_dbEscape($hesk_settings['db_pfix']).'statuses` WHERE `ID` = '.$ticket['status']; $statusContentKeyRow = hesk_dbQuery($statusContentKeySql)->fetch_assoc(); - $ticket['status'] = $hesklang[$statusContentKeyRow['ShortNameContentKey']]; + $ticket['status'] = $hesklang[$statusContentKeyRow['Key']]; switch ($ticket['priority']) { @@ -779,14 +779,14 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
    fetch_assoc()) { ?>
    - +
    + +
    + +
    +
    +
    + +
    +
    + +
    +
    + + + + + + + + + + + + + fetch_assoc()) + { + $checkedEcho = ($row['IsClosed'] == 1) ? 'checked="checked"' : ''; + $isDisabled = false; + if ($row['IsNewTicketStatus'] || $row['IsClosedByClient'] || $row['IsCustomerReplyStatus'] || + $row['IsStaffClosedOption'] || $row['IsStaffReopenedStatus'] || $row['IsDefaultStaffReplyStatus'] || + $row['LockedTicketStatus'] || $row['IsAutocloseOption']) + { + $isDisabled = true; + } + + $yesSelected = $customersOnlySelected = $staffOnlySelected = $noSelected = ''; + if ($row['Closable'] == 'yes') { $yesSelected = 'selected'; } + elseif ($row['Closable'] == 'conly') { $customersOnlySelected = 'selected'; } + elseif ($row['Closable'] == 'sonly') { $staffOnlySelected = 'selected'; } + else { $noSelected = 'selected'; } + + echo ''; + echo ''; //Name + echo ''; // Language File Key + echo ''; // Text Color + echo ''; + echo ''; // Resolved Status? + echo ''; //Delete status? + echo ''; + } + + //Print out an additional blank space for adding a status + echo ''; + echo ''; + echo ''; // Language File Key + echo ''; // Text Color + echo ''; + echo ''; // Resolved Status? + echo ''; //Empty placeholder where the delete row is. + echo ''; + ?> + +
    '.$hesklang[$row['Key']].' + + '; + if ($isDisabled) + { + echo ''; + } else + { + echo ''; + } + echo '
    '.$hesklang['addNew'].' + +
    +
    +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + + +
    +
    +
    +
    +
    +
    + +fetch_assoc()) + { + //-- If the status is marked for deletion, delete it and skip everything below. + if (isset($_POST['s'.$row['ID'].'_delete'])) + { + $delete = "DELETE FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."statuses` WHERE `ID` = ?"; + $stmt = hesk_dbConnect()->prepare($delete); + $stmt->bind_param('i', $row['ID']); + $stmt->execute(); + $wasStatusDeleted = true; + } else + { + //-- Update the information in the database with what is on the page + $query = "UPDATE `".hesk_dbEscape($hesk_settings['db_pfix'])."statuses` SET `Key` = ?, `TextColor` = ?, `IsClosed` = ?, `Closable` = ? WHERE `ID` = ?"; + $stmt = hesk_dbConnect()->prepare($query); + $isStatusClosed = (isset($_POST['s'.$row['ID'].'_isClosed']) ? 1 : 0); + $stmt->bind_param('sssisi', $_POST['s'.$row['ID'].'_key'], $_POST['s'.$row['ID'].'_textColor'], $isStatusClosed, $_POST['s'.$row['ID'].'_closable'], $row['ID']); + $stmt->execute(); + } + } + + //-- If any statuses were deleted, re-index them before adding a new one + if ($wasStatusDeleted) { + //-- First drop and re-add the ID column + hesk_dbQuery("ALTER TABLE `".hesk_dbEscape($hesk_settings['db_pfix'])."statuses` DROP COLUMN `ID`"); + hesk_dbQuery("ALTER TABLE `".hesk_dbEscape($hesk_settings['db_pfix'])."statuses` ADD `ID` INT NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST"); + + //-- Since statuses should be zero-based, but are now one-based, subtract one from each ID + hesk_dbQuery("UPDATE `".hesk_dbEscape($hesk_settings['db_pfix'])."statuses` SET `ID` = `ID`-1"); + } + + //-- Insert the addition if there is anything to add + if ($_POST['sN_key'] != null && $_POST['sN_textColor'] != null) + { + //-- The next ID is equal to the number of rows, since the IDs are zero-indexed. + $nextValue = hesk_dbQuery('SELECT * FROM `'.hesk_dbEscape($hesk_settings['db_pfix']).'statuses`')->num_rows; + $isClosed = isset($_POST['sN_isClosed']) ? 1 : 0; + $insert = "INSERT INTO `".hesk_dbEscape($hesk_settings['db_pfix'])."statuses` (`ID`, `Key`, `TextColor`, `IsClosed`, `Closable`) + VALUES (".$nextValue.", '".hesk_dbEscape($_POST['sN_key'])."', '".hesk_dbEscape($_POST['sN_textColor'])."', ".$isClosed.", '".hesk_dbEscape($_POST['sN_closable'])."')"; + hesk_dbQuery($insert); + } + + //-- Update default status for actions + $defaultQuery = "UPDATE `".hesk_dbEscape($hesk_settings['db_pfix'])."statuses` SET "; + + hesk_dbConnect()->query($defaultQuery . "`IsNewTicketStatus` = 0"); + $updateQuery = $defaultQuery . "`IsNewTicketStatus` = 1 WHERE `ID` = ?"; + $stmt = hesk_dbConnect()->prepare($updateQuery); + $stmt->bind_param('i', $_POST['newTicket']); + $stmt->execute(); + + + hesk_dbConnect()->query($defaultQuery . "`IsClosedByClient` = 0"); + $updateQuery = $defaultQuery . "`IsClosedByClient` = 1 WHERE `ID` = ?"; + $stmt = hesk_dbConnect()->prepare($updateQuery); + $stmt->bind_param('i', $_POST['closedByClient']); + $stmt->execute(); + + hesk_dbConnect()->query($defaultQuery . "`IsCustomerReplyStatus` = 0"); + $updateQuery = $defaultQuery . "`IsCustomerReplyStatus` = 1 WHERE `ID` = ?"; + $stmt = hesk_dbConnect()->prepare($updateQuery); + $stmt->bind_param('i', $_POST['replyFromClient']); + $stmt->execute(); + + hesk_dbConnect()->query($defaultQuery . "`IsStaffClosedOption` = 0"); + $updateQuery = $defaultQuery . "`IsStaffClosedOption` = 1 WHERE `ID` = ?"; + $stmt = hesk_dbConnect()->prepare($updateQuery); + $stmt->bind_param('i', $_POST['staffClosedOption']); + $stmt->execute(); + + hesk_dbConnect()->query($defaultQuery . "`IsStaffReopenedStatus` = 0"); + $updateQuery = $defaultQuery . "`IsStaffReopenedStatus` = 1 WHERE `ID` = ?"; + $stmt = hesk_dbConnect()->prepare($updateQuery); + $stmt->bind_param('i', $_POST['staffReopenedStatus']); + $stmt->execute(); + + hesk_dbConnect()->query($defaultQuery . "`IsDefaultStaffReplyStatus` = 0"); + $updateQuery = $defaultQuery . "`IsDefaultStaffReplyStatus` = 1 WHERE `ID` = ?"; + $stmt = hesk_dbConnect()->prepare($updateQuery); + $stmt->bind_param('i', $_POST['defaultStaffReplyStatus']); + $stmt->execute(); + + hesk_dbConnect()->query($defaultQuery . "`LockedTicketStatus` = 0"); + $updateQuery = $defaultQuery . "`LockedTicketStatus` = 1 WHERE `ID` = ?"; + $stmt = hesk_dbConnect()->prepare($updateQuery); + $stmt->bind_param('i', $_POST['lockedTicketStatus']); + $stmt->execute(); + + hesk_dbConnect()->query($defaultQuery . "`IsAutocloseOption` = 0"); + $updateQuery = $defaultQuery . "`IsAutocloseOption` = 1 WHERE `ID` = ?"; + $stmt = hesk_dbConnect()->prepare($updateQuery); + $stmt->bind_param('i', $_POST['autocloseTicketOption']); + $stmt->execute(); + + hesk_process_messages($hesklang['statuses_saved'],'manage_statuses.php','SUCCESS'); +} \ No newline at end of file diff --git a/inc/email_functions.inc.php b/inc/email_functions.inc.php index 35f36d77..1aa7597f 100644 --- a/inc/email_functions.inc.php +++ b/inc/email_functions.inc.php @@ -608,9 +608,9 @@ function hesk_getEmailSubject($eml_file, $ticket='', $is_ticket=1, $strip=0) } /* Set status */ - $statusRs = hesk_dbQuery("SELECT `ShortNameContentKey` FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."statuses` WHERE `ID` = ".$ticket['status']); + $statusRs = hesk_dbQuery("SELECT `Key` FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."statuses` WHERE `ID` = ".$ticket['status']); $row = hesk_dbFetchAssoc($statusRs); - $ticket['status'] = $hesklang[$row['ShortNameContentKey']]; + $ticket['status'] = $hesklang[$row['Key']]; /* Replace all special tags */ $msg = str_replace('%%SUBJECT%%', $ticket['subject'], $msg); @@ -778,9 +778,9 @@ function hesk_processMessage($msg, $ticket, $is_admin, $is_ticket, $just_message $ticket['owner'] = hesk_msgToPlain( hesk_getOwnerName($ticket['owner']), 1); /* Set status */ - $statusRs = hesk_dbQuery("SELECT `ShortNameContentKey` FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."statuses` WHERE `ID` = ".$ticket['status']); + $statusRs = hesk_dbQuery("SELECT `Key` FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."statuses` WHERE `ID` = ".$ticket['status']); $row = hesk_dbFetchAssoc($statusRs); - $ticket['status'] = $hesklang[$row['ShortNameContentKey']]; + $ticket['status'] = $hesklang[$row['Key']]; /* Replace all special tags */ $msg = str_replace('%%NAME%%', $ticket['name'] ,$msg); diff --git a/inc/show_search_form.inc.php b/inc/show_search_form.inc.php index d775550a..16499df6 100644 --- a/inc/show_search_form.inc.php +++ b/inc/show_search_form.inc.php @@ -38,10 +38,10 @@ if ( ! isset($status) ) { $status = array(); //-- We don't want to check statuses that are considered "closed" - $statusRS = hesk_dbQuery('SELECT `ID`, `ShortNameContentKey` FROM `'.hesk_dbEscape($hesk_settings['db_pfix']).'statuses` WHERE `IsClosed` = 0'); + $statusRS = hesk_dbQuery('SELECT `ID`, `Key` FROM `'.hesk_dbEscape($hesk_settings['db_pfix']).'statuses` WHERE `IsClosed` = 0'); while ($row = $statusRS->fetch_assoc()) { - $status[$row['ID']] = $row['ShortNameContentKey']; + $status[$row['ID']] = $row['Key']; } } @@ -131,7 +131,7 @@ $more2 = empty($_GET['more2']) ? 0 : 1; fetch_assoc()) { if ($rowCounter > 3) @@ -149,7 +149,7 @@ $more2 = empty($_GET['more2']) ? 0 : 1; } echo ''; + echo '/> '.$hesklang[$row['Key']].''; $rowCounter++; } diff --git a/inc/ticket_list.inc.php b/inc/ticket_list.inc.php index d24cea03..04f4030e 100644 --- a/inc/ticket_list.inc.php +++ b/inc/ticket_list.inc.php @@ -386,8 +386,8 @@ if ($total > 0) // Print ticket status if ( hesk_show_column('status') ) { - $statusName = hesk_dbFetchAssoc(hesk_dbQuery("SELECT `ShortNameContentKey`, `TextColor` FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."statuses` WHERE ID = ".$ticket['status'])); - $ticket['status']=''.$hesklang[$statusName['ShortNameContentKey']].''; + $statusName = hesk_dbFetchAssoc(hesk_dbQuery("SELECT `Key`, `TextColor` FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."statuses` WHERE ID = ".$ticket['status'])); + $ticket['status']=''.$hesklang[$statusName['Key']].''; echo ''.$ticket['status'].' '; } diff --git a/index.php b/index.php index f36dc325..d73403d1 100644 --- a/index.php +++ b/index.php @@ -1194,11 +1194,11 @@ function forgot_tid() } /* Prepare ticket statuses */ - $myStatusSQL = hesk_dbQuery("SELECT `ID`, `TicketViewContentKey` FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."statuses`"); + $myStatusSQL = hesk_dbQuery("SELECT `ID`, `Key` FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."statuses`"); $my_status = array(); while ($myStatusRow = hesk_dbFetchAssoc($myStatusSQL)) { - $my_status[$myStatusRow['ID']] = $hesklang[$myStatusRow['TicketViewContentKey']]; + $my_status[$myStatusRow['ID']] = $hesklang[$myStatusRow['Key']]; } // Get tickets from the database diff --git a/install/mods-for-hesk/sql/installSql.php b/install/mods-for-hesk/sql/installSql.php index ce61e4a9..059f1264 100644 --- a/install/mods-for-hesk/sql/installSql.php +++ b/install/mods-for-hesk/sql/installSql.php @@ -444,6 +444,10 @@ function execute230Scripts() { hesk_dbConnect(); executeQuery("ALTER TABLE `".hesk_dbEscape($hesk_settings['db_pfix'])."service_messages` ADD COLUMN `icon` VARCHAR(150)"); + executeQuery("ALTER TABLE `".hesk_dbEscape($hesk_settings['db_pfix'])."statuses` ADD COLUMN `Key` TEXT"); + executeQuery("UPDATE `".hesk_dbEscape($hesk_settings['db_pfix'])."statuses` SET `Key` = `ShortNameContentKey`"); + executeQuery("ALTER TABLE `".hesk_dbEscape($hesk_settings['db_pfix'])."statuses` DROP COLUMN `ShortNameContentKey`"); + executeQuery("ALTER TABLE `".hesk_dbEscape($hesk_settings['db_pfix'])."statuses` DROP COLUMN `TicketViewContentKey`"); executeQuery("UPDATE `".hesk_dbEscape($hesk_settings['db_pfix'])."settings` SET `Value` = '2.3.0' WHERE `Key` = 'modsForHeskVersion'"); } // END Version 2.3.0 \ No newline at end of file diff --git a/language/en/text.php b/language/en/text.php index cff0606c..6dd8e9ab 100644 --- a/language/en/text.php +++ b/language/en/text.php @@ -29,6 +29,10 @@ $hesklang['sm_search_icon'] = 'Search Icon'; $hesklang['sm_iconpicker_footer_label'] = '{0} - {1} of {2}'; // {0}: lower bound of page, {1}: upper bound of page, {2}: total number of icons $hesklang['mods_for_hesk_acronym'] = 'MFH'; // THIS SHOULD NOT BE TRANSLATED $hesklang['added_in_mods_for_hesk'] = 'Added in Mods for HESK'; +$hesklang['statuses_intro'] = 'Here you can add, remove, and modify ticket statuses, as well as changing the default status for particular actions.'; +$hesklang['statuses_saved'] = 'Ticket statuses have been updated!'; +$hesklang['language_key'] = 'Language Key'; +$hesklang['language_key_description'] = 'This is the language file \'key\' that contains the text you want to display'; // ADDED OR MODIFIED IN Mods for HESK 2.2.1 $hesklang['popart_no_colon']='Top Knowledgebase Articles'; // same as $hesklang['popart'] but without a colon (:) @@ -226,10 +230,6 @@ $hesklang['changeLanguage'] = 'Change language to'; // ADDED OR MODIFIED IN Mods For HESK 1.2 $hesklang['statuses'] = 'Statuses'; $hesklang['basicProperties'] = 'Basic Properties'; -$hesklang['shortNameKey'] = 'Short Name Key'; -$hesklang['shortNameKeyDescr'] = "This is the language file 'key' that contains the text you want to display on all pages that have statuses, except for the ticket view pages (ticket.php, admin_ticket.php, and print.php)"; -$hesklang['longNameKey'] = 'Long Name Key'; -$hesklang['longNameKeyDescr'] = "This is the language file 'key' that contains the text you want to display on ticket.php, print.php, and admin_ticket.php"; $hesklang['textColor'] = 'Text Color'; $hesklang['textColorDescr'] = 'This is the hex color code for the status that will be used on the ticket search page and export search page'; $hesklang['closedQuestionMark'] = 'Closed?'; diff --git a/print.php b/print.php index d4d26795..05ee7bcc 100644 --- a/print.php +++ b/print.php @@ -60,7 +60,7 @@ if ( empty($_SESSION['id']) ) } /* Get ticket info */ -$res = hesk_dbQuery("SELECT `t1`.* , `ticketStatus`.`IsClosed` AS `isClosed`, `ticketStatus`.`TicketViewContentKey` AS `statusKey`, `t2`.name AS `repliername` +$res = hesk_dbQuery("SELECT `t1`.* , `ticketStatus`.`IsClosed` AS `isClosed`, `ticketStatus`.`Key` AS `statusKey`, `t2`.name AS `repliername` FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."tickets` AS `t1` LEFT JOIN `".hesk_dbEscape($hesk_settings['db_pfix'])."users` AS `t2` ON `t1`.`replierid` = `t2`.`id` INNER JOIN `".hesk_dbEscape($hesk_settings['db_pfix'])."statuses` AS `ticketStatus` ON `t1`.`status` = `ticketStatus`.`ID` WHERE `trackid`='".hesk_dbEscape($trackingID)."' LIMIT 1"); diff --git a/ticket.php b/ticket.php index 8c0668ae..24c94315 100644 --- a/ticket.php +++ b/ticket.php @@ -106,7 +106,7 @@ hesk_dbConnect(); hesk_limitBfAttempts(); /* Get ticket info */ -$res = hesk_dbQuery( "SELECT `t1`.* , `t2`.name AS `repliername`, `ticketStatus`.`IsClosed` AS `isClosed`, `ticketStatus`.`TicketViewContentKey` AS `statusKey` FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."tickets` AS `t1` INNER JOIN `".hesk_dbEscape($hesk_settings['db_pfix'])."statuses` AS `ticketStatus` ON `t1`.`status` = `ticketStatus`.`ID` LEFT JOIN `".hesk_dbEscape($hesk_settings['db_pfix'])."users` AS `t2` ON `t1`.`replierid` = `t2`.`id` WHERE `trackid`='".hesk_dbEscape($trackingID)."' LIMIT 1"); +$res = hesk_dbQuery( "SELECT `t1`.* , `t2`.name AS `repliername`, `ticketStatus`.`IsClosed` AS `isClosed`, `ticketStatus`.`Key` AS `statusKey` FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."tickets` AS `t1` INNER JOIN `".hesk_dbEscape($hesk_settings['db_pfix'])."statuses` AS `ticketStatus` ON `t1`.`status` = `ticketStatus`.`ID` LEFT JOIN `".hesk_dbEscape($hesk_settings['db_pfix'])."users` AS `t2` ON `t1`.`replierid` = `t2`.`id` WHERE `trackid`='".hesk_dbEscape($trackingID)."' LIMIT 1"); /* Ticket found? */ if (hesk_dbNumRows($res) != 1) @@ -299,7 +299,7 @@ require_once(HESK_PATH . 'inc/header.inc.php'); $repliesColumnWidth = 3; } echo '

    '.$hesklang['status'].'

    '; - $ticketStatusKey = $status['ShortNameContentKey']; + $ticketStatusKey = $status['Key']; echo '

    '.$hesklang[$ticketStatusKey].'

    '; echo '
    '; echo '

    '.$hesklang['last_replier'].'