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
5797405d
Commit
5797405d
authored
2 years ago
by
Michaela Brückner
Browse files
Options
Downloads
Patches
Plain Diff
Raumanfragen on page Zeiten/Räume, re #1327
parent
83948882
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/controllers/course/timesrooms.php
+16
-0
16 additions, 0 deletions
app/controllers/course/timesrooms.php
app/views/course/timesrooms/_roomRequest.php
+127
-12
127 additions, 12 deletions
app/views/course/timesrooms/_roomRequest.php
with
143 additions
and
12 deletions
app/controllers/course/timesrooms.php
+
16
−
0
View file @
5797405d
...
@@ -180,7 +180,23 @@ class Course_TimesroomsController extends AuthenticatedController
...
@@ -180,7 +180,23 @@ class Course_TimesroomsController extends AuthenticatedController
$dates
=
$this
->
course
->
getDatesWithExdates
();
$dates
=
$this
->
course
->
getDatesWithExdates
();
$this
->
current_user
=
User
::
findCurrent
();
$this
->
user_has_permissions
=
ResourceManager
::
userHasGlobalPermission
(
$this
->
current_user
,
'admin'
);
$check_room_requests
=
Config
::
get
()
->
RESOURCES_ALLOW_ROOM_REQUESTS
;
$check_room_requests
=
Config
::
get
()
->
RESOURCES_ALLOW_ROOM_REQUESTS
;
$this
->
room_requests
=
RoomRequest
::
findBySQL
(
'course_id = :course_id
ORDER BY course_id, metadate_id, termin_id'
,
[
'course_id'
=>
$this
->
course
->
id
]
);
$this
->
global_requests
=
$this
->
course
->
room_requests
->
filter
(
function
(
RoomRequest
$request
)
{
return
$request
->
closed
<
2
&&
!
$request
->
termin_id
;
});
$single_dates
=
[];
$single_dates
=
[];
$this
->
single_date_room_request_c
=
0
;
$this
->
single_date_room_request_c
=
0
;
foreach
(
$dates
as
$val
)
{
foreach
(
$dates
as
$val
)
{
...
...
This diff is collapsed.
Click to expand it.
app/views/course/timesrooms/_roomRequest.php
+
127
−
12
View file @
5797405d
<?php
$global_requests
=
$course
->
room_requests
->
filter
(
function
(
RoomRequest
$request
)
{
return
$request
->
closed
<
2
&&
!
$request
->
termin_id
;
});
?>
<section
class=
"contentbox"
>
<section
class=
"contentbox"
>
<header>
<header>
<h1>
<h1>
...
@@ -29,13 +24,133 @@ $global_requests = $course->room_requests->filter(function (RoomRequest $request
...
@@ -29,13 +24,133 @@ $global_requests = $course->room_requests->filter(function (RoomRequest $request
</nav>
</nav>
</header>
</header>
<?php
echo
$flash
[
'message'
];
?>
<?
if
(
count
(
$room_requests
))
:
?>
<section>
<section>
<?
if
(
count
(
$global_requests
)
>
0
)
:
?>
<table
class=
"default"
>
<p>
<?=
_
(
'Für diese Veranstaltung liegt eine offene Raumanfrage vor'
)
?>
</p>
<colgroup>
<?=
Studip\LinkButton
::
create
(
_
(
'Raumanfragen anzeigen'
),
<col
style=
"width: 40%"
>
URLHelper
::
getURL
(
'dispatch.php/course/room_requests/index/'
.
$course
->
getId
()))
?>
<col
style=
"width: 20%"
>
<?
else
:
?>
<col>
<p>
<?=
_
(
'Keine Raumanfrage vorhanden'
)
?>
</p>
<col
style=
"width: 50px"
>
<?
endif
?>
</colgroup>
<thead>
<tr>
<th>
<?=
_
(
'Art der Anfrage'
)
?>
</th>
<th>
<?=
_
(
'Anfragender'
)
?>
</th>
<th>
<?=
_
(
'Bearbeitungsstatus'
)
?>
</th>
<th></th>
</tr>
</thead>
<tbody>
<?
foreach
(
$room_requests
as
$rr
)
:
?>
<tr>
<td>
<?=
htmlReady
(
$rr
->
getTypeString
(),
1
,
1
)
?>
</td>
<td>
<?=
htmlReady
(
$rr
->
user
?
$rr
->
user
->
getFullName
()
:
''
)
?>
</td>
<td>
<?=
htmlReady
(
$rr
->
getStatusText
())
?>
</td>
<td
class=
"actions"
>
<a
class=
"load-in-new-row"
href=
"
<?=
$controller
->
link_for
(
'course/room_requests/info/'
.
$rr
->
id
)
?>
"
>
<?=
Icon
::
create
(
'info'
,
Icon
::
ROLE_CLICKABLE
,
[
'title'
=>
_
(
'Weitere Informationen einblenden'
)
]
)
?>
</a>
<?
$params
=
[]
?>
<?
$dialog
=
[];
?>
<?
if
(
Request
::
isXhr
())
:
?>
<?
$params
[
'asDialog'
]
=
true
;
?>
<?
$dialog
[
'data-dialog'
]
=
'size=big'
?>
<?
endif
?>
<?
$actionMenu
=
ActionMenu
::
get
()
->
setContext
(
$rr
->
getTypeString
())
?>
<?
$actionMenu
->
addLink
(
$controller
->
url_for
(
'course/room_requests/request_summary/'
.
$rr
->
id
,
[
'clear_cache'
=>
1
]),
_
(
'Diese Anfrage bearbeiten'
),
Icon
::
create
(
'edit'
,
Icon
::
ROLE_CLICKABLE
,
[
'title'
=>
_
(
'Diese Anfrage bearbeiten'
)
]
),
$dialog
)
?>
<?php
if
(
$rr
->
room
&&
!
$user_has_permissions
)
{
$user_has_permissions
=
$rr
->
room
->
userHasPermission
(
$current_user
,
'admin'
);
}
?>
<?
if
(
$user_has_permissions
&&
(
int
)
$rr
->
closed
===
0
)
:
?>
<?
$actionMenu
->
addLink
(
URLHelper
::
getURL
(
'dispatch.php/resources/room_request/resolve/'
.
$rr
->
id
,
[
'reload-on-close'
=>
1
,
'single-request'
=>
1
]
),
_
(
'Diese Anfrage selbst auflösen'
),
Icon
::
create
(
'admin'
,
Icon
::
ROLE_CLICKABLE
,
[
'title'
=>
_
(
'Diese Anfrage selbst auflösen'
)
]
),
[
'data-dialog'
=>
'1'
]
)
?>
<?
endif
?>
<?
$actionMenu
->
addLink
(
$controller
->
url_for
(
'course/room_requests/delete/'
.
$rr
->
id
),
_
(
'Diese Anfrage löschen'
),
Icon
::
create
(
'trash'
,
Icon
::
ROLE_CLICKABLE
,
[
'title'
=>
_
(
'Diese Anfrage löschen'
)
]
)
)
?>
<?=
$actionMenu
->
render
()
?>
</td>
</tr>
<?
endforeach
?>
<?
if
(
$request_id
==
$rr
->
id
)
:
?>
<tr>
<td
colspan=
"4"
>
<?=
$this
->
render_partial
(
'course/room_requests/_request.php'
,
[
'request'
=>
$rr
]);
?>
</td>
</tr>
<?
endif
?>
</tbody>
</table>
</section>
</section>
<?
else
:
?>
<?=
MessageBox
::
info
(
_
(
'Zu dieser Veranstaltung sind noch keine Raumanfragen vorhanden.'
))
?>
<?
endif
?>
<?
if
(
Request
::
isXhr
())
:
?>
<div
data-dialog-button
>
<?=
\Studip\LinkButton
::
createEdit
(
_
(
'Neue Raumanfrage erstellen'
),
$controller
->
url_for
(
'course/room_requests/new/'
.
$course_id
,
$url_params
),
[
'data-dialog'
=>
'size=big'
]
)
?>
</div>
<?
endif
?>
</section>
</section>
This diff is collapsed.
Click to expand it.
André Noack
@anoack
mentioned in commit
2d984771
·
2 years ago
mentioned in commit
2d984771
mentioned in commit 2d98477105af04583e939130daa4a5436e649662
Toggle commit list
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