Added MaintenanceNotification
This commit is contained in:
117
Layout/default/MaintenanceNotification/Form.php
Normal file
117
Layout/default/MaintenanceNotification/Form.php
Normal file
@@ -0,0 +1,117 @@
|
||||
<?php include(realpath(dirname(__FILE__)."/../../$mfLayoutPackage")."/header.php"); ?>
|
||||
|
||||
<!-- 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("MaintenanceNotification")?>">Wartungsmeldungen</a></li>
|
||||
<li class="breadcrumb-item active"><?=($notification && $notification->id) ? "Bearbeiten" : "Neu" ?></li>
|
||||
</ol>
|
||||
</div>
|
||||
<h4 class="page-title"><?=($notification->id) ? "Wartungsmeldung bearbeiten" : "Neue Wartungsmeldung" ?></h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end page title -->
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
|
||||
<div class="card bg-light">
|
||||
<div class="card-body">
|
||||
|
||||
<form class="form-horizontal" method="post" action="<?=self::getUrl("MaintenanceNotification", "save")?>" enctype="multipart/form-data">
|
||||
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
|
||||
<input type="hidden" name="id" value="<?=$notification->id?>" />
|
||||
|
||||
<label class="form-label" for="from">Wartungsfenster Von *:</label>
|
||||
<div class="form-group row">
|
||||
<div class="col-2">
|
||||
<input type="text" class="form-control datepicker" name="from_date" id="from_date" placeholder="Datum" value="<?=($notification && $notification->from) ? date("d.m.Y", $notification->from) : ""?>" />
|
||||
</div>
|
||||
<div class="col-2">
|
||||
<input type="text" class="form-control timepicker" name="from_time" id="from_time" placeholder="Uhrzeit" value="<?=($notification && $notification->from) ? date("H:i", $notification->from) : ""?>" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<label class="form-label" for="from">Wartungsfenster Bis *:</label>
|
||||
<div class="form-group row">
|
||||
<div class="col-2">
|
||||
<input type="text" class="form-control datepicker" name="to_date" id="to_date" placeholder="Datum" value="<?=($notification && $notification->to) ? date("d.m.Y", $notification->to) : ""?>"/>
|
||||
</div>
|
||||
<div class="col-2">
|
||||
<input type="text" class="form-control timepicker" name="to_time" id="to_time" placeholder="Uhrzeit" value="<?=($notification && $notification->to) ? date("H:i", $notification->to) : ""?>"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row col-12">
|
||||
<label class="form-label" for="from">PLZ-Bereich *:</label>
|
||||
<textarea class="form-control" name="plz" id="from" style="height: 86px;"><?=($notification && $notification->plzs) ? implode(", ", $notification->plzs) : ""?></textarea>
|
||||
<small class="text-primary">PLZ' mit Leerzeichen oder Komma getrennt</small>
|
||||
</div>
|
||||
|
||||
|
||||
<hr />
|
||||
|
||||
<div class="form-group row mt-3 col-12">
|
||||
<label class="form-label" for="subject_id">Betreff *:</label>
|
||||
<select name="subject_id" id="subject_id" class="form-control" onchange="changeText(this)">
|
||||
<option></option>
|
||||
<?php foreach(MaintenanceNotificationTemplate::getAll() as $tpl): ?>
|
||||
<option value="<?=$tpl->id?>" <?=($notification && $notification->subject_id == $tpl->id) ? "selected='selected'" : ""?> data-text-template="<?=htmlentities($tpl->text)?>"><?=htmlentities($tpl->subject)?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<label class="form-label" for="text">Wartungsmeldung Text *:</label>
|
||||
<textarea id="text" name="text" placeholder="Bitte geben Sie hier den Emailinhalt ein..." rows="12" style="width: 100%; height: 600px; padding: 10px;"><?= htmlentities($notification->text)?></textarea>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-lg-2"></label>
|
||||
<div class="col-lg-10">
|
||||
<button type="submit" name="return" value="form" class="btn btn-primary mr-1">Speichern</button>
|
||||
<button type="submit" name="return" value="index" class="btn btn-primary">Speichern und zur Übersicht</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$('.datepicker').datepicker({
|
||||
language: 'de',
|
||||
format: "dd.mm.yyyy",
|
||||
showWeekDays: true,
|
||||
todayBtn: 'linked',
|
||||
orientation: "bottom",
|
||||
autoclose: true
|
||||
});
|
||||
$('.timepicker').timepicker({
|
||||
format: "HH:mm"
|
||||
});
|
||||
});
|
||||
|
||||
function changeText(elem) {
|
||||
var text = $(elem).find(":selected").data("text-template");
|
||||
$("#text").text(text);
|
||||
}
|
||||
</script>
|
||||
|
||||
<?php include(realpath(dirname(__FILE__)."/../../$mfLayoutPackage")."/footer.php"); ?>
|
||||
107
Layout/default/MaintenanceNotification/Index.php
Normal file
107
Layout/default/MaintenanceNotification/Index.php
Normal file
@@ -0,0 +1,107 @@
|
||||
<?php include(realpath(dirname(__FILE__)."/../../$mfLayoutPackage")."/header.php"); ?>
|
||||
|
||||
<!-- 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">Wartungsmeldungen</li>
|
||||
</ol>
|
||||
</div>
|
||||
<h4 class="page-title">Wartungsmeldungen</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end page title -->
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
|
||||
<div class="card">
|
||||
<div class="card-body mb-3">
|
||||
<h4 class="header-title mb-3">Filter</h4>
|
||||
|
||||
<form method="get" action="<?=self::getUrl("Mailtemplate")?>">
|
||||
<div class="row">
|
||||
|
||||
<div class="col-1">
|
||||
<label class="form-label" for="filter_name">Name</label>
|
||||
<input type="text" class="form-control" name="filter[name]" id="filter_name" value="<?=$filter['name']?>" />
|
||||
</div>
|
||||
|
||||
<div class="col-1">
|
||||
<label class="form-label" for="filter_description">Beschreibung</label>
|
||||
<input type="text" class="form-control" name="filter[description]" id="filter_description" value="<?=$filter['description']?>" />
|
||||
</div>
|
||||
|
||||
<div class="col-1">
|
||||
<label class="form-label" for="filter_subject">Betreff</label>
|
||||
<input type="text" class="form-control" name="filter[subject]" id="filter_betreff" value="<?=$filter['subject']?>" />
|
||||
</div>
|
||||
|
||||
<div class="col-1">
|
||||
<label class="form-label" for="filter_is_include">Betreff</label>
|
||||
<select class="form-control" name="filter[is_include]" id="filter_is_include">
|
||||
<option></option>
|
||||
<option value="0" <?=(array_key_exists("is_include", $filter) && $filter["is_include"] == 0) ? "selected='selected'" : ""?>>Dokumente</option>
|
||||
<option value="1" <?=(array_key_exists("is_include", $filter) && $filter["is_include"] == 1) ? "selected='selected'" : ""?>>Templates</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="row mt-2">
|
||||
<div class="col">
|
||||
<button type="submit" class="btn btn-primary">Filter anwenden</button>
|
||||
<a class="btn btn-secondary" href="<?=self::getUrl("MaintenanceNotification")?>?resetFilter=1">Filter zurücksetzen</a>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="card">
|
||||
<div class="card-body mb-3">
|
||||
<div class="float-left">
|
||||
<h4 class="header-title">Liste offener Wartungsmeldungen</h4>
|
||||
</div>
|
||||
<div class="float-right">
|
||||
<a class="btn btn-primary mb-2" href="<?=self::getUrl("MaintenanceNotification", "add")?>"><i class="fas fa-plus"></i> Neue Wartungsmeldungen erstellen</a>
|
||||
</div>
|
||||
|
||||
<table class="table table-striped table-hover">
|
||||
<tr>
|
||||
<th>Betreff</th>
|
||||
<th>PLZ-Bereich</th>
|
||||
<th>Versandtermin</th>
|
||||
<th>Aussendung abgeschlossen</th>
|
||||
<th>Erstellt</th>
|
||||
<th>Bearbeitet</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
<?php foreach($notifications as $notification): ?>
|
||||
<tr>
|
||||
<td><?=$notification->subject?></td>
|
||||
<td><?=($notification->plz) ? implode(", ", $notification->plzs) : ""?></td>
|
||||
<td><?=($notification->send_ts) ? date("d.m.Y H:i", $notification->send_ts) : ""?></td>
|
||||
<td><?=($notification->sent) ? "Ja" : "nein"?></td>
|
||||
<td><?=date("d.m.Y H:i",$notification->create)?> (<?=$notification->editor->name?>)</td>
|
||||
<td><?=date("d.m.Y H:i",$notification->edit)?> (<?=$notification->creator->name?>)</td>
|
||||
<td style="text-align: left; letter-spacing: 4px; font-size: 1.1em;">
|
||||
<a href="<?=self::getUrl("MaintenanceNotification", "edit", ["id" => $notification->id])?>"><i class="far fa-edit" title="Wartungsmeldung bearbeiten"></i></a>
|
||||
<a href="<?=self::getUrl("MaintenanceNotification", "delete", ["id" => $notification->id])?>" class="text-danger" onclick="if(!confirm('Wartungsmeldung wirklich löschen?')) return false;" title="Wartungsmeldung Löschen"><i class="fas fa-trash"></i></a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php include(realpath(dirname(__FILE__)."/../../$mfLayoutPackage")."/footer.php"); ?>
|
||||
Reference in New Issue
Block a user