diff --git a/www/admin/aktiviteter/edit.php b/www/admin/aktiviteter/edit.php index 69435f9..4825cb9 100644 --- a/www/admin/aktiviteter/edit.php +++ b/www/admin/aktiviteter/edit.php @@ -14,6 +14,7 @@ $as = new SimpleSAML_Auth_Simple('default-sp'); $as->requireAuth(); $attrs = $as->getAttributes(); $uname = $attrs['uid'][0]; +$name = $attrs['cn'][0]; if(!$userManager->hasGroup($uname, 'aktiviteter')){ echo 'Her har du ikke lov\'t\'å\'værra!!!'; @@ -36,24 +37,31 @@ if(isset($_GET['id'])){ } $today = new DateTimeImmutable; -$defaultStart = $today->format("Y-m-d H:00:00"); -$inOneHour = $today->add(new DateInterval('PT1H')); -$defaultEnd = $inOneHour->format("Y-m-d H:00:00"); +$today = $today->setTime(18, 15); +$defaultStart = $today->format("Y-m-d H:15:00"); +$inTwoHours = $today->add(new DateInterval('PT1H45M')); +$defaultEnd = $inTwoHours->format("Y-m-d H:00:00"); -$event = new \pvv\side\SimpleEvent( - 0, - 'Kul Hendelse', - $today, - $inOneHour, - 'PVV', - 'Norge et sted', - 'her skjer det noe altså' -); +$event; if($new == 0){ $event = $customActivity->getEventByID($eventID); } -?> +else { + $event = new \pvv\side\SimpleEvent( + 0, + '', + $today, + $inTwoHours, + '', + '', + '' + ); +} + +?> + +
@@ -75,34 +83,50 @@ if($new == 0){