Browse Source

Moved all content strings into the language file

tags/2.6.0
Mike Koch 3 years ago
parent
commit
fe78f743d1

+ 13
- 3
admin/calendar.php View File

@@ -68,7 +68,7 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
<div class="col-lg-3">
<div class="panel panel-default">
<div class="panel-heading">
<h4>Categories</h4>
<h4><?php echo $hesklang['calendar_categories']; ?></h4>
</div>
<div class="panel-body">
<ul class="list-unstyled">
@@ -90,7 +90,7 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
<div class="panel panel-default">
<div class="panel-heading">
<h4>
Calendar
<?php echo $hesklang['calendar_title_case']; ?>
<span class="nu-floatRight panel-button">
<button class="btn btn-success" id="create-event-button">
<i class="fa fa-plus-circle"></i>
@@ -472,7 +472,17 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
</div>
</div>
</div>

<div style="display: none">
<p id="lang_error_loading_events"><?php echo $hesklang['error_loading_events']; ?></p>
<p id="lang_error_deleting_event"><?php echo $hesklang['error_deleting_event']; ?></p>
<p id="lang_event_deleted"><?php echo $hesklang['event_deleted']; ?></p>
<p id="lang_event_created"><?php echo $hesklang['event_created']; ?></p>
<p id="lang_error_creating_event"><?php echo $hesklang['error_creating_event']; ?></p>
<p id="lang_event_updated"><?php echo $hesklang['event_updated']; ?></p>
<p id="lang_error_updating_event"><?php echo $hesklang['error_updating_event']; ?></p>
<p id="lang_ticket_due_date_updated"><?php echo $hesklang['ticket_due_date_updated']; ?></p>
<p id="lang_error_updating_ticket_due_date"><?php echo $hesklang['error_updating_ticket_due_date']; ?></p>
</div>
<?php

require_once(HESK_PATH . 'inc/footer.inc.php');

+ 5
- 2
calendar.php View File

@@ -64,7 +64,7 @@ require_once(HESK_PATH . 'inc/header.inc.php');
<div class="col-lg-3">
<div class="panel panel-default">
<div class="panel-heading">
<h4>Categories</h4>
<h4><?php echo $hesklang['calendar_categories']; ?></h4>
</div>
<div class="panel-body">
<ul class="list-unstyled">
@@ -86,7 +86,7 @@ require_once(HESK_PATH . 'inc/header.inc.php');
<div class="panel panel-default">
<div class="panel-heading">
<h4>
Calendar
<?php echo $hesklang['calendar_title_case']; ?>
</h4>
</div>
<div class="panel-body">
@@ -114,4 +114,7 @@ require_once(HESK_PATH . 'inc/header.inc.php');
<span></span>
</div>
</div>
</div>
<div style="display: none">
<p id="lang_error_loading_events"><?php echo $hesklang['error_loading_events']; ?></p>
</div>

+ 13
- 19
js/calendar/mods-for-hesk-calendar.js View File

@@ -23,7 +23,7 @@ $(document).ready(function() {
},
error: function(data) {
console.error(data);
$.jGrowl('An error occurred when trying to load events', { theme: 'alert-danger', closeTemplate: '' });
$.jGrowl($('#lang_error_loading_events').text(), { theme: 'alert-danger', closeTemplate: '' });
}
});
},
@@ -122,11 +122,11 @@ $(document).ready(function() {
data: data,
success: function() {
removeFromCalendar(data.id);
$.jGrowl('Event successfully deleted', { theme: 'alert-success', closeTemplate: '' });
$.jGrowl($('#lang_event_deleted').text(), { theme: 'alert-success', closeTemplate: '' });
$('#edit-event-modal').modal('hide');
},
error: function(data) {
$.jGrowl('An error occurred when trying to delete the event', { theme: 'alert-danger', closeTemplate: '' });
$.jGrowl($('#lang_error_deleting_event').text(), { theme: 'alert-danger', closeTemplate: '' });
}
});
});
@@ -166,12 +166,12 @@ $(document).ready(function() {
url: getHelpdeskUrl() + '/internal-api/admin/calendar/',
data: data,
success: function(id) {
addToCalendar(id, data, "Event successfully created");
addToCalendar(id, data, $('#lang_event_created').text());
$('#create-event-modal').modal('hide');
updateCategoryVisibility();
},
error: function(data) {
$.jGrowl('An error occurred when trying to create the event', { theme: 'alert-danger', closeTemplate: '' });
error: function() {
$.jGrowl($('#lang_error_creating_event').text(), { theme: 'alert-danger', closeTemplate: '' });
}
});
});
@@ -213,11 +213,11 @@ $(document).ready(function() {
data: data,
success: function() {
removeFromCalendar(data.id);
addToCalendar(data.id, data, "Event successfully updated");
addToCalendar(data.id, data, $('#lang_event_updated').text());
$('#edit-event-modal').modal('hide');
},
error: function(data) {
$.jGrowl('An error occurred when trying to update the event', { theme: 'alert-danger', closeTemplate: '' });
error: function() {
$.jGrowl($('#lang_error_updating_event').text(), { theme: 'alert-danger', closeTemplate: '' });
}
});
});
@@ -237,12 +237,6 @@ function removeFromCalendar(id) {

function buildEvent(id, dbObject) {
if (dbObject.type == 'TICKET') {
var endOfDay = moment(dbObject.startTime)
.set('hour', 23)
.set('minute', 59)
.set('second', 59)
.set('millisecond', 999);

return {
title: dbObject.title,
trackingId: dbObject.trackingId,
@@ -396,10 +390,10 @@ function respondToDragAndDrop(event, delta, revertFunc) {
dueDate: event.start.format('YYYY-MM-DD')
},
success: function() {
$.jGrowl('Ticket due date successfully updated', { theme: 'alert-success', closeTemplate: '' });
$.jGrowl($('#lang_ticket_due_date_updated').text(), { theme: 'alert-success', closeTemplate: '' });
},
error: function() {
$.jGrowl('An error occurred when trying to update the ticket due date', { theme: 'alert-danger', closeTemplate: '' });
$.jGrowl($('#lang_error_updating_ticket_due_date').text(), { theme: 'alert-danger', closeTemplate: '' });
revertFunc();
}
});
@@ -431,10 +425,10 @@ function respondToDragAndDrop(event, delta, revertFunc) {
url: getHelpdeskUrl() + '/internal-api/admin/calendar/',
data: data,
success: function() {
$.jGrowl('Event successfully updated', { theme: 'alert-success', closeTemplate: '' });
$.jGrowl($('#lang_event_updated').text(), { theme: 'alert-success', closeTemplate: '' });
},
error: function() {
$.jGrowl('An error occurred when trying to update the event', { theme: 'alert-danger', closeTemplate: '' });
$.jGrowl($('#lang_error_updating_event').text(), { theme: 'alert-danger', closeTemplate: '' });
revertFunc();
}
});

+ 1
- 58
js/calendar/mods-for-hesk-customer-calendar.js View File

@@ -23,7 +23,7 @@ $(document).ready(function() {
},
error: function(data) {
console.error(data);
$.jGrowl('An error occurred when trying to load events', { theme: 'alert-danger', closeTemplate: '' });
$.jGrowl($('#lang_error_loading_events').text(), { theme: 'alert-danger', closeTemplate: '' });
}
});
},
@@ -71,68 +71,11 @@ $(document).ready(function() {
}
});

