Skip to content

Commit

Permalink
additional changes to handbook, translates and migrations
Browse files Browse the repository at this point in the history
  • Loading branch information
paaton committed Nov 28, 2023
1 parent f376986 commit 4ad42d0
Show file tree
Hide file tree
Showing 13 changed files with 21 additions and 39 deletions.
3 changes: 0 additions & 3 deletions sql/init-postgresql.sql
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,6 @@ create table "participant"
email TEXT,
legal_representative TEXT,
health_problems TEXT,
medicaments TEXT,
psychical_health_problems TEXT,
food_preferences TEXT,
scout_unit TEXT,
tshirt TEXT,
Expand All @@ -106,7 +104,6 @@ create table "participant"
patrol_leader_id int,
patrol_name TEXT,
drivers_license TEXT,
printed_handbook TEXT,
languages TEXT,
skills TEXT,
preferred_position TEXT,
Expand Down
3 changes: 0 additions & 3 deletions sql/init.sql
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,6 @@ create table participant
email TEXT,
legal_representative TEXT,
health_problems TEXT,
medicaments TEXT,
psychical_health_problems TEXT,
food_preferences TEXT,
scout_unit TEXT,
tshirt TEXT,
Expand All @@ -110,7 +108,6 @@ create table participant
patrol_leader_id int,
patrol_name TEXT,
drivers_license TEXT,
printed_handbook TEXT,
languages TEXT,
skills TEXT,
preferred_position TEXT,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ public function up(): void
$tableUser = $this->table('participant');
$tableUser->addColumn('medications', 'string', ['null' => true]);
$tableUser->addColumn('psychical_health_problems', 'string', ['null' => true]);
$tableUser->addColumn('printed_handbook', 'boolean', ['null' => true]);
$tableUser->save();
}

Expand All @@ -18,6 +19,7 @@ public function down(): void
$tableUser = $this->table('participant');
$tableUser->removeColumn('medications');
$tableUser->removeColumn('psychical_health_problems');
$tableUser->removeColumn('printed_handbook');
$tableUser->save();
}
}

This file was deleted.

2 changes: 1 addition & 1 deletion src/Event/AbstractContentArbiter.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ abstract class AbstractContentArbiter
public bool $birthDate = true;
public bool $birthPlace = false;
public bool $health = true;
public bool $medicaments = false;
public bool $medicaments = true;
public bool $psychicalHealth = true;
public bool $food = false;
public bool $idNumber = false;
Expand Down
6 changes: 1 addition & 5 deletions src/Event/EventType/Obrok/EventTypeObrok.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function getContentArbiterIst(): ContentArbiterIst
{
$ca = parent::getContentArbiterIst();
$ca->tshirt = true;

$ca->printedHandbook = true;
return $ca;
}

Expand All @@ -38,8 +38,6 @@ public function getContentArbiterTroopLeader(): ContentArbiterTroopLeader
$ca->phone = true;
$ca->email = true;
$ca->unit = true;
$ca->medicaments = true;
$ca->psychicalHealth = true;
$ca->printedHandbook = true;

return $ca;
Expand All @@ -52,8 +50,6 @@ public function getContentArbiterTroopParticipant(): ContentArbiterTroopParticip
$ca->phone = true;
$ca->email = true;
$ca->unit = true;
$ca->medicaments = true;
$ca->psychicalHealth = true;
$ca->printedHandbook = true;

return $ca;
Expand Down
2 changes: 1 addition & 1 deletion src/Participant/Participant.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
* @property string|null $skills
* @property array|null $preferredPosition m:useMethods(getPreferredPosition|setPreferredPosition)
* @property string|null $driversLicense
* @property string|null $printedHandbook
* @property boolean|null $printedHandbook
* @property string|null $notes
* @property DateTimeInterface|null $registrationCloseDate m:passThru(dateFromString|dateToString)
* @property DateTimeInterface|null $registrationApproveDate m:passThru(dateFromString|dateToString)
Expand Down
2 changes: 1 addition & 1 deletion src/Participant/ParticipantService.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ private function addParamsIntoPerson(array $params, Participant $p): Participant
$preferredPosition = $params['preferredPosition'] ?? [];
$p->preferredPosition = $preferredPosition;
$p->driversLicense = $params['driversLicense'] ?? null;
$p->printedHandbook = $params['printedHandbook'] ?? null;
$p->printedHandbook = array_key_exists('printedhandbook', $params) ? true : NULL;
$p->notes = $params['notes'] ?? null;

