Started Contract Index

This commit is contained in:
Frank Schubert
2022-05-24 17:23:14 +02:00
parent 814261f023
commit b0fe713d0d
8 changed files with 202 additions and 29 deletions

View File

@@ -23,6 +23,12 @@
<div class="row">
<div class="col-lg-12">
<div class="row justify-content-center " >
<div class="hidden mb-4 col-6 alert alert-warning text-center" id="contract-readonly-notice">
Diese Bestellung kann nicht mehr bearbeitet werden, da sie bereits abgeschlossen und in Verrechnung ist.
</div>
</div>
<div class="card">
<div class="card-body">
@@ -34,8 +40,6 @@
<input type="hidden" name="id" value="<?=$order->id?>" />
<div class="row">
<div class="col-lg-6">
@@ -624,27 +628,22 @@
<?php else: ?>
<?php if(is_array($order->files) && count($order->files)): ?>
<table class="table table-striped table-hover">
<table id="files-table" class="table table-striped table-hover">
<tr>
<th>Name</th>
<th>Beschreibung</th>
<th>Dateiname</th>
<th>Original Dateiname</th>
<th>Hochgeladen</th>
<th>Zuletzt bearbeitet</th>
<th></th>
</tr>
<?php foreach($order->files as $file): ?>
<tr>
<td><a href="<?=self::getUrl("File", "Download", ['id' => $file->file->id])?>"><?=$file->name?></a></td>
<td><?=nl2br($file->description)?></td>
<td><?=nl2br(htmlentities($file->description))?></td>
<td><?=$file->file->filename?></td>
<td><?=$file->file->orig_filename?></td>
<td class="text-monospace"><?=date("d.m.Y", $file->create)?> (<?=$file->creator->name?>)</td>
<td class="text-monospace"><?=date("d.m.Y", $file->edit)?> (<?=$file->editor->name?>)</td>
<td>
<a href="<?=self::getUrl("OrderFile", "edit", ["id" => $file->id])?>"><i class="far fa-edit" title="Bearbeiten"></i></a>
<a href="<?=self::getUrl("OrderFile", "delete", ["id" => $file->id])?>" onclick="if(!confirm('Dokument wirklich löschen?')) return false;" class="text-danger" title="Löschen"><i class="fas fa-trash"></i></a>
<a class="delete-button" href="<?=self::getUrl("OrderFile", "delete", ["id" => $file->id])?>" onclick="if(!confirm('Dokument wirklich löschen?')) return false;" title="Löschen"><i class="fas fa-trash text-danger"></i></a>
</td>
</tr>
@@ -660,13 +659,6 @@
</div>
</div>
<div class="form-group row">
<label class="col-lg-2 col-form-label" for="file_filename">Download Dateiname</label>
<div class="col-lg-10">
<input type="text" class="form-control" name="file_filename" id="file_filename" />
</div>
</div>
<div class="form-group row">
<label class="col-lg-2 col-form-label" for="file_description">Beschreibung</label>
<div class="col-lg-10">
@@ -1183,6 +1175,17 @@
<?php if(!$order->finish_date): ?>
$('#finish_date_field').hide();
<?php endif; ?>
<?php if($order->finish_date && is_array($order->contracts) && count($order->contracts)): ?>
$("input").prop("disabled", true);
$("input[type=text]").prop("readonly", true);
$("select").prop("disabled", true);
$("textarea").prop("disabled", true);
$("button").prop("disabled", true);
//$("#files-table a.edit-button").removeAttr("href");
$("#files-table a.delete-button").removeAttr("href").removeAttr("onclick");
$("#contract-readonly-notice").show();
<?php endif; ?>
});