2021-11-10 10:32:46 +03:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* @var array $available_providers
|
|
|
|
* @var array $available_services
|
|
|
|
* @var string $base_url
|
|
|
|
* @var string $date_format
|
|
|
|
* @var string $time_format
|
|
|
|
* @var string $first_weekday
|
|
|
|
* @var array $edit_appointment
|
|
|
|
* @var array $customers
|
|
|
|
* @var array $secretary_providers
|
|
|
|
* @var string $calendar_view
|
|
|
|
* @var string $timezones
|
|
|
|
* @var string $user_id
|
|
|
|
* @var string $user_email
|
|
|
|
* @var string $timezone
|
|
|
|
* @var string $role_slug
|
|
|
|
* @var array $privileges
|
|
|
|
*/
|
|
|
|
?>
|
|
|
|
|
2021-11-08 12:57:03 +03:00
|
|
|
<link rel="stylesheet" type="text/css" href="<?= asset_url('/assets/vendor/fullcalendar/fullcalendar.min.css') ?>">
|
2017-09-14 16:18:20 +03:00
|
|
|
|
2021-11-08 12:57:03 +03:00
|
|
|
<script src="<?= asset_url('assets/vendor/fullcalendar/fullcalendar.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>
|
2020-10-20 16:03:48 +03:00
|
|
|
<script src="<?= asset_url('assets/js/working_plan_exceptions_modal.js') ?>"></script>
|
2017-11-14 16:01:49 +03:00
|
|
|
<script src="<?= asset_url('assets/js/backend_calendar.js') ?>"></script>
|
|
|
|
<script src="<?= asset_url('assets/js/backend_calendar_default_view.js') ?>"></script>
|
|
|
|
<script src="<?= asset_url('assets/js/backend_calendar_table_view.js') ?>"></script>
|
|
|
|
<script src="<?= asset_url('assets/js/backend_calendar_google_sync.js') ?>"></script>
|
|
|
|
<script src="<?= asset_url('assets/js/backend_calendar_appointments_modal.js') ?>"></script>
|
2020-10-21 21:36:37 +03:00
|
|
|
<script src="<?= asset_url('assets/js/backend_calendar_unavailability_events_modal.js') ?>"></script>
|
2017-11-14 16:01:49 +03:00
|
|
|
<script src="<?= asset_url('assets/js/backend_calendar_api.js') ?>"></script>
|
2017-09-05 15:58:34 +03:00
|
|
|
<script>
|
2015-11-28 12:52:42 +02:00
|
|
|
var GlobalVariables = {
|
2020-09-07 13:34:52 +03:00
|
|
|
csrfToken: <?= json_encode($this->security->get_csrf_hash()) ?>,
|
|
|
|
availableProviders: <?= json_encode($available_providers) ?>,
|
|
|
|
availableServices: <?= json_encode($available_services) ?>,
|
|
|
|
baseUrl: <?= json_encode($base_url) ?>,
|
|
|
|
dateFormat: <?= json_encode($date_format) ?>,
|
|
|
|
timeFormat: <?= json_encode($time_format) ?>,
|
|
|
|
firstWeekday: <?= json_encode($first_weekday) ?>,
|
|
|
|
editAppointment: <?= json_encode($edit_appointment) ?>,
|
|
|
|
customers: <?= json_encode($customers) ?>,
|
|
|
|
secretaryProviders: <?= json_encode($secretary_providers) ?>,
|
|
|
|
calendarView: <?= json_encode($calendar_view) ?>,
|
|
|
|
timezones: <?= json_encode($timezones) ?>,
|
|
|
|
user: {
|
|
|
|
id: <?= $user_id ?>,
|
|
|
|
email: <?= json_encode($user_email) ?>,
|
|
|
|
timezone: <?= json_encode($timezone) ?>,
|
|
|
|
role_slug: <?= json_encode($role_slug) ?>,
|
|
|
|
privileges: <?= json_encode($privileges) ?>,
|
2015-11-28 12:52:42 +02:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2020-09-07 13:30:24 +03:00
|
|
|
$(function () {
|
2016-07-17 14:46:38 +03:00
|
|
|
BackendCalendar.initialize(GlobalVariables.calendarView);
|
2015-11-28 12:52:42 +02:00
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
2020-09-03 14:35:58 +03:00
|
|
|
<div class="container-fluid backend-page" id="calendar-page">
|
2020-08-31 20:11:02 +03:00
|
|
|
<div class="row" id="calendar-toolbar">
|
|
|
|
<div id="calendar-filter" class="col-12 col-sm-5">
|
2020-05-05 20:35:33 +03:00
|
|
|
<div class="form-group calendar-filter-items">
|
2020-08-31 20:11:02 +03:00
|
|
|
<select id="select-filter-item" class="form-control col"
|
2020-10-22 12:29:09 +03:00
|
|
|
data-tippy-content="<?= lang('select_filter_item_hint') ?>">
|
2016-07-12 23:02:59 +03:00
|
|
|
</select>
|
|
|
|
</div>
|
2015-11-28 12:52:42 +02:00
|
|
|
</div>
|
|
|
|
|
2020-08-31 20:11:02 +03:00
|
|
|
<div id="calendar-actions" class="col-12 col-sm-7">
|
2016-07-13 23:56:05 +03:00
|
|
|
<?php if (($role_slug == DB_SLUG_ADMIN || $role_slug == DB_SLUG_PROVIDER)
|
2020-08-31 13:23:10 +03:00
|
|
|
&& config('google_sync_feature') == TRUE): ?>
|
|
|
|
<button id="google-sync" class="btn btn-primary"
|
2020-10-22 12:29:09 +03:00
|
|
|
data-tippy-content="<?= lang('trigger_google_sync_hint') ?>">
|
2020-05-05 20:35:33 +03:00
|
|
|
<i class="fas fa-sync-alt"></i>
|
2017-09-14 16:18:20 +03:00
|
|
|
<span><?= lang('synchronize') ?></span>
|
2016-07-13 23:56:05 +03:00
|
|
|
</button>
|
2015-11-28 12:52:42 +02:00
|
|
|
|
2020-05-05 20:35:33 +03:00
|
|
|
<button id="enable-sync" class="btn btn-light" data-toggle="button"
|
2020-10-22 12:29:09 +03:00
|
|
|
data-tippy-content="<?= lang('enable_appointment_sync_hint') ?>">
|
2020-12-08 01:10:49 +03:00
|
|
|
<i class="fas fa-calendar-alt mr-2"></i>
|
2017-09-14 16:18:20 +03:00
|
|
|
<span><?= lang('enable_sync') ?></span>
|
2015-11-28 12:52:42 +02:00
|
|
|
</button>
|
2016-07-13 23:56:05 +03:00
|
|
|
<?php endif ?>
|
2015-11-28 12:52:42 +02:00
|
|
|
|
2016-07-12 23:02:59 +03:00
|
|
|
<?php if ($privileges[PRIV_APPOINTMENTS]['add'] == TRUE): ?>
|
2020-12-09 15:17:45 +03:00
|
|
|
<div class="btn-group">
|
|
|
|
<button class="btn btn-light" id="insert-appointment">
|
2020-12-08 01:10:49 +03:00
|
|
|
<i class="fas fa-plus-square mr-2"></i>
|
2020-12-09 15:17:45 +03:00
|
|
|
<?= lang('appointment') ?>
|
|
|
|
</button>
|
|
|
|
|
|
|
|
<button class="btn btn-light dropdown-toggle" id="insert-dropdown" data-toggle="dropdown">
|
|
|
|
<span class="caret"></span>
|
|
|
|
<span class="sr-only">Toggle Dropdown</span>
|
|
|
|
</button>
|
|
|
|
|
|
|
|
<div class="dropdown-menu">
|
|
|
|
<a class="dropdown-item" href="#" id="insert-unavailable">
|
|
|
|
<i class="fas fa-plus-square mr-2"></i>
|
|
|
|
<?= lang('unavailable') ?>
|
|
|
|
</a>
|
|
|
|
<a class="dropdown-item" href="#" id="insert-working-plan-exception"
|
|
|
|
<?= $this->session->userdata('role_slug') !== 'admin' ? 'hidden' : '' ?>>
|
|
|
|
<i class="fas fa-plus-square mr-2"></i>
|
|
|
|
<?= lang('working_plan_exception') ?>
|
|
|
|
</a>
|
|
|
|
</div>
|
2020-05-04 14:56:23 +03:00
|
|
|
</div>
|
2016-07-12 23:02:59 +03:00
|
|
|
<?php endif ?>
|
2016-07-13 23:56:05 +03:00
|
|
|
|
2020-12-09 15:17:45 +03:00
|
|
|
<button id="reload-appointments" class="btn btn-light"
|
|
|
|
data-tippy-content="<?= lang('reload_appointments_hint') ?>">
|
2020-09-07 12:21:16 +03:00
|
|
|
<i class="fas fa-sync-alt"></i>
|
2016-07-13 23:56:05 +03:00
|
|
|
</button>
|
2016-07-24 14:26:20 +03:00
|
|
|
|
2020-12-09 15:17:45 +03:00
|
|
|
<?php if ($calendar_view === 'default'): ?>
|
2020-05-05 20:35:33 +03:00
|
|
|
<a class="btn btn-light" href="<?= site_url('backend?view=table') ?>"
|
2020-10-22 12:29:09 +03:00
|
|
|
data-tippy-content="<?= lang('table') ?>">
|
2020-09-07 12:21:16 +03:00
|
|
|
<i class="fas fa-table"></i>
|
2020-05-04 14:38:28 +03:00
|
|
|
</a>
|
|
|
|
<?php endif ?>
|
|
|
|
|
2020-12-09 15:17:45 +03:00
|
|
|
<?php if ($calendar_view === 'table'): ?>
|
2020-06-09 17:36:54 +03:00
|
|
|
<a class="btn btn-light" href="<?= site_url('backend?view=default') ?>"
|
2020-10-22 12:29:09 +03:00
|
|
|
data-tippy-content="<?= lang('default') ?>">
|
2020-06-18 21:23:16 +03:00
|
|
|
<i class="fas fa-calendar-alt"></i>
|
2020-05-04 14:38:28 +03:00
|
|
|
</a>
|
|
|
|
<?php endif ?>
|
2015-11-28 12:52:42 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2021-11-12 10:25:27 +03:00
|
|
|
<div id="calendar">
|
|
|
|
<!-- Dynamically Generated Content -->
|
|
|
|
</div>
|
2015-11-28 12:52:42 +02:00
|
|
|
</div>
|
|
|
|
|
2021-11-12 10:25:27 +03:00
|
|
|
<!-- Page Components -->
|
2020-08-31 13:23:10 +03:00
|
|
|
|
2021-11-12 10:25:27 +03:00
|
|
|
<?= component('manage_appointment_modal') ?>
|
|
|
|
<?= component('manage_appointment_modal') ?>
|
|
|
|
<?= component('manage_unavailable_modal') ?>
|
|
|
|
<?= component('select_google_calendar_modal') ?>
|
|
|
|
<?= component('working_plan_exceptions_modal') ?>
|
2020-10-20 16:03:48 +03:00
|
|
|
|