Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Forms: increase the max email length to 75 chars #689

Merged
merged 3 commits into from Nov 6, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGEDB.php
Expand Up @@ -778,4 +778,12 @@
ALTER TABLE `gibbonApplicationForm` ADD `username` VARCHAR(20) NULL AFTER `gender`;end
ALTER TABLE `gibbonApplicationForm` ADD `studentID` VARCHAR(10) NULL AFTER `gibbonPaymentID`;end
ALTER TABLE `gibbonRubricColumn` ADD `visualise` ENUM('Y','N') NOT NULL DEFAULT 'Y' AFTER `gibbonScaleGradeID`;end
ALTER TABLE `gibbonPerson` CHANGE `email` `email` VARCHAR(75) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL;end
ALTER TABLE `gibbonPerson` CHANGE `emailAlternate` `emailAlternate` VARCHAR(75) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL;end
ALTER TABLE `gibbonPersonUpdate` CHANGE `email` `email` VARCHAR(75) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL;end
ALTER TABLE `gibbonPersonUpdate` CHANGE `emailAlternate` `emailAlternate` VARCHAR(75) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL;end
ALTER TABLE `gibbonStaffApplicationForm` CHANGE `email` `email` VARCHAR(75) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL;end
ALTER TABLE `gibbonApplicationForm` CHANGE `email` `email` VARCHAR(75) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL;end
ALTER TABLE `gibbonApplicationForm` CHANGE `parent1email` `parent1email` VARCHAR(75) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL;end
ALTER TABLE `gibbonApplicationForm` CHANGE `parent2email` `parent2email` VARCHAR(75) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL;end
";
1 change: 1 addition & 0 deletions CHANGELOG.txt
Expand Up @@ -40,6 +40,7 @@ v17.0.00
System: updated vis.js library to v4.21.0
System: updated robots.txt to disallow all indexing
System: added ability to set background image
System: increased the max email length to 75 chars for all forms
Activities: post-OOification fix to include All Users in Staff selection for in Manage Activities
Activities: fixed incorrect count in Registered column in Activity Enrolment Summary
Attendance: fixed an error in the parent view of Student History for PHP 7.1+
Expand Down
2 changes: 1 addition & 1 deletion installer/install.php
Expand Up @@ -451,7 +451,7 @@

$row = $form->addRow();
$row->addLabel('email', __('Email'));
$row->addEmail('email')->maxLength(50)->isRequired();
$row->addEmail('email')->isRequired();

$row = $form->addRow();
$row->addLabel('support', '<b>'.__('Receive Support?').'</b>')->description(__('Join our mailing list and recieve a welcome email from the team.'));
Expand Down
4 changes: 2 additions & 2 deletions modules/Data Updater/data_personal.php
Expand Up @@ -352,7 +352,7 @@

$row = $form->addRow();
$row->addLabel('email', __('Email'));
$email = $row->addEmail('email')->maxLength(50);
$email = $row->addEmail('email');

$uniqueEmailAddress = getSettingByScope($connection2, 'User Admin', 'uniqueEmailAddress');
if ($uniqueEmailAddress == 'Y') {
Expand All @@ -361,7 +361,7 @@

$row = $form->addRow();
$row->addLabel('emailAlternate', __('Alternate Email'));
$row->addEmail('emailAlternate')->maxLength(50);
$row->addEmail('emailAlternate');

$row = $form->addRow();
$row->addAlert(__('Address information for an individual only needs to be set under the following conditions:'), 'warning')
Expand Down
2 changes: 1 addition & 1 deletion modules/Messenger/messenger_post.php
Expand Up @@ -106,7 +106,7 @@
if (isActionAccessible($guid, $connection2, "/modules/Messenger/messenger_post.php", "New Message_fromSchool")) {
$row = $form->addRow()->addClass('email');
$row->addLabel('emailReplyTo', __('Reply To'));
$row->addEmail('emailReplyTo')->maxLength(50);
$row->addEmail('emailReplyTo');
}
}

Expand Down
6 changes: 3 additions & 3 deletions modules/Staff/applicationForm.php
Expand Up @@ -231,7 +231,7 @@

$row = $form->addRow();
$row->addLabel('email', __('Email'));
$email = $row->addEmail('email')->maxLength(50)->isRequired();
$email = $row->addEmail('email')->isRequired();

$row = $form->addRow();
$row->addLabel('phone1', __('Phone'))->description(__('Type, country code, number.'));
Expand Down Expand Up @@ -310,11 +310,11 @@

$row = $form->addRow();
$row->addLabel('referenceEmail1', __('Referee 1'))->description(__('An email address for a referee at the applicant\'s current school.'));
$row->addEmail('referenceEmail1')->maxLength(50)->isRequired();
$row->addEmail('referenceEmail1')->isRequired();

$row = $form->addRow();
$row->addLabel('referenceEmail2', __('Referee 2'))->description(__('An email address for a second referee.'));
$row->addEmail('referenceEmail2')->maxLength(50)->isRequired();
$row->addEmail('referenceEmail2')->isRequired();

}

Expand Down
6 changes: 3 additions & 3 deletions modules/Staff/applicationForm_manage_edit.php
Expand Up @@ -247,7 +247,7 @@

$row = $form->addRow();
$row->addLabel('email', __('Email'));
$email = $row->addEmail('email')->maxLength(50)->isRequired();
$email = $row->addEmail('email')->isRequired();

