diff --git a/controllers/QuestsController.inc b/controllers/QuestsController.inc index 184cef93..ca8622f7 100644 --- a/controllers/QuestsController.inc +++ b/controllers/QuestsController.inc @@ -122,12 +122,19 @@ $questtexttypes = $this->Questtexts->getQuesttexttypes(); $questtexttypes = array_map(function($t) { return $t['url']; }, $questtexttypes); $questtextCount = $this->Questtexts->getQuesttextsCountForQuest($quest['id'], $questtexttypeUrl); - if($questtextCount > 0 && in_array($questtexttypeUrl, $questtexttypes)) + if(/*$questtextCount > 0 && */in_array($questtexttypeUrl, $questtexttypes)) { $questtextPos = max(intval($questtextPos), 1); - $questtext = $this->Questtexts->getQuesttextByUrl($quest['id'], $questtexttypeUrl, $questtextPos); - $questtext['count'] = $questtextCount; - $questtext['sidequests'] = $this->Quests->getSidequestsForQuesttext($questtext['id']); + try { + $questtext = $this->Questtexts->getQuesttextByUrl($quest['id'], $questtexttypeUrl, $questtextPos); + $questtext['count'] = $questtextCount; + $questtext['sidequests'] = $this->Quests->getSidequestsForQuesttext($questtext['id']); + } + catch(\nre\exceptions\IdNotFoundException $e) { + if(!($questtexttypeUrl == 'Prolog' || $questtexttypeUrl == 'Epilog' && $questtextPos == 1)) { + throw $e; + } + } } // Quest status @@ -166,10 +173,13 @@ $task = $this->renderTask($questtype['classname'], $seminary, $questgroup, $quest, $character); } + // Has Character solved quest? + $solved = $this->Quests->hasCharacterSolvedQuest($quest['id'], $character['id']); + // Next Quest/Questgroup $nextQuests = null; $nextQuestgroup = null; - if($questtexttypeUrl == 'Epilog') + if($questtexttypeUrl == 'Epilog' || $solved) { if($quest['is_mainquest']) { @@ -191,9 +201,6 @@ } } - // Has Character solved quest? - $solved = $this->Quests->hasCharacterSolvedQuest($quest['id'], $character['id']); - // Pass data to view $this->set('seminary', $seminary); 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 0f2ca49e..b612a217 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 57f560a6..390e7ef1 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-03-21 23:55+0100\n" -"PO-Revision-Date: 2014-03-21 23:55+0100\n" +"POT-Creation-Date: 2014-03-22 14:37+0100\n" +"PO-Revision-Date: 2014-03-22 14:37+0100\n" "Last-Translator: \n" "Language-Team: \n" "Language: de_DE\n" @@ -129,18 +129,22 @@ msgid "unsolved" msgstr "ungelöst" #: ../../../views/html/quests/quest.tpl:60 +msgid "Task" +msgstr "Aufgabe" + +#: ../../../views/html/quests/quest.tpl:68 +msgid "Task successfully solved" +msgstr "Du hast die Aufgabe erfolgreich gelöst" + +#: ../../../views/html/quests/quest.tpl:69 msgid "Go on" msgstr "Hier geht es weiter" -#: ../../../views/html/quests/quest.tpl:65 -#: ../../../views/html/quests/quest.tpl:67 +#: ../../../views/html/quests/quest.tpl:74 +#: ../../../views/html/quests/quest.tpl:76 msgid "Quest" msgstr "Quest" -#: ../../../views/html/quests/quest.tpl:81 -msgid "Task" -msgstr "Aufgabe" - #: ../../../views/html/quests/submission.tpl:11 #, php-format msgid "Submission of %s" diff --git a/views/html/quests/quest.tpl b/views/html/quests/quest.tpl index bd88ff3a..45e6cdc3 100644 --- a/views/html/quests/quest.tpl +++ b/views/html/quests/quest.tpl @@ -55,8 +55,17 @@ + +
+

+

+ +
+ +
+

0) : ?>
- - -
-

-

- -
-