From 19126d97f5f27e8f526562436aeb62aa714e77dd Mon Sep 17 00:00:00 2001 From: coderkun Date: Fri, 21 Mar 2014 15:48:42 +0100 Subject: [PATCH] set status of Quest in listing and set progress bar width for Questgroups --- controllers/QuestgroupsController.inc | 9 +++++--- views/html/questgroups/questgroup.tpl | 33 ++++++++------------------- 2 files changed, 16 insertions(+), 26 deletions(-) diff --git a/controllers/QuestgroupsController.inc b/controllers/QuestgroupsController.inc index 7ae4bd72..8657bf89 100644 --- a/controllers/QuestgroupsController.inc +++ b/controllers/QuestgroupsController.inc @@ -108,15 +108,18 @@ if(count($childQuestgroupshierarchy) == 0) { $quests = $this->Quests->getMainquestsForQuestgroup($questgroup['id']); - for($i=0; $i &$quest) { + // Set status + $quest['solved'] = $this->Quests->hasCharacterSolvedQuest($quest['id'], $character['id']); + // Check permission if($i > 0) { - $quests[$i]['access'] = $this->Quests->hasCharacterSolvedQuest($quests[$i-1]['id'], $character['id']); + $quest['access'] = $this->Quests->hasCharacterSolvedQuest($quests[$i-1]['id'], $character['id']); } // Attach sidequests - $quests[$i]['sidequests'] = $this->Quests->getSidequestsForQuest($quests[$i]['id']); + $quests[$i]['sidequests'] = $this->Quests->getSidequestsForQuest($quest['id']); } } diff --git a/views/html/questgroups/questgroup.tpl b/views/html/questgroups/questgroup.tpl index 368eab4e..a80ec0ae 100644 --- a/views/html/questgroups/questgroup.tpl +++ b/views/html/questgroups/questgroup.tpl @@ -1,5 +1,4 @@ -

-

+

@@ -19,12 +18,12 @@
- +

/ XP

- +
@@ -35,33 +34,21 @@