diff --git a/controllers/CharactergroupsqueststationsController.inc b/controllers/CharactergroupsqueststationsController.inc index 73cf7fc3..3a180d22 100644 --- a/controllers/CharactergroupsqueststationsController.inc +++ b/controllers/CharactergroupsqueststationsController.inc @@ -166,13 +166,33 @@ $station['wrongav'] = $this->Media->getSeminaryMediaById($station['wrongav_id']); } - // Get Character group + // Get Character group(s) + $stationgroups = null; + $stationgroup = null; $charactergroup = null; - $character = $this->Characters->getCharacterForUserAndSeminary($this->Auth->getUserId(), $seminary['id']); - $charactergroups = $this->Charactergroups->getGroupsForCharacter($character['id']); - if(!empty($charactergroups)) { - // TODO Multiple Character groups - $charactergroup = $charactergroups[0]; + if(count(array_intersect(array('admin', 'moderator'), \hhu\z\controllers\SeminaryController::$character['characterroles'])) > 0) { + $stationgroups = $this->Charactergroups->getGroupsForGroupsgroup($groupsgroup['id']); + } + else + { + $character = $this->Characters->getCharacterForUserAndSeminary($this->Auth->getUserId(), $seminary['id']); + $stationgroups = $this->Charactergroups->getGroupsForCharacter($character['id']); + if(!empty($stationgroups)) { + $stationgroup = $stationgroups[0]; + $charactergroup = $stationgroup; + } + } + // Select group by parameter + $selectedStationGroupId = $this->request->getGetParam('stationgroup'); + if(!is_null($selectedStationGroupId)) + { + $selectedStationGroupId = intval($selectedStationGroupId); + foreach($stationgroups as &$group) { + if($group['id'] == $selectedStationGroupId) { + $stationgroup = $group; + break; + } + } } // TODO Check permissions @@ -219,18 +239,25 @@ } // Status - $solved = false; + $entered = false; $tried = false; - if(!is_null($charactergroup)) { - $tried = $this->Charactergroupsqueststations->hasCharactergroupTriedStation( + $solved = false; + if(!is_null($stationgroup)) { + $entered = $this->Charactergroupsqueststations->hasCharactergroupEnteredStation( $station['id'], - $charactergroup['id'] + $stationgroup['id'] ); - if($tried) { - $solved = $this->Charactergroupsqueststations->hasCharactergroupSolvedStation( + if($entered) { + $tried = $this->Charactergroupsqueststations->hasCharactergroupTriedStation( $station['id'], - $charactergroup['id'] + $stationgroup['id'] ); + if($tried) { + $solved = $this->Charactergroupsqueststations->hasCharactergroupSolvedStation( + $station['id'], + $stationgroup['id'] + ); + } } } @@ -248,9 +275,11 @@ $this->set('station', $station); $this->set('task', $task); $this->set('groups', $groups); - $this->set('stationgroup', $charactergroup); - $this->set('solved', $solved); + $this->set('stationgroups', $stationgroups); + $this->set('stationgroup', $stationgroup); + $this->set('entered', $entered); $this->set('tried', $tried); + $this->set('solved', $solved); } diff --git a/views/html/charactergroupsquests/quest.tpl b/views/html/charactergroupsquests/quest.tpl index 6e2d6ba0..75c5abc3 100644 --- a/views/html/charactergroupsquests/quest.tpl +++ b/views/html/charactergroupsquests/quest.tpl @@ -98,7 +98,11 @@
  • + + + + diff --git a/views/html/charactergroupsqueststations/station.tpl b/views/html/charactergroupsqueststations/station.tpl index d0406c14..a185f34d 100644 --- a/views/html/charactergroupsqueststations/station.tpl +++ b/views/html/charactergroupsqueststations/station.tpl @@ -7,6 +7,7 @@
    + @@ -24,6 +25,9 @@ + + +

    @@ -41,16 +45,40 @@
  • - -
  • - - - - + 1) : ?> +
    + +
  • + +
  • + + + + format(new \DateTime($solved))?> + format(new \DateTime($solved))?> + + + format(new \DateTime($tried))?> + format(new \DateTime($tried))?> + + + + format(new \DateTime($entered))?> + format(new \DateTime($entered))?> + +
  • + diff --git a/www/css/desktop.css b/www/css/desktop.css index 1854ccd3..00a537fd 100644 --- a/www/css/desktop.css +++ b/www/css/desktop.css @@ -302,7 +302,8 @@ input[type="submit"][disabled]{text-shadow:1px 2px #d48c4e;background:#f9ac69;bo .grpqslist li{float:left;width:100px;height:100px;text-align:center;margin:5px} .grpqslist li a{color:#5e5c58} .grpqslist li i{font-size:100px;padding:0} -.grpqsicon{float:right;box-shadow:0 0 5px gray} +.grpqsicon{float:right;box-shadow:0 0 5px gray;text-align:center} +.grpqsicon i{display:block;font-size:100px;width:100px;height:100px;padding:0} /** Achievements **/