Gruppen können angelegt und bearbeitet werden
Teili können angelegt werden
This commit is contained in:
@ -11,7 +11,8 @@ function kompass_print_gruppen_overview()
|
||||
<p style="width: 100%; text-align: right">
|
||||
<input type="hidden" name="action" value="searchmember">
|
||||
<input type="text" name="member_name" style="width: 500px;"
|
||||
placeholder="<?=__('Search for member', BDP_LV_PLUGIN_SLUG); ?>" />
|
||||
placeholder="<?=__('Search member', BDP_LV_PLUGIN_SLUG); ?>" />
|
||||
<input type="submit" class="button" value="<?= __('Search', BDP_LV_PLUGIN_SLUG); ?>" />
|
||||
</p>
|
||||
</form>
|
||||
|
||||
@ -28,15 +29,60 @@ function kompass_print_gruppen_overview()
|
||||
<?php
|
||||
|
||||
foreach ($dbHandler->readFromDb( GruppenController::KOMPASS_STAMMESGRUPPEN_GRUPPEN) as $currentGruppe) {
|
||||
$participantCount = $dbHandler->countSqlRows(GruppenController::KOMPASS_STAMMESGRUPPEN_TEILIS, ['gruppe_id' => $currentGruppe->id]);
|
||||
echo '<tr>';
|
||||
echo '<td>' . $currentGruppe->gruppen_name .'</td>';
|
||||
echo '<td>' . $dbHandler->countSqlRows(GruppenController::KOMPASS_STAMMESGRUPPEN_TEILIS, ['gruppe_id' => $currentGruppe->id]) .'</td>';
|
||||
echo '<td><a href="admin.php?page=bdp-kompass-limit-login-attempts&action=removeFromList">' .
|
||||
__('Show Members', BDP_LV_PLUGIN_SLUG) . '</a></td>';
|
||||
echo '<td>' . $participantCount . '</td>';
|
||||
echo '<td> ' . kompass_get_group_actions($currentGruppe->id, $participantCount ) .'</td>';
|
||||
echo '</tr>';
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<?php
|
||||
echo '<p>';
|
||||
if ( current_user_can( 'send_mails' ) ) {
|
||||
echo '<a class="button" href="' . admin_url('admin.php?page=kompass-groups') . '&action=compose-mail&group-id=0">' .
|
||||
__( 'Mail to multiple groups', BDP_LV_PLUGIN_SLUG ) . '</a> ';
|
||||
}
|
||||
|
||||
if (current_user_can('create_teilis')) {
|
||||
echo '<a class="button" href="' . admin_url('admin.php?page=kompass-groups') . '&action=new-member">' .
|
||||
__( 'New Member', BDP_LV_PLUGIN_SLUG ) . '</a> ';
|
||||
}
|
||||
|
||||
if ( current_user_can( 'delete_teilis' ) ) {
|
||||
?>
|
||||
<a class="button" href="admin.php?page=kompass-groups&action=create_group_form">
|
||||
<?= __('Create Group', BDP_LV_PLUGIN_SLUG); ?></a>
|
||||
<?php
|
||||
}
|
||||
echo '</p>';
|
||||
}
|
||||
|
||||
function kompass_get_group_actions(int $groupId, int $participantCount) : string
|
||||
{
|
||||
$elements = [];
|
||||
if ($participantCount > 0) {
|
||||
$elements[] = '<a href="' . admin_url('admin.php?page=kompass-groups') . '&action=show-members&group-id=' .$groupId .'">' .
|
||||
__('Show Members', BDP_LV_PLUGIN_SLUG) . '</a>';
|
||||
if (current_user_can('send_mails')) {
|
||||
$elements[] = '<a href="' . admin_url('admin.php?page=kompass-groups') . '&action=compose-mail&group-id=' .$groupId .'">' .
|
||||
__( 'Mail to group', BDP_LV_PLUGIN_SLUG ) . '</a>';
|
||||
}
|
||||
} else {
|
||||
if (current_user_can('delete_groups')) {
|
||||
$elements[] = '<a href="' . admin_url('admin.php?page=kompass-groups') . '&action=delete-group&group-id=' .$groupId .'">' .
|
||||
__('Delete', BDP_LV_PLUGIN_SLUG) . '</a>';
|
||||
}
|
||||
}
|
||||
|
||||
if (current_user_can('edit_groups')) {
|
||||
$elements[] = '<a href="' . admin_url('admin.php?page=kompass-groups') . '&action=edit-group&group-id=' .$groupId .'">' .
|
||||
__('Edit', BDP_LV_PLUGIN_SLUG) . '</a>';
|
||||
}
|
||||
|
||||
return implode('<br />' , $elements);
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user