Skip to content
This repository has been archived by the owner on Dec 18, 2021. It is now read-only.

Issues 386 Sub-Menu Wochenansicht #401

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 14 additions & 0 deletions lib/calendar/calendars_controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,18 @@ public function checkPerm()
return false;
}
}

protected function getSelectDay()
{
$request_day = rex_request('day', 'string', rex_cookie('calendar_day', 'string', '')); // 20112019 Ymd
setcookie('calendar_day', $request_day, time() + 60 + 60 * 24, '/screen/calendars/');

return $request_day;
}

protected function removeSelectDay()
{
setcookie('calendar_day', '', -1, '/screen/calendars/');
unset($_COOKIE['calendar_day']);
}
}
13 changes: 8 additions & 5 deletions lib/calendar/calendars_controller_screen.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ public function controller($function)
{
if (!in_array($function, $this->functions)) {
$function = $this->function_default;
$this->removeSelectDay();
}
$this->function = $function;

Expand Down Expand Up @@ -230,7 +231,8 @@ public function getDayPage($p = [])
$s1_content = '';
$s2_content = '';

$request_day = rex_request('day', 'string'); // 20112019 Ymd
$request_day = $this->getSelectDay();

if (!$day = DateTime::createFromFormat('Ymd', $request_day)) {
$day = new DateTime();
}
Expand Down Expand Up @@ -332,7 +334,8 @@ public function getWeekPage($p = [])
$s1_content = '';
$s2_content = '';

$request_day = rex_request('day', 'string'); // 20112019 Ymd
$request_day = $request_day = $this->getSelectDay();

if (!$day = DateTime::createFromFormat('Ymd', $request_day)) {
$day = new DateTime();
}
Expand Down Expand Up @@ -458,7 +461,7 @@ public function getCustomerplanPage($p = [])
$s1_content = '';
$s2_content = '';

$request_day = rex_request('day', 'string'); // 20112019 Ymd
$request_day = $this->getSelectDay(); // 20112019 Ymd

// Ansichten:
// - 14 tägig
Expand Down Expand Up @@ -610,7 +613,7 @@ public function getProjectEventPage($p = [])
$s1_content = '';
$s2_content = '';

$request_day = rex_request('day', 'string'); // 20112019 Ymd
$request_day = $this->getSelectDay(); // 20112019 Ymd
if (!$day = DateTime::createFromFormat('Ymd', $request_day)) {
$day = new DateTime();
}
Expand Down Expand Up @@ -692,7 +695,7 @@ public function getProjectJobPage($p = [])
$s1_content = '';
$s2_content = '';

$request_day = rex_request('day', 'string'); // 20112019 Ymd
$request_day = $this->getSelectDay(); // 20112019 Ymd
if (!$day = DateTime::createFromFormat('Ymd', $request_day)) {
$day = new DateTime();
}
Expand Down