From b1d8fede465950e5d1a0d6521a6d862a02e9ce36 Mon Sep 17 00:00:00 2001 From: Igor Scheller Date: Sat, 22 Dec 2018 00:12:46 +0100 Subject: [PATCH] user: allow up to 40 characters for dect numbers closes #309 (EPVPN number in DECT field is shortened) closes #529 (For dect numbers are only 5 digits allowed) --- ...0_change_users_contact_dect_field_size.php | 47 ++++++++++++++++++ includes/pages/admin_user.php | 2 +- includes/pages/guest_login.php | 4 +- includes/pages/user_settings.php | 4 +- .../lang/de_DE.UTF-8/LC_MESSAGES/default.mo | Bin 44968 -> 44970 bytes .../lang/de_DE.UTF-8/LC_MESSAGES/default.po | 4 +- tests/Unit/Models/User/UserTest.php | 2 +- 7 files changed, 55 insertions(+), 8 deletions(-) create mode 100644 db/migrations/2018_12_21_000000_change_users_contact_dect_field_size.php diff --git a/db/migrations/2018_12_21_000000_change_users_contact_dect_field_size.php b/db/migrations/2018_12_21_000000_change_users_contact_dect_field_size.php new file mode 100644 index 00000000..0478b138 --- /dev/null +++ b/db/migrations/2018_12_21_000000_change_users_contact_dect_field_size.php @@ -0,0 +1,47 @@ + 'contact_dect', + 'users_contact' => 'dect', + ]; + + /** + * Run the migration + */ + public function up() + { + $this->changeDectTo(40); + } + + /** + * Reverse the migration + */ + public function down() + { + $this->changeDectTo(5); + } + + /** + * @param int $length + */ + protected function changeDectTo(int $length) + { + foreach ($this->tables as $table => $column) { + if (!$this->schema->hasTable($table)) { + continue; + } + + $this->schema->table($table, function (Blueprint $table) use ($column, $length) { + $table->string($column, $length)->change(); + }); + } + } +} diff --git a/includes/pages/admin_user.php b/includes/pages/admin_user.php index 63993fc9..4e0fd24b 100644 --- a/includes/pages/admin_user.php +++ b/includes/pages/admin_user.php @@ -55,7 +55,7 @@ function admin_user() $html .= ' Name' . '' . "\n"; $html .= ' Vorname' . '' . "\n"; $html .= ' Handy' . '' . "\n"; - $html .= ' DECT' . '' . "\n"; + $html .= ' DECT' . '' . "\n"; if ($user_source->settings->email_human) { $html .= " email" . '' . "\n"; } diff --git a/includes/pages/guest_login.php b/includes/pages/guest_login.php index 2df09d79..1b16333f 100644 --- a/includes/pages/guest_login.php +++ b/includes/pages/guest_login.php @@ -168,11 +168,11 @@ function guest_register() $preName = strip_request_item('prename'); } if ($request->has('dect')) { - if (strlen(strip_request_item('dect')) <= 5) { + if (strlen(strip_request_item('dect')) <= 40) { $dect = strip_request_item('dect'); } else { $valid = false; - error(__('For dect numbers are only 5 digits allowed.')); + error(__('For dect numbers are only 40 digits allowed.')); } } if ($request->has('mobile')) { diff --git a/includes/pages/user_settings.php b/includes/pages/user_settings.php index c39c0ef7..9099f658 100644 --- a/includes/pages/user_settings.php +++ b/includes/pages/user_settings.php @@ -72,11 +72,11 @@ function user_settings_main($user_source, $enable_tshirt_size, $tshirt_sizes) // Trivia $user_source->personalData->last_name = strip_request_item('lastname', $user_source['Name']); $user_source->personalData->first_name = strip_request_item('prename', $user_source['Vorname']); - if (strlen(strip_request_item('dect')) <= 5) { + if (strlen(strip_request_item('dect')) <= 40) { $user_source->contact->dect = strip_request_item('dect', $user_source['DECT']); } else { $valid = false; - error(__('For dect numbers are only 5 digits allowed.')); + error(__('For dect numbers are only 40 digits allowed.')); } $user_source->contact->mobile = strip_request_item('mobile', $user_source['Handy']); diff --git a/resources/lang/de_DE.UTF-8/LC_MESSAGES/default.mo b/resources/lang/de_DE.UTF-8/LC_MESSAGES/default.mo index a1765a6b2becede4ddf86ca743321dabe9234fe4..7411a1bea5734460acbd23db6dea57f6939c827b 100644 GIT binary patch delta 7969 zcmXZg3w+P@9>?*Y-OS83voT{An~iO3Gjo~C<~Cc#RxI~hZc!Mrv(fYy=2Ak~T#8(# ziBXaylBmN`8C^VxERIuh$)TL2&T(FE-|yqmqv!YY{e6Gm%jf(3{{E}&HEug<+}=s` zbhUCEXJfkK_~Pg2h3C*4Yp^a}Ll6AT#(!WEv1f+k_+UG0H>^XPgKGbztsjc&e?0cZ z85oWqXE-j$pTZ?7G|(?t8y{eMbn9m7(=g9*oJ@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