summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--db/migrations/2018_12_21_000000_change_users_contact_dect_field_size.php47
-rw-r--r--includes/pages/admin_user.php2
-rw-r--r--includes/pages/guest_login.php4
-rw-r--r--includes/pages/user_settings.php4
-rw-r--r--resources/lang/de_DE.UTF-8/LC_MESSAGES/default.mobin44968 -> 44970 bytes
-rw-r--r--resources/lang/de_DE.UTF-8/LC_MESSAGES/default.po4
-rw-r--r--tests/Unit/Models/User/UserTest.php2
7 files changed, 55 insertions, 8 deletions
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 @@
+<?php
+
+namespace Engelsystem\Migrations;
+
+use Engelsystem\Database\Migration\Migration;
+use Illuminate\Database\Schema\Blueprint;
+
+class ChangeUsersContactDectFieldSize extends Migration
+{
+ /** @var array */
+ protected $tables = [
+ 'AngelTypes' => '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 .= ' <tr><td>Name</td><td>' . '<input size="40" name="eName" value="' . $user_source->personalData->last_name . '" class="form-control"></td></tr>' . "\n";
$html .= ' <tr><td>Vorname</td><td>' . '<input size="40" name="eVorname" value="' . $user_source->personalData->first_name . '" class="form-control"></td></tr>' . "\n";
$html .= ' <tr><td>Handy</td><td>' . '<input type= "tel" size="40" name="eHandy" value="' . $user_source->contact->mobile . '" class="form-control"></td></tr>' . "\n";
- $html .= ' <tr><td>DECT</td><td>' . '<input size="4" name="eDECT" value="' . $user_source->contact->dect . '" class="form-control"></td></tr>' . "\n";
+ $html .= ' <tr><td>DECT</td><td>' . '<input size="40" name="eDECT" value="' . $user_source->contact->dect . '" class="form-control"></td></tr>' . "\n";
if ($user_source->settings->email_human) {
$html .= " <tr><td>email</td><td>" . '<input type="email" size="40" name="eemail" value="' . $user_source->email . '" class="form-control"></td></tr>' . "\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 a1765a6b..7411a1be 100644
--- a/resources/lang/de_DE.UTF-8/LC_MESSAGES/default.mo
+++ b/resources/lang/de_DE.UTF-8/LC_MESSAGES/default.mo
Binary files differ
diff --git a/resources/lang/de_DE.UTF-8/LC_MESSAGES/default.po b/resources/lang/de_DE.UTF-8/LC_MESSAGES/default.po
index 263d1641..3f54c381 100644
--- a/resources/lang/de_DE.UTF-8/LC_MESSAGES/default.po
+++ b/resources/lang/de_DE.UTF-8/LC_MESSAGES/default.po
@@ -1577,8 +1577,8 @@ msgstr ""
#: /Users/msquare/workspace/projects/engelsystem/includes/pages/guest_login.php:190
#: /Users/msquare/workspace/projects/engelsystem/includes/pages/user_settings.php:85
-msgid "For dect numbers are only 5 digits allowed."
-msgstr "Die DECT Nummer darf nur 5 Zeichen lang sein."
+msgid "For dect numbers are only 40 digits allowed."
+msgstr "Die DECT Nummer darf nur 40 Zeichen lang sein."
#: /Users/msquare/workspace/projects/engelsystem/includes/pages/guest_login.php:274
msgid "Angel registration successful!"
diff --git a/tests/Unit/Models/User/UserTest.php b/tests/Unit/Models/User/UserTest.php
index c30f7761..9e967892 100644
--- a/tests/Unit/Models/User/UserTest.php
+++ b/tests/Unit/Models/User/UserTest.php
@@ -32,7 +32,7 @@ class UserTest extends TestCase
Contact::class,
'contact',
[
- 'dect' => '1234',
+ 'dect' => '1234567',
'email' => 'foo@bar.batz',
'mobile' => '1234/12341234',
]