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
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
|
<? use \Studip\Button; ?>
<a name="autoren"></a>
<form action="<?= $controller->url_for('course/members/edit_autor') ?>" method="post" data-dialog="">
<?= CSRFProtection::tokenTag() ?>
<table id="autor" class="default collapsable tablesorter">
<caption>
<? if ($is_tutor) : ?>
<span class="actions">
<a href="<?= URLHelper::getLink('dispatch.php/messages/write', [
'filter' => 'send_sms_to_all',
'emailrequest' => 1,
'who' => 'autor',
'course_id' => $course_id,
'default_subject' => $subject,
]) ?>" data-dialog title="<?= sprintf(
_('Nachricht mit Mailweiterleitung an alle %s versenden'),
htmlReady($status_groups['autor'])
) ?>">
<?= Icon::create('inbox') ?>
</a>
</span>
<? endif ?>
<?= htmlReady($status_groups['autor']) ?>
</caption>
<colgroup>
<col width="20">
<? if ($is_tutor) : ?>
<? if (!$is_locked) : ?>
<col width="20">
<? endif ?>
<col>
<col width="15%">
<col width="35%">
<? $cols = $cols_foot = 6; ?>
<? else : ?>
<col>
<? $cols = 3 ?>
<? endif ?>
<col width="80">
</colgroup>
<thead>
<tr class="sortable">
<? if ($is_tutor && !$is_locked) : ?>
<th>
<input aria-label="<?= sprintf(_('Alle %s auswählen'), htmlReady($status_groups['autor'])) ?>"
type="checkbox" name="all" value="1" data-proxyfor=":checkbox[name^=autor]">
</th>
<? endif ?>
<th><p class="sr-only"><?= _('Nummer') ?></p></th>
<th <? if ($sort_by === 'nachname' && $sort_status === 'autor') printf('class="sort%s"', $order); ?>>
<? $order = $sort_status !== 'autor' ? 'desc' : $order; ?>
<a href="<?= URLHelper::getLink(sprintf(
'?sortby=nachname&sort_status=autor&order=%s&toggle=%s#autoren',
$order,
$sort_by === 'nachname'
)) ?>">
<?= _('Nachname, Vorname') ?>
</a>
</th>
<? if($is_tutor) :?>
<th <? if ($sort_by === 'mkdate' && $sort_status === 'autor') printf('class="sort%s"', $order); ?>>
<a href="<?= URLHelper::getLink(sprintf(
'?sortby=mkdate&sort_status=autor&order=%s&toggle=%s#autoren',
$order,
$sort_by === 'mkdate'
)) ?>">
<?= _('Anmeldedatum') ?>
</a>
</th>
<th><?= _('Studiengang') ?></th>
<? endif ?>
<th class="actions"><?= _('Aktion') ?></th>
</tr>
</thead>
<tbody>
<? $nr = $autor_nr ?? 0; ?>
<? foreach ($autoren as $autor) : ?>
<? $fullname = $autor['fullname']?>
<tr>
<? if ($is_tutor && !$is_locked) : ?>
<td>
<input aria-label="<?= sprintf(_('%s auswählen'), htmlReady($fullname)) ?>"
type="checkbox" name="autor[<?= $autor['user_id'] ?>]" value="1"
<? if (isset($flash['checked']) && in_array($autor['user_id'], $flash['checked'])) echo 'checked'; ?>>
</td>
<? endif ?>
<td style="text-align: right"><?= sprintf('%02u', ++$nr) ?></td>
<td>
<a href="<?= $controller->url_for('profile?username=' . $autor['username']) ?>" <? if ($autor['mkdate'] >= $last_visitdate) echo 'class="new-member"'; ?>>
<?= Avatar::getAvatar($autor['user_id'], $autor['username'])->getImageTag(
Avatar::SMALL,
[
'style' => 'margin-right: 5px'
]
) ?>
<?= htmlReady($fullname) ?>
<? if ($user_id === $autor['user_id'] && $autor['visible'] === 'no') : ?>
(<?= _('Unsichtbar') ?>)
<? endif ?>
</a>
<? if ($is_tutor && $autor['comment']) : ?>
<?= tooltipHtmlIcon(sprintf(
'<strong>%s</strong><br>%s',
_('Bemerkung'),
htmlReady($autor['comment'])
)) ?>
<? endif ?>
</td>
<? if ($is_tutor) : ?>
<td>
<? if (!empty($autor['mkdate'])) : ?>
<?= strftime('%x %X', $autor['mkdate'])?>
<? endif ?>
</td>
<td>
<?= $this->render_partial('course/members/_studycourse.php', [
'studycourses' => new SimpleCollection(UserStudyCourse::findByUser($autor['user_id'])),
]) ?>
</td>
<? endif ?>
<td class="actions">
<? $actionMenu = ActionMenu::get()->setContext($fullname) ?>
<? if ($is_tutor) : ?>
<? $actionMenu->addLink(
$controller->url_for('course/members/add_comment/' . $autor['user_id']),
_('Bemerkung hinzufügen'),
Icon::create('comment'),
['data-dialog' => 'size=auto']
) ?>
<? endif ?>
<? if ($user_id !== $autor['user_id']) : ?>
<? $actionMenu->addLink(
URLHelper::getURL('dispatch.php/messages/write', [
'filter' => 'send_sms_to_all',
'emailrequest' => 1,
'rec_uname' => $autor['username'],
'default_subject' => $subject,
]),
_('Nachricht mit Mailweiterleitung senden'),
Icon::create(
'mail',
Icon::ROLE_CLICKABLE, [
'title' => sprintf(_('Nachricht mit Weiterleitung an %s senden'), $fullname),
]),
['data-dialog' => '']
) ?>
<? else: ?>
<? $actionMenu->addLink(
'#',
_('Nachricht mit Mailweiterleitung senden'),
Icon::create('mail', Icon::ROLE_INACTIVE),
['disabled' => true]
) ?>
<? endif ?>
<? if ($is_tutor && !$is_locked) : ?>
<? $actionMenu->addLink(
$controller->url_for('course/members/cancel_subscription/singleuser/autor/' . $autor['user_id']),
_('Aus Veranstaltung austragen'),
Icon::create(
'door-leave',
Icon::ROLE_CLICKABLE,
['title' => sprintf(_('%s austragen'), $fullname)])
) ?>
<? endif ?>
<?= $actionMenu->render() ?>
</td>
</tr>
<? endforeach ?>
<? if (!empty($invisibles)) : ?>
<tr>
<td colspan="<?= $cols ?>" class="blank"></td>
</tr>
<tr>
<td colspan="<?= $cols ?>">+ <?= sprintf(_('%u unsichtbare %s'), $invisibles, htmlReady($status_groups['autor'])) ?></td>
</tr>
<? endif ?>
</tbody>
<? if ($is_tutor && !$is_locked && count($autoren) > 0) : ?>
<tfoot>
<tr>
<td colspan="<?= $cols_foot ?>" class="groupactions">
<select name="action_autor" id="action_autor" aria-label="<?= _('Aktion auswählen') ?>">
<option value="">- <?= _('Aktion auswählen') ?></option>
<? if($is_dozent) : ?>
<option value="upgrade">
<?= sprintf(_('Zu %s hochstufen'), htmlReady($status_groups['tutor'])) ?>
</option>
<? endif ?>
<option value="downgrade">
<?= sprintf(_('Zu %s herunterstufen'), htmlReady($status_groups['user'])) ?>
</option>
<? if ($to_waitlist_actions) : ?>
<option value="to_admission_first">
<?= _('An den Anfang der Warteliste verschieben') ?>
</option>
<option value="to_admission_last">
<?= _('Ans Ende der Warteliste verschieben') ?>
</option>
<? endif ?>
<option value="remove"><?= _('Austragen') ?></option>
<? if($is_dozent) : ?>
<option value="to_course">
<?= _('In andere Veranstaltung verschieben/kopieren') ?>
</option>
<option value="to_accepted_list">
<?= _('Auf die vorläufige Liste verschieben') ?>
</option>
<? endif ?>
<option value="message"><?=_('Nachricht senden')?></option>
</select>
<?= Button::create(_('Ausführen'), 'submit_autor') ?>
</td>
</tr>
</tfoot>
<? endif ?>
</table>
</form>
|