From 0089c28a9605d0ac81971adcad0f924dd69e1e68 Mon Sep 17 00:00:00 2001 From: coderkun Date: Thu, 24 Apr 2014 16:49:09 +0200 Subject: [PATCH] show optional Questlines also for Questgroup (Issue #132) --- controllers/QuestgroupsController.inc | 9 ++++++ locale/de_DE/LC_MESSAGES/The Legend of Z.mo | Bin 10054 -> 10124 bytes locale/de_DE/LC_MESSAGES/The Legend of Z.po | 23 ++++++++-------- models/QuestgroupsModel.inc | 29 +++++++++++++++++--- views/html/questgroups/questgroup.tpl | 6 ++-- 5 files changed, 50 insertions(+), 17 deletions(-) diff --git a/controllers/QuestgroupsController.inc b/controllers/QuestgroupsController.inc index 687887a6..8e4d01c4 100644 --- a/controllers/QuestgroupsController.inc +++ b/controllers/QuestgroupsController.inc @@ -113,6 +113,15 @@ $data = $this->Questgroups->getCumulatedDataForQuestgroup($group['id'], $character['id']); $group['xps'] = $data['xps']; $group['character_xps'] = $data['character_xps']; + + // Attach related Questgroups + $group['relatedQuestgroups'] = array(); + $relatedQuestgroups = $this->Questgroups->getRelatedQuestsgroupsOfQuestgroup($group['id']); + foreach($relatedQuestgroups as &$relatedQuestgroup) { + if($this->Questgroups->hasCharacterEnteredQuestgroup($relatedQuestgroup['id'], $character['id'])) { + $group['relatedQuestgroups'][] = $this->Questgroups->getQuestgroupById($relatedQuestgroup['id']); + } + } } } } diff --git a/locale/de_DE/LC_MESSAGES/The Legend of Z.mo b/locale/de_DE/LC_MESSAGES/The Legend of Z.mo index c67ab17165b10a06a7e21b6ca67f7c32dce39d7e..df2c161487e13f364061d59f3851f83fc6cedc1f 100644 GIT binary patch delta 3349 zcmX@+*W+J*Pl#nI0|NuYECvP!83qQ1H!KVcml+rs_Hcqk85lTt85lSi7#KLAv=A=? zgE#{NgETJ#gEj*LgE21y0}lfOLp(1710MqeLk?73H7^4LD+2>V3oiqM5Ca247cTuW43Pp143Z2C3`J0dJpvGitOO}wU|`rS0CC_Ir~wZJAQpTQfLQQX0ODh2 zL5PpJ1tH?I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s5xCfq}u6fq|h8)F1#g7#SECN*Nd!0zuU(0|P@B0|Nu7 zm*E4_$N*`XfZFa23?LsdFwB^IkVhC)>VW0#85kI>LG5BNkAb0+0a66DFfcF_FhDXD lD5I8aX64<+y!ncN3Ol3e<99aMW diff --git a/locale/de_DE/LC_MESSAGES/The Legend of Z.po b/locale/de_DE/LC_MESSAGES/The Legend of Z.po index 8c8fee42..445f46f9 100644 --- a/locale/de_DE/LC_MESSAGES/The Legend of Z.po +++ b/locale/de_DE/LC_MESSAGES/The Legend of Z.po @@ -1,8 +1,8 @@ msgid "" msgstr "" "Project-Id-Version: The Legend of Z\n" -"POT-Creation-Date: 2014-04-24 15:46+0100\n" -"PO-Revision-Date: 2014-04-24 15:46+0100\n" +"POT-Creation-Date: 2014-04-24 16:46+0100\n" +"PO-Revision-Date: 2014-04-24 16:46+0100\n" "Last-Translator: \n" "Language-Team: \n" "Language: de_DE\n" @@ -216,7 +216,7 @@ msgstr "Charaktere" #: views/html/charactergroups/group.tpl:45 #: views/html/charactergroups/managegroup.tpl:54 -#: views/html/questgroups/questgroup.tpl:55 views/html/quests/create.tpl:9 +#: views/html/questgroups/questgroup.tpl:57 views/html/quests/create.tpl:9 #: views/html/quests/index.tpl:9 msgid "Quests" msgstr "Quests" @@ -277,7 +277,7 @@ msgstr "Ranking" #: views/html/characters/character.tpl:67 #: views/html/characters/character.tpl:73 #: views/html/characters/character.tpl:79 -#: views/html/characters/character.tpl:90 views/html/quests/index.tpl:38 +#: views/html/characters/character.tpl:90 views/html/quests/index.tpl:37 #: views/html/seminarybar/index.tpl:6 views/html/seminarybar/index.tpl:42 #, php-format msgid "%d XPs" @@ -439,24 +439,28 @@ msgstr "Kurse" msgid "Logout" msgstr "Logout" -#: views/html/questgroups/create.tpl:9 +#: views/html/questgroups/create.tpl:8 msgid "Questgroups" msgstr "Questgruppen" -#: views/html/questgroups/create.tpl:11 +#: views/html/questgroups/create.tpl:10 msgid "Create Questgroup" msgstr "Questgruppe erstellen" -#: views/html/questgroups/create.tpl:15 views/html/questgroups/create.tpl:16 +#: views/html/questgroups/create.tpl:14 views/html/questgroups/create.tpl:15 #: views/html/seminaries/create.tpl:11 views/html/seminaries/create.tpl:12 #: views/html/seminaries/edit.tpl:11 views/html/seminaries/edit.tpl:12 msgid "Title" msgstr "Titel" -#: views/html/questgroups/create.tpl:18 views/html/quests/create.tpl:43 +#: views/html/questgroups/create.tpl:17 views/html/quests/create.tpl:43 msgid "Create" msgstr "Erstellen" +#: views/html/questgroups/questgroup.tpl:45 +msgid "Found optional Questline" +msgstr "Optionale Questline gefunden" + #: views/html/quests/create.tpl:11 msgid "Create Quest" msgstr "Quest erstellen" @@ -789,8 +793,5 @@ msgstr "Rollen" #~ msgid "as" #~ msgstr "als" -#~ msgid "containing optional Quests" -#~ msgstr "Enthaltene optionale Quests" - #~ msgid "This Quest is optional" #~ msgstr "Diese Quest ist optional" diff --git a/models/QuestgroupsModel.inc b/models/QuestgroupsModel.inc index 1534251d..21ee1452 100644 --- a/models/QuestgroupsModel.inc +++ b/models/QuestgroupsModel.inc @@ -369,8 +369,8 @@ /** * Get all related Questgroups of a Questtext. * - * @param int $questtextId ID of the questtext - * @return array Sidequests for the questtext + * @param int $questtextId ID of the Questtext + * @return array Related Questgroups for the Questtext */ public function getRelatedQuestsgroupsOfQuesttext($questtextId) { @@ -388,8 +388,8 @@ /** * Get all related Questgroups of a Quest. * - * @param int $questId ID of the quest - * @return array Sidequests for the quest + * @param int $questId ID of the Quest + * @return array Related Quests for the Quest */ public function getRelatedQuestsgroupsOfQuest($questId) { @@ -406,6 +406,27 @@ } + /** + * Get all related Questgroups of a Questgroup. + * + * @param int $questgroupId ID of the Questgroup + * @return array Related Questgroups for the Questgroup + */ + public function getRelatedQuestsgroupsOfQuestgroup($questgroupId) + { + return $this->db->query( + 'SELECT questgroups_questtexts.questgroup_id AS id '. + 'FROM questgroups '. + 'INNER JOIN quests ON quests.questgroup_id = questgroups.id '. + 'INNER JOIN questtexts ON questtexts.quest_id = quests.id '. + 'INNER JOIN questgroups_questtexts ON questgroups_questtexts.questtext_id = questtexts.id '. + 'WHERE questgroups.id = ?', + 'i', + $questgroupId + ); + } + + /** * Calculate cumulated data for a Questgroup, its * sub-Questgroups and all its Quests. diff --git a/views/html/questgroups/questgroup.tpl b/views/html/questgroups/questgroup.tpl index c0f2218e..347880a7 100644 --- a/views/html/questgroups/questgroup.tpl +++ b/views/html/questgroups/questgroup.tpl @@ -40,10 +40,12 @@

/ XP

+
-

Versteckte Bonus-Questline gefunden:

-

Hier der Titel der entsprechenden Bonus-Questline

+

:

+

+