aboutsummaryrefslogtreecommitdiff
path: root/app/views/questionnaire/assign_step1.php
blob: 7904c823ab09f3cdb1c3d7b9d7a33d8c040142c7 (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
<article class="studip">
    <header><h1><?= _('Gefundene Veranstaltungen') ?></h1></header>
    <section>
        <? if ($found_courses): ?>
            <table class="default">
                <colgroup>
                    <col width="30px">
                    <col>
                    <col>
                </colgroup>
                <thead>
                    <tr>
                        <th>
                            <input type="checkbox" data-proxyfor=".FoundCourseListItem"
                                   id="AskALotPlugin_course_select_proxy"
                                   data-proxyfor="input[name='course_id_list[]']"
                                   data-activates="#questionnaire_assign_step1_button">
                        </th>
                        <th><?= dgettext('AskALotPlugin', 'Veranstaltung') ?></th>
                        <th><?= dgettext('AskALotPlugin', 'Lehrende') ?></th>
                    </tr>
                </thead>
                <tbody>
                    <? foreach ($found_courses as $found_course): ?>
                        <? $teachers = CourseMember::findByCourseAndStatus(
                            $found_course->id,
                            'dozent'
                        );
                        $teacher_arr = [];
                        foreach ($teachers as $teacher) {
                            $teacher_arr[] = $teacher->getUserFullName();
                        } ?>
                        <tr>
                            <td>
                                <input type="checkbox" name="course_id_list[]"
                                       class="FoundCourseListItem"
                                       value="<?= htmlReady($found_course->id) ?>">
                            </td>
                            <td>
                                <a href="<?= $controller->link_for(
                                         'course/details',
                                         ['cid' => $found_course->id]
                                         ) ?>" data-dialog="1">
                                    <?= htmlReady($found_course->getFullName()) ?>
                                </a>
                            </td>
                            <td><?= htmlReady(implode(', ', $teacher_arr)) ?></td>
                        </tr>
                    <? endforeach ?>
                </tbody>
            </table>
            <?= \Studip\Button::create(
                _('Auswählen'),
                'select_courses',
                [
                    'id' => 'questionnaire_assign_step1_button',
                    'disabled' => 'disabled'
                ]
            ) ?>
        <? else: ?>
            <?= MessageBox::info(
                _('Es wurden keine zur Suche passenden Veranstaltungen gefunden!')
            ) ?>
        <? endif ?>
        <?= \Studip\LinkButton::create(
            _('Neue Suche'),
            $controller->link_for('questionnaire/assign')
        ) ?>
    </section>
</article>