aboutsummaryrefslogtreecommitdiff
path: root/app/views/admission/courseset/index.php
blob: 656b5bab111a2b7cdf41857ac8c3f5d99d7ee6c6 (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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
<?php
/**
 * @var CourseSet[] $coursesets
 * @var Admission_CoursesetController $controller
 * @var string $course_set_details
 */
Helpbar::get()->addPlainText(_('Info'),_("Anmeldesets legen fest, wer sich zu den zugeordneten Veranstaltungen anmelden darf."));
Helpbar::get()->addPlainText(_('Info'),_("Hier sehen Sie alle Anmeldesets, auf die Sie Zugriff haben."));

?>
<?= $this->render_partial('admission/courseset/_institute_choose.php') ?>
<?php
if ($coursesets) {
?>
<form action="<?= $controller->link_for('admission/courseset/bulk') ?>" method="post">
    <table class="default nohover sortable-table" id="courseset-list">
        <colgroup>
            <col style="width: 24px">
            <col>
            <col style="width: 25%">
            <col style="width: 5%">
            <col style="width: 5%">
            <col style="width: 10%">
            <col style="width: 100px">
        </colgroup>
        <thead>
            <tr>
                <th data-sort="false">
                    <input type="checkbox"
                           data-proxyfor="#courseset-list tbody :checkbox"
                           data-activates="#courseset-list tfoot .button">
                </th>
                <th data-sort="text"><?= _('Name des Sets') ?></th>
                <th data-sort="text"><?= _('Besitzer') ?></th>
                <th data-sort="htmldata"><?= _('Privat') ?></th>
                <th data-sort="numeric"><?= _('Anzahl') ?></th>
                <th data-sort="htmldata"><?= _('Letzte Änderung') ?></th>
                <th data-sort="false" class="actions"><?= _('Aktionen') ?></th>
            </tr>
        </thead>
        <tbody>
        <? foreach ($coursesets as $courseset) : ?>
            <tr>
                <td>
                    <input type="checkbox" name="ids[]" value="<?= htmlReady($courseset->getId()) ?>">
                </td>
                <td><?= htmlReady(my_substr($courseset->getName(),0,70)) ?></td>
                <td><?= htmlReady(get_fullname($courseset->getUserId(), 'no_title_rev')) ?></td>
                <td data-sort-value="'<?= $courseset->getPrivate() ? 1 : 0 ?>'">
                    <?= $courseset->getPrivate() ? _('Ja') : _('Nein') ?>
                </td>
                <td><?= count($courseset->getCourses()) ?></td>
                <td data-sort-value="<?= $courseset->getChdate() ?>">
                    <time datetime="<?= date('Y-m-d H:i:s', $courseset->getChdate()) ?>" title="<?= strftime('%x %X', $courseset->getChdate()) ?>">
                        <?= reltime($courseset->getChdate()) ?>
                    </time>
                </td>
                <td class="actions">
                    <a class="load-in-new-row" href="<?= $controller->link_for('', ['course_set_details' => $courseset->getId()]); ?>">
                        <?= Icon::create('info')->asSvg(['title' => _('Weitere Informationen einblenden')]) ?>
                    </a>
                    <? if ($courseset->isUserAllowedToEdit($GLOBALS['user']->id)) : ?>
                    <a href="<?= $controller->link_for('admission/courseset/copy/'.$courseset->getId()); ?>">
                            <?= Icon::create('clipboard')->asSvg(['title' => _('Anmeldeset kopieren'), "alt" => _('Anmeldeset kopieren')]); ?>
                        </a>
                    <a href="<?= $controller->link_for('admission/courseset/configure/'.$courseset->getId()); ?>">
                            <?= Icon::create('edit')->asSvg(['title' => _('Anmeldeset bearbeiten')]) ?>
                        </a>
                        <a href="<?= $controller->link_for('admission/courseset/delete/'. $courseset->getId(), ['really' => 1]) ?>"
                           data-confirm="<?= sprintf(_('Soll das Anmeldeset %s wirklich gelöscht werden?'), htmlReady($courseset->getName())) ?>">
                            <?= Icon::create('trash')->asSvg(['title' => _('Anmeldeset löschen')]) ?>
                        </a>
                     <? endif ?>
                </td>
            </tr>
            <? if ($course_set_details == $courseset->getId()) : ?>
                <tr>
                    <td colspan="7">
                        <?= $courseset->toString() ?>
                    </td>
                </tr>
            <? endif ?>
        <? endforeach ?>
        </tbody>
        <tfoot>
            <tr>
                <td colspan="7">
                    <?= Studip\Button::create(_('Löschen'), 'delete', [
                        'data-confirm' => _('Sollen die markierten Anmeldesets wirklich gelöscht werden?'),
                    ]) ?>
                </td>
            </tr>
        </tfoot>
    </table>
</form>
<?php
} else {
?>
<?= MessageBox::info(sprintf(_('Es wurden keine Anmeldesets gefunden. Sie können ein '.
    'neues %sAnmeldeset anlegen%s.'), '<a href="'.
    $controller->url_for('admission/courseset/configure').'">',
    '</a>')); ?>
<?php
}
?>