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
6531b2db
Commit
6531b2db
authored
3 years ago
by
Moritz Strohm
Browse files
Options
Downloads
Patches
Plain Diff
fixes BIESt #123 and #126
parent
ada5a480
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
app/controllers/resources/export.php
+25
-12
25 additions, 12 deletions
app/controllers/resources/export.php
with
25 additions
and
12 deletions
app/controllers/resources/export.php
+
25
−
12
View file @
6531b2db
...
@@ -304,23 +304,36 @@ class Resources_ExportController extends AuthenticatedController
...
@@ -304,23 +304,36 @@ class Resources_ExportController extends AuthenticatedController
foreach
(
$resources
as
$resource
)
{
foreach
(
$resources
as
$resource
)
{
//Retrieve the bookings in the specified time range:
//Retrieve the bookings in the specified time range:
$bookings
=
ResourceBooking
::
findByResourceAndTimeRanges
(
$intervals
=
ResourceBookingInterval
::
findBySql
(
$resource
,
'`resource_id` = :resource_id
AND
(`begin` BETWEEN :begin AND :end
OR `end` BETWEEN :begin AND :end)
ORDER BY `begin` ASC, `end` ASC'
,
[
[
[
'resource_id'
=>
$resource
->
id
,
'begin'
=>
$this
->
begin
->
getTimestamp
(),
'begin'
=>
$this
->
begin
->
getTimestamp
(),
'end'
=>
$this
->
end
->
getTimestamp
()
'end'
=>
$this
->
end
->
getTimestamp
()
]
]
],
[
0
,
1
,
2
,
3
]
);
);
//Prepare data for export:
//Prepare data for export:
foreach
(
$bookings
as
$booking
)
{
foreach
(
$intervals
as
$interval
)
{
$booking
=
$interval
->
booking
;
if
(
!
$booking
instanceof
ResourceBooking
)
{
continue
;
}
$description
=
$booking
->
description
;
if
(
!
$booking
->
isSimpleBooking
())
{
$course
=
$booking
->
assigned_course_date
->
course
;
if
(
$course
instanceof
Course
)
{
$description
=
$course
->
getFullName
();
}
}
$booking_data
[]
=
[
$booking_data
[]
=
[
date
(
'd.m.Y H:i'
,
$booking
->
begin
),
date
(
'd.m.Y H:i'
,
(
$interval
->
begin
+
$booking
->
preparation_time
)
),
date
(
'd.m.Y H:i'
,
$
booking
->
end
),
date
(
'd.m.Y H:i'
,
$
interval
->
end
),
sprintf
(
sprintf
(
_
(
'%u min.'
),
_
(
'%u min.'
),
intval
(
$booking
->
preparation_time
/
60
)
intval
(
$booking
->
preparation_time
/
60
)
...
@@ -339,7 +352,7 @@ class Resources_ExportController extends AuthenticatedController
...
@@ -339,7 +352,7 @@ class Resources_ExportController extends AuthenticatedController
)
)
)
)
),
),
$
booking
->
description
,
$description
,
$booking
->
booking_user
?
$booking
->
booking_user
->
getFullName
()
:
''
,
$booking
->
booking_user
?
$booking
->
booking_user
->
getFullName
()
:
''
,
implode
(
', '
,
$booking
->
getAssignedUsers
()),
implode
(
', '
,
$booking
->
getAssignedUsers
()),
$booking
->
internal_comment
$booking
->
internal_comment
...
...
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