Skip to content

Commit

Permalink
Issues 386 Sub-Menu Wochenansicht
Browse files Browse the repository at this point in the history
- Wenn ich einen Tag selektiert hab, wird dieser dann auch für die
  Wochenansicht, Tagesansicht und Kundenansicht verwendet.
  Bis ich wieder neu auf den Kalender komme.

closed yakamara#386
  • Loading branch information
frag-seb committed Feb 25, 2016
1 parent 67bfe02 commit 25f185e
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
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']);
}
}
9 changes: 6 additions & 3 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

0 comments on commit 25f185e

Please sign in to comment.