include Character groups Achievements when copying Seminaries

This commit is contained in:
oliver 2016-03-12 16:03:38 +01:00
commit 7c2b3111c2
3 changed files with 10 additions and 2 deletions

View file

@ -461,6 +461,7 @@
array_key_exists('charactergroupsgroups', $elements), array_key_exists('charactergroupsgroups', $elements),
array_key_exists('charactergroupsquests', $elements), array_key_exists('charactergroupsquests', $elements),
array_key_exists('charactergroupsqueststations', $elements), array_key_exists('charactergroupsqueststations', $elements),
array_key_exists('charactergroupsachievements', $elements),
array_key_exists('map', $elements) array_key_exists('map', $elements)
); );
$seminary = $this->Seminaries->getSeminaryById($seminaryId); $seminary = $this->Seminaries->getSeminaryById($seminaryId);

View file

@ -24,7 +24,7 @@
* *
* @var array * @var array
*/ */
public $models = array('questgroupshierarchy', 'questgroups', 'quests', 'questtopics', 'media', 'characters', 'charactertypes', 'xplevels', 'avatars', 'achievements', 'charactergroups', 'charactergroupsquests', 'charactergroupsqueststations', 'seminarycharacterfields', 'map', 'uploads'); public $models = array('questgroupshierarchy', 'questgroups', 'quests', 'questtopics', 'media', 'characters', 'charactertypes', 'xplevels', 'avatars', 'achievements', 'charactergroups', 'charactergroupsquests', 'charactergroupsqueststations', 'charactergroupsachievements', 'seminarycharacterfields', 'map', 'uploads');
@ -348,10 +348,11 @@
* @param boolean $copyCharactergroupsgroups Whether to copy Character groups-groups or not * @param boolean $copyCharactergroupsgroups Whether to copy Character groups-groups or not
* @param boolean $copyCharactergroupsquests Whether to copy Character groups Quests or not * @param boolean $copyCharactergroupsquests Whether to copy Character groups Quests or not
* @param boolean $copyCharactergroupsqueststations Whether to copy Character groups Quest Stations or not * @param boolean $copyCharactergroupsqueststations Whether to copy Character groups Quest Stations or not
* @param boolean $copyCharactergroupsachievements Whether to copy Character groups Achievements or not
* @param boolean $copyMap Whether to copy Map or not * @param boolean $copyMap Whether to copy Map or not
* @return ID of newly created Seminary * @return ID of newly created Seminary
*/ */
public function copySeminary($userId, $sourceSeminaryId, $title, $course, $description, $copySeminaryfields, $copyMedia, $copyQuestgroupshierarchy, $copyQuestgroups, $copyQuests, $copyQuesttopics, $copyCharactertypes, $copyXPlevels, $copyAvatars, $copyAchievements, $copyCharactergroupsgroups, $copyCharactergroupsquests, $copyCharactergroupsqueststations, $copyMap) public function copySeminary($userId, $sourceSeminaryId, $title, $course, $description, $copySeminaryfields, $copyMedia, $copyQuestgroupshierarchy, $copyQuestgroups, $copyQuests, $copyQuesttopics, $copyCharactertypes, $copyXPlevels, $copyAvatars, $copyAchievements, $copyCharactergroupsgroups, $copyCharactergroupsquests, $copyCharactergroupsqueststations, $copyCharactergroupsachievements, $copyMap)
{ {
// Get Seminary // Get Seminary
$seminary = $this->getSeminaryById($sourceSeminaryId); $seminary = $this->getSeminaryById($sourceSeminaryId);
@ -452,6 +453,10 @@
$this->Charactergroupsqueststations->copyStationsOfSeminary($userId, $charactergroupsquestIds, $seminaryMediaIds); $this->Charactergroupsqueststations->copyStationsOfSeminary($userId, $charactergroupsquestIds, $seminaryMediaIds);
} }
} }
// Copy Charactergroupsachievements
if($copyCharactergroupsachievements) {
$this->Charactergroupsachievements->copyAchievementsOfSeminary($userId, $characterGroupsgroupIds, $seminaryMediaIds);
}
} }
// Copy Map // Copy Map

View file

@ -110,6 +110,8 @@
<input type="checkbox" id="elements_charactergroupsqueststations" name="elements[charactergroupsqueststations]" <?php if(array_key_exists('charactergroupsqueststations', $elements)) : ?>checked="checked"<?php endif ?> /> <input type="checkbox" id="elements_charactergroupsqueststations" name="elements[charactergroupsqueststations]" <?php if(array_key_exists('charactergroupsqueststations', $elements)) : ?>checked="checked"<?php endif ?> />
<label for="elements_charactergroupsqueststations"><?=_('Character Groups Quest Stations')?></label> <label for="elements_charactergroupsqueststations"><?=_('Character Groups Quest Stations')?></label>
</div> </div>
<input type="checkbox" id="elements_charactergroupsachievements" name="elements[charactergroupsachievements]" <?php if(array_key_exists('charactergroupsachievements', $elements)) : ?>checked="checked"<?php endif ?> />
<label for="elements_charactergroupsachievements"><?=_('Character Groups Achievements')?></label>
</div> </div>
<input type="checkbox" id="elements_map" name="elements[map]" <?php if(array_key_exists('map', $elements)) : ?>checked="checked"<?php endif ?> /> <input type="checkbox" id="elements_map" name="elements[map]" <?php if(array_key_exists('map', $elements)) : ?>checked="checked"<?php endif ?> />
<label for="elements_map"><?=_('Map')?></label> <label for="elements_map"><?=_('Map')?></label>