add QR-codes for Character groups Achievements (implements #124)

This commit is contained in:
oliver 2016-03-12 16:04:51 +01:00
commit bdfd021673
4 changed files with 73 additions and 2 deletions

View file

@ -25,7 +25,7 @@
*
* @var array
*/
public $models = array('seminaries', 'charactergroups', 'charactergroupsquests', 'charactergroupsqueststations');
public $models = array('seminaries', 'charactergroups', 'charactergroupsquests', 'charactergroupsqueststations', 'charactergroupsachievements');
@ -62,6 +62,39 @@
)));
}
/**
* Action: cga.
*
* Redirect to a Character groups Achievements
*
* @param string $achievementHash Hash of Character groups Achievement
*/
public function cga($achievementHash)
{
// Get Achievement
$achievement = $this->Charactergroupsachievements->getAchievementByHash($achievementHash);
// Get Character groups-group
$groupsgroup = $this->Charactergroups->getGroupsgroupById($achievement['charactergroupsgroup_id']);
// Get seminary
$seminary = $this->Seminaries->getSeminaryById($groupsgroup['seminary_id']);
// Redirect
$this->redirect(
$this->linker->link(
array(
'charactergroupsachievements',
'achievement',
$seminary['url'],
$groupsgroup['url'],
$achievement['hash']
)
)
);
}
}
?>