Skip to content

Commit

Permalink
Merge pull request #365 from dbuckalew/civilian
Browse files Browse the repository at this point in the history
getAssignedShip modification
  • Loading branch information
dweinerATL authored Sep 1, 2022
2 parents aec917d + 920f3d7 commit af689fe
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 23 deletions.
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# MEDUSA CHANGELOG

## 2.0.11
- Moved source of chapter types for getAssignedShip in User.php to config record in the database rather than hardcoded

## 2.0.10
- Rename QE3 Silver Jubilee ribbon svg

## 2.0.9
- Updating Awards Given/Requested
- Reformat code for consistency
- Bump jquery from 3.4.1 to 3.5.0
- Czech import
- Remove extraneous assignments from upload
- Fix error in history

## 2.0.8 (Hotfix)
- Fixed incorrect highlighting of members that were not promotable
- Fixed css for chapter tree
Expand Down
26 changes: 3 additions & 23 deletions app/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -534,6 +534,7 @@ public function getNameofLands()
public function getAssignedShip()
{
$holding = MedusaConfig::get('chapter.holding');
$assignable_types = MedusaConfig::get('chapter.assignable');

if (isset($this->assignment) == true) {
foreach ($this->assignment as $assignment) {
Expand All @@ -544,29 +545,8 @@ public function getAssignedShip()

$chapter = Chapter::find($assignment['chapter_id']);

switch ($chapter->chapter_type) {
case 'ship':
case 'bivouac':
case 'company':
case 'station':
case 'shuttle':
case 'section':
case 'squad':
case 'platoon':
case 'battalion':
case 'barracks':
case 'outpost':
case 'fort':
case 'small_craft':
case 'lac':
case 'theater':
case 'headquarters':
case 'jstation':
case 'jfort':
case 'tug':
case 'mship':
return $assignment['chapter_id'];
break;
if (in_array($chapter->chapter_type, $assignable_types) === true) {
return $assignment['chapter_id'];
}
}
}
Expand Down

0 comments on commit af689fe

Please sign in to comment.