Skip to content
This repository has been archived by the owner on Sep 14, 2020. It is now read-only.

Commit

Permalink
Merge branch 'bug-fixes' into 'master'
Browse files Browse the repository at this point in the history
3.3.1 Update

See merge request mike-koch/Mods-for-HESK!96
  • Loading branch information
mike-koch committed Mar 23, 2018
2 parents 62c1661 + 306c2d3 commit e88bb35
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 19 deletions.
4 changes: 2 additions & 2 deletions admin/service_messages.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,8 @@
<form id="service-message" class="form-horizontal" data-toggle="validator" method="post">
<div class="modal-body">
<ul class="nav nav-tabs" role="tablist">
<li role="presentation" class="active"><a href="#sm-contents" role="tab" data-toggle="tab">Contents</a></li>
<li role="presentation"><a href="#properties" role="tab" data-toggle="tab">Properties</a></li>
<li role="presentation" class="active"><a href="#sm-contents" role="tab" data-toggle="tab"><?php echo $hesklang['kb_content']; ?></a></li>
<li role="presentation"><a href="#properties" role="tab" data-toggle="tab"><?php echo $hesklang['properties']; ?></a></li>
</ul><br>
<div class="tab-content">
<div role="tabpanel" class="tab-pane active" id="sm-contents">
Expand Down
10 changes: 9 additions & 1 deletion api/Controllers/Tickets/StaffTicketController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion build.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php

// Define the current build
define('MODS_FOR_HESK_BUILD', 50);
define('MODS_FOR_HESK_BUILD', 51);
16 changes: 8 additions & 8 deletions calendar.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,11 @@
<p id="setting_default_view"><?php echo $modsForHesk_settings['default_calendar_view']; ?></p>
<p id="setting_first_day_of_week"><?php echo $modsForHesk_settings['first_day_of_week']; ?></p>
<p id="setting_show_start_time"><?php echo $modsForHesk_settings['calendar_show_start_time']; ?></p>
</div>
<?php
$businessHoursRs = hesk_dbQuery("SELECT * FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "mfh_calendar_business_hours`");
while ($row = hesk_dbFetchAssoc($businessHoursRs)):
?>
<p id="business_hours_<?php echo $row['day_of_week']; ?>_start"><?php echo $row['start_time']; ?></p>
<p id="business_hours_<?php echo $row['day_of_week']; ?>_end"><?php echo $row['end_time']; ?></p>
<?php endwhile; ?>
<?php
$businessHoursRs = hesk_dbQuery("SELECT * FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "mfh_calendar_business_hours`");
while ($row = hesk_dbFetchAssoc($businessHoursRs)):
?>
<p id="business_hours_<?php echo $row['day_of_week']; ?>_start"><?php echo $row['start_time']; ?></p>
<p id="business_hours_<?php echo $row['day_of_week']; ?>_end"><?php echo $row['end_time']; ?></p>
<?php endwhile; ?>
</div>
2 changes: 1 addition & 1 deletion inc/headerAdmin.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@
/* If page requires WYSIWYG editor include TinyMCE Javascript */
if (defined('WYSIWYG') && $hesk_settings['kb_wysiwyg']) {
?>
<script type="text/javascript" src="<?php echo HESK_PATH; ?>inc/tiny_mce/3.5.11/tiny_mce.js"></script>
<script type="text/javascript" src="<?php echo HESK_PATH; ?>inc/tiny_mce/3.5.12/tiny_mce.js"></script>
<?php
}

Expand Down
1 change: 1 addition & 0 deletions install/migrations/core.php
Original file line number Diff line number Diff line change
Expand Up @@ -228,5 +228,6 @@ function getAllMigrations() {
170 => 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),
);
}
13 changes: 8 additions & 5 deletions internal-api/js/admin-ticket.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion internal-api/js/manage-categories.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit e88bb35

Please sign in to comment.