$uniqueEmailAddress = getSettingByScope($connection2, 'User Admin', 'uniqueEmailAddress');
if ($uniqueEmailAddress == 'Y') {
Expand Down Expand Up @@ -337,11 +337,11 @@

$row = $form->addRow();
$row->addLabel('referenceEmail1', __('Referee 1'))->description(__('An email address for a referee at the applicant\'s current school.'));
$row->addEmail('referenceEmail1')->maxLength(50)->isRequired();
$row->addEmail('referenceEmail1')->isRequired();

$row = $form->addRow();
$row->addLabel('referenceEmail2', __('Referee 2'))->description(__('An email address for a second referee.'));
$row->addEmail('referenceEmail2')->maxLength(50)->isRequired();
$row->addEmail('referenceEmail2')->isRequired();

}

Expand Down
4 changes: 2 additions & 2 deletions modules/Students/applicationForm.php
Expand Up @@ -291,7 +291,7 @@

$row = $form->addRow();
$row->addLabel('email', __('Email'));
$email = $row->addEmail('email')->maxLength(50);
$email = $row->addEmail('email');
if ($uniqueEmailAddress == 'Y') {
$email->isUnique('./publicRegistrationCheck.php');
}
Expand Down Expand Up @@ -616,7 +616,7 @@

$row = $form->addRow()->setClass("parentSection{$i}");
$row->addLabel("parent{$i}email", __('Email'));
$email = $row->addEmail("parent{$i}email")->isRequired($i == 1)->maxLength(50)->loadFrom($application);
$email = $row->addEmail("parent{$i}email")->isRequired($i == 1)->loadFrom($application);
if ($uniqueEmailAddress == 'Y') {
$email->isUnique('./publicRegistrationCheck.php', array('fieldName' => 'email'));
}
Expand Down
4 changes: 2 additions & 2 deletions modules/Students/applicationForm_manage_edit.php
Expand Up @@ -386,7 +386,7 @@

$row = $form->addRow();
$row->addLabel('email', __('Email'));
$email = $row->addEmail('email')->maxLength(50);
$email = $row->addEmail('email');
if ($uniqueEmailAddress == 'Y') {
$email->isUnique('./modules/User Admin/user_manage_emailAjax.php');
}
Expand Down Expand Up @@ -637,7 +637,7 @@

$row = $form->addRow()->setClass("parentSection{$i}");
$row->addLabel("parent{$i}email", __('Email'));
$email = $row->addEmail("parent{$i}email")->isRequired($i == 1)->maxLength(50);
$email = $row->addEmail("parent{$i}email")->isRequired($i == 1);

if ($uniqueEmailAddress == 'Y') {
$email->isUnique('./modules/User Admin/user_manage_emailAjax.php', array('fieldName' => 'email'));
Expand Down
4 changes: 2 additions & 2 deletions modules/User Admin/user_manage_add.php
Expand Up @@ -170,7 +170,7 @@

$row = $form->addRow();
$emailLabel = $row->addLabel('email', __('Email'));
$email = $row->addEmail('email')->maxLength(50);
$email = $row->addEmail('email');

$uniqueEmailAddress = getSettingByScope($connection2, 'User Admin', 'uniqueEmailAddress');
if ($uniqueEmailAddress == 'Y') {
Expand All @@ -179,7 +179,7 @@

$row = $form->addRow();
$row->addLabel('emailAlternate', __('Alternate Email'));
$row->addEmail('emailAlternate')->maxLength(50);
$row->addEmail('emailAlternate');

$row = $form->addRow();
$row->addAlert(__('Address information for an individual only needs to be set under the following conditions:'), 'warning')
Expand Down
4 changes: 2 additions & 2 deletions modules/User Admin/user_manage_edit.php
Expand Up @@ -232,7 +232,7 @@

$row = $form->addRow();
$emailLabel = $row->addLabel('email', __('Email'));
$email = $row->addEmail('email')->maxLength(50);
$email = $row->addEmail('email');

$uniqueEmailAddress = getSettingByScope($connection2, 'User Admin', 'uniqueEmailAddress');
if ($uniqueEmailAddress == 'Y') {
Expand All @@ -241,7 +241,7 @@

$row = $form->addRow();
$row->addLabel('emailAlternate', __('Alternate Email'));
$row->addEmail('emailAlternate')->maxLength(50);
$row->addEmail('emailAlternate');

$row = $form->addRow();
$row->addAlert(__('Address information for an individual only needs to be set under the following conditions:'), 'warning')
Expand Down
2 changes: 1 addition & 1 deletion publicRegistration.php
Expand Up @@ -81,7 +81,7 @@

$row = $form->addRow();
$row->addLabel('email', __('Email'));
$email = $row->addEmail('email')->maxLength(50)->isRequired();
$email = $row->addEmail('email')->isRequired();

$uniqueEmailAddress = getSettingByScope($connection2, 'User Admin', 'uniqueEmailAddress');
if ($uniqueEmailAddress == 'Y') {
Expand Down
2 changes: 1 addition & 1 deletion src/Forms/FormFactory.php
Expand Up @@ -127,7 +127,7 @@ public function createEditor($name, $guid)

public function createEmail($name)
{
return (new Input\TextField($name))->addValidation('Validate.Email');
return (new Input\TextField($name))->addValidation('Validate.Email')->maxLength(75);
}

//A URL web link
Expand Down