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
Marcus Eibrink-Lunzenauer
Stud.IP
Commits
e70f6eb0
Commit
e70f6eb0
authored
1 year ago
by
David Siegfried
Committed by
Jan-Hendrik Willms
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
fix errors in cal-export, re #3832
Merge request
studip/studip!2696
parent
a5d02f3c
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/classes/calendar/ICalendarExport.class.php
+43
-45
43 additions, 45 deletions
lib/classes/calendar/ICalendarExport.class.php
with
43 additions
and
45 deletions
lib/classes/calendar/ICalendarExport.class.php
+
43
−
45
View file @
e70f6eb0
...
@@ -124,53 +124,53 @@ class ICalendarExport
...
@@ -124,53 +124,53 @@ class ICalendarExport
}
}
/**
/**
* @param CalendarDate $date
* @param CalendarDate
| CourseExDate
$date
* @return array
* @return array
*/
*/
public
function
prepareCalendarDate
(
CalendarDate
$date
):
array
public
function
prepareCalendarDate
(
$date
):
array
{
{
$properties
=
return
[
[
'SUMMARY'
=>
$date
->
title
,
'SUMMARY'
=>
$date
->
title
,
'DESCRIPTION'
=>
$date
->
description
,
'DESCRIPTION'
=>
$date
->
description
,
'LOCATION'
=>
$date
->
location
,
'LOCATION'
=>
$date
->
location
,
'CATEGORIES'
=>
$date
->
getCategoryAsString
(),
'CATEGORIES'
=>
$date
->
getCategoryAsString
(),
'LAST-MODIFIED'
=>
$date
->
chdate
,
'LAST-MODIFIED'
=>
$date
->
chdate
,
'CREATED'
=>
$date
->
mkdate
,
'CREATED'
=>
$date
->
mkdate
,
'DTSTAMP'
=>
$this
->
time
,
'DTSTAMP'
=>
$this
->
time
,
'DTSTART'
=>
$date
->
begin
,
'DTSTART'
=>
$date
->
begin
,
'DTEND'
=>
$date
->
end
,
'DTEND'
=>
$date
->
end
,
'EXDATE'
=>
implode
(
','
,
$date
->
exceptions
->
pluck
(
'date'
)),
'EXDATE'
=>
implode
(
','
,
$date
->
exceptions
->
pluck
(
'date'
)),
'PRIORITY'
=>
5
,
'PRIORITY'
=>
5
,
'RRULE'
=>
[
'RRULE'
=>
[
'type'
=>
$date
->
repetition_type
,
'type'
=>
$date
->
repetition_type
,
'offset'
=>
$date
->
offset
,
'offset'
=>
$date
->
offset
,
'interval'
=>
$date
->
interval
,
'interval'
=>
$date
->
interval
,
'days'
=>
$date
->
days
,
'days'
=>
$date
->
days
,
'count'
=>
$date
->
number_of_dates
,
'count'
=>
$date
->
number_of_dates
,
'expire'
=>
$date
->
repetition_end
,
'expire'
=>
$date
->
repetition_end
,
'month'
=>
$date
->
month
'month'
=>
$date
->
month
]
]
];
];
return
$properties
;
}
}
public
function
prepareCourseDate
(
CourseDate
$date
):
array
/**
* @param CalendarDate | CourseExDate $date
* @return array
*/
public
function
prepareCourseDate
(
$date
):
array
{
{
$properties
=
return
[
[
'SUMMARY'
=>
$date
->
course
->
getFullName
(),
'SUMMARY'
=>
$date
->
course
->
getFullName
(),
'DESCRIPTION'
=>
''
,
'DESCRIPTION'
=>
''
,
'LOCATION'
=>
$date
->
getRoomName
(),
'LOCATION'
=>
$date
->
getRoomName
(),
'CATEGORIES'
=>
$GLOBALS
[
'TERMIN_TYP'
][
$date
->
date_typ
][
'name'
],
'CATEGORIES'
=>
$GLOBALS
[
'TERMIN_TYP'
][
$date
->
date_typ
][
'name'
],
'LAST-MODIFIED'
=>
$date
->
chdate
,
'LAST-MODIFIED'
=>
$date
->
chdate
,
'CREATED'
=>
$date
->
mkdate
,
'CREATED'
=>
$date
->
mkdate
,
'DTSTAMP'
=>
$this
->
time
,
'DTSTAMP'
=>
$this
->
time
,
'DTSTART'
=>
$date
->
date
,
'DTSTART'
=>
$date
->
date
,
'DTEND'
=>
$date
->
end_time
,
'DTEND'
=>
$date
->
end_time
,
'PRIORITY'
=>
''
'PRIORITY'
=>
''
];
];
return
$properties
;
}
}
/**
/**
...
@@ -600,14 +600,12 @@ class ICalendarExport
...
@@ -600,14 +600,12 @@ class ICalendarExport
*/
*/
private
function
getFacultyEmail
(
string
$user_id
):
string
private
function
getFacultyEmail
(
string
$user_id
):
string
{
{
$stmt
=
DBManager
::
get
()
->
prepare
(
'
return
DBManager
::
get
()
->
fetchColumn
(
'
SELECT `email`
SELECT `email`
FROM `Institute`
FROM `Institute`
LEFT JOIN `user_inst` USING(`institut_id`)
LEFT JOIN `user_inst` USING(`institut_id`)
WHERE `Institute`.`Institut_id` = `fakultaets_id`
WHERE `Institute`.`Institut_id` = `fakultaets_id`
AND `user_id` = ?'
);
AND `user_id` = ?'
,
[
$user_id
]);
$stmt
->
execute
([
$user_id
]);
return
$stmt
->
fetchColumn
();
}
}
/**
/**
...
...
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