forked from mirrors/easyappointments
Merge branch 'develop' into bootstrap-4-and-fontawesome
This commit is contained in:
commit
33e11291bc
6 changed files with 62 additions and 25 deletions
|
@ -777,6 +777,7 @@ class Backend_api extends CI_Controller {
|
|||
->set_output(json_encode(AJAX_SUCCESS));
|
||||
}
|
||||
|
||||
$response = AJAX_SUCCESS;
|
||||
}
|
||||
catch (Exception $exception)
|
||||
{
|
||||
|
|
|
@ -545,6 +545,7 @@ class Appointments_Model extends CI_Model {
|
|||
->select('count(*) AS attendants_number')
|
||||
->from('appointments')
|
||||
->group_start()
|
||||
->group_start()
|
||||
->where('start_datetime <=', $slot_start->format('Y-m-d H:i:s'))
|
||||
->where('end_datetime >', $slot_start->format('Y-m-d H:i:s'))
|
||||
->group_end()
|
||||
|
@ -552,6 +553,7 @@ class Appointments_Model extends CI_Model {
|
|||
->where('start_datetime <', $slot_end->format('Y-m-d H:i:s'))
|
||||
->where('end_datetime >=', $slot_end->format('Y-m-d H:i:s'))
|
||||
->group_end()
|
||||
->group_end()
|
||||
->where('id_services', $service_id)
|
||||
->get()
|
||||
->row()
|
||||
|
|
|
@ -270,6 +270,21 @@ window.BackendCalendarDefaultView = window.BackendCalendarDefaultView || {};
|
|||
return (result > 500) ? result : 500; // Minimum height is 500px
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the event notes for the popup widget.
|
||||
*
|
||||
* @param {Event} event
|
||||
*/
|
||||
function getEventNotes(event) {
|
||||
if (!event.data || !event.data.notes) {
|
||||
return '-';
|
||||
}
|
||||
|
||||
var notes = event.data.notes;
|
||||
|
||||
return notes.length > 100 ? notes.substring(0, 100) + '...' : notes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Calendar Event "Click" Callback
|
||||
*
|
||||
|
@ -296,11 +311,6 @@ window.BackendCalendarDefaultView = window.BackendCalendarDefaultView || {};
|
|||
&& GlobalVariables.user.privileges.appointments.delete === true)
|
||||
? 'mr-2' : 'd-none'; // Same value at the time.
|
||||
|
||||
var notes = '';
|
||||
if (event.data) { // Only custom unavailable periods have notes.
|
||||
notes = '<strong>Notes</strong> ' + event.data.notes;
|
||||
}
|
||||
|
||||
$html = $('<div/>', {
|
||||
'html': [
|
||||
$('<strong/>', {
|
||||
|
@ -321,8 +331,11 @@ window.BackendCalendarDefaultView = window.BackendCalendarDefaultView || {};
|
|||
}),
|
||||
$('<br/>'),
|
||||
|
||||
$('<strong/>', {
|
||||
'text': EALang.notes
|
||||
}),
|
||||
$('<span/>', {
|
||||
'text': notes
|
||||
'text': getEventNotes(event)
|
||||
}),
|
||||
$('<br/>'),
|
||||
|
||||
|
@ -502,6 +515,14 @@ window.BackendCalendarDefaultView = window.BackendCalendarDefaultView || {};
|
|||
}),
|
||||
$('<br/>'),
|
||||
|
||||
$('<strong/>', {
|
||||
'text': EALang.notes
|
||||
}),
|
||||
$('<span/>', {
|
||||
'text': getEventNotes(event)
|
||||
}),
|
||||
$('<br/>'),
|
||||
|
||||
$('<hr/>'),
|
||||
|
||||
$('<div/>', {
|
||||
|
|
|
@ -997,6 +997,21 @@ window.BackendCalendarTableView = window.BackendCalendarTableView || {};
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the event notes for the popup widget.
|
||||
*
|
||||
* @param {Event} event
|
||||
*/
|
||||
function getEventNotes(event) {
|
||||
if (!event.data || !event.data.notes) {
|
||||
return '-';
|
||||
}
|
||||
|
||||
var notes = event.data.notes;
|
||||
|
||||
return notes.length > 100 ? notes.substring(0, 100) + '...' : notes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Calendar Event "Click" Callback
|
||||
*
|
||||
|
@ -1023,11 +1038,6 @@ window.BackendCalendarTableView = window.BackendCalendarTableView || {};
|
|||
&& GlobalVariables.user.privileges.appointments.delete === true)
|
||||
? 'mr-2' : 'd-none'; // Same value at the time.
|
||||
|
||||
var notes = '';
|
||||
if (event.data) { // Only custom unavailable periods have notes.
|
||||
notes = '<strong>Notes</strong> ' + event.data.notes;
|
||||
}
|
||||
|
||||
$html = $('<div/>', {
|
||||
'html': [
|
||||
$('<strong/>', {
|
||||
|
@ -1046,8 +1056,11 @@ window.BackendCalendarTableView = window.BackendCalendarTableView || {};
|
|||
}),
|
||||
$('<br/>'),
|
||||
|
||||
$('<strong/>', {
|
||||
'text': EALang.notes
|
||||
}),
|
||||
$('<span/>', {
|
||||
'text': notes
|
||||
'text': getEventNotes(event)
|
||||
}),
|
||||
$('<br/>'),
|
||||
|
||||
|
@ -1212,6 +1225,14 @@ window.BackendCalendarTableView = window.BackendCalendarTableView || {};
|
|||
}),
|
||||
$('<br/>'),
|
||||
|
||||
$('<strong/>', {
|
||||
'text': EALang.notes
|
||||
}),
|
||||
$('<span/>', {
|
||||
'text': getEventNotes(event)
|
||||
}),
|
||||
$('<br/>'),
|
||||
|
||||
$('<hr/>'),
|
||||
|
||||
$('<div/>', {
|
||||
|
|
|
@ -58,7 +58,7 @@ window.BackendCalendarUnavailabilitiesModal = window.BackendCalendarUnavailabili
|
|||
unavailable.id = $dialog.find('#unavailable-id').val();
|
||||
}
|
||||
|
||||
var successCallback = function (response) {
|
||||
var successCallback = function () {
|
||||
// Display success message to the user.
|
||||
Backend.displayNotification(EALang.unavailable_saved);
|
||||
|
||||
|
@ -68,15 +68,7 @@ window.BackendCalendarUnavailabilitiesModal = window.BackendCalendarUnavailabili
|
|||
$('#select-filter-item').trigger('change');
|
||||
};
|
||||
|
||||
var errorCallback = function (jqXHR, textStatus, errorThrown) {
|
||||
GeneralFunctions.displayMessageBox('Communication Error', 'Unfortunately ' +
|
||||
'the operation could not complete due to server communication errors.');
|
||||
|
||||
$dialog.find('.modal-message').txt(EALang.service_communication_error);
|
||||
$dialog.find('.modal-message').addClass('alert-danger').removeClass('d-none');
|
||||
};
|
||||
|
||||
BackendCalendarApi.saveUnavailable(unavailable, successCallback, errorCallback);
|
||||
BackendCalendarApi.saveUnavailable(unavailable, successCallback, GeneralFunctions.ajaxFailureHandler);
|
||||
});
|
||||
|
||||
/**
|
||||
|
|
|
@ -51,7 +51,7 @@ $(function () {
|
|||
$alert
|
||||
.text('Easy!Appointments has been successfully installed!')
|
||||
.addClass('alert-success')
|
||||
.show();
|
||||
.removeClass('hidden');
|
||||
|
||||
setTimeout(function () {
|
||||
window.location.href = GlobalVariables.baseUrl + '/index.php/backend';
|
||||
|
@ -71,7 +71,7 @@ $(function () {
|
|||
try {
|
||||
$alert
|
||||
.removeClass('alert-danger')
|
||||
.hide();
|
||||
.addClass('hidden');
|
||||
$('input').closest('.form-group').removeClass('has-error');
|
||||
|
||||
// Check for empty fields.
|
||||
|
@ -116,7 +116,7 @@ $(function () {
|
|||
$alert
|
||||
.addClass('alert-danger')
|
||||
.text(error.message)
|
||||
.show();
|
||||
.removeClass('hidden');
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue