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 c67ab171..df2c1614 100644 Binary files a/locale/de_DE/LC_MESSAGES/The Legend of Z.mo and b/locale/de_DE/LC_MESSAGES/The Legend of Z.mo differ 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 @@
=$group['character_xps']?> / =$group['xps']?> XP
+Versteckte Bonus-Questline gefunden:
-Hier der Titel der entsprechenden Bonus-Questline
+=_('Found optional Questline')?>:
+