Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Stud.IP
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jan-Hendrik Willms
Stud.IP
Commits
0ecb3ea6
Commit
0ecb3ea6
authored
2 years ago
by
Michaela Brückner
Browse files
Options
Downloads
Patches
Plain Diff
closes #1839
parent
da4efaf7
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/views/resources/_common/_special_permission_table.php
+123
-0
123 additions, 0 deletions
app/views/resources/_common/_special_permission_table.php
app/views/resources/room_group/permissions.php
+1
-1
1 addition, 1 deletion
app/views/resources/room_group/permissions.php
with
124 additions
and
1 deletion
app/views/resources/_common/_special_permission_table.php
0 → 100644
+
123
−
0
View file @
0ecb3ea6
<?php
/**
* Template variables:
* - table_id: The ID of the table. This is required for the JS code which adds
* new users to the table to work.
* - table caption: An optional table caption.
* - permissions: An array of ResourcePermission objects.
* - single_user: The User object in case the table is used in single
* user mode where the permissions of one specific user are displayed.
* - custom_columns: An associative multi-dimensional array to display
* additional columns.
* Structure:
* The first layer has the column names as indexes.
* The second layer contains an associative array with the cells
* for the column. That array has the permission object IDs
* (see permissions above) as indexes.
* - custom_actions: A multi-dimensional array for additional actions in the
* actions column. The array has the following structure:
* The first layer contains associative arrays where each array represents
* one action.
* The second layer consists of associative arrays with the following
* structure:
* [
* 'icon' => The Icon object for the action.
* 'title' => The descriptive title for the action.
* 'link_classes' => Classes which shall be added to the link element
* of the action.
* 'url' => An optional URL that shall be attached to the action's
* link element via the href attribute.
* 'js_action' => An optional JavaScript action that shall be attached
* to the link element using the onclick attribute.
* ]
*/
?>
<table
class=
"default sortable-table resource-permissions-table"
data-sortlist=
"[[1, 0]]"
<?=
$table_id
?
'id="'
.
htmlReady
(
$table_id
)
.
'"'
:
''
?>
>
<?
if
(
!
empty
(
$table_caption
))
:
?>
<caption>
<?=
htmlReady
(
$table_caption
)
?>
</caption>
<?
endif
?>
<colgroup>
<col>
<col>
<?
if
(
!
empty
(
$custom_columns
))
:
?>
<?
foreach
(
$custom_columns
as
$column_name
)
:
?>
<col>
<?
endforeach
?>
<?
endif
?>
</colgroup>
<thead>
<tr>
<th
data-sort=
"text"
>
<?=
_
(
'Name'
)
?>
</th>
<th
data-sort=
"htmldata"
>
<?=
_
(
'Rechtestufe'
)
?>
</th>
<?
if
(
!
empty
(
$custom_columns
))
:
?>
<?
foreach
(
array_keys
(
$custom_columns
)
as
$column_name
)
:
?>
<th>
<?=
htmlReady
(
$column_name
)
?>
</th>
<?
endforeach
?>
<?
endif
?>
</tr>
</thead>
<tbody>
<?
if
(
count
(
$permissions
))
:
?>
<?
foreach
(
$permissions
as
$permission
)
:
?>
<?
$permission_sort_key
=
10
;
switch
(
$permission
->
perms
)
{
case
'autor'
:
{
$permission_sort_key
=
20
;
break
;
}
case
'tutor'
:
{
$permission_sort_key
=
30
;
break
;
}
case
'admin'
:
{
$permission_sort_key
=
40
;
break
;
}
}
?>
<tr
data-user_id=
"
<?=
htmlReady
(
$permission
->
user_id
)
?>
"
>
<td>
<?
if
(
$permission
->
user
instanceof
User
)
:
?>
<?=
htmlReady
(
$permission
->
user
->
getFullName
(
'full_rev_username'
))
?>
(
<?=
htmlReady
(
$permission
->
user
->
perms
)
?>
)
<?
else
:
?>
<?=
_
(
'unbekannt'
)
?>
<?
endif
?>
<input
type=
"hidden"
name=
"permissions[user_id][]"
value=
"
<?=
htmlReady
(
$permission
->
user_id
)
?>
"
>
</td>
<td
data-sort-value=
"
<?=
htmlReady
(
$permission_sort_key
)
?>
"
>
<?=
htmlReady
(
$permission
->
perms
)
?>
</td>
<?
if
(
!
empty
(
$custom_columns
))
:
?>
<?
foreach
(
$custom_columns
as
$column_content
)
:
?>
<td>
<?=
htmlReady
(
$column_content
[
$permission
->
id
])
?>
</td>
<?
endforeach
?>
<?
endif
?>
</tr>
<?
endforeach
?>
<?
endif
?>
<tr
id=
"resource-empty-permission-list-message"
<?=
count
(
$permissions
)
?
'class="invisible"'
:
''
?>
>
<td
colspan=
"3"
style=
"text-align: center"
>
<?
if
(
$single_user
instanceof
User
)
:
?>
<?=
$custom_empty_list_message
?:
sprintf
(
_
(
'Es sind keine besonderen Rechte für %s vorhanden.'
),
htmlReady
(
$single_user
->
getFullName
()
))
?>
<?
else
:
?>
<?=
$custom_empty_list_message
?:
_
(
'Es sind keine besonderen Rechte vorhanden.'
)
?>
<?
endif
?>
</td>
</tr>
</tbody>
</table>
This diff is collapsed.
Click to expand it.
app/views/resources/room_group/permissions.php
+
1
−
1
View file @
0ecb3ea6
...
...
@@ -42,7 +42,7 @@
)
?>
<?
if
(
$partial_permissions
)
:
?>
<?=
$this
->
render_partial
(
'resources/_common/_permission_table.php'
,
'resources/_common/_
special_
permission_table.php'
,
[
'permissions'
=>
$partial_permissions
,
'custom_columns'
=>
[
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment