2015-07-20 22:41:24 +03:00
|
|
|
/* ----------------------------------------------------------------------------
|
|
|
|
* Easy!Appointments - Open Source Web Scheduler
|
2015-10-05 01:31:06 +03:00
|
|
|
*
|
2015-07-20 22:41:24 +03:00
|
|
|
* @package EasyAppointments
|
|
|
|
* @author A.Tselegidis <alextselegidis@gmail.com>
|
2020-03-11 12:10:59 +03:00
|
|
|
* @copyright Copyright (c) 2013 - 2020, Alex Tselegidis
|
2015-10-05 01:31:06 +03:00
|
|
|
* @license http://opensource.org/licenses/GPL-3.0 - GPLv3
|
2015-07-20 22:41:24 +03:00
|
|
|
* @link http://easyappointments.org
|
|
|
|
* @since v1.0.0
|
|
|
|
* ---------------------------------------------------------------------------- */
|
|
|
|
|
2018-01-23 12:08:37 +03:00
|
|
|
(function () {
|
2016-04-24 20:28:33 +03:00
|
|
|
|
|
|
|
'use strict';
|
|
|
|
|
2013-09-25 18:43:17 +03:00
|
|
|
/**
|
2016-05-14 13:28:42 +03:00
|
|
|
* Class WorkingPlan
|
|
|
|
*
|
2016-04-24 20:28:33 +03:00
|
|
|
* Contains the working plan functionality. The working plan DOM elements must be same
|
|
|
|
* in every page this class is used.
|
2015-10-05 01:31:06 +03:00
|
|
|
*
|
2016-04-24 20:28:33 +03:00
|
|
|
* @class WorkingPlan
|
2013-09-25 18:43:17 +03:00
|
|
|
*/
|
2018-01-23 12:08:37 +03:00
|
|
|
var WorkingPlan = function () {
|
2016-04-24 20:28:33 +03:00
|
|
|
/**
|
|
|
|
* This flag is used when trying to cancel row editing. It is
|
|
|
|
* true only whenever the user presses the cancel button.
|
|
|
|
*
|
2016-05-14 13:28:42 +03:00
|
|
|
* @type {Boolean}
|
2016-04-24 20:28:33 +03:00
|
|
|
*/
|
|
|
|
this.enableCancel = false;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This flag determines whether the jeditables are allowed to submit. It is
|
|
|
|
* true only whenever the user presses the save button.
|
|
|
|
*
|
2016-05-14 13:28:42 +03:00
|
|
|
* @type {Boolean}
|
2016-04-24 20:28:33 +03:00
|
|
|
*/
|
|
|
|
this.enableSubmit = false;
|
|
|
|
};
|
2015-10-05 01:31:06 +03:00
|
|
|
|
2013-09-25 18:43:17 +03:00
|
|
|
/**
|
2016-04-24 20:28:33 +03:00
|
|
|
* Setup the dom elements of a given working plan.
|
2015-10-05 01:31:06 +03:00
|
|
|
*
|
2016-05-14 13:28:42 +03:00
|
|
|
* @param {Object} workingPlan Contains the working hours and breaks for each day of the week.
|
2013-09-25 18:43:17 +03:00
|
|
|
*/
|
2018-01-23 12:08:37 +03:00
|
|
|
WorkingPlan.prototype.setup = function (workingPlan) {
|
2018-07-06 02:21:24 +03:00
|
|
|
var fDaynum = GeneralFunctions.getWeekDayId(GlobalVariables.firstWeekday);
|
2020-04-27 21:14:20 +03:00
|
|
|
var workingPlanSorted = GeneralFunctions.sortWeekDictionary(workingPlan,fDaynum);
|
2018-07-06 02:21:24 +03:00
|
|
|
|
|
|
|
$('.working-plan tbody').empty();
|
|
|
|
$('.breaks tbody').empty();
|
2020-03-10 22:32:53 +03:00
|
|
|
|
2018-07-06 02:21:24 +03:00
|
|
|
// Build working plan day list starting with the first weekday as set in the General settings
|
2018-06-26 00:53:12 +03:00
|
|
|
$.each(workingPlanSorted, function (index, workingDay) {
|
2018-07-06 02:21:24 +03:00
|
|
|
|
|
|
|
var day = this.convertValueToDay(index);
|
2020-04-27 21:14:20 +03:00
|
|
|
var dayTranslatedName = GeneralFunctions.upperCaseFirstLetter(day)
|
2020-03-10 22:32:53 +03:00
|
|
|
|
2018-07-06 02:21:24 +03:00
|
|
|
var tr =
|
|
|
|
'<tr>' +
|
|
|
|
'<td>' +
|
|
|
|
'<div class="checkbox">' +
|
2020-04-27 21:14:20 +03:00
|
|
|
'<label> <input type="checkbox" id="' + index + '">' + dayTranslatedName + '</label>' +
|
2020-03-10 22:32:53 +03:00
|
|
|
'</div>' +
|
2018-07-06 02:21:24 +03:00
|
|
|
'</td>' +
|
|
|
|
'<td><input id="'+index+'-start" class="work-start form-control input-sm"></td>' +
|
|
|
|
'<td><input id="'+index+'-end" class="work-end form-control input-sm"></td>' +
|
|
|
|
'</tr>';
|
|
|
|
|
2020-03-10 22:32:53 +03:00
|
|
|
$('.working-plan tbody').append(tr);
|
2018-07-06 02:21:24 +03:00
|
|
|
|
2020-05-06 20:15:11 +03:00
|
|
|
if (workingDay) {
|
2016-04-24 20:28:33 +03:00
|
|
|
$('#' + index).prop('checked', true);
|
2019-06-08 17:48:24 +03:00
|
|
|
$('#' + index + '-start').val(Date.parse(workingDay.start).toString(GlobalVariables.timeFormat === 'regular' ? 'h:mm tt' : 'HH:mm').toUpperCase());
|
2018-03-08 16:55:51 +03:00
|
|
|
$('#' + index + '-end').val(Date.parse(workingDay.end).toString(GlobalVariables.timeFormat === 'regular' ? 'h:mm tt' : 'HH:mm').toUpperCase());
|
2016-04-24 20:28:33 +03:00
|
|
|
|
2018-07-06 02:21:24 +03:00
|
|
|
// Sort day's breaks according to the starting hour
|
|
|
|
workingDay.breaks.sort(function (break1, break2) {
|
|
|
|
// We can do a direct string comparison since we have time based on 24 hours clock.
|
|
|
|
return (break1.start).localeCompare(break2.start);
|
|
|
|
});
|
|
|
|
|
2016-04-24 20:28:33 +03:00
|
|
|
// Add the day's breaks on the breaks table.
|
2018-01-23 12:08:37 +03:00
|
|
|
$.each(workingDay.breaks, function (i, brk) {
|
2016-04-24 20:28:33 +03:00
|
|
|
|
2018-07-06 02:21:24 +03:00
|
|
|
tr =
|
2018-01-23 12:08:37 +03:00
|
|
|
'<tr>' +
|
2020-04-27 21:14:20 +03:00
|
|
|
'<td class="break-day editable">' + dayTranslatedName + '</td>' +
|
2018-03-08 16:55:51 +03:00
|
|
|
'<td class="break-start editable">' + Date.parse(brk.start).toString(GlobalVariables.timeFormat === 'regular' ? 'h:mm tt' : 'HH:mm').toUpperCase() + '</td>' +
|
|
|
|
'<td class="break-end editable">' + Date.parse(brk.end).toString(GlobalVariables.timeFormat === 'regular' ? 'h:mm tt' : 'HH:mm').toUpperCase() + '</td>' +
|
2018-01-23 12:08:37 +03:00
|
|
|
'<td>' +
|
|
|
|
'<button type="button" class="btn btn-default btn-sm edit-break" title="' + EALang.edit + '">' +
|
|
|
|
'<span class="glyphicon glyphicon-pencil"></span>' +
|
|
|
|
'</button>' +
|
|
|
|
'<button type="button" class="btn btn-default btn-sm delete-break" title="' + EALang.delete + '">' +
|
|
|
|
'<span class="glyphicon glyphicon-remove"></span>' +
|
|
|
|
'</button>' +
|
|
|
|
'<button type="button" class="btn btn-default btn-sm save-break hidden" title="' + EALang.save + '">' +
|
|
|
|
'<span class="glyphicon glyphicon-ok"></span>' +
|
|
|
|
'</button>' +
|
|
|
|
'<button type="button" class="btn btn-default btn-sm cancel-break hidden" title="' + EALang.cancel + '">' +
|
|
|
|
'<span class="glyphicon glyphicon-ban-circle"></span>' +
|
|
|
|
'</button>' +
|
|
|
|
'</td>' +
|
|
|
|
'</tr>';
|
2016-10-06 21:40:20 +03:00
|
|
|
$('.breaks tbody').append(tr);
|
2016-04-24 20:28:33 +03:00
|
|
|
}.bind(this));
|
|
|
|
} else {
|
|
|
|
$('#' + index).prop('checked', false);
|
|
|
|
$('#' + index + '-start').prop('disabled', true);
|
|
|
|
$('#' + index + '-end').prop('disabled', true);
|
|
|
|
}
|
|
|
|
}.bind(this));
|
2013-09-25 18:43:17 +03:00
|
|
|
|
2016-04-24 20:28:33 +03:00
|
|
|
// Make break cells editable.
|
|
|
|
this.editableBreakDay($('.breaks .break-day'));
|
|
|
|
this.editableBreakTime($('.breaks').find('.break-start, .break-end'));
|
|
|
|
};
|
2013-09-25 18:43:17 +03:00
|
|
|
|
2018-04-12 16:03:46 +03:00
|
|
|
/**
|
|
|
|
* Setup the dom elements of a given extra working plan day.
|
|
|
|
*
|
|
|
|
* @param {Object} extraWorkingPlan Contains the extra working day.
|
|
|
|
*/
|
|
|
|
WorkingPlan.prototype.setupExtraPeriods = function (extraWorkingPlan) {
|
|
|
|
$.each(extraWorkingPlan, function (index, extraWorkingDay) {
|
2020-05-06 20:15:11 +03:00
|
|
|
if (extraWorkingDay) {
|
2018-04-12 16:03:46 +03:00
|
|
|
|
|
|
|
$('#' + index).prop('checked', true);
|
2018-04-12 17:15:18 +03:00
|
|
|
$('#' + index + '-start').val(Date.parse(extraWorkingDay.start).toString(GlobalVariables.timeFormat === 'regular' ? 'h:mm tt' : 'HH:mm').toUpperCase());
|
|
|
|
$('#' + index + '-end').val(Date.parse(extraWorkingDay.end).toString(GlobalVariables.timeFormat === 'regular' ? 'h:mm tt' : 'HH:mm').toUpperCase());
|
2018-04-12 16:03:46 +03:00
|
|
|
|
|
|
|
var day = GeneralFunctions.formatDate(Date.parse(index), GlobalVariables.dateFormat, false);
|
|
|
|
|
|
|
|
var tr =
|
|
|
|
'<tr>' +
|
|
|
|
'<td class="extra-day editable">' + day + '</td>' +
|
2020-03-10 22:09:31 +03:00
|
|
|
'<td class="extra-start editable">' + Date.parse(extraWorkingDay.start).toString(GlobalVariables.timeFormat === 'regular' ? 'h:mm tt' : 'HH:mm').toUpperCase().toUpperCase() + '</td>' +
|
|
|
|
'<td class="extra-end editable">' + Date.parse(extraWorkingDay.end).toString(GlobalVariables.timeFormat === 'regular' ? 'h:mm tt' : 'HH:mm').toUpperCase().toUpperCase() + '</td>' +
|
2018-04-12 16:03:46 +03:00
|
|
|
'<td>' +
|
|
|
|
'<button type="button" class="btn btn-default btn-sm edit-extra" title="' + EALang.edit + '">' +
|
|
|
|
'<span class="glyphicon glyphicon-pencil"></span>' +
|
|
|
|
'</button>' +
|
|
|
|
'<button type="button" class="btn btn-default btn-sm delete-extra" title="' + EALang.delete + '">' +
|
|
|
|
'<span class="glyphicon glyphicon-remove"></span>' +
|
|
|
|
'</button>' +
|
|
|
|
'<button type="button" class="btn btn-default btn-sm save-extra hidden" title="' + EALang.save + '">' +
|
|
|
|
'<span class="glyphicon glyphicon-ok"></span>' +
|
|
|
|
'</button>' +
|
|
|
|
'<button type="button" class="btn btn-default btn-sm cancel-extra hidden" title="' + EALang.cancel + '">' +
|
|
|
|
'<span class="glyphicon glyphicon-ban-circle"></span>' +
|
|
|
|
'</button>' +
|
|
|
|
'</td>' +
|
|
|
|
'</tr>';
|
|
|
|
$('.extra-periods tbody').append(tr);
|
|
|
|
} else {
|
|
|
|
$('#' + index).prop('checked', false);
|
|
|
|
$('#' + index + '-start').prop('disabled', true);
|
|
|
|
$('#' + index + '-end').prop('disabled', true);
|
|
|
|
}
|
|
|
|
}.bind(this));
|
|
|
|
|
|
|
|
// Make break cells editable.
|
|
|
|
this.editableBreakTime($('.extra-periods .extra-day'));
|
|
|
|
this.editableBreakTime($('.extra-periods').find('.extra-start, .extra-end'));
|
|
|
|
};
|
|
|
|
|
2013-09-25 18:43:17 +03:00
|
|
|
/**
|
2016-05-14 13:28:42 +03:00
|
|
|
* Enable editable break day.
|
|
|
|
*
|
2016-04-24 20:28:33 +03:00
|
|
|
* This method makes editable the break day cells.
|
2015-10-05 01:31:06 +03:00
|
|
|
*
|
2016-05-14 13:28:42 +03:00
|
|
|
* @param {Object} $selector The jquery selector ready for use.
|
2013-09-25 18:43:17 +03:00
|
|
|
*/
|
2018-01-23 12:08:37 +03:00
|
|
|
WorkingPlan.prototype.editableBreakDay = function ($selector) {
|
2016-04-24 20:28:33 +03:00
|
|
|
var weekDays = {};
|
2017-11-16 01:19:17 +03:00
|
|
|
weekDays[EALang.sunday] = EALang.sunday; //'Sunday';
|
2017-09-11 17:09:15 +03:00
|
|
|
weekDays[EALang.monday] = EALang.monday; //'Monday';
|
|
|
|
weekDays[EALang.tuesday] = EALang.tuesday; //'Tuesday';
|
|
|
|
weekDays[EALang.wednesday] = EALang.wednesday; //'Wednesday';
|
|
|
|
weekDays[EALang.thursday] = EALang.thursday; //'Thursday';
|
|
|
|
weekDays[EALang.friday] = EALang.friday; //'Friday';
|
|
|
|
weekDays[EALang.saturday] = EALang.saturday; //'Saturday';
|
2016-04-24 20:28:33 +03:00
|
|
|
|
2018-01-23 12:08:37 +03:00
|
|
|
$selector.editable(function (value, settings) {
|
2016-04-24 20:28:33 +03:00
|
|
|
return value;
|
|
|
|
}, {
|
|
|
|
type: 'select',
|
|
|
|
data: weekDays,
|
|
|
|
event: 'edit',
|
|
|
|
height: '30px',
|
|
|
|
submit: '<button type="button" class="hidden submit-editable">Submit</button>',
|
|
|
|
cancel: '<button type="button" class="hidden cancel-editable">Cancel</button>',
|
|
|
|
onblur: 'ignore',
|
2018-01-23 12:08:37 +03:00
|
|
|
onreset: function (settings, td) {
|
2016-04-24 20:28:33 +03:00
|
|
|
if (!this.enableCancel) {
|
|
|
|
return false; // disable ESC button
|
|
|
|
}
|
|
|
|
}.bind(this),
|
2018-01-23 12:08:37 +03:00
|
|
|
onsubmit: function (settings, td) {
|
2016-04-24 20:28:33 +03:00
|
|
|
if (!this.enableSubmit) {
|
|
|
|
return false; // disable Enter button
|
|
|
|
}
|
|
|
|
}.bind(this)
|
|
|
|
});
|
|
|
|
};
|
2013-09-25 18:43:17 +03:00
|
|
|
|
|
|
|
/**
|
2016-05-14 13:28:42 +03:00
|
|
|
* Enable editable break time.
|
|
|
|
*
|
2016-04-24 20:28:33 +03:00
|
|
|
* This method makes editable the break time cells.
|
2015-10-05 01:31:06 +03:00
|
|
|
*
|
2016-05-14 13:28:42 +03:00
|
|
|
* @param {Object} $selector The jquery selector ready for use.
|
2013-09-25 18:43:17 +03:00
|
|
|
*/
|
2018-01-23 12:08:37 +03:00
|
|
|
WorkingPlan.prototype.editableBreakTime = function ($selector) {
|
|
|
|
$selector.editable(function (value, settings) {
|
2016-04-24 20:28:33 +03:00
|
|
|
// Do not return the value because the user needs to press the "Save" button.
|
|
|
|
return value;
|
|
|
|
}, {
|
|
|
|
event: 'edit',
|
2017-10-31 14:16:45 +03:00
|
|
|
height: '30px',
|
2016-04-24 20:28:33 +03:00
|
|
|
submit: '<button type="button" class="hidden submit-editable">Submit</button>',
|
|
|
|
cancel: '<button type="button" class="hidden cancel-editable">Cancel</button>',
|
|
|
|
onblur: 'ignore',
|
2018-01-23 12:08:37 +03:00
|
|
|
onreset: function (settings, td) {
|
2016-04-24 20:28:33 +03:00
|
|
|
if (!this.enableCancel) {
|
|
|
|
return false; // disable ESC button
|
|
|
|
}
|
|
|
|
}.bind(this),
|
2018-01-23 12:08:37 +03:00
|
|
|
onsubmit: function (settings, td) {
|
2016-04-24 20:28:33 +03:00
|
|
|
if (!this.enableSubmit) {
|
|
|
|
return false; // disable Enter button
|
|
|
|
}
|
|
|
|
}.bind(this)
|
|
|
|
});
|
|
|
|
};
|
2013-09-25 18:43:17 +03:00
|
|
|
|
|
|
|
/**
|
2016-04-24 20:28:33 +03:00
|
|
|
* Binds the event handlers for the working plan dom elements.
|
2013-09-25 18:43:17 +03:00
|
|
|
*/
|
2018-01-23 12:08:37 +03:00
|
|
|
WorkingPlan.prototype.bindEventHandlers = function () {
|
2016-04-24 20:28:33 +03:00
|
|
|
/**
|
|
|
|
* Event: Day Checkbox "Click"
|
|
|
|
*
|
|
|
|
* Enable or disable the time selection for each day.
|
|
|
|
*/
|
2020-05-06 20:15:11 +03:00
|
|
|
$('.working-plan tbody').on( "click", "input:checkbox", function () {
|
2016-04-24 20:28:33 +03:00
|
|
|
var id = $(this).attr('id');
|
|
|
|
|
2020-05-06 20:15:11 +03:00
|
|
|
if ($(this).prop('checked') === true) {
|
2018-04-12 17:15:18 +03:00
|
|
|
$('#' + id + '-start').prop('disabled', false).val('9:00 AM');
|
|
|
|
$('#' + id + '-end').prop('disabled', false).val('6:00 PM');
|
2016-04-24 20:28:33 +03:00
|
|
|
} else {
|
|
|
|
$('#' + id + '-start').prop('disabled', true).val('');
|
|
|
|
$('#' + id + '-end').prop('disabled', true).val('');
|
|
|
|
}
|
2013-09-25 18:43:17 +03:00
|
|
|
});
|
|
|
|
|
2016-04-24 20:28:33 +03:00
|
|
|
/**
|
|
|
|
* Event: Add Break Button "Click"
|
|
|
|
*
|
|
|
|
* A new row is added on the table and the user can enter the new break
|
|
|
|
* data. After that he can either press the save or cancel button.
|
|
|
|
*/
|
2018-01-23 12:08:37 +03:00
|
|
|
$('.add-break').click(function () {
|
2016-04-24 20:28:33 +03:00
|
|
|
var tr =
|
2018-01-23 12:08:37 +03:00
|
|
|
'<tr>' +
|
|
|
|
'<td class="break-day editable">' + EALang.sunday + '</td>' +
|
2018-04-12 17:15:18 +03:00
|
|
|
'<td class="break-start editable">9:00 AM</td>' +
|
|
|
|
'<td class="break-end editable">10:00 AM</td>' +
|
2018-01-23 12:08:37 +03:00
|
|
|
'<td>' +
|
|
|
|
'<button type="button" class="btn btn-default btn-sm edit-break" title="' + EALang.edit + '">' +
|
|
|
|
'<span class="glyphicon glyphicon-pencil"></span>' +
|
|
|
|
'</button>' +
|
|
|
|
'<button type="button" class="btn btn-default btn-sm delete-break" title="' + EALang.delete + '">' +
|
|
|
|
'<span class="glyphicon glyphicon-remove"></span>' +
|
|
|
|
'</button>' +
|
|
|
|
'<button type="button" class="btn btn-default btn-sm save-break hidden" title="' + EALang.save + '">' +
|
|
|
|
'<span class="glyphicon glyphicon-ok"></span>' +
|
|
|
|
'</button>' +
|
|
|
|
'<button type="button" class="btn btn-default btn-sm cancel-break hidden" title="' + EALang.cancel + '">' +
|
|
|
|
'<span class="glyphicon glyphicon-ban-circle"></span>' +
|
|
|
|
'</button>' +
|
|
|
|
'</td>' +
|
|
|
|
'</tr>';
|
2016-04-24 20:28:33 +03:00
|
|
|
$('.breaks').prepend(tr);
|
|
|
|
|
|
|
|
// Bind editable and event handlers.
|
|
|
|
tr = $('.breaks tr')[1];
|
|
|
|
this.editableBreakDay($(tr).find('.break-day'));
|
|
|
|
this.editableBreakTime($(tr).find('.break-start, .break-end'));
|
|
|
|
$(tr).find('.edit-break').trigger('click');
|
|
|
|
$('.add-break').prop('disabled', true);
|
|
|
|
}.bind(this));
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Event: Edit Break Button "Click"
|
|
|
|
*
|
|
|
|
* Enables the row editing for the "Breaks" table rows.
|
|
|
|
*/
|
2018-01-23 12:08:37 +03:00
|
|
|
$(document).on('click', '.edit-break', function () {
|
2016-04-24 20:28:33 +03:00
|
|
|
// Reset previous editable tds
|
|
|
|
var $previousEdt = $(this).closest('table').find('.editable').get();
|
2018-01-23 12:08:37 +03:00
|
|
|
$.each($previousEdt, function (index, editable) {
|
2020-05-06 20:15:11 +03:00
|
|
|
if (editable.reset) {
|
2016-05-14 13:28:42 +03:00
|
|
|
editable.reset();
|
2016-04-24 20:28:33 +03:00
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
// Make all cells in current row editable.
|
|
|
|
$(this).parent().parent().children().trigger('edit');
|
|
|
|
$(this).parent().parent().find('.break-start input, .break-end input').timepicker({
|
2018-03-08 16:55:51 +03:00
|
|
|
timeFormat: GlobalVariables.timeFormat === 'regular' ? 'h:mm tt' : 'HH:mm',
|
2017-09-11 17:09:15 +03:00
|
|
|
currentText: EALang.now,
|
|
|
|
closeText: EALang.close,
|
|
|
|
timeOnlyTitle: EALang.select_time,
|
|
|
|
timeText: EALang.time,
|
|
|
|
hourText: EALang.hour,
|
|
|
|
minuteText: EALang.minutes
|
2016-04-24 20:28:33 +03:00
|
|
|
});
|
|
|
|
$(this).parent().parent().find('.break-day select').focus();
|
|
|
|
|
|
|
|
// Show save - cancel buttons.
|
|
|
|
$(this).closest('table').find('.edit-break, .delete-break').addClass('hidden');
|
|
|
|
$(this).parent().find('.save-break, .cancel-break').removeClass('hidden');
|
2017-10-31 14:16:45 +03:00
|
|
|
$(this).closest('tr').find('select,input:text').addClass('form-control input-sm')
|
2016-04-24 20:28:33 +03:00
|
|
|
|
|
|
|
$('.add-break').prop('disabled', true);
|
2013-12-20 19:44:44 +02:00
|
|
|
});
|
2013-09-25 18:43:17 +03:00
|
|
|
|
2016-04-24 20:28:33 +03:00
|
|
|
/**
|
|
|
|
* Event: Delete Break Button "Click"
|
|
|
|
*
|
|
|
|
* Removes the current line from the "Breaks" table.
|
|
|
|
*/
|
2018-01-23 12:08:37 +03:00
|
|
|
$(document).on('click', '.delete-break', function () {
|
|
|
|
$(this).parent().parent().remove();
|
2016-04-24 20:28:33 +03:00
|
|
|
});
|
2015-10-05 01:31:06 +03:00
|
|
|
|
2016-04-24 20:28:33 +03:00
|
|
|
/**
|
|
|
|
* Event: Cancel Break Button "Click"
|
|
|
|
*
|
|
|
|
* Bring the ".breaks" table back to its initial state.
|
2016-05-14 13:28:42 +03:00
|
|
|
*
|
|
|
|
* @param {jQuery.Event} e
|
2016-04-24 20:28:33 +03:00
|
|
|
*/
|
2018-01-23 12:08:37 +03:00
|
|
|
$(document).on('click', '.cancel-break', function (e) {
|
2016-04-24 20:28:33 +03:00
|
|
|
var element = e.target;
|
2016-10-23 22:52:36 +03:00
|
|
|
var $modifiedRow = $(element).closest('tr');
|
2016-04-24 20:28:33 +03:00
|
|
|
this.enableCancel = true;
|
2016-10-23 22:52:36 +03:00
|
|
|
$modifiedRow.find('.cancel-editable').trigger('click');
|
2016-04-24 20:28:33 +03:00
|
|
|
this.enableCancel = false;
|
|
|
|
|
|
|
|
$(element).closest('table').find('.edit-break, .delete-break').removeClass('hidden');
|
2016-10-23 22:52:36 +03:00
|
|
|
$modifiedRow.find('.save-break, .cancel-break').addClass('hidden');
|
2016-04-24 20:28:33 +03:00
|
|
|
$('.add-break').prop('disabled', false);
|
|
|
|
}.bind(this));
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Event: Save Break Button "Click"
|
|
|
|
*
|
|
|
|
* Save the editable values and restore the table to its initial state.
|
2016-05-14 13:28:42 +03:00
|
|
|
*
|
|
|
|
* @param {jQuery.Event} e
|
2016-04-24 20:28:33 +03:00
|
|
|
*/
|
2018-01-23 12:08:37 +03:00
|
|
|
$(document).on('click', '.save-break', function (e) {
|
2016-04-24 20:28:33 +03:00
|
|
|
// Break's start time must always be prior to break's end.
|
|
|
|
var element = e.target,
|
2016-10-23 22:52:36 +03:00
|
|
|
$modifiedRow = $(element).closest('tr'),
|
|
|
|
start = Date.parse($modifiedRow.find('.break-start input').val()),
|
|
|
|
end = Date.parse($modifiedRow.find('.break-end input').val());
|
2016-10-21 02:37:42 +03:00
|
|
|
|
2016-04-24 20:28:33 +03:00
|
|
|
if (start > end) {
|
2018-03-17 20:00:55 +03:00
|
|
|
$modifiedRow.find('.break-end input').val(start.addHours(1).toString(GlobalVariables.timeFormat === 'regular' ? 'h:mm tt' : 'HH:mm'));
|
2016-04-24 20:28:33 +03:00
|
|
|
}
|
2013-09-25 18:43:17 +03:00
|
|
|
|
2016-04-24 20:28:33 +03:00
|
|
|
this.enableSubmit = true;
|
2016-10-23 22:52:36 +03:00
|
|
|
$modifiedRow.find('.editable .submit-editable').trigger('click');
|
2016-04-24 20:28:33 +03:00
|
|
|
this.enableSubmit = false;
|
|
|
|
|
2016-10-23 22:52:36 +03:00
|
|
|
$modifiedRow.find('.save-break, .cancel-break').addClass('hidden');
|
2016-04-24 20:28:33 +03:00
|
|
|
$(element).closest('table').find('.edit-break, .delete-break').removeClass('hidden');
|
|
|
|
$('.add-break').prop('disabled', false);
|
2020-03-10 22:32:53 +03:00
|
|
|
|
2018-07-06 02:21:24 +03:00
|
|
|
// Refresh working plan to have the new break sorted in the break list.
|
|
|
|
var workingPlan = this.get();
|
|
|
|
this.setup(workingPlan);
|
2020-03-10 22:32:53 +03:00
|
|
|
|
2016-04-24 20:28:33 +03:00
|
|
|
}.bind(this));
|
2018-04-12 16:03:46 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Event: Add Extra Period Button "Click"
|
|
|
|
*
|
|
|
|
* A new row is added on the table and the user can enter the new extra day
|
|
|
|
* data. After that he can either press the save or cancel button.
|
|
|
|
*/
|
|
|
|
$('.add-extra-periods').click(function () {
|
|
|
|
var today = GeneralFunctions.formatDate(new Date(), GlobalVariables.dateFormat, false);
|
|
|
|
var tr =
|
|
|
|
'<tr>' +
|
|
|
|
'<td class="extra-day editable">' + today + '</td>' +
|
2018-04-12 17:15:18 +03:00
|
|
|
'<td class="extra-start editable">' + (GlobalVariables.timeFormat === 'regular' ? '9:00 AM' : '09:00').toUpperCase() + '</td>' +
|
|
|
|
'<td class="extra-end editable">' + (GlobalVariables.timeFormat === 'regular' ? '10:00 AM' : '10:00').toUpperCase() + '</td>' +
|
2018-04-12 16:03:46 +03:00
|
|
|
'<td>' +
|
|
|
|
'<button type="button" class="btn btn-default btn-sm edit-extra" title="' + EALang.edit + '">' +
|
|
|
|
'<span class="glyphicon glyphicon-pencil"></span>' +
|
|
|
|
'</button>' +
|
|
|
|
'<button type="button" class="btn btn-default btn-sm delete-extra" title="' + EALang.delete + '">' +
|
|
|
|
'<span class="glyphicon glyphicon-remove"></span>' +
|
|
|
|
'</button>' +
|
|
|
|
'<button type="button" class="btn btn-default btn-sm save-extra hidden" title="' + EALang.save + '">' +
|
|
|
|
'<span class="glyphicon glyphicon-ok"></span>' +
|
|
|
|
'</button>' +
|
|
|
|
'<button type="button" class="btn btn-default btn-sm cancel-extra hidden" title="' + EALang.cancel + '">' +
|
|
|
|
'<span class="glyphicon glyphicon-ban-circle"></span>' +
|
|
|
|
'</button>' +
|
|
|
|
'</td>' +
|
|
|
|
'</tr>';
|
|
|
|
$('.extra-periods').prepend(tr);
|
|
|
|
|
|
|
|
// Bind editable and event handlers.
|
|
|
|
tr = $('.extra-periods tr')[1];
|
|
|
|
this.editableBreakTime($(tr).find('.extra-day'));
|
|
|
|
this.editableBreakTime($(tr).find('.extra-start, .extra-end'));
|
|
|
|
$(tr).find('.edit-extra').trigger('click');
|
|
|
|
$('.add-extra-periods').prop('disabled', true);
|
|
|
|
}.bind(this));
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Event: Edit Extra Period Button "Click"
|
|
|
|
*
|
|
|
|
* Enables the row editing for the "Extra Period" table rows.
|
|
|
|
*/
|
|
|
|
$(document).on('click', '.edit-extra', function () {
|
|
|
|
// Reset previous editable tds
|
|
|
|
var $previousEdt = $(this).closest('table').find('.editable').get();
|
|
|
|
$.each($previousEdt, function (index, editable) {
|
2020-05-06 20:15:11 +03:00
|
|
|
if (editable.reset) {
|
2018-04-12 16:03:46 +03:00
|
|
|
editable.reset();
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
// Make all cells in current row editable.
|
|
|
|
$(this).parent().parent().children().trigger('edit');
|
|
|
|
$(this).parent().parent().find('.extra-start input, .extra-end input').timepicker({
|
2018-04-12 17:15:18 +03:00
|
|
|
timeFormat: GlobalVariables.timeFormat === 'regular' ? 'h:mm tt' : 'HH:mm',
|
2018-04-12 16:03:46 +03:00
|
|
|
currentText: EALang.now,
|
|
|
|
closeText: EALang.close,
|
|
|
|
timeOnlyTitle: EALang.select_time,
|
|
|
|
timeText: EALang.time,
|
|
|
|
hourText: EALang.hour,
|
|
|
|
minuteText: EALang.minutes
|
|
|
|
});
|
|
|
|
|
|
|
|
var dateFormat;
|
|
|
|
|
|
|
|
switch (GlobalVariables.dateFormat) {
|
|
|
|
case 'DMY':
|
|
|
|
dateFormat = 'dd/mm/yy';
|
|
|
|
break;
|
|
|
|
case 'MDY':
|
|
|
|
dateFormat = 'mm/dd/yy';
|
|
|
|
break;
|
|
|
|
case 'YMD':
|
|
|
|
dateFormat = 'yy/mm/dd';
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
$(this).parent().parent().find('.extra-day input').datetimepicker({
|
|
|
|
dateFormat: dateFormat,
|
|
|
|
|
|
|
|
// Translation
|
|
|
|
dayNames: [EALang.sunday, EALang.monday, EALang.tuesday, EALang.wednesday,
|
|
|
|
EALang.thursday, EALang.friday, EALang.saturday],
|
|
|
|
dayNamesShort: [EALang.sunday.substr(0, 3), EALang.monday.substr(0, 3),
|
|
|
|
EALang.tuesday.substr(0, 3), EALang.wednesday.substr(0, 3),
|
|
|
|
EALang.thursday.substr(0, 3), EALang.friday.substr(0, 3),
|
|
|
|
EALang.saturday.substr(0, 3)],
|
|
|
|
dayNamesMin: [EALang.sunday.substr(0, 2), EALang.monday.substr(0, 2),
|
|
|
|
EALang.tuesday.substr(0, 2), EALang.wednesday.substr(0, 2),
|
|
|
|
EALang.thursday.substr(0, 2), EALang.friday.substr(0, 2),
|
|
|
|
EALang.saturday.substr(0, 2)],
|
|
|
|
monthNames: [EALang.january, EALang.february, EALang.march, EALang.april,
|
|
|
|
EALang.may, EALang.june, EALang.july, EALang.august, EALang.september,
|
|
|
|
EALang.october, EALang.november, EALang.december],
|
|
|
|
prevText: EALang.previous,
|
|
|
|
nextText: EALang.next,
|
|
|
|
currentText: EALang.now,
|
|
|
|
closeText: EALang.close,
|
|
|
|
firstDay: 1,
|
|
|
|
showTimepicker: false
|
|
|
|
});
|
|
|
|
|
|
|
|
// Show save - cancel buttons.
|
|
|
|
$(this).closest('table').find('.edit-extra, .delete-extra').addClass('hidden');
|
|
|
|
$(this).parent().find('.save-extra, .cancel-extra').removeClass('hidden');
|
|
|
|
$(this).closest('tr').find('select,input:text').addClass('form-control input-sm')
|
|
|
|
|
|
|
|
$('.add-extra-periods').prop('disabled', true);
|
|
|
|
});
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Event: Delete Extra Period Button "Click"
|
|
|
|
*
|
|
|
|
* Removes the current line from the "Extra Periods" table.
|
|
|
|
*/
|
|
|
|
$(document).on('click', '.delete-extra', function () {
|
|
|
|
$(this).parent().parent().remove();
|
|
|
|
});
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Event: Cancel Extra Period Button "Click"
|
|
|
|
*
|
|
|
|
* Bring the ".extra-period" table back to its initial state.
|
|
|
|
*
|
|
|
|
* @param {jQuery.Event} e
|
|
|
|
*/
|
|
|
|
$(document).on('click', '.cancel-extra', function (e) {
|
|
|
|
var element = e.target;
|
|
|
|
var $modifiedRow = $(element).closest('tr');
|
|
|
|
this.enableCancel = true;
|
|
|
|
$modifiedRow.find('.cancel-editable').trigger('click');
|
|
|
|
this.enableCancel = false;
|
|
|
|
|
|
|
|
$(element).closest('table').find('.edit-extra, .delete-extra').removeClass('hidden');
|
|
|
|
$modifiedRow.find('.save-extra, .cancel-extra').addClass('hidden');
|
|
|
|
$('.add-extra-periods').prop('disabled', false);
|
|
|
|
}.bind(this));
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Event: Save Extra Period Button "Click"
|
|
|
|
*
|
|
|
|
* Save the editable values and restore the table to its initial state.
|
|
|
|
*
|
|
|
|
* @param {jQuery.Event} e
|
|
|
|
*/
|
|
|
|
$(document).on('click', '.save-extra', function (e) {
|
|
|
|
// Break's start time must always be prior to break's end.
|
|
|
|
var element = e.target,
|
|
|
|
$modifiedRow = $(element).closest('tr'),
|
|
|
|
start = Date.parse($modifiedRow.find('.extra-start input').val()),
|
|
|
|
end = Date.parse($modifiedRow.find('.extra-end input').val());
|
|
|
|
|
|
|
|
if (start > end) {
|
2018-04-12 17:15:18 +03:00
|
|
|
$modifiedRow.find('.extra-end input').val(start.addHours(1).toString(GlobalVariables.timeFormat === 'regular' ? 'h:mm tt' : 'HH:mm').toUpperCase());
|
2018-04-12 16:03:46 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
this.enableSubmit = true;
|
|
|
|
$modifiedRow.find('.editable .submit-editable').trigger('click');
|
|
|
|
this.enableSubmit = false;
|
|
|
|
|
|
|
|
$modifiedRow.find('.save-extra, .cancel-extra').addClass('hidden');
|
|
|
|
$(element).closest('table').find('.edit-extra, .delete-extra').removeClass('hidden');
|
|
|
|
$('.add-extra-periods').prop('disabled', false);
|
|
|
|
}.bind(this));
|
2016-04-24 20:28:33 +03:00
|
|
|
};
|
2013-09-25 18:43:17 +03:00
|
|
|
|
|
|
|
/**
|
2016-04-24 20:28:33 +03:00
|
|
|
* Get the working plan settings.
|
2015-10-05 01:31:06 +03:00
|
|
|
*
|
2016-05-14 13:28:42 +03:00
|
|
|
* @return {Object} Returns the working plan settings object.
|
2013-09-25 18:43:17 +03:00
|
|
|
*/
|
2018-01-23 12:08:37 +03:00
|
|
|
WorkingPlan.prototype.get = function () {
|
2016-04-24 20:28:33 +03:00
|
|
|
var workingPlan = {};
|
2018-01-23 12:08:37 +03:00
|
|
|
$('.working-plan input:checkbox').each(function (index, checkbox) {
|
2016-04-24 20:28:33 +03:00
|
|
|
var id = $(checkbox).attr('id');
|
2020-05-06 20:15:11 +03:00
|
|
|
if ($(checkbox).prop('checked') === true) {
|
2017-11-17 17:09:04 +03:00
|
|
|
workingPlan[id] = {
|
|
|
|
start: Date.parse($('#' + id + '-start').val()).toString('HH:mm'),
|
|
|
|
end: Date.parse($('#' + id + '-end').val()).toString('HH:mm'),
|
|
|
|
breaks: []
|
|
|
|
};
|
2016-04-24 20:28:33 +03:00
|
|
|
|
2018-01-23 12:08:37 +03:00
|
|
|
$('.breaks tr').each(function (index, tr) {
|
2016-04-24 20:28:33 +03:00
|
|
|
var day = this.convertDayToValue($(tr).find('.break-day').text());
|
2017-11-17 17:09:04 +03:00
|
|
|
|
2020-05-06 20:15:11 +03:00
|
|
|
if (day === id) {
|
2017-03-10 11:24:27 +03:00
|
|
|
var start = $(tr).find('.break-start').text();
|
|
|
|
var end = $(tr).find('.break-end').text();
|
2016-04-24 20:28:33 +03:00
|
|
|
|
|
|
|
workingPlan[id].breaks.push({
|
2017-11-17 17:09:04 +03:00
|
|
|
start: Date.parse(start).toString('HH:mm'),
|
|
|
|
end: Date.parse(end).toString('HH:mm')
|
2016-04-24 20:28:33 +03:00
|
|
|
});
|
|
|
|
}
|
|
|
|
}.bind(this));
|
2019-06-08 17:48:24 +03:00
|
|
|
|
|
|
|
// Sort breaks increasingly by hour within day
|
|
|
|
workingPlan[id].breaks.sort(function (break1, break2) {
|
2019-07-30 15:32:58 +03:00
|
|
|
// We can do a direct string comparison since we have time based on 24 hours clock.
|
|
|
|
return (break1.start).localeCompare(break2.start);
|
2019-06-08 17:48:24 +03:00
|
|
|
});
|
2016-04-24 20:28:33 +03:00
|
|
|
} else {
|
|
|
|
workingPlan[id] = null;
|
|
|
|
}
|
2016-04-26 20:45:17 +03:00
|
|
|
}.bind(this));
|
2013-09-25 18:43:17 +03:00
|
|
|
|
2016-04-24 20:28:33 +03:00
|
|
|
return workingPlan;
|
|
|
|
};
|
2013-09-25 18:43:17 +03:00
|
|
|
|
2018-04-12 16:03:46 +03:00
|
|
|
/**
|
|
|
|
* Get the extra working plan settings.
|
|
|
|
*
|
|
|
|
* @return {Object} Returns the extra working plan settings object.
|
|
|
|
*/
|
|
|
|
WorkingPlan.prototype.getExtraWP = function () {
|
|
|
|
var extraWorkingPlan = {};
|
|
|
|
$('.extra-periods tbody tr').each(function (index, tr) {
|
|
|
|
|
|
|
|
var day = GeneralFunctions.ISO8601DateString($(tr).find('.extra-day').text(), GlobalVariables.dateFormat);
|
|
|
|
|
|
|
|
var start = $(tr).find('.extra-start').text();
|
|
|
|
var end = $(tr).find('.extra-end').text();
|
|
|
|
|
|
|
|
extraWorkingPlan[day] = {
|
|
|
|
start: Date.parse(start).toString('HH:mm'),
|
|
|
|
end: Date.parse(end).toString('HH:mm'),
|
|
|
|
breaks: []
|
|
|
|
};
|
|
|
|
}.bind(this));
|
|
|
|
|
|
|
|
return extraWorkingPlan;
|
|
|
|
};
|
|
|
|
|
2013-09-25 18:43:17 +03:00
|
|
|
/**
|
2016-05-14 13:28:42 +03:00
|
|
|
* Enables or disables the timepicker functionality from the working plan input text fields.
|
2015-10-05 01:31:06 +03:00
|
|
|
*
|
2020-05-06 20:15:11 +03:00
|
|
|
* @param {Boolean} [disabled] If true then the timepickers will be disabled.
|
2013-09-25 18:43:17 +03:00
|
|
|
*/
|
2018-01-23 12:08:37 +03:00
|
|
|
WorkingPlan.prototype.timepickers = function (disabled) {
|
2016-04-24 20:28:33 +03:00
|
|
|
disabled = disabled || false;
|
|
|
|
|
2020-05-06 20:15:11 +03:00
|
|
|
if (disabled === false) {
|
2016-04-24 20:28:33 +03:00
|
|
|
// Set timepickers where needed.
|
2017-09-23 04:42:14 +03:00
|
|
|
$('.working-plan input:text').timepicker({
|
2018-04-12 17:15:18 +03:00
|
|
|
timeFormat: GlobalVariables.timeFormat === 'regular' ? 'h:mm tt' : 'HH:mm',
|
2017-09-11 17:09:15 +03:00
|
|
|
currentText: EALang.now,
|
|
|
|
closeText: EALang.close,
|
|
|
|
timeOnlyTitle: EALang.select_time,
|
|
|
|
timeText: EALang.time,
|
|
|
|
hourText: EALang.hour,
|
|
|
|
minuteText: EALang.minutes,
|
2016-04-24 20:28:33 +03:00
|
|
|
|
2018-01-23 12:08:37 +03:00
|
|
|
onSelect: function (datetime, inst) {
|
2016-04-24 20:28:33 +03:00
|
|
|
// Start time must be earlier than end time.
|
|
|
|
var start = Date.parse($(this).parent().parent().find('.work-start').val()),
|
|
|
|
end = Date.parse($(this).parent().parent().find('.work-end').val());
|
|
|
|
|
|
|
|
if (start > end) {
|
2018-03-17 20:00:55 +03:00
|
|
|
$(this).parent().parent().find('.work-end').val(start.addHours(1).toString(GlobalVariables.timeFormat === 'regular' ? 'h:mm tt' : 'HH:mm'));
|
2016-04-24 20:28:33 +03:00
|
|
|
}
|
2013-09-25 18:43:17 +03:00
|
|
|
}
|
|
|
|
});
|
|
|
|
} else {
|
2016-04-24 20:28:33 +03:00
|
|
|
$('.working-plan input').timepicker('destroy');
|
2013-09-25 18:43:17 +03:00
|
|
|
}
|
2016-04-24 20:28:33 +03:00
|
|
|
};
|
2015-10-05 01:31:06 +03:00
|
|
|
|
2016-04-24 20:28:33 +03:00
|
|
|
/**
|
|
|
|
* Reset the current plan back to the company's default working plan.
|
|
|
|
*/
|
2018-01-23 12:08:37 +03:00
|
|
|
WorkingPlan.prototype.reset = function () {
|
2013-09-25 18:43:17 +03:00
|
|
|
|
2016-04-24 20:28:33 +03:00
|
|
|
};
|
2013-10-17 18:31:43 +03:00
|
|
|
|
2016-04-24 20:28:33 +03:00
|
|
|
/**
|
|
|
|
* This is necessary for translated days.
|
|
|
|
*
|
2016-05-14 13:28:42 +03:00
|
|
|
* @param {String} value Day value could be like "monday", "tuesday" etc.
|
2016-04-24 20:28:33 +03:00
|
|
|
*/
|
2018-01-23 12:08:37 +03:00
|
|
|
WorkingPlan.prototype.convertValueToDay = function (value) {
|
2016-04-24 20:28:33 +03:00
|
|
|
switch (value) {
|
2017-11-16 01:19:17 +03:00
|
|
|
case 'sunday':
|
|
|
|
return EALang.sunday;
|
2016-04-24 20:28:33 +03:00
|
|
|
case 'monday':
|
2017-09-11 17:09:15 +03:00
|
|
|
return EALang.monday;
|
2016-04-24 20:28:33 +03:00
|
|
|
case 'tuesday':
|
2017-09-11 17:09:15 +03:00
|
|
|
return EALang.tuesday;
|
2016-04-24 20:28:33 +03:00
|
|
|
case 'wednesday':
|
2017-09-11 17:09:15 +03:00
|
|
|
return EALang.wednesday;
|
2016-04-24 20:28:33 +03:00
|
|
|
case 'thursday':
|
2017-09-11 17:09:15 +03:00
|
|
|
return EALang.thursday;
|
2016-04-24 20:28:33 +03:00
|
|
|
case 'friday':
|
2017-09-11 17:09:15 +03:00
|
|
|
return EALang.friday;
|
2016-04-24 20:28:33 +03:00
|
|
|
case 'saturday':
|
2017-09-11 17:09:15 +03:00
|
|
|
return EALang.saturday;
|
2016-04-24 20:28:33 +03:00
|
|
|
}
|
|
|
|
};
|
2015-10-05 01:31:06 +03:00
|
|
|
|
2016-04-24 20:28:33 +03:00
|
|
|
/**
|
|
|
|
* This is necessary for translated days.
|
|
|
|
*
|
2016-05-14 13:28:42 +03:00
|
|
|
* @param {String} value Day value could be like "Monday", "Tuesday" etc.
|
2016-04-24 20:28:33 +03:00
|
|
|
*/
|
2018-01-23 12:08:37 +03:00
|
|
|
WorkingPlan.prototype.convertDayToValue = function (day) {
|
2016-04-24 20:28:33 +03:00
|
|
|
switch (day) {
|
2017-11-16 01:19:17 +03:00
|
|
|
case EALang.sunday:
|
|
|
|
return 'sunday';
|
2017-09-11 17:09:15 +03:00
|
|
|
case EALang.monday:
|
2016-04-24 20:28:33 +03:00
|
|
|
return 'monday';
|
2017-09-11 17:09:15 +03:00
|
|
|
case EALang.tuesday:
|
2016-04-24 20:28:33 +03:00
|
|
|
return 'tuesday';
|
2017-09-11 17:09:15 +03:00
|
|
|
case EALang.wednesday:
|
2016-04-24 20:28:33 +03:00
|
|
|
return 'wednesday';
|
2017-09-11 17:09:15 +03:00
|
|
|
case EALang.thursday:
|
2016-04-24 20:28:33 +03:00
|
|
|
return 'thursday';
|
2017-09-11 17:09:15 +03:00
|
|
|
case EALang.friday:
|
2016-04-24 20:28:33 +03:00
|
|
|
return 'friday';
|
2017-09-11 17:09:15 +03:00
|
|
|
case EALang.saturday:
|
2016-04-24 20:28:33 +03:00
|
|
|
return 'saturday';
|
|
|
|
}
|
|
|
|
};
|
2013-12-20 13:12:36 +02:00
|
|
|
|
2016-04-24 20:28:33 +03:00
|
|
|
window.WorkingPlan = WorkingPlan;
|
|
|
|
|
2016-10-23 22:52:36 +03:00
|
|
|
})();
|