MaketRandevu/application/views/backend/calendar.php

156 lines
6.6 KiB
PHP
Raw Normal View History

<?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
*/
?>
<link rel="stylesheet" type="text/css" href="<?= asset_url('/assets/vendor/fullcalendar/fullcalendar.min.css') ?>">
<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>
<script src="<?= asset_url('assets/js/working_plan_exceptions_modal.js') ?>"></script>
<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>
<script src="<?= asset_url('assets/js/backend_calendar_unavailability_events_modal.js') ?>"></script>
<script src="<?= asset_url('assets/js/backend_calendar_api.js') ?>"></script>
2017-09-05 15:58:34 +03:00
<script>
var GlobalVariables = {
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) ?>,
}
};
$(function () {
BackendCalendar.initialize(GlobalVariables.calendarView);
});
</script>
<div class="container-fluid backend-page" id="calendar-page">
<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">
<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') ?>">
</select>
</div>
</div>
<div id="calendar-actions" class="col-12 col-sm-7">
<?php if (($role_slug == DB_SLUG_ADMIN || $role_slug == DB_SLUG_PROVIDER)
&& 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>
<span><?= lang('synchronize') ?></span>
</button>
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') ?>">
<i class="fas fa-calendar-alt mr-2"></i>
<span><?= lang('enable_sync') ?></span>
</button>
<?php endif ?>
<?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">
<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>
</div>
<?php endif ?>
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>
</button>
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>
</a>
<?php endif ?>
2020-12-09 15:17:45 +03:00
<?php if ($calendar_view === 'table'): ?>
<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>
</a>
<?php endif ?>
</div>
</div>
<div id="calendar"><!-- Dynamically Generated Content --></div>
</div>
2017-09-05 15:58:34 +03:00
<!-- MANAGE APPOINTMENT MODAL -->
<?php require __DIR__ . '/../modals/manage_appointment_modal.php' ?>
2017-09-05 15:58:34 +03:00
<!-- MANAGE UNAVAILABLE MODAL -->
<?php require __DIR__ . '/../modals/manage_unavailable_modal.php' ?>
2017-09-05 15:58:34 +03:00
<!-- SELECT GOOGLE CALENDAR MODAL -->
<?php require __DIR__ . '/../modals/select_google_calendar_modal.php' ?>
<!-- WORKING PLAN EXCEPTIONS MODAL -->
<?php require __DIR__ . '/../modals/working_plan_exceptions_modal.php' ?>