return $p;
Expand Down
2 changes: 2 additions & 0 deletions src/Templates/cs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ detail:
uploadFileMissing: "soubor zatím není nahraný :("
printedHandbook: "Tištěný handbook"
printedHandbook-detail: "Chci na akci dostat vytištěný handbook"
handbook-yes: "ano"
handbook-no: "ne"
notice: "Poznámky"
notice-placeholder: "cokoli dalšího?"
skills: "Dovednosti"
Expand Down
2 changes: 2 additions & 0 deletions src/Templates/en.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@ detail:
printedHandbook: "Paper Handbook"
printedHandbook-detail: "I want to obtain paper printed event handbook"
notice: "Notice"
handbook-yes: "yes"
handbook-no: "no"
notice-placeholder: "anything else?"
skills: "Skills"
skills-placeholder: "sailing; food handling certificate; advanced first aid; ..."
Expand Down
10 changes: 9 additions & 1 deletion src/Templates/sk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,11 @@ detail:
foodOther: "iné - prosím upresni v poznámke"
food-placeholder: "V prípade inej diéty, než sú uvedené vyššie, uved svou preferenciu v poznámke"
issues: "Zdravotné údaje"
issues-placeholder: "pravidelne užívané lieky, prekonané operácie, závažné choroby, alergie - spúšťač, symptómy, podávané lieky..."
issues-placeholder: "prekonané operácie, závažné choroby, alergie - spúšťač, symptómy"
medicaments: "léky"
medicaments-placeholder: "pravidelně užívané léky"
psychicalIssues: "psychická onemocnění"
psychicalIssues-placeholder: "psychická onemocnění, jakékoliv psychické obtíže"
language: "Ovládané jazyky + úroveň"
language-placeholder: "např. angličtina B1, francouština C1, němčina pasivně"
idNumber: "Číslo občianskeho preukazu/pasu"
Expand All @@ -111,6 +115,10 @@ detail:
uploadedFileSuccessful: "soubor úspěšně nahraný!"
uploadedFileNote: "PDF s potvrzením najdeš na našem webu"
uploadFileMissing: "soubor zatím není nahraný :("
printedHandbook: "Tištěný handbook"
printedHandbook-detail: "Chci na akci dostat vytištěný handbook"
handbook-yes: "ano"
handbook-no: "ne"
notice: "Poznámka"
notice-placeholder: "ešte niečo?"
skills: "Zručnosti"
Expand Down
2 changes: 1 addition & 1 deletion src/Templates/translatable/widgets/changeDetails.twig
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@
type="checkbox"
name="printedHandbook"
value="yes"
{% if personDetails.getPrintedHandbook == 'yes' %} checked{% endif %}
{% if personDetails.getPrintedHandbook %} checked{% endif %}
/>
</div>
{% endif %}{% if ca.notes %}
Expand Down
2 changes: 1 addition & 1 deletion src/Templates/translatable/widgets/details.twig
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
{{ detail.uploadFileMissing|trans }}
{% endif %}<br/>
{% endif %}{% if ca.printedHandbook %}
{% trans %}detail.printedHandbook{% endtrans %}:<b>{{ person.getPrintedHandbook ?? 'no' }}</b><br/>
{% trans %}detail.printedHandbook{% endtrans %}:<b>{{ (person.getPrintedHandbook ? detail.handbook-yes : detail.handbook-no)|trans }}</b><br/>
{% endif %}{% if ca.notes %}
{% trans %}detail.notice{% endtrans %}: <b>{{ person.getNotes }}</b><br/>
{% endif %}

0 comments on commit 4ad42d0

Please sign in to comment.