Merge branch 'fronkdev' into 'master'
Added Journal/History/Contacts to ConstructionConsent See merge request fronk/thetool!938
This commit is contained in:
@@ -377,6 +377,18 @@
|
||||
|
||||
}
|
||||
|
||||
$("#kg").change(updateGstnr);
|
||||
$("#gst").change(updateGstnr);
|
||||
|
||||
function updateGstnr() {
|
||||
let kg = $("#kg").val();
|
||||
let gst = $("#gst").val();
|
||||
|
||||
if(!kg || !gst) return;
|
||||
|
||||
$("#gstnr").val(kg + gst);
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<?php include(realpath(dirname(__FILE__) . "/../../$mfLayoutPackage") . "/footer.php"); ?>
|
||||
@@ -60,9 +60,12 @@ $pagination_entity_name = "Adressen";
|
||||
<?=$item->adb_hausnummer->strasse->gemeinde->name?>
|
||||
</td>
|
||||
</tr><tr>
|
||||
<th>Anzahl Bestellungen</th>
|
||||
<td><?=$item->preorder_count?></td>
|
||||
</tr>
|
||||
<th>Wohneinheiten</th>
|
||||
<td><?=$item->adb_hausnummer->unit_count?></td>
|
||||
</tr><tr>
|
||||
<th>Bestellungen</th>
|
||||
<td><?=$item->preorder_count?></td>
|
||||
</tr>
|
||||
<?php else: ?>
|
||||
<tr>
|
||||
<th>Straße</th>
|
||||
@@ -156,6 +159,43 @@ $pagination_entity_name = "Adressen";
|
||||
</div>
|
||||
|
||||
<div class="col-7">
|
||||
<div class="card border-top-warning">
|
||||
<div class="card-body">
|
||||
<h3 class="text-center mb-3">Ansprechpartner
|
||||
<small><a data-toggle="modal" data-target="#newContactModal" href="#"><i class="fas fa-plus"></i> Neuen Ansprechpartner hinzufügen</a></small>
|
||||
</h3>
|
||||
|
||||
<?php if(!is_array($item->contacts) || !count($item->contacts)): ?>
|
||||
<i>Keine Ansprechpartner eingetragen</i>
|
||||
<?php else: ?>
|
||||
<table class="table table-sm table-striped table-hover">
|
||||
<tr>
|
||||
<th>Kontakttyp</th>
|
||||
<th>Name</th>
|
||||
<th>Telefon</th>
|
||||
<th>Fax</th>
|
||||
<th>Email</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
<?php foreach($item->contacts as $type => $contacts): ?>
|
||||
<?php foreach($contacts as $contact): ?>
|
||||
<tr>
|
||||
<td class="text-monospace"><?=__($contact->type, "consent")?></td>
|
||||
<td><?=$contact->name?></td>
|
||||
<td><?=$contact->phone?></td>
|
||||
<td><?=$contact->fax?></td>
|
||||
<td><?=$contact->email?></td>
|
||||
<td>
|
||||
<!--a href="<?=self::getUrl("ConstructionConsentContact", "edit", ["contact_id" => $contact->id])?>" title="Ansprechpartner bearbeiten"><i class="far fa-fw fa-edit"></i></a-->
|
||||
<a href="<?=self::getUrl("ConstructionConsentContact", "delete", ["contact_id" => $contact->id])?>" onclick="if(!confirm('Ansprechpartner wirklich löschen?')) return false;" class="text-danger" title="Löschen"><i class="fas fa-trash"></i></a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
<?php endforeach; ?>
|
||||
</table>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card border-top-success">
|
||||
<div class="card-body">
|
||||
@@ -193,12 +233,13 @@ $pagination_entity_name = "Adressen";
|
||||
<?=$owner->email?>
|
||||
</td>
|
||||
<td class="text-monospace">
|
||||
<span id="status-<?=$owner->id?>-text" data-status-id="<?=$owner->status?>"><span id="status-<?=$owner->id?>-statustext"><?=__($owner->status, "consent")?></span> <a href="#" onclick="return toggleStatusControl(<?=$owner->id?>)"><i class="fas fa-fw fa-edit"></i></a></span>
|
||||
<span id="status-<?=$owner->id?>-text" data-status-id="<?=$owner->status?>"><span id="status-<?=$owner->id?>-statustext"><?=($owner->status) ? __($owner->status, "consent") : ""?></span> <a href="#" onclick="return toggleStatusControl(<?=$owner->id?>)"><i class="fas fa-fw fa-edit"></i></a></span>
|
||||
<div class="input-group" id="status-<?=$owner->id?>-input" style="display:none">
|
||||
<select class="form-control">
|
||||
<option value="new" <?=($owner->status == "new") ? "selected='selected'" : ""?>><?=__("new", "consent")?></option>
|
||||
<option value="requested" <?=($owner->status == "requested") ? "selected='selected'" : ""?>><?=__("requested", "consent")?></option>
|
||||
<option value="answered" <?=($owner->status == "answered") ? "selected='selected'" : ""?>><?=__("answered", "consent")?></option>
|
||||
<option value="sent" <?=($owner->status == "sent") ? "selected='selected'" : ""?>><?=__("sent", "consent")?></option>
|
||||
<option value="returned" <?=($owner->status == "returned") ? "selected='selected'" : ""?>><?=__("returned", "consent")?></option>
|
||||
<option value="outstanding" <?=($owner->status == "outstanding") ? "selected='selected'" : ""?>><?=__("outstanding", "consent")?></option>
|
||||
</select>
|
||||
<div class="input-group-append">
|
||||
<button type="button" class="btn btn-primary" title="Speichern" onclick="saveStatusControl(<?=$owner->id?>)"><i class="fas fa-check"></i></button>
|
||||
@@ -211,8 +252,10 @@ $pagination_entity_name = "Adressen";
|
||||
<div class="input-group" id="result-<?=$owner->id?>-input" style="display:none">
|
||||
<select class="form-control">
|
||||
<option></option>
|
||||
<option value="success" <?=($owner->result == "success") ? "selected='selected'" : ""?>><?=__("success", "consent")?></option>
|
||||
<option value="failure" <?=($owner->result == "failure") ? "selected='selected'" : ""?>><?=__("failure", "consent")?></option>
|
||||
<option value="open" <?=($owner->result == "open") ? "selected='selected'" : ""?>><?=__("open", "consent")?></option>
|
||||
<option value="accepted" <?=($owner->result == "accepted") ? "selected='selected'" : ""?>><?=__("accepted", "consent")?></option>
|
||||
<option value="denied" <?=($owner->result == "denied") ? "selected='selected'" : ""?>><?=__("denied", "consent")?></option>
|
||||
<option value="unresolvable" <?=($owner->result == "unresolvable") ? "selected='selected'" : ""?>><?=__("unresolvable", "consent")?></option>
|
||||
</select>
|
||||
<div class="input-group-append">
|
||||
<button type="button" class="btn btn-primary" title="Speichern" onclick="saveResultControl(<?=$owner->id?>)"><i class="fas fa-check"></i></button>
|
||||
@@ -236,14 +279,86 @@ $pagination_entity_name = "Adressen";
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-6">
|
||||
|
||||
<div class="card border-top-warning">
|
||||
<div class="card-body">
|
||||
<h4>Journal</h4>
|
||||
|
||||
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<button type="button" class="btn btn-sm btn-info" onclick="$('#new-journal').toggle(); $('#new-journal-text').focus()"><i class="fas fa-plus"></i> Neuer Journaleintrag</button>
|
||||
<div id="new-journal" class="hidden mt-2">
|
||||
<form method="post" action="<?=self::getUrl("ConstructionConsentJournal", "save")?>">
|
||||
<input type="hidden" name="consent_id" value="<?=$item->id?>" />
|
||||
<textarea id="new-journal-text" name="text" class="form-control mb-2" style="height:120px;" placeholder="Text hier eingeben..."></textarea>
|
||||
<button class="btn btn-sm btn-primary" type="submit"><i class="fas fa-save"></i> Speichern</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<table class="table table-striped table-sm journal">
|
||||
<?php foreach($item->journal as $j): ?>
|
||||
<tr>
|
||||
<td style="white-space: nowrap" class="text-monospace"><?=date("d.m.Y H:i", $j->create)?> (<?=$j->creator?>)</td>
|
||||
<td style="width: 100%">
|
||||
<?=nl2br($j->text)?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-lg-6">
|
||||
|
||||
<div class="card border-top-info">
|
||||
<div class="card-body">
|
||||
<h4>History</h4>
|
||||
|
||||
<div style="max-height: 550px; overflow: scroll">
|
||||
<table class="table table-sm table-striped">
|
||||
<tr>
|
||||
<th>Zeitpunkt</th>
|
||||
<th>Benutzer</th>
|
||||
<th>Feld</th>
|
||||
<th>Alter Wert</th>
|
||||
<th>Neuer Wert</th>
|
||||
</tr>
|
||||
<?php foreach($item->history as $history): ?>
|
||||
<tr>
|
||||
<td class="text-monospace"><?=date("d.m.Y H:i:s", $history->create)?></td>
|
||||
<td><?=$history->creator->name?></td>
|
||||
<td><?=$history->getKey()?></td>
|
||||
<td class="text-monospace"><?=$history->getText("old")?></td>
|
||||
<td class="text-monospace"><?=$history->getText("new")?></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
|
||||
</div>
|
||||
|
||||
<div class="modal fade" id="newOwnerModal" aria-hidden="true" aria-labelledby="#newOwnerModelLabel" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-dialog modal-dialog-centered">
|
||||
<div class="modal-content">
|
||||
<form method="post" action="<?=self::getUrl("ConstructionConsentOwner", "save")?>">
|
||||
<div class="modal-header">
|
||||
@@ -350,6 +465,79 @@ $pagination_entity_name = "Adressen";
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal fade" id="newContactModal" aria-hidden="true" aria-labelledby="#newContactModelLabel" tabindex="-1">
|
||||
<div class="modal-dialog modal-dialog-centered">
|
||||
<div class="modal-content">
|
||||
<form method="post" action="<?=self::getUrl("ConstructionConsentContact", "save")?>">
|
||||
<div class="modal-header">
|
||||
<h3 class="modal-title" id="newContactModelLabel">Neuen Ansprechpartner hinzufügen</h3>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
|
||||
<input type="hidden" name="constructionconsent_id" value="<?=$item->id?>" />
|
||||
|
||||
<div class="form-group">
|
||||
<label for="street" class="col-form-label">Kontakttyp:</label>
|
||||
<select class="form-control" name="type" id="contact_type">
|
||||
|
||||
<option value="property_manager">Hausverwaltung</option>
|
||||
<option value="electrician">Elektriker</option>
|
||||
<option value="contact">Ansprechpartner</option>
|
||||
<option value="other">Sonstige</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="name" class="col-form-label">Name: *</label>
|
||||
<textarea class="form-control" name="name" id="contact_name"></textarea>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="street" class="col-form-label">Straße:</label>
|
||||
<input type="text" class="form-control" name="street" id="contact_street" />
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="zip" class="col-form-label">PLZ / Ort:</label>
|
||||
<div class="row">
|
||||
<div class="col-4">
|
||||
<input type="text" class="form-control" name="zip" id="contact_zip" />
|
||||
</div>
|
||||
<div class="col-8">
|
||||
<input type="text" class="form-control" name="city" id="contact_city" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="phone" class="col-form-label">Telefon:</label>
|
||||
<input type="text" class="form-control" name="phone" id="contact_phone" />
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="fax" class="col-form-label">Fax:</label>
|
||||
<input type="text" class="form-control" name="fax" id="contact_fax" />
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="email" class="col-form-label">Email:</label>
|
||||
<input type="text" class="form-control" name="email" id="contact_email" />
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">Abbrechen</button>
|
||||
<button type="submit" class="btn btn-primary">Speichern</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
@@ -454,6 +642,11 @@ $pagination_entity_name = "Adressen";
|
||||
'json');
|
||||
}
|
||||
|
||||
function toggleJournal(order_id) {
|
||||
$("#journal-container").find("div.opener").remove();
|
||||
$("#journal-container").css("max-height", "750px").css("overflow", "auto");
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<?php include(realpath(dirname(__FILE__)."/../../$mfLayoutPackage")."/footer.php"); ?>
|
||||
Reference in New Issue
Block a user