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
e398eec2
Commit
e398eec2
authored
10 months ago
by
Peter Thienel
Committed by
David Siegfried
10 months ago
Browse files
Options
Downloads
Patches
Plain Diff
Resolve "Terminkalender: Dialog des Termin-Exports schließt sich nicht nach Download"
Closes #4094 Merge request
studip/studip!2938
parent
e7bfc2e8
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/calendar/calendar.php
+32
-20
32 additions, 20 deletions
app/controllers/calendar/calendar.php
app/views/calendar/calendar/export.php
+1
-1
1 addition, 1 deletion
app/views/calendar/calendar/export.php
with
33 additions
and
21 deletions
app/controllers/calendar/calendar.php
+
32
−
20
View file @
e398eec2
...
@@ -770,29 +770,41 @@ class Calendar_CalendarController extends AuthenticatedController
...
@@ -770,29 +770,41 @@ class Calendar_CalendarController extends AuthenticatedController
PageLayout
::
postError
(
_
(
'Bitte wählen Sie aus, welche Termine exportiert werden sollen!'
));
PageLayout
::
postError
(
_
(
'Bitte wählen Sie aus, welche Termine exportiert werden sollen!'
));
return
;
return
;
}
}
$ical
=
''
;
$this
->
relocate
(
$this
->
url_for
(
'calendar/calendar/export_file'
,
[
$calendar_export
=
new
ICalendarExport
();
'begin'
=>
$this
->
begin
->
format
(
'd.m.Y'
),
if
(
$this
->
dates_to_export
===
'user'
)
{
'end'
=>
$this
->
end
->
format
(
'd.m.Y'
),
$ical
=
$calendar_export
->
exportCalendarDates
(
User
::
findCurrent
()
->
id
,
$this
->
begin
,
$this
->
end
);
'dates_to_export'
=>
$this
->
dates_to_export
}
elseif
(
$this
->
dates_to_export
===
'course'
)
{
]));
$ical
=
$calendar_export
->
exportCourseDates
(
User
::
findCurrent
()
->
id
,
$this
->
begin
,
$this
->
end
);
$ical
.
=
$calendar_export
->
exportCourseExDates
(
User
::
findCurrent
()
->
id
,
$this
->
begin
,
$this
->
end
);
}
elseif
(
$this
->
dates_to_export
===
'all'
)
{
$ical
=
$calendar_export
->
exportCalendarDates
(
User
::
findCurrent
()
->
id
,
$this
->
begin
,
$this
->
end
);
$ical
.
=
$calendar_export
->
exportCourseDates
(
User
::
findCurrent
()
->
id
,
$this
->
begin
,
$this
->
end
);
$ical
.
=
$calendar_export
->
exportCourseExDates
(
User
::
findCurrent
()
->
id
,
$this
->
begin
,
$this
->
end
);
}
$ical
=
$calendar_export
->
writeHeader
()
.
$ical
.
$calendar_export
->
writeFooter
();
$this
->
response
->
add_header
(
'Content-Type'
,
'text/calendar;charset=utf-8'
);
$this
->
response
->
add_header
(
'Content-Disposition'
,
'attachment; filename="studip.ics"'
);
$this
->
response
->
add_header
(
'Content-Transfer-Encoding'
,
'binary'
);
$this
->
response
->
add_header
(
'Pragma'
,
'public'
);
$this
->
response
->
add_header
(
'Cache-Control'
,
'private'
);
$this
->
response
->
add_header
(
'Content-Length'
,
strlen
(
$ical
));
$this
->
render_text
(
$ical
);
}
}
}
}
public
function
export_file_action
()
{
$begin
=
Request
::
getDateTime
(
'begin'
,
'd.m.Y'
);
$end
=
Request
::
getDateTime
(
'end'
,
'd.m.Y'
);
$dates_to_export
=
Request
::
option
(
'dates_to_export'
,
'user'
);
$ical
=
''
;
$calendar_export
=
new
ICalendarExport
();
if
(
$dates_to_export
===
'user'
)
{
$ical
=
$calendar_export
->
exportCalendarDates
(
User
::
findCurrent
()
->
id
,
$begin
,
$end
);
}
elseif
(
$dates_to_export
===
'course'
)
{
$ical
=
$calendar_export
->
exportCourseDates
(
User
::
findCurrent
()
->
id
,
$begin
,
$end
);
$ical
.
=
$calendar_export
->
exportCourseExDates
(
User
::
findCurrent
()
->
id
,
$begin
,
$end
);
}
elseif
(
$dates_to_export
===
'all'
)
{
$ical
=
$calendar_export
->
exportCalendarDates
(
User
::
findCurrent
()
->
id
,
$begin
,
$end
);
$ical
.
=
$calendar_export
->
exportCourseDates
(
User
::
findCurrent
()
->
id
,
$begin
,
$end
);
$ical
.
=
$calendar_export
->
exportCourseExDates
(
User
::
findCurrent
()
->
id
,
$begin
,
$end
);
}
$ical
=
$calendar_export
->
writeHeader
()
.
$ical
.
$calendar_export
->
writeFooter
();
$this
->
response
->
add_header
(
'Content-Type'
,
'text/calendar;charset=utf-8'
);
$this
->
response
->
add_header
(
'Content-Disposition'
,
'attachment; filename="studip.ics"'
);
$this
->
response
->
add_header
(
'Content-Transfer-Encoding'
,
'binary'
);
$this
->
response
->
add_header
(
'Pragma'
,
'public'
);
$this
->
response
->
add_header
(
'Cache-Control'
,
'private'
);
$this
->
response
->
add_header
(
'Content-Length'
,
strlen
(
$ical
));
$this
->
render_text
(
$ical
);
}
public
function
import_action
()
{}
public
function
import_action
()
{}
public
function
import_file_action
()
public
function
import_file_action
()
...
...
This diff is collapsed.
Click to expand it.
app/views/calendar/calendar/export.php
+
1
−
1
View file @
e398eec2
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
* @var DateTimeImmutable $end
* @var DateTimeImmutable $end
*/
*/
?>
?>
<form
class=
"default"
method=
"post"
<form
class=
"default"
method=
"post"
data-dialog=
"size=auto"
action=
"
<?=
$controller
->
link_for
(
'calendar/calendar/export'
,
$user_id
??
null
)
?>
"
>
action=
"
<?=
$controller
->
link_for
(
'calendar/calendar/export'
,
$user_id
??
null
)
?>
"
>
<?=
CSRFProtection
::
tokenTag
()
?>
<?=
CSRFProtection
::
tokenTag
()
?>
<fieldset>
<fieldset>
...
...
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