From e4f98c29d1f99daff34e9c9c05f00386ccd80b63 Mon Sep 17 00:00:00 2001 From: oliver Date: Sat, 12 Mar 2016 16:02:58 +0100 Subject: [PATCH] list Character groups Achievements for Character groups and groups-groups --- controllers/CharactergroupsController.inc | 17 ++++++++++++++- views/html/charactergroups/group.tpl | 25 ++++++++++++++++++++++ views/html/charactergroups/groupsgroup.tpl | 20 +++++++++++++++++ 3 files changed, 61 insertions(+), 1 deletion(-) diff --git a/controllers/CharactergroupsController.inc b/controllers/CharactergroupsController.inc index e01a7241..b2f9ce09 100644 --- a/controllers/CharactergroupsController.inc +++ b/controllers/CharactergroupsController.inc @@ -24,7 +24,7 @@ * * @var array */ - public $models = array('seminaries', 'charactergroups', 'charactergroupsquests', 'characters', 'avatars', 'media'); + public $models = array('seminaries', 'charactergroups', 'charactergroupsquests', 'charactergroupsachievements', 'characters', 'avatars', 'media'); /** * Required components * @@ -120,6 +120,14 @@ // Get Character groups-group Quests $quests = $this->Charactergroupsquests->getQuestsForCharactergroupsgroup($groupsgroup['id']); + // Get Achievements + $achievements = array(); + if(count(array_intersect(array('admin', 'moderator'), \hhu\z\controllers\SeminaryController::$character['characterroles'])) > 0) { + $achievements = $this->Charactergroupsachievements->getAchievementsForCharactergroupsgroup( + $groupsgroup['id'] + ); + } + // Set titile $this->addTitle($groupsgroup['name']); @@ -131,6 +139,7 @@ $this->set('groupsgroup', $groupsgroup); $this->set('groups', $groups); $this->set('quests', $quests); + $this->set('achievements', $achievements); } @@ -350,6 +359,11 @@ // Get Character groups Quests $quests = $this->Charactergroupsquests->getQuestsForGroup($group['id']); + // Get Achievements + $achievements = $this->Charactergroupsachievements->getAchievedAchievementsForGroup( + $group['id'] + ); + // Set titile $this->addTitle($group['name']); @@ -361,6 +375,7 @@ $this->set('groupsgroup', $groupsgroup); $this->set('group', $group); $this->set('quests', $quests); + $this->set('achievements', $achievements); } diff --git a/views/html/charactergroups/group.tpl b/views/html/charactergroups/group.tpl index a9c7276a..885b6078 100644 --- a/views/html/charactergroups/group.tpl +++ b/views/html/charactergroups/group.tpl @@ -59,3 +59,28 @@ + + 0) : ?> +
+

+ 0) : ?> + + + +
+ diff --git a/views/html/charactergroups/groupsgroup.tpl b/views/html/charactergroups/groupsgroup.tpl index 9ac565f4..96c99a0a 100644 --- a/views/html/charactergroups/groupsgroup.tpl +++ b/views/html/charactergroups/groupsgroup.tpl @@ -44,3 +44,23 @@ + + + 0 || in_array(\hhu\z\controllers\SeminaryController::$character['id'], array_map(function($c) { return $c['id']; }, $group['characters']))) : ?> +

+ + +