diff --git a/api/Controllers/Tickets/StaffTicketController.php b/api/Controllers/Tickets/StaffTicketController.php
index e049bca5..7cefe216 100644
--- a/api/Controllers/Tickets/StaffTicketController.php
+++ b/api/Controllers/Tickets/StaffTicketController.php
@@ -10,6 +10,7 @@
use BusinessLogic\Tickets\TicketEditor;
use BusinessLogic\Tickets\TicketRetriever;
use Controllers\JsonRetriever;
+use Symfony\Component\Console\Helper\Helper;
class StaffTicketController extends \BaseClass {
function get($id) {
@@ -55,7 +56,14 @@ static function updateDueDate($id) {
$json = JsonRetriever::getJsonData();
- $dueDate = date('Y-m-d H:i:s', strtotime(Helpers::safeArrayGet($json, 'dueDate')));
+ $newDueDate = Helpers::safeArrayGet($json, 'dueDate');
+
+ if ($newDueDate !== null) {
+ $dueDate = date('Y-m-d H:i:s', strtotime(Helpers::safeArrayGet($json, 'dueDate')));
+ } else {
+ $dueDate = null;
+ }
+
$ticketEditor->updateDueDate($id, $dueDate, $userContext, $hesk_settings);
}
diff --git a/build.php b/build.php
index 189c8f08..a33f04d7 100644
--- a/build.php
+++ b/build.php
@@ -1,4 +1,4 @@
-
-
-
-
-
\ No newline at end of file
+
+
+
+
+
\ No newline at end of file
diff --git a/inc/headerAdmin.inc.php b/inc/headerAdmin.inc.php
index 37976b7b..8b5af140 100644
--- a/inc/headerAdmin.inc.php
+++ b/inc/headerAdmin.inc.php
@@ -194,7 +194,7 @@
/* If page requires WYSIWYG editor include TinyMCE Javascript */
if (defined('WYSIWYG') && $hesk_settings['kb_wysiwyg']) {
?>
-
+
new \v330\CalendarImprovements\AddShowStartTimeSetting(170),
171 => new \v330\AddHighlightTicketRowsSetting(171),
172 => new UpdateMigration('3.3.0', '3.2.5', 172),
+ 173 => new UpdateMigration('3.3.1', '3.3.0', 173),
);
}
\ No newline at end of file
diff --git a/internal-api/js/admin-ticket.js b/internal-api/js/admin-ticket.js
index 1364337c..81ae9c8a 100644
--- a/internal-api/js/admin-ticket.js
+++ b/internal-api/js/admin-ticket.js
@@ -20,14 +20,17 @@ $(document).ready(function() {
$editableDueDateContainer.find('#submit').click(function() {
var newDueDate = $editableDueDateContainer.find('input[type="text"][name="due-date"]').val();
+ var ticketId = $('input[type="hidden"][name="orig_id"]').val();
$.ajax({
method: 'POST',
- url: heskPath + 'internal-api/admin/calendar/',
- data: {
- trackingId: $('input[type="hidden"][name="track"]').val(),
- action: 'update-ticket',
- dueDate: newDueDate
+ url: heskPath + 'api/v1/staff/tickets/' + ticketId + '/due-date',
+ headers: {
+ 'X-Internal-Call': true,
+ 'X-HTTP-Method-Override': 'PATCH'
},
+ data: JSON.stringify({
+ dueDate: newDueDate === '' ? null : newDueDate
+ }),
success: function() {
mfhAlert.success(mfhLang.text('ticket_due_date_updated'));
$readonlyDueDateContainer.find('span#due-date').text(newDueDate == '' ? $('#lang_none').text() : newDueDate);
diff --git a/internal-api/js/manage-categories.js b/internal-api/js/manage-categories.js
index 5ea1ad59..e91836fb 100644
--- a/internal-api/js/manage-categories.js
+++ b/internal-api/js/manage-categories.js
@@ -268,7 +268,7 @@ function bindFormSubmit() {
var foregroundColor = $modal.find('input[name="foreground-color"]').val();
var manager = parseInt($modal.find('select[name="manager"]').val());
var data = {
- autoassign: $modal.find('input[name="autoassign"]').val() === 'true',
+ autoassign: $modal.find('input[name="autoassign"]:checked').val() === '1',
backgroundColor: $modal.find('input[name="background-color"]').val(),
description: $modal.find('textarea[name="description"]').val(),
displayBorder: $modal.find('input[name="display-border"]:checked').val() === '1',