Backup #1782

ID1782
Dateipfad/var/www/dev.campus.systemische-tools.de/src/View/contracts/show.php
Version3
Typ modified
Größe4.3 KB
Hash7fb4f744912785200e1c6232c899c98bbdaca2cb93da69e54090fa56e5482910
Datum2025-12-27 14:06:17
Geändert vonclaude-code-hook
GrundClaude Code Pre-Hook Backup vor Edit-Operation
Datei existiert Ja

Dateiinhalt

<?php ob_start(); ?>

<nav class="breadcrumb">
    <a href="/contracts">Contracts</a> &raquo; <?= htmlspecialchars($contract['name']) ?>
</nav>

<h1><?= htmlspecialchars($contract['name']) ?></h1>

<?php if (isset($_SESSION['success'])): ?>
<div class="alert alert--success"><?= htmlspecialchars($_SESSION['success']) ?></div>
<?php unset($_SESSION['success']); ?>
<?php endif; ?>

<?php if (isset($_SESSION['validation_result'])): ?>
<?php $vr = $_SESSION['validation_result']; ?>
<div class="alert alert--<?= $vr['result'] === 'passed' ? 'success' : 'error' ?>">
    Validierung: <strong><?= $vr['result'] ?></strong>
    (Critical: <?= $vr['critical'] ?>, Major: <?= $vr['major'] ?>, Minor: <?= $vr['minor'] ?>)
</div>
<?php unset($_SESSION['validation_result']); ?>
<?php endif; ?>

<table>
    <tr>
        <th>ID</th>
        <td><?= $contract['id'] ?></td>
    </tr>
    <tr>
        <th>UUID</th>
        <td><code><?= $contract['uuid'] ?></code></td>
    </tr>
    <tr>
        <th>Version</th>
        <td><strong><?= htmlspecialchars($contract['version']) ?></strong></td>
    </tr>
    <tr>
        <th>Status</th>
        <td><span class="badge badge--<?= $contract['status'] ?>"><?= $contract['status'] ?></span></td>
    </tr>
    <tr>
        <th>Scope</th>
        <td><?= htmlspecialchars($contract['scope_description'] ?? '-') ?></td>
    </tr>
    <tr>
        <th>Erstellt</th>
        <td><?= $contract['created_at'] ?> von <?= htmlspecialchars($contract['created_by']) ?></td>
    </tr>
    <tr>
        <th>Aktualisiert</th>
        <td><?= $contract['updated_at'] ?></td>
    </tr>
</table>

<h2>YAML-Inhalt</h2>
<pre><code><?= htmlspecialchars($contract['yaml_content']) ?></code></pre>

<h2>Aktionen</h2>
<div class="action-bar">
    <a href="/contracts/<?= $contract['id'] ?>/edit" class="btn btn--primary">Bearbeiten</a>
    <button type="button" class="btn"
            hx-post="/contracts/<?= $contract['id'] ?>/validate"
            hx-headers='{"X-CSRF-TOKEN": "<?= $csrfToken ?>"}'
            hx-target="#validation-result"
            hx-swap="innerHTML"
            hx-disabled-elt="this">
        Validieren
    </button>
    <?php if ($contract['status'] !== 'deprecated'): ?>
    <button type="button" class="btn btn--danger"
            hx-post="/contracts/<?= $contract['id'] ?>/deprecate"
            hx-headers='{"X-CSRF-TOKEN": "<?= $csrfToken ?>"}'
            hx-confirm="Contract wirklich als deprecated markieren?"
            hx-disabled-elt="this">
        Deprecate
    </button>
    <?php endif; ?>
</div>
<div id="validation-result"></div>

<?php if (!empty($history)): ?>
<h2>Versionshistorie</h2>
<table>
    <thead>
        <tr>
            <th>Version</th>
            <th>Geändert am</th>
            <th>Von</th>
            <th>Beschreibung</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td><strong><?= htmlspecialchars($contract['version']) ?></strong> (aktuell)</td>
            <td><?= $contract['updated_at'] ?></td>
            <td>-</td>
            <td>-</td>
        </tr>
        <?php foreach ($history as $h): ?>
        <tr>
            <td><?= htmlspecialchars($h['previous_version']) ?></td>
            <td><?= $h['changed_at'] ?></td>
            <td><?= htmlspecialchars($h['changed_by']) ?></td>
            <td><?= htmlspecialchars($h['change_description'] ?? '-') ?></td>
        </tr>
        <?php endforeach; ?>
    </tbody>
</table>
<?php endif; ?>

<?php if (!empty($validations)): ?>
<h2>Letzte Validierungen</h2>
<table>
    <thead>
        <tr>
            <th>Datum</th>
            <th>Ergebnis</th>
            <th>Critical</th>
            <th>Major</th>
            <th>Minor</th>
            <th>Dauer</th>
        </tr>
    </thead>
    <tbody>
        <?php foreach ($validations as $v): ?>
        <tr>
            <td><?= $v['validated_at'] ?></td>
            <td><span class="badge badge--<?= $v['result'] === 'passed' ? 'success' : 'failed' ?>"><?= $v['result'] ?></span></td>
            <td><?= $v['critical_count'] ?></td>
            <td><?= $v['major_count'] ?></td>
            <td><?= $v['minor_count'] ?></td>
            <td><?= $v['duration_ms'] ?>ms</td>
        </tr>
        <?php endforeach; ?>
    </tbody>
</table>
<?php endif; ?>

<p style="margin-top: 2rem;">
    <a href="/contracts">&larr; Zurück zur Übersicht</a>
</p>

<?php $content = ob_get_clean(); ?>
<?php require VIEW_PATH . '/layout.php'; ?>

Vollständig herunterladen

Aktionen

Herunterladen

Andere Versionen dieser Datei

ID Version Typ Größe Datum
1782 3 modified 4.3 KB 2025-12-27 14:06
1756 2 modified 4.2 KB 2025-12-27 12:50
93 1 modified 4.1 KB 2025-12-20 19:16

← Zurück zur Übersicht