aboutsummaryrefslogtreecommitdiff
path: root/app/views/admin/lockrules/index.php
blob: 9835b3b2ad65af5ae42631fc4913289f42ad623d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<?php
# Lifter010: TODO
?>

<form method="post" class="default">
    <?= CSRFProtection::tokenTag() ?>
    <table class="default">
        <caption>
            <?= _('Sperrebenen für den Bereich:') ?> <?= $rule_type_names[$lock_rule_type]; ?>
        </caption>
        <colgroup>
            <col width="30%">
            <col width="50%">
            <col width="20%">
        </colgroup>
        <thead>
        <tr>
            <th><?= _('Name') ?></th>
            <th><?= _('Beschreibung') ?></th>
            <th><?= _('Besitzer') ?></th>
            <th><?= _('Aktionen') ?></th>
        </tr>
        </thead>
        <tbody>
        <? if(count($lock_rules) > 0) : ?>
            <? foreach ($lock_rules as $rule): ?>
                <tr>
                    <td>
                        <?= htmlReady($rule->name) ?>
                    </td>
                    <td>
                        <?= htmlReady(my_substr($rule->description, 0, 100)) ?>
                    </td>
                    <td>
                        <?= htmlReady($rule->user_id ? get_fullname($rule->user_id) : '') ?>
                    </td>
                    <td class="actions">
                        <a href="<?= $controller->url_for('admin/lockrules/edit/' . $rule->lock_id) ?>">
                            <?= Icon::create('edit', 'clickable', ['title' => _('Diese Regel bearbeiten')])->asImg() ?>
                        </a>

                        <?
                        if ($rule->getUsage()) :?>
                            <? $msg = sprintf(_('Sie beabsichtigen die Ebene %s zu löschen. Diese Ebene wird von %s Objekten benutzt. Soll sie trotzdem gelöscht werden?'),
                                htmlReady($rule->name), htmlReady($rule->getUsage())) ?>
                        <? else : ?>
                            <? $msg = sprintf(_('Möchten Sie die Ebene %s löschen?'), $rule->name) ?>
                        <? endif ?>
                        <?= Icon::create('trash', 'clickable', [
                                'title' => _('Diese Regel löschen'),
                                'style' => 'vertical-align: middle'
                            ])->asInput(['data-confirm'=>$msg,'formaction'=>$controller->url_for('admin/lockrules/delete/'.$rule->lock_id)]) ?>
                    </td>
                </tr>
            <? endforeach; ?>
        <? else :?>
            <tr>
                <td colspan="4" style="text-align: center">
                    <?=_('Keine Sperrebenen vorhanden')?>
                </td>
            </tr>
        <? endif?>
        </tbody>
    </table>
</form>