diff --git a/Layout/default/Calendar/Form.php b/Layout/default/Calendar/Form.php index c0e73b15f..8c5f60218 100644 --- a/Layout/default/Calendar/Form.php +++ b/Layout/default/Calendar/Form.php @@ -15,7 +15,15 @@ -

id) ? "Kalender Verwaltung bearbeiten" : "Neuer Kalender Verwaltung" ?>

+

+ id && $calendars->user_id): ?> + Kalender Verwaltung bearbeiten + id && !$calendars->user_id): ?> + Benutzer bearbeiten + + Neuen Kalender Benutzer anlegen + +

@@ -35,15 +43,31 @@
- + user_id): ?> + + + + +
+ id || !$calendars->user_id): ?> +
+ +
+ + + Automatisch: vorname.nachname@xinon.extern + +
+
+
@@ -76,7 +100,108 @@
+
+ +
+
+ calendar_admin==1) ? 'checked="checked"' : '' ?> class="custom-control-input" value="1" + id="calendar_admin" name="calendar_admin"> + +
+ + Bekommt automatisch "all"-Rechte auf alle neuen Benutzer + +
+
+ id): ?> +
+ +
+
+
+ + + + + + + + + + + rights, true) ?: []; + $allCalendars = CalendarModel::getAll(); + $sortedCalendars = []; + foreach ($allCalendars as $cal) { + if ($cal->id == $calendars->id || !$cal->go_calendar_id) continue; + $name = $cal->user_id ? $cal->user->name : $cal->calendar_name; + $sortedCalendars[] = [ + 'cal' => $cal, + 'name' => $name + ]; + } + usort($sortedCalendars, function($a, $b) { + return strcasecmp($a['name'], $b['name']); + }); + + foreach ($sortedCalendars as $item): + $cal = $item['cal']; + $calendarName = $item['name']; + $currentRight = isset($currentRights[$cal->go_calendar_id]) ? $currentRights[$cal->go_calendar_id] : 'none'; + ?> + + + + + + + + +
KalenderKeineLesenAlle Rechte
+ + user_id): ?> + Mitarbeiter + + Extern + + +
+ > + +
+
+
+ > + +
+
+
+ > + +
+
+
+
+
+
+
@@ -100,8 +225,7 @@ ?> diff --git a/Layout/default/Calendar/View.php b/Layout/default/Calendar/View.php index 49c362364..6d7f7c853 100644 --- a/Layout/default/Calendar/View.php +++ b/Layout/default/Calendar/View.php @@ -24,7 +24,18 @@ if (!is_array($Calendar_colors[$Calendar[0]->go_calendar_id])) { $specialCalendars = array(999 => 'Abwesenheiten', 998 => 'Geburtstage', 997 => 'Feiertage'); $carCalendars = array(); foreach ($rights as $key => $right) : - $CalArray[$CalendarAll[$key]->user->name] = $key; + $calendarName = ''; + if (isset($CalendarAll[$key])) { + if ($CalendarAll[$key]->user_id) { + $calendarName = $CalendarAll[$key]->user->name; + } elseif ($CalendarAll[$key]->calendar_name) { + $calendarName = $CalendarAll[$key]->calendar_name; + } + } + + if ($calendarName) { + $CalArray[$calendarName] = $key; + } endforeach; //$CalArray['Anhänger Klein SO-421DH'] = 30; //$CalArray['Einblasmaschine Bagela'] = 31; @@ -209,14 +220,25 @@ endforeach; value="" title="Textfarbe">
@@ -765,7 +787,8 @@ endforeach;
-