aboutsummaryrefslogtreecommitdiff
path: root/app/views/course/wizard/steps/basicdata/index.php
blob: 1d16c9d5ce380f14d014ef59e81ffad3b9d0c23a (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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
<?php
/**
 * @var Semester[] $semesters
 */
?>
<legend>
    <?= _('Grunddaten') ?>
</legend>
<section>
    <label for="wizard-coursetype" class="required">
        <?= _('Typ') ?>
    </label>
    <select name="coursetype" id="wizard-coursetype">
        <?php foreach ($types as $class => $subtypes) { ?>
            <optgroup label="<?= htmlReady($class) ?>">
                <?php foreach ($subtypes as $type) { ?>
                    <option value="<?= $type['id'] ?>"<?= $type['id'] == $values['coursetype'] ? ' selected="selected"' : '' ?>>
                        <?= htmlReady($type['name']) ?>
                    </option>
                <?php } ?>
            </optgroup>
        <?php } ?>
    </select>
</section>
<section>
    <label for="wizard-start-time" class="required">
        <?= _('Semester') ?>
    </label>
    <select name="start_semester" id="wizard-start-time">
        <?php
        $default_semester = Semester::findDefault();
        if ($default_semester && empty($values['start_semester'])) {
            $values['start_semester'] = $default_semester;
        }
        ?>
        <?php foreach (array_reverse($semesters) as $semester) : ?>
            <option value="<?= htmlReady($semester->id) ?>" <?= $semester->id == $values['start_semester'] ? ' selected' : '' ?>>
                <?= htmlReady($semester->name) ?>
            </option>
        <?php endforeach ?>
    </select>
</section>
<section>
    <label for="wizard-name" class="required">
        <?= _('Veranstaltungstitel') ?>
    </label>
    <?= I18N::input('name', $values['name'], ['id' => 'wizard-name', 'size' => 75, 'maxlength' => 255]) ?>
</section>
<section>
    <? $course_number_format_config = Config::get()->getMetadata('COURSE_NUMBER_FORMAT'); ?>
    <label for="wizard-number">
        <?= _('Veranstaltungsnummer') ?>
        <?= $course_number_format_config['comment'] ? tooltipIcon($course_number_format_config['comment']) : '' ?>
    </label>
    <? $course_number_format = Config::get()->COURSE_NUMBER_FORMAT; ?>
    <input type="text" name="number" id="wizard-number" size="20" maxlength="99" value="<?= htmlReady($values['number'] ?? '') ?>"
     <? if ($course_number_format) : ?>pattern="<?= htmlReady($course_number_format) ?>" <? endif ?>/>
</section>
<section data-mandatory="<?=htmlready(json_encode($admission_turnout_mandatory_types))?>" <?=in_array($values['coursetype'],$admission_turnout_mandatory_types) ? '' : 'style="display: none"' ?>>
    <label for="wizard-maxmembers" class="required">
        <?= _('max. Teilnehmendenzahl') ?>
    </label>
    <input type="number" name="maxmembers" id="wizard-maxmember" min="0" value="<?= htmlReady($values['maxmembers'] ?? '') ?>"/>
</section>
<section>
    <label for="wizard-description">
        <?= _('Beschreibung') ?>
    </label>
    <?= I18N::textarea('description', $values['description'], ['id' => 'wizard-description', 'cols' => 75, 'rows' => 4]) ?>
</section>
<section>
    <label for="wizard-home-institute" class="required">
        <?= _('Heimateinrichtung') ?>
    </label>
    <select name="institute" id="wizard-home-institute" class="nested-select">
        <?php
        $fak_id = '';
        foreach ($institutes as $inst) :
            if ($inst['is_fak']) {
                $fak_id = $inst['Institut_id'];
            }
            ?>
            <option value="<?= $inst['Institut_id'] ?>"<?=
            $inst['Institut_id'] == $values['institute'] ? ' selected="selected"' : '' ?> class="<?=
            $inst['is_fak'] ? 'faculty' : ($inst['fakultaets_id'] == $fak_id ? 'sub_institute' : 'institute') ?>">
                <?= htmlReady($inst['Name']) ?>
            </option>
        <?php endforeach ?>
    </select>
    <?= Icon::create('arr_2right', 'sort')->asInput(["name" => 'select_institute', "value" => '1', "class" => 'hidden-js']) ?>
</section>
<section>
    <label for="part_inst_id_1">
        <?= _('Beteiligte Einrichtungen') ?>
    </label>
    <div id="wizard-instsearch">
        <?= $instsearch ?>
    </div>
    <?php if (!empty($values['part_inst_id_parameter'])) : ?>
        <?= Icon::create('arr_2down', Icon::ROLE_SORT)->asInput(["name" => 'add_part_inst', "value" => '1']) ?>
    <?php endif ?>
</section>
<section>
    <div id="wizard-participating">
        <div class="description<?= count($values['participating']) ? '' : ' hidden-js' ?>">
            <?= _('bereits zugeordnet:') ?>
        </div>
        <?php foreach ($values['participating'] as $id => $assigned) : ?>
            <?php if ($inst = Institute::find($id)) : ?>
                <?= $this->render_partial('basicdata/_institute',
                    ['class' => 'institute', 'inst' => $inst]) ?>
            <?php endif ?>
        <?php endforeach ?>
    </div>
</section>

<section >
    <label for="lecturer_id_2" class="required">
        <?= _('Lehrende') ?>
    </label>
    <div id="wizard-lecturersearch">
        <?= $lsearch ?>
    </div>
    <?php if (!empty($values['lecturer_id_parameter'])) : ?>
        <?= Icon::create('arr_2down', Icon::ROLE_SORT)->asInput(["name" => 'add_lecturer', "value" => '1']) ?>
    <?php endif ?>
</section>
<section>
    <div id="wizard-lecturers" data-ajax-url="<?= $ajax_url ?>" data-default-enabled="<?= $default_deputies_enabled ?>">
        <div class="description<?= count($values['lecturers']) ? '' : ' hidden-js' ?>">
            <?= _('bereits zugeordnet:') ?>
        </div>
        <?php foreach ($values['lecturers'] as $id => $assigned) : ?>
            <?php if ($user = User::find($id)) : ?>
                <?= $this->render_partial('basicdata/_user',
                    ['class' => 'lecturer', 'inputname' => 'lecturers', 'user' => $user]) ?>
            <?php endif ?>
        <?php endforeach ?>
    </div>
</section>

<?php if (isset($dsearch)) : ?>
<section>
    <label for="deputy_id_3">
        <?= _('Vertretungen') ?>
    </label>
    <div id="wizard-deputysearch">
        <?= $dsearch ?>
    </div>
    <?php if (!empty($values['deputy_id_parameter'])) : ?>
        <?= Icon::create('arr_2down', Icon::ROLE_SORT)->asInput(["name" => 'add_deputy', "value" => '1']) ?>
    <?php endif ?>
</section>
<section>
    <div id="wizard-deputies">
        <div class="description<?= count($values['deputies']) ? '' : ' hidden-js' ?>">
            <?= _('bereits zugeordnet:') ?>
        </div>
        <?php foreach ($values['deputies'] as $id => $assigned) : ?>
            <?php if ($user = User::find($id)) : ?>
                <?php if (!in_array($id, array_keys($values['lecturers']))) : ?>
                    <?= $this->render_partial('basicdata/_user',
                        ['class' => 'deputy', 'inputname' => 'deputies', 'user' => $user]) ?>
                <?php endif ?>
            <?php endif ?>
        <?php endforeach ?>
    </div>
</section>
<?php endif ?>

<section for="tutor_id_parameter">
    <label for="tutor_id_2">
        <?= _('Tutor/-in') ?>
    </label>
    <div id="wizard-tutorsearch">
        <?= $tsearch ?>
    </div>
    <?php if (!empty($values['tutor_id_parameter'])) : ?>
        <?= Icon::create('arr_2down', Icon::ROLE_SORT)->asInput(["name" => 'add_tutor', "value" => '1']) ?>
    <?php endif ?>
</section>

<section>
    <div id="wizard-tutors">
        <div class="description<?= count($values['tutors']) ? '' : ' hidden-js' ?>">
            <?= _('bereits zugeordnet:') ?>
        </div>
        <?php foreach ($values['tutors'] as $id => $assigned) : ?>
            <?php if ($user = User::find($id)) : ?>
                <?= $this->render_partial('basicdata/_user',
                    ['class' => 'tutor', 'inputname' => 'tutors', 'user' => $user]) ?>
            <?php endif ?>
        <?php endforeach ?>
    </div>
</section>