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
|
<? use \Studip\Button; ?>
<a name="tutoren"></a>
<form action="<?= $controller->url_for('course/members/edit_tutor') ?>" method="post" data-dialog="size=50%">
<?= CSRFProtection::tokenTag() ?>
<table class="default collapsable">
<caption>
<? if($is_tutor) : ?>
<span class="actions">
<a href="<?= URLHelper::getLink('dispatch.php/messages/write', [
'filter' => 'send_sms_to_all',
'who' => 'tutor',
'emailrequest' => 1,
'course_id' => $course_id,
'default_subject' => $subject,
]) ?>" data-dialog title="<?= sprintf(
_('Nachricht mit Mailweiterleitung an alle %s versenden'),
htmlReady( $status_groups['tutor'])
) ?>">
<?= Icon::create('inbox') ?>
</a>
</span>
<? endif ?>
<?= htmlReady($status_groups['tutor']) ?>
</caption>
<colgroup>
<? if ($is_dozent && !$tutor_is_locked) : ?>
<col width="20">
<? endif ?>
<col width="<?= (($is_tutor && !$is_dozent) || $tutor_is_locked) ? 40 : 20 ?>">
<col>
<? if ($is_dozent) : ?>
<col width="15%">
<col width="35%">
<? endif ?>
<col width="80">
</colgroup>
<thead>
<tr class="sortable">
<? if ($is_dozent && !$tutor_is_locked): ?>
<th>
<input aria-label="<?= sprintf(_('Alle %s auswählen'), htmlReady($status_groups['tutor'])) ?>"
type="checkbox" name="all" value="1" data-proxyfor=":checkbox[name^=tutor]">
</th>
<? endif ?>
<th><p class="sr-only"><?= _('Nummer') ?></p></th>
<th <? if ($sort_by === 'nachname' && $sort_status === 'tutor') printf('class="sort%s"', $order); ?>>
<? $order = $sort_status !== 'tutor' ? 'desc' : $order; ?>
<a href="<?= URLHelper::getLink(sprintf(
'?sortby=nachname&sort_status=tutor&order=%s&toggle=%s#tutoren',
$order,
$sort_by === 'nachname'
)) ?>">
<?= _('Nachname, Vorname') ?>
</a>
</th>
<? if($is_dozent) : ?>
<th <? if ($sort_by === 'mkdate' && $sort_status === 'tutor') printf('class="sort%s"', $order); ?>>
<a href="<?= URLHelper::getLink(sprintf(
'?sortby=mkdate&sort_status=tutor&order=%s&toggle=%s#tutoren',
$order,
$sort_by === 'mkdate'
)) ?>">
<?= _('Anmeldedatum') ?>
</a>
</th>
<th><?=_('Studiengang')?></th>
<? endif ?>
<th class="actions"><?= _('Aktion') ?></th>
</tr>
</thead>
<tbody>
<? $nr= 0; ?>
<? foreach ($tutoren as $tutor) : ?>
<? $fullname = $tutor['fullname'];?>
<tr>
<? if ($is_dozent && !$tutor_is_locked): ?>
<td>
<input aria-label="<?= sprintf(_('%s auswählen'), htmlReady($fullname)) ?>"
type="checkbox" name="tutor[<?= $tutor['user_id'] ?>]" value="1"
<? if (isset($flash['checked']) && in_array($tutor['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=' . $tutor['username']) ?>" <? if ($tutor['mkdate'] >= $last_visitdate) echo 'class="new-member"'; ?>>
<?= Avatar::getAvatar($tutor['user_id'], $tutor['username'])->getImageTag(Avatar::SMALL, [
'style' => 'margin-right: 5px'
]) ?>
<?= htmlReady($fullname) ?>
</a>
<? if ($is_tutor && $tutor['comment']) : ?>
<?= tooltipHtmlIcon(sprintf(
'<strong>%s</strong><br>%s',
_('Bemerkung'),
htmlReady($tutor['comment'])
)) ?>
<? endif ?>
</td>
<? if($is_dozent) : ?>
<td>
<? if (!empty($tutor['mkdate'])) : ?>
<?= strftime('%x %X', $tutor['mkdate'])?>
<? endif ?>
</td>
<td>
<?= $this->render_partial('course/members/_studycourse.php', [
'studycourses' => new SimpleCollection(UserStudyCourse::findByUser($tutor['user_id']))
]) ?>
</td>
<? endif ?>
<td class="actions">
<? $actionMenu = ActionMenu::get()->setContext($fullname) ?>
<? if ($is_tutor) : ?>
<? $actionMenu->addLink(
$controller->url_for('course/members/add_comment/' . $tutor['user_id']),
_('Bemerkung hinzufügen'),
Icon::create('comment'),
['data-dialog' => 'size=auto']
) ?>
<? endif ?>
<? if ($user_id !== $tutor['user_id']) : ?>
<? $actionMenu->addLink(
URLHelper::getURL('dispatch.php/messages/write', [
'filter' => 'send_sms_to_all',
'emailrequest' => 1,
'rec_uname' => $tutor['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_dozent && !$tutor_is_locked && $user_id !== $tutor['user_id'] && count($tutoren) >= 1) : ?>
<? $actionMenu->addLink(
$controller->url_for('course/members/cancel_subscription/singleuser/tutor/' . $tutor['user_id']),
_('Aus Veranstaltung austragen'),
Icon::create('door-leave'),
['title' => sprintf(_('%s austragen'), $fullname)]
) ?>
<? endif ?>
<?= $actionMenu->render() ?>
</td>
</tr>
<? endforeach ?>
</tbody>
<? if ($is_dozent && !$tutor_is_locked): ?>
<tfoot>
<tr>
<td colspan="6" class="groupactions">
<select name="action_tutor" id="tutor_action" aria-label="<?= _('Aktion auswählen') ?>">
<option value="">- <?= _('Aktion auswählen') ?></option>
<option value="downgrade"><?= sprintf(_('Zu %s herunterstufen'), htmlReady($status_groups['autor'])) ?></option>
<option value="remove"><?= _('Austragen') ?></option>
<option value="message"><?=_('Nachricht senden')?></option>
<!--<option value="copy_to_course"><?= _('In Seminar verschieben/kopieren') ?></option>-->
</select>
<?= Button::create(_('Ausführen'), 'submit_autor') ?>
</td>
</tr>
</tfoot>
<? endif ?>
</table>
</form>
|