$('#create-form').submit(function(e) {
e.preventDefault();

var start = $('#create-form input[name="start-date"]').val();
var end = $('#create-form input[name="end-date"]').val();
var dateFormat = 'YYYY-MM-DD';
var allDay = $('#create-form input[name="all-day"]').is(':checked');

if (!allDay) {
start += ' ' + $('#create-form input[name="start-time"]').val();
end += ' ' + $('#create-form input[name="end-time"]').val();
dateFormat = 'YYYY-MM-DD HH:mm:ss';
}

var data = {
title: $('#create-form input[name="name"]').val(),
location: $('#create-form input[name="location"]').val(),
startTime: moment(start).format(dateFormat),
endTime: moment(end).format(dateFormat),
allDay: allDay,
comments: $('#create-form textarea[name="comments"]').val(),
categoryId: $('#create-form select[name="category"]').val(),
action: 'create',
type: 'CALENDAR',
categoryColor: $('#create-form select[name="category"] :selected').attr('data-color'),
categoryName: $('#create-form select[name="category"] :selected').text().trim(),
reminderValue: $('#create-form input[name="reminder-value"]').val(),
reminderUnits: $('#create-form select[name="reminder-unit"]').val()
};

$.ajax({
method: 'POST',
url: getHelpdeskUrl() + '/internal-api/admin/calendar/',
data: data,
success: function(id) {
addToCalendar(id, data, "Event successfully created");
$('#create-event-modal').modal('hide');
updateCategoryVisibility();
},
error: function(data) {
$.jGrowl('An error occurred when trying to create the event', { theme: 'alert-danger', closeTemplate: '' });
}
});
});

$('input[name="category-toggle"]').change(updateCategoryVisibility);
});

function addToCalendar(id, event, successMessage) {
var eventObject = buildEvent(id, event);
$('#calendar').fullCalendar('renderEvent', eventObject);
$.jGrowl(successMessage, { theme: 'alert-success', closeTemplate: '' });
}

function buildEvent(id, dbObject) {
if (dbObject.type == 'TICKET') {
var endOfDay = moment(dbObject.startTime)
.set('hour', 23)
.set('minute', 59)
.set('second', 59)
.set('millisecond', 999);

return {
title: dbObject.title,
trackingId: dbObject.trackingId,

+ 9
- 0
language/en/text.php View File

@@ -72,6 +72,15 @@ $hesklang['to_title_case'] = 'To';
$hesklang['clear_for_no_due_date'] = 'Clear for no due date';
$hesklang['ticket_due_date_updated'] = 'Ticket due date successfully updated';
$hesklang['error_updating_ticket_due_date'] = 'An error occurred when trying to update the ticket due date';
$hesklang['error_loading_events'] = 'An error occurred when trying to load events';
$hesklang['error_deleting_event'] = 'An error occurred when trying to delete the event';
$hesklang['event_deleted'] = 'Event successfully deleted';
$hesklang['event_created'] = 'Event successfully created';
$hesklang['error_creating_event'] = 'An error occurred when trying to create the event';
$hesklang['event_updated'] = 'Event successfully updated';
$hesklang['error_updating_event'] = 'An error occurred when trying to update the event';
$hesklang['calendar_title_case'] = 'Calendar';
$hesklang['calendar_categories'] = 'Categories';

// ADDED OR MODIFIED IN Mods for HESK 2.5.2
$hesklang['manage_statuses'] = 'Manage Statuses';

Loading…
Cancel
Save