Rename the manage-unavailable-modal to unavailabilities-modal
This commit is contained in:
parent
7126d75988
commit
f2c40a58b2
6 changed files with 20 additions and 15 deletions
|
@ -5,7 +5,7 @@
|
||||||
*/
|
*/
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<div id="manage-unavailable" class="modal fade">
|
<div id="unavailabilities-modal" class="modal fade">
|
||||||
<div class="modal-dialog">
|
<div class="modal-dialog">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
|
@ -83,3 +83,9 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<?php section('scripts') ?>
|
||||||
|
|
||||||
|
<script src="<?= asset_url('assets/js/components/unavailabilities_modal.js') ?>"></script>
|
||||||
|
|
||||||
|
<?php section('scripts') ?>
|
|
@ -42,7 +42,6 @@
|
||||||
<script src="<?= asset_url('assets/vendor/jquery-jeditable/jquery.jeditable.min.js') ?>"></script>
|
<script src="<?= asset_url('assets/vendor/jquery-jeditable/jquery.jeditable.min.js') ?>"></script>
|
||||||
<script src="<?= asset_url('assets/vendor/jquery-ui-timepicker-addon/jquery-ui-timepicker-addon.min.js') ?>"></script>
|
<script src="<?= asset_url('assets/vendor/jquery-ui-timepicker-addon/jquery-ui-timepicker-addon.min.js') ?>"></script>
|
||||||
<script src="<?= asset_url('assets/js/components/working_plan_exceptions_modal.js') ?>"></script>
|
<script src="<?= asset_url('assets/js/components/working_plan_exceptions_modal.js') ?>"></script>
|
||||||
<script src="<?= asset_url('assets/js/components/manage_unavailabilities_modal.js') ?>"></script>
|
|
||||||
<script src="<?= asset_url('assets/js/utils/date.js') ?>"></script>
|
<script src="<?= asset_url('assets/js/utils/date.js') ?>"></script>
|
||||||
<script src="<?= asset_url('assets/js/utils/message.js') ?>"></script>
|
<script src="<?= asset_url('assets/js/utils/message.js') ?>"></script>
|
||||||
<script src="<?= asset_url('assets/js/utils/validation.js') ?>"></script>
|
<script src="<?= asset_url('assets/js/utils/validation.js') ?>"></script>
|
||||||
|
@ -159,7 +158,7 @@
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
component(
|
component(
|
||||||
'manage_unavailable_modal',
|
'unavailabilities_modal',
|
||||||
'',
|
'',
|
||||||
[
|
[
|
||||||
'timezones' => $timezones,
|
'timezones' => $timezones,
|
||||||
|
|
|
@ -10,21 +10,21 @@
|
||||||
* ---------------------------------------------------------------------------- */
|
* ---------------------------------------------------------------------------- */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Backend Calendar Unavailability Events Modal
|
* Unavailabilities Modal
|
||||||
*
|
*
|
||||||
* This module implements the unavailability events modal functionality.
|
* This module implements the unavailability events modal functionality.
|
||||||
*
|
*
|
||||||
* Old Module Name: BackendCalendarUnavailabilityEventsModal
|
* Old Name: BackendCalendarUnavailabilityEventsModal
|
||||||
*/
|
*/
|
||||||
App.Components.ManageUnavailabilitiesModal = (function () {
|
App.Components.UnavailabilitiesModal = (function () {
|
||||||
function bindEventHandlers() {
|
function bindEventHandlers() {
|
||||||
/**
|
/**
|
||||||
* Event: Manage Unavailable Dialog Save Button "Click"
|
* Event: Manage Unavailable Dialog Save Button "Click"
|
||||||
*
|
*
|
||||||
* Stores the unavailable period changes or inserts a new record.
|
* Stores the unavailable period changes or inserts a new record.
|
||||||
*/
|
*/
|
||||||
$('#manage-unavailable #save-unavailable').on('click', () => {
|
$('#unavailabilities-modal #save-unavailable').on('click', () => {
|
||||||
const $dialog = $('#manage-unavailable');
|
const $dialog = $('#unavailabilities-modal');
|
||||||
$dialog.find('.modal-message').addClass('d-none');
|
$dialog.find('.modal-message').addClass('d-none');
|
||||||
$dialog.find('.is-invalid').removeClass('is-invalid');
|
$dialog.find('.is-invalid').removeClass('is-invalid');
|
||||||
|
|
||||||
|
@ -94,7 +94,7 @@ App.Components.ManageUnavailabilitiesModal = (function () {
|
||||||
$('#insert-unavailable').on('click', () => {
|
$('#insert-unavailable').on('click', () => {
|
||||||
resetUnavailableDialog();
|
resetUnavailableDialog();
|
||||||
|
|
||||||
const $dialog = $('#manage-unavailable');
|
const $dialog = $('#unavailabilities-modal');
|
||||||
|
|
||||||
// Set the default datetime values.
|
// Set the default datetime values.
|
||||||
const startMoment = moment();
|
const startMoment = moment();
|
||||||
|
@ -136,11 +136,11 @@ App.Components.ManageUnavailabilitiesModal = (function () {
|
||||||
/**
|
/**
|
||||||
* Reset unavailable dialog form.
|
* Reset unavailable dialog form.
|
||||||
*
|
*
|
||||||
* Reset the "#manage-unavailable" dialog. Use this method to bring the dialog to the initial state
|
* Reset the "#unavailabilities-modal" dialog. Use this method to bring the dialog to the initial state
|
||||||
* before it becomes visible to the user.
|
* before it becomes visible to the user.
|
||||||
*/
|
*/
|
||||||
function resetUnavailableDialog() {
|
function resetUnavailableDialog() {
|
||||||
const $dialog = $('#manage-unavailable');
|
const $dialog = $('#unavailabilities-modal');
|
||||||
|
|
||||||
$dialog.find('#unavailable-id').val('');
|
$dialog.find('#unavailable-id').val('');
|
||||||
|
|
|
@ -110,7 +110,7 @@ App.Pages.Calendar = (function () {
|
||||||
|
|
||||||
App.Components.AppointmentsModal.initialize();
|
App.Components.AppointmentsModal.initialize();
|
||||||
|
|
||||||
App.Components.ManageUnavailabilitiesModal.initialize();
|
App.Components.UnavailabilitiesModal.initialize();
|
||||||
|
|
||||||
// Load and initialize the calendar view.
|
// Load and initialize the calendar view.
|
||||||
if (view === 'table') {
|
if (view === 'table') {
|
||||||
|
|
|
@ -143,8 +143,8 @@ App.Utils.CalendarDefaultView = (function () {
|
||||||
unavailable.end_datetime = lastFocusedEventData.end.format('YYYY-MM-DD HH:mm:ss');
|
unavailable.end_datetime = lastFocusedEventData.end.format('YYYY-MM-DD HH:mm:ss');
|
||||||
endMoment = moment(unavailable.end_datetime);
|
endMoment = moment(unavailable.end_datetime);
|
||||||
|
|
||||||
$dialog = $('#manage-unavailable');
|
$dialog = $('#unavailabilities-modal');
|
||||||
App.Components.ManageUnavailabilitiesModal.resetUnavailableDialog();
|
App.Components.UnavailabilitiesModal.resetUnavailableDialog();
|
||||||
|
|
||||||
// Apply unavailable data to dialog.
|
// Apply unavailable data to dialog.
|
||||||
$dialog.find('.modal-header h3').text('Edit Unavailable Period');
|
$dialog.find('.modal-header h3').text('Edit Unavailable Period');
|
||||||
|
|
|
@ -223,7 +223,7 @@ App.Utils.CalendarTableView = (function () {
|
||||||
unavailable.end_datetime = lastFocusedEventData.end.format('YYYY-MM-DD HH:mm:ss');
|
unavailable.end_datetime = lastFocusedEventData.end.format('YYYY-MM-DD HH:mm:ss');
|
||||||
endMoment = moment(unavailable.end_datetime);
|
endMoment = moment(unavailable.end_datetime);
|
||||||
|
|
||||||
$dialog = $('#manage-unavailable');
|
$dialog = $('#unavailabilities-modal');
|
||||||
BackendCalendarUnavailabilityEventsModal.resetUnavailableDialog();
|
BackendCalendarUnavailabilityEventsModal.resetUnavailableDialog();
|
||||||
|
|
||||||
// Apply unavailable data to dialog.
|
// Apply unavailable data to dialog.
|
||||||
|
|
Loading…
Reference in a new issue