From cf20b65902c3f503b1f568c94df130ec0c4c9494 Mon Sep 17 00:00:00 2001 From: Arnout Engelen Date: Sun, 30 Apr 2017 13:00:53 +0200 Subject: [PATCH 1/3] Reword 'wants to operate a car for the PL' As discussed in #sha2017-angel --- includes/view/UserDriverLicenses_view.php | 4 ++-- locale/de_DE.UTF-8/LC_MESSAGES/default.po | 8 ++++---- locale/pt_BR.UTF.8/LC_MESSAGES/pt_BR.po | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/includes/view/UserDriverLicenses_view.php b/includes/view/UserDriverLicenses_view.php index 5a3effeb..3c0eaf8d 100644 --- a/includes/view/UserDriverLicenses_view.php +++ b/includes/view/UserDriverLicenses_view.php @@ -19,10 +19,10 @@ function UserDriverLicense_edit_view($user_source, $wants_to_drive, $user_driver msg(), form([ form_info(_("Privacy"), _("Your driving license information is only visible for supporters and admins.")), - form_checkbox('wants_to_drive', _("I am willing to operate cars for the PL"), $wants_to_drive), + form_checkbox('wants_to_drive', _("I am willing to drive a car for the event"), $wants_to_drive), div('panel panel-default', [ div('panel-body', [ - form_checkbox('has_car', _("I have my own car with me and am willing to use it for the PL (You'll get reimbursed for fuel)"), $user_driver_license['has_car']), + form_checkbox('has_car', _("I have my own car with me and am willing to use it for the event (You'll get reimbursed for fuel)"), $user_driver_license['has_car']), heading(_("Driver license"), 3), form_checkbox('has_license_car', _("Car"), $user_driver_license['has_license_car']), form_checkbox('has_license_3_5t_transporter', _("Transporter 3,5t"), $user_driver_license['has_license_3_5t_transporter']), diff --git a/locale/de_DE.UTF-8/LC_MESSAGES/default.po b/locale/de_DE.UTF-8/LC_MESSAGES/default.po index 1f64a66f..28e9d534 100644 --- a/locale/de_DE.UTF-8/LC_MESSAGES/default.po +++ b/locale/de_DE.UTF-8/LC_MESSAGES/default.po @@ -2308,15 +2308,15 @@ msgid "" msgstr "Deine Führerschein-Infos sind nur für Supporter und Admins sichtbar." #: /Users/msquare/workspace/projects/engelsystem/includes/view/UserDriverLicenses_view.php:22 -msgid "I am willing to operate cars for the PL" -msgstr "Ich möchte für die PL Auto fahren" +msgid "I am willing to drive a car for the event" +msgstr "Ich möchte für das Event Auto fahren" #: /Users/msquare/workspace/projects/engelsystem/includes/view/UserDriverLicenses_view.php:25 msgid "" -"I have my own car with me and am willing to use it for the PL (You'll get " +"I have my own car with me and am willing to use it for the event (You'll get " "reimbursed for fuel)" msgstr "" -"Ich habe mein eigenes Auto dabei und möchte würde es zum Fahren für die PL " +"Ich habe mein eigenes Auto dabei und möchte würde es zum Fahren für das Event " "verwenden (Du wirst für Spritkosten entschädigt)" #: /Users/msquare/workspace/projects/engelsystem/includes/view/UserDriverLicenses_view.php:26 diff --git a/locale/pt_BR.UTF.8/LC_MESSAGES/pt_BR.po b/locale/pt_BR.UTF.8/LC_MESSAGES/pt_BR.po index d31e838f..888d1812 100644 --- a/locale/pt_BR.UTF.8/LC_MESSAGES/pt_BR.po +++ b/locale/pt_BR.UTF.8/LC_MESSAGES/pt_BR.po @@ -2159,12 +2159,12 @@ msgstr "" "e os admins." #: includes/view/UserDriverLicenses_view.php:22 -msgid "I am willing to operate cars for the PL" +msgid "I am willing to drive a car for the event" msgstr "Eu desejo dirigir carros para o evento" #: includes/view/UserDriverLicenses_view.php:25 msgid "" -"I have my own car with me and am willing to use it for the PL (You'll get " +"I have my own car with me and am willing to use it for the event (You'll get " "reimbursed for fuel)" msgstr "" "Eu tenho meu próprio carro e estou disposto a usá-lo no evento\n" From 3d8dea37331eb4031958fadf0cc8cd623402fdce Mon Sep 17 00:00:00 2001 From: Arnout Engelen Date: Sun, 30 Apr 2017 13:01:33 +0200 Subject: [PATCH 2/3] Form validation: should tick at least on license Owning a car is not sufficient, select at least one kind of drivers' license --- includes/model/UserDriverLicenses_model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/model/UserDriverLicenses_model.php b/includes/model/UserDriverLicenses_model.php index 6caa3589..afc44575 100644 --- a/includes/model/UserDriverLicenses_model.php +++ b/includes/model/UserDriverLicenses_model.php @@ -24,7 +24,7 @@ function UserDriverLicense_new() { * @return boolean */ function UserDriverLicense_valid($user_driver_license) { - return $user_driver_license['has_car'] || $user_driver_license['has_license_car'] || $user_driver_license['has_license_3_5t_transporter'] || $user_driver_license['has_license_7_5t_truck'] || $user_driver_license['has_license_12_5t_truck'] || $user_driver_license['has_license_forklift']; + return $user_driver_license['has_license_car'] || $user_driver_license['has_license_3_5t_transporter'] || $user_driver_license['has_license_7_5t_truck'] || $user_driver_license['has_license_12_5t_truck'] || $user_driver_license['has_license_forklift']; } /** From b688b928dbabf6ba3ced4021e7e9808de7777e25 Mon Sep 17 00:00:00 2001 From: Arnout Engelen Date: Sun, 30 Apr 2017 13:02:38 +0200 Subject: [PATCH 3/3] Read wants_to_drive field correctly --- includes/view/AngelTypes_view.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/view/AngelTypes_view.php b/includes/view/AngelTypes_view.php index 7b20b7dd..592f8d6b 100644 --- a/includes/view/AngelTypes_view.php +++ b/includes/view/AngelTypes_view.php @@ -124,9 +124,9 @@ function AngelType_view_members($angeltype, $members, $admin_user_angeltypes, $a $members_unconfirmed = []; foreach ($members as $member) { $member['Nick'] = User_Nick_render($member); - + if ($angeltype['requires_driver_license']) { - $member['wants_to_drive'] = glyph_bool($member['user_id']); + $member['wants_to_drive'] = glyph_bool($member['wants_to_drive']); $member['has_car'] = glyph_bool($member['has_car']); $member['has_license_car'] = glyph_bool($member['has_license_car']); $member['has_license_3_5t_transporter'] = glyph_bool($member['has_license_3_5t_transporter']);