Merge branch 'spidev' into 'master'
Kalender Updates See merge request fronk/thetool!900
This commit is contained in:
@@ -19,90 +19,415 @@
|
||||
<!-- end page title -->
|
||||
|
||||
|
||||
<div class="card">
|
||||
<div class="card-body mb-3">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="float-left">
|
||||
<h4 class="header-title">Liste aller Kalender Verwaltung</h4>
|
||||
</div>
|
||||
<div class="float-right">
|
||||
<!-- <a class="btn btn-primary mb-2" href="--><?php //= self::getUrl("Calendar", "add") ?><!--"><i-->
|
||||
<!-- class="fas fa-plus"></i> Neuen Kalender Verwaltung anlegen</a>-->
|
||||
<div class="card">
|
||||
<div class="card-body mb-3">
|
||||
<ul class="nav nav-tabs" id="myTab" role="tablist">
|
||||
<li class="nav-item">
|
||||
<a
|
||||
class="nav-link active"
|
||||
id="home-tab"
|
||||
data-toggle="tab"
|
||||
href="#home"
|
||||
role="tab"
|
||||
aria-controls="home"
|
||||
aria-selected="true"
|
||||
>Vorlagen</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a
|
||||
class="nav-link"
|
||||
id="profile-tab"
|
||||
data-toggle="tab"
|
||||
href="#user-tab"
|
||||
role="tab"
|
||||
aria-controls="user-tab"
|
||||
aria-selected="false"
|
||||
>Benutzer</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<!-- Tab Inhalte -->
|
||||
<div class="tab-content" id="myTabContent">
|
||||
<div
|
||||
class="tab-pane fade show active"
|
||||
id="home"
|
||||
role="tabpanel"
|
||||
aria-labelledby="home-tab"
|
||||
>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<a class="btn btn-primary mb-2 float-right"
|
||||
href="<?= self::getUrl("CalendarTemplate", "add") ?>"><i
|
||||
class="fas fa-plus"></i> Neuen Vorlage anlegen</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<table id="datatable" class="table table-striped table-hover table-sm">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-center">Name</th>
|
||||
<th class="text-center">GO Kalender ID</th>
|
||||
<th class="text-center">Microsoft Id</th>
|
||||
<th class="text-center">Kalenderrechte</th>
|
||||
<th class="text-center">Webhook</th>
|
||||
<th class="text-center">Webhook Timeout</th>
|
||||
<th class="text-center">Aktiv</th>
|
||||
<th class="edit-width"></th>
|
||||
</tr>
|
||||
<tr id="filterrow">
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($calendars as $calendar):
|
||||
$calenadarRights = json_decode($calendar->rights, true);
|
||||
$rights = "";
|
||||
foreach ($calenadarRights as $key => $value) {
|
||||
if ($key != $calendar->go_calendar_id) {
|
||||
$rights .= $calendars[$key]->user->name . " : " . $value . "<br>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
<table id="datatable2" class="table table-striped table-hover table-sm">
|
||||
<thead>
|
||||
<tr>
|
||||
<td><?= $calendar->user->name ?></td>
|
||||
<td class="text-center"><?= $calendar->go_calendar_id ?></td>
|
||||
<td class="text-nowrap"><?= $calendar->microsoft_id ?></td>
|
||||
<td><?= $rights ?></td>
|
||||
<td class="text-nowrap"><?= $calendar->subscription_id ?></td>
|
||||
<td class="text-center"><?= ($calendar->expirationDateTime) ? date("d.m.Y H:i", $calendar->expirationDateTime) : '' ?></td>
|
||||
<td class="text-center"><?= ($calendar->active==1) ? '<i class="fa-regular fa-circle-check mr-1"></i>' : '<i class="fa-regular fa-circle-xmark mr-1"></i>' ?></td>
|
||||
<td style="text-align: left; letter-spacing: 4px; font-size: 1.1em;">
|
||||
<a href="<?= self::getUrl("Calendar", "edit", ["id" => $calendar->id]) ?>"><i
|
||||
class="far fa-edit" title="Bearbeiten"></i></a>
|
||||
<a href="<?= self::getUrl("Calendar", "delete", ["id" => $calendar->id]) ?>"
|
||||
onclick="if(!confirm('Kalender Verwaltung wirklich löschen?')) return false;"
|
||||
class="text-danger"
|
||||
title="Löschen"><i class="fas fa-trash"></i></a>
|
||||
</td>
|
||||
<th class="text-center">Termintyp</th>
|
||||
<th class="text-center">Vorlagen Name</th>
|
||||
<th class="text-center">Reminder</th>
|
||||
<th class="text-center">Vorlagen Text</th>
|
||||
<th class="edit-width"></th>
|
||||
</tr>
|
||||
<tr id="filterrow2">
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($calendartemplates as $calendartemplate): ?>
|
||||
<tr>
|
||||
<td class="text-center"><?= $calendarTemplateEventTypes[$calendartemplate->event_type] ?></td>
|
||||
<td><?= $calendartemplate->name ?></td>
|
||||
<td class="text-center"><?= ($calendartemplate->is_reminder) ? 'Ja' : 'Nein' ?></td>
|
||||
<td><?= $calendartemplate->text ?></td>
|
||||
<td style="text-align: left; letter-spacing: 4px; font-size: 1.1em;">
|
||||
<a href="<?= self::getUrl("CalendarTemplate", "edit", ["id" => $calendartemplate->id]) ?>"><i
|
||||
class="far fa-edit" title="Bearbeiten"></i></a>
|
||||
<a href="<?= self::getUrl("CalendarTemplate", "delete", ["id" => $calendartemplate->id]) ?>"
|
||||
onclick="if(!confirm('Vorlage wirklich löschen?')) return false;" class="text-danger"
|
||||
title="Löschen"><i class="fas fa-trash"></i></a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div
|
||||
class="tab-pane fade col-12"
|
||||
id="user-tab"
|
||||
role="tabpanel"
|
||||
aria-labelledby="profile-tab"
|
||||
>
|
||||
<table id="datatable" class="table table-striped table-hover table-sm" style="width:100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-center">Name</th>
|
||||
<th class="text-center">GO Kalender ID</th>
|
||||
<th class="text-center">Microsoft Id</th>
|
||||
<th class="text-center">Kalenderrechte</th>
|
||||
<th class="text-center">Webhook</th>
|
||||
<th class="text-center">Webhook Timeout</th>
|
||||
<th class="text-center">Aktiv</th>
|
||||
<th class="edit-width" style="width: 50px !important;text-decoration: underline"></th>
|
||||
</tr>
|
||||
<tr id="filterrow">
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($calendars as $calendar):
|
||||
$calenadarRights = json_decode($calendar->rights, true);
|
||||
$rights = "";
|
||||
foreach ($calenadarRights as $key => $value) {
|
||||
if ($key != $calendar->go_calendar_id) {
|
||||
$rights .= $calendars[$key]->user->name . " : " . $value . "<br>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
<tr>
|
||||
<td><?= $calendar->user->name ?></td>
|
||||
<td class="text-center"><?= $calendar->go_calendar_id ?></td>
|
||||
<td class="text-nowrap"><?= $calendar->microsoft_id ?></td>
|
||||
<td><?= $rights ?></td>
|
||||
<td class="text-nowrap"><?= $calendar->subscription_id ?></td>
|
||||
<td class="text-center"><?= ($calendar->expirationDateTime) ? date("d.m.Y H:i", $calendar->expirationDateTime) : '' ?></td>
|
||||
<td class="text-center"><?= ($calendar->active == 1) ? '<i class="fa-regular fa-circle-check mr-1"></i>' : '<i class="fa-regular fa-circle-xmark mr-1"></i>' ?></td>
|
||||
<td style="text-align: left; letter-spacing: 4px; font-size: 1.1em;">
|
||||
<a href="<?= self::getUrl("Calendar", "edit", ["id" => $calendar->id]) ?>"><i
|
||||
class="far fa-edit" title="Bearbeiten"></i></a>
|
||||
<a href="<?= self::getUrl("Calendar", "delete", ["id" => $calendar->id]) ?>"
|
||||
onclick="if(!confirm('Kalender Verwaltung wirklich löschen?')) return false;"
|
||||
class="text-danger"
|
||||
title="Löschen"><i class="fas fa-trash"></i></a>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var hidesearch = [8];
|
||||
|
||||
$(document).ready(function () {
|
||||
let table;
|
||||
let table2;
|
||||
let tableInitialized = false;
|
||||
var hidesearch = [4];
|
||||
if (typeof hidesearch === "undefined") {
|
||||
var hidesearch;
|
||||
hidesearch = [100];
|
||||
}
|
||||
|
||||
if (typeof pageLength === "undefined") {
|
||||
var pageLength;
|
||||
pageLength = 25;
|
||||
}
|
||||
|
||||
if (typeof cstmdom === "undefined") {
|
||||
var cstmdom;
|
||||
cstmdom = "flBrtip";
|
||||
|
||||
}
|
||||
if (typeof columndefs === "undefined") {
|
||||
var columndefs;
|
||||
columndefs = "";
|
||||
|
||||
}
|
||||
|
||||
if (typeof columnfilter === "undefined") {
|
||||
var columnfilter;
|
||||
columnfilter = "";
|
||||
}
|
||||
if (typeof columnoptions === "undefined") {
|
||||
var columnoptions;
|
||||
columnoptions = "";
|
||||
}
|
||||
|
||||
$('#filterrow2 th').each(function (i) {
|
||||
let title = $('#datatable2 thead th').eq($(this).index()).text();
|
||||
|
||||
if (hidesearch.includes($(this).index())) {
|
||||
|
||||
} else if (columnfilter.includes($(this).index())) {
|
||||
$(this).html('<select style="padding: 0;height: 28px;;text-align: center;" id="selectsearch" class="form-control form-control-select form-control-special" data-index="' + i + '">' + columnoptions + '</select>');
|
||||
|
||||
} else {
|
||||
$(this).html('<input type="text" placeholder="' + title + '" class="form-control" data-index="' + i + '" value="" />');
|
||||
}
|
||||
});
|
||||
table2 = $('#datatable2').DataTable({
|
||||
responsive: {
|
||||
breakpoints: [
|
||||
{name: 'desktop', width: Infinity},
|
||||
{name: 'tablet', width: 1024},
|
||||
{name: 'fablet', width: 768},
|
||||
{name: 'phone', width: 480}
|
||||
]
|
||||
},
|
||||
pageLength: pageLength,
|
||||
buttons: [
|
||||
{
|
||||
extend: 'excelHtml5',
|
||||
text: 'XLSX Export',
|
||||
className: 'btn-success margina d-none d-lg-block',
|
||||
exportOptions: {
|
||||
columns: ['th:not(:last-child)'],
|
||||
format: {
|
||||
body: function (data, row, column, node) {
|
||||
data = $('<p>' + data + '</p>').text();
|
||||
return $.isNumeric(data.replace(',', '.')) ? data.replace(',', '.') : data;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
], columnDefs: [
|
||||
columndefs
|
||||
],
|
||||
"language": {
|
||||
"url": "/datatables/json/german.json?v1"
|
||||
},
|
||||
orderCellsTop: true,
|
||||
stateSave: true,
|
||||
stateDuration: 60 * 60 * 24 * 30,
|
||||
"initComplete": function () {
|
||||
$('#datatable2_filter').append('<i id="clear_cookie2" class="fas fa-times clear-fa" title="Filter löschen" aria-hidden="true" ></i>');
|
||||
$('#clear_cookie2').click(function () {
|
||||
$('#filterrow2 input').val('');
|
||||
$('#filterrow2 select').val('');
|
||||
table2.search('').columns().search('').draw();
|
||||
});
|
||||
},
|
||||
"dom": cstmdom
|
||||
|
||||
});
|
||||
|
||||
$('#filterrow2').on('keyup', 'input', function () {
|
||||
|
||||
table2
|
||||
.column($(this).data('index'))
|
||||
.search(this.value)
|
||||
.draw();
|
||||
|
||||
|
||||
});
|
||||
|
||||
$('#selectsearch').change(function () {
|
||||
table2
|
||||
.column($(this).data('index'))
|
||||
.search(this.value)
|
||||
.draw();
|
||||
|
||||
|
||||
});
|
||||
let state2 = table2.state.loaded();
|
||||
if (state2) {
|
||||
table2.columns().eq(0).each(function (colIdx) {
|
||||
var colSearch = state2.columns[colIdx].search;
|
||||
|
||||
if (colSearch.search) {
|
||||
|
||||
|
||||
$('#filterrow2').find("[data-index='" + colIdx + "']").val(colSearch.search);
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
table2.draw();
|
||||
}
|
||||
$('a[data-toggle="tab"]').on('shown.bs.tab', function (e) {
|
||||
var target = $(e.target).attr("href"); // z.B. #table
|
||||
|
||||
if (target === '#user-tab' && !tableInitialized) {
|
||||
// Initialisierung der DataTable
|
||||
var hidesearch = [6, 7];
|
||||
if (typeof hidesearch === "undefined") {
|
||||
var hidesearch;
|
||||
hidesearch = [100];
|
||||
}
|
||||
console.log(hidesearch);
|
||||
|
||||
if (typeof pageLength === "undefined") {
|
||||
var pageLength;
|
||||
pageLength = 25;
|
||||
}
|
||||
|
||||
if (typeof cstmdom === "undefined") {
|
||||
var cstmdom;
|
||||
cstmdom = "flBrtip";
|
||||
|
||||
}
|
||||
if (typeof columndefs === "undefined") {
|
||||
var columndefs;
|
||||
columndefs = "";
|
||||
|
||||
}
|
||||
|
||||
if (typeof columnfilter === "undefined") {
|
||||
var columnfilter;
|
||||
columnfilter = "";
|
||||
}
|
||||
if (typeof columnoptions === "undefined") {
|
||||
var columnoptions;
|
||||
columnoptions = "";
|
||||
}
|
||||
|
||||
$('#filterrow th').each(function (i) {
|
||||
let title = $('#datatable thead th').eq($(this).index()).text();
|
||||
|
||||
if (hidesearch.includes($(this).index())) {
|
||||
|
||||
} else if (columnfilter.includes($(this).index())) {
|
||||
$(this).html('<select style="padding: 0;height: 28px;;text-align: center;" id="selectsearch" class="form-control form-control-select form-control-special" data-index="' + i + '">' + columnoptions + '</select>');
|
||||
|
||||
} else {
|
||||
$(this).html('<input type="text" placeholder="' + title + '" class="form-control" data-index="' + i + '" value="" />');
|
||||
}
|
||||
});
|
||||
table = $('#datatable').DataTable({
|
||||
responsive: {
|
||||
breakpoints: [
|
||||
{name: 'desktop', width: Infinity},
|
||||
{name: 'tablet', width: 1024},
|
||||
{name: 'fablet', width: 768},
|
||||
{name: 'phone', width: 480}
|
||||
]
|
||||
},
|
||||
pageLength: pageLength,
|
||||
buttons: [
|
||||
{
|
||||
extend: 'excelHtml5',
|
||||
text: 'XLSX Export',
|
||||
className: 'btn-success margina d-none d-lg-block',
|
||||
exportOptions: {
|
||||
columns: ['th:not(:last-child)'],
|
||||
format: {
|
||||
body: function (data, row, column, node) {
|
||||
data = $('<p>' + data + '</p>').text();
|
||||
return $.isNumeric(data.replace(',', '.')) ? data.replace(',', '.') : data;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
], columnDefs: [
|
||||
columndefs
|
||||
],
|
||||
"language": {
|
||||
"url": "/datatables/json/german.json?v1"
|
||||
},
|
||||
orderCellsTop: true,
|
||||
stateSave: true,
|
||||
stateDuration: 60 * 60 * 24 * 30,
|
||||
"initComplete": function () {
|
||||
$('#datatable_filter').append('<i id="clear_cookie" class="fas fa-times clear-fa" title="Filter löschen" aria-hidden="true" ></i>');
|
||||
$('#clear_cookie').click(function () {
|
||||
$('#filterrow input').val('');
|
||||
$('#filterrow select').val('');
|
||||
table.search('').columns().search('').draw();
|
||||
});
|
||||
},
|
||||
"dom": cstmdom
|
||||
|
||||
});
|
||||
|
||||
$('#filterrow').on('keyup', 'input', function () {
|
||||
|
||||
table
|
||||
.column($(this).data('index'))
|
||||
.search(this.value)
|
||||
.draw();
|
||||
|
||||
|
||||
});
|
||||
|
||||
$('#selectsearch').change(function () {
|
||||
table
|
||||
.column($(this).data('index'))
|
||||
.search(this.value)
|
||||
.draw();
|
||||
|
||||
|
||||
});
|
||||
let state = table.state.loaded();
|
||||
if (state) {
|
||||
table.columns().eq(0).each(function (colIdx) {
|
||||
var colSearch = state.columns[colIdx].search;
|
||||
|
||||
if (colSearch.search) {
|
||||
|
||||
|
||||
$('#filterrow').find("[data-index='" + colIdx + "']").val(colSearch.search);
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
table.draw();
|
||||
}
|
||||
tableInitialized = true;
|
||||
} else if (target === '#table' && tableInitialized) {
|
||||
// Neuberechnung der Spalten, falls die Tabelle bereits initialisiert ist
|
||||
table.columns.adjust().responsive.recalc();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<script type="text/javascript"
|
||||
src="<?= self::getResourcePath() ?>assets/js/datatables-std.js?<?= date('U') ?>"></script>
|
||||
<!--script type="text/javascript"
|
||||
src="<?= self::getResourcePath() ?>assets/js/datatables-std.js?<?= date('U') ?>"></script-->
|
||||
|
||||
|
||||
<?php include(realpath(dirname(__FILE__) . "/../../$mfLayoutPackage") . "/footer.php"); ?>
|
||||
@@ -565,7 +565,7 @@ endforeach;
|
||||
</div>
|
||||
<div class="d-inline-block ml-2">
|
||||
<div class="dropdown">
|
||||
<button style="padding: 1px 8px;" class="btn btn-info dropdown-toggle"
|
||||
<button style="padding: 1px 8px;" id="preview-button" class="btn btn-info dropdown-toggle"
|
||||
type="button" data-toggle="dropdown" aria-expanded="false">
|
||||
Vorlagen
|
||||
</button>
|
||||
@@ -671,6 +671,7 @@ endforeach;
|
||||
let requestUpdateColorUrl = "<?= self::getUrl("Calendar", "api", ['do' => 'updateCalendarColor']) ?>";
|
||||
let requestDeleteUrl = "<?= self::getUrl("Calendar", "api", ['do' => 'deleteCalendarEvent']) ?>";
|
||||
let requestUpdateEventsUrl = "<?= self::getUrl("api/v1/calendar")?>/calendarStream?user=<?= $encryptedUser ?>";
|
||||
let requestgetpreviewtUrl = "<?= self::getUrl("CalendarTemplate", "api", ['do' => 'getPreview']) ?>";
|
||||
let calendarRights = '<?php echo json_encode($rights); ?>';
|
||||
|
||||
var holiDays = [];
|
||||
|
||||
172
Layout/default/CalendarTemplate/Form.php
Normal file
172
Layout/default/CalendarTemplate/Form.php
Normal file
@@ -0,0 +1,172 @@
|
||||
<?php include(realpath(dirname(__FILE__) . "/../../$mfLayoutPackage") . "/header.php"); ?>
|
||||
<link href="<?= self::getResourcePath() ?>assets/css/select2-cstm.css?<?= date('U') ?>" rel="stylesheet"
|
||||
type="text/css"/>
|
||||
<style>
|
||||
.btn-sm {
|
||||
padding: .1rem .5rem;
|
||||
font-size: .9rem;
|
||||
line-height: 1.5;
|
||||
border-radius: .15rem;
|
||||
}
|
||||
</style>
|
||||
<!-- start page title -->
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="page-title-box">
|
||||
<div class="page-title-right">
|
||||
<ol class="breadcrumb m-0">
|
||||
<li class="breadcrumb-item"><a href="<?= self::getUrl("Dashboard") ?>"><?= MFAPPNAME_SLUG ?></a>
|
||||
</li>
|
||||
<li class="breadcrumb-item"><a
|
||||
href="<?= self::getUrl("CalendarTemplate") ?>">Vorlagen</a></li>
|
||||
<li class="breadcrumb-item active"><?= ($calendartemplates->id) ? "bearbeiten" : "Neu" ?></li>
|
||||
|
||||
</ol>
|
||||
</div>
|
||||
<h4 class="page-title"><?= ($calendartemplates->id) ? "Vorlage bearbeiten" : "Neuer Vorlage" ?></h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end page title -->
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
|
||||
<div class="card bg-light">
|
||||
<div class="card-body">
|
||||
<h4 class="header-title mb-2"><?= ($calendartemplates->id) ? "Vorlage bearbeiten" : "Neuer Vorlage" ?></h4>
|
||||
|
||||
<form class="form-horizontal" method="post"
|
||||
action="<?= self::getUrl("CalendarTemplate", "save") ?>">
|
||||
<div class="card no-shadow">
|
||||
<div class="card-body">
|
||||
<input type="hidden" name="id" value="<?= $calendartemplates->id ?>"/>
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-2 col-form-label" for="event_type">Termintyp</label>
|
||||
<div class="col-lg-3">
|
||||
<select class="select2 form-control " name="event_type" id="event_type">
|
||||
<?php foreach (CalendarTemplateModel::$calendarTemplateEventTypes as $key => $value): ?>
|
||||
<option value="<?= $key ?>" <?= ($calendartemplates->event_type == $key) ? 'selected="selected"' : '' ?>><?= $value ?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-2 col-form-label" for="name">Vorlagen Name</label>
|
||||
<div class="col-lg-3">
|
||||
<input type="text" id="name" name="name" class="form-control"
|
||||
value="<?= $calendartemplates->name ?>"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-2 col-form-label" for="is_reminder">Reminder</label>
|
||||
<div class="col-lg-3">
|
||||
<div class="form-check mt-1">
|
||||
<input class="form-check-input" <?= ($calendartemplates->is_reminder) ? 'checked="checked"' : '' ?> type="checkbox" name="is_reminder" id="is_reminder" value="1">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
|
||||
<label class="col-lg-2 col-form-label" for="text">Vorlagen Text</label>
|
||||
<div class="col-lg-3">
|
||||
<div class="snippet-buttons mb-1">
|
||||
<button class="btn btn-info btn-sm" type="button" data-snippet="[&&date&&]"
|
||||
title="Datum des Termins">Datum
|
||||
</button>
|
||||
<button class="btn btn-info btn-sm" type="button" data-snippet="[&&start&&]"
|
||||
title="Start Uhrzeit des Termins">Start
|
||||
</button>
|
||||
<button class="btn btn-info btn-sm" type="button" data-snippet="[&&end&&]"
|
||||
title="End Uhrzeit des Termins">Ende
|
||||
</button>
|
||||
<button class="btn btn-info btn-sm" type="button" data-snippet="[&&vmnm&&]"
|
||||
title="Dynamisch Vormittag/Nachmittags je nach Termin begin">dyn.
|
||||
VM/NM
|
||||
</button>
|
||||
</div>
|
||||
<textarea id="text" name="text" style="height: 200px;"
|
||||
class="form-control"><?= $calendartemplates->text ?></textarea>
|
||||
</div>
|
||||
<div class="col-lg-4">
|
||||
<h5 id="preview-info" data-date="<?= date('d.m.Y', strtotime('+1 day')) ?>"
|
||||
data-start="08:00" data-end="10:00" data-dynvmnm="vormittags"
|
||||
class="pt-0 mt-0">Vorschau für Beispieltermin: <span
|
||||
class="font-14 font-weight-normal"><?= date('d.m.Y', strtotime('+1 day')) . " 08:00 - 10:00" ?></span>
|
||||
</h5>
|
||||
<div id="text-preview"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-2"></label>
|
||||
<div class="col-lg-10">
|
||||
<button type="submit" class="btn btn-primary">Speichern</button>
|
||||
<a href="<?= self::getUrl("Calendar") ?>">
|
||||
<button type="button" class="btn btn-secondary">Abbrechen</button>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(".select2").select2({placeholder: ""});
|
||||
|
||||
// disable mousewheel on a input number field when in focus
|
||||
$('form').on('focus', 'input[type=number]', function (e) {
|
||||
$(this).on('wheel.disableScroll', function (e) {
|
||||
e.preventDefault()
|
||||
})
|
||||
});
|
||||
$('form').on('blur', 'input[type=number]', function (e) {
|
||||
$(this).off('wheel.disableScroll')
|
||||
});
|
||||
$(document).ready(function () {
|
||||
function preview() {
|
||||
let text = $("#text").val();
|
||||
text = text.replace(/\[&&vmnm&&\]/g, $("#preview-info").data("dynvmnm"));
|
||||
text = text.replace(/\[&&date&&\]/g, $("#preview-info").data("date"));
|
||||
text = text.replace(/\[&&start&&\]/g, $("#preview-info").data("start"));
|
||||
text = text.replace(/\[&&end&&\]/g, $("#preview-info").data("end"));
|
||||
text = text.replace(/\n/g, "<br>");
|
||||
$("#text-preview").html(text);
|
||||
}
|
||||
$("#text").on("keyup blur change focus", preview);
|
||||
preview();
|
||||
$('.snippet-buttons button').on('click', function () {
|
||||
var snippet = $(this).data('snippet');
|
||||
insertAtCursor('#text', snippet);
|
||||
$('#text').focus();
|
||||
});
|
||||
|
||||
function insertAtCursor(textareaSelector, text) {
|
||||
var textarea = $(textareaSelector)[0];
|
||||
var start = textarea.selectionStart;
|
||||
var end = textarea.selectionEnd;
|
||||
var value = textarea.value;
|
||||
|
||||
// Text vor und nach der Cursorposition
|
||||
var before = value.substring(0, start);
|
||||
var after = value.substring(end, value.length);
|
||||
|
||||
// Neuen Wert setzen
|
||||
textarea.value = before + text + after;
|
||||
|
||||
// Cursorposition setzen
|
||||
var cursorPosition = start + text.length;
|
||||
textarea.selectionStart = textarea.selectionEnd = cursorPosition;
|
||||
}
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
<?php include(realpath(dirname(__FILE__) . "/../../$mfLayoutPackage") . "/footer.php"); ?>
|
||||
88
Layout/default/CalendarTemplate/Index.php
Normal file
88
Layout/default/CalendarTemplate/Index.php
Normal file
@@ -0,0 +1,88 @@
|
||||
<?php include(realpath(dirname(__FILE__) . "/../../$mfLayoutPackage") . "/header.php"); ?>
|
||||
<link href="<?= self::getResourcePath() ?>assets/css/datatables-std.css?<?= date('U') ?>" rel="stylesheet"
|
||||
type="text/css"/>
|
||||
<!-- start page title -->
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="page-title-box">
|
||||
<div class="page-title-right">
|
||||
<ol class="breadcrumb m-0">
|
||||
<li class="breadcrumb-item"><a href="<?= self::getUrl("Dashboard") ?>"><?= MFAPPNAME_SLUG ?></a>
|
||||
</li>
|
||||
<li class="breadcrumb-item active">Vorlagen</li>
|
||||
</ol>
|
||||
</div>
|
||||
<h4 class="page-title">Vorlagen</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end page title -->
|
||||
|
||||
|
||||
<div class="card">
|
||||
<div class="card-body mb-3">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="float-left">
|
||||
<h4 class="header-title">Liste aller Vorlagen</h4>
|
||||
</div>
|
||||
<div class="float-right">
|
||||
<a class="btn btn-primary mb-2" href="<?= self::getUrl("CalendarTemplate", "add") ?>"><i
|
||||
class="fas fa-plus"></i> Neuen Vorlage anlegen</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<table id="datatable" class="table table-striped table-hover table-sm">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-center">Termintyp</th>
|
||||
<th class="text-center">Vorlagen Name</th>
|
||||
<th class="text-center">Reminder</th>
|
||||
<th class="text-center">Vorlagen Text</th>
|
||||
<th class="edit-width"></th>
|
||||
</tr>
|
||||
<tr id="filterrow">
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($calendartemplates as $calendartemplate): ?>
|
||||
<tr>
|
||||
<td class="text-center"><?= $calendarTemplateEventTypes[$calendartemplate->event_type] ?></td>
|
||||
<td><?= $calendartemplate->name ?></td>
|
||||
<td style="text-align: center" class="text-center"><?= ($calendartemplate->is_reminder) ? 'Ja' : 'Nein' ?></td>
|
||||
<td><?= $calendartemplate->text ?></td>
|
||||
<td style="text-align: left; letter-spacing: 4px; font-size: 1.1em;">
|
||||
<a href="<?= self::getUrl("CalendarTemplate", "edit", ["id" => $calendartemplate->id]) ?>"><i
|
||||
class="far fa-edit" title="Bearbeiten"></i></a>
|
||||
<a href="<?= self::getUrl("CalendarTemplate", "delete", ["id" => $calendartemplate->id]) ?>"
|
||||
onclick="if(!confirm('Vorlage wirklich löschen?')) return false;" class="text-danger"
|
||||
title="Löschen"><i class="fas fa-trash"></i></a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var hidesearch = [4];
|
||||
|
||||
$(document).ready(function () {
|
||||
|
||||
});
|
||||
</script>
|
||||
<script type="text/javascript"
|
||||
src="<?= self::getResourcePath() ?>assets/js/datatables-std.js?<?= date('U') ?>"></script>
|
||||
|
||||
|
||||
<?php include(realpath(dirname(__FILE__) . "/../../$mfLayoutPackage") . "/footer.php"); ?>
|
||||
Reference in New Issue
Block a user