summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2017-04-09 09:34:24 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2017-04-09 09:34:24 +0000
commitc2c526c822e29484ba404b9ce3ffe2accfc40b25 (patch)
treea23145f9cefa73bb719098619f7647f2e927210b
parent0c90a19eb22b81da4cd32ea6da263b220a2dfbd0 (diff)
downloadredmine-c2c526c822e29484ba404b9ce3ffe2accfc40b25.tar.gz
redmine-c2c526c822e29484ba404b9ce3ffe2accfc40b25.zip
Introduce setting to hide optional user custom fields on registration form (#24089).
Patch by Jan Schulz-Hofen. git-svn-id: http://svn.redmine.org/redmine/trunk@16537 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--app/views/account/register.html.erb2
-rw-r--r--app/views/settings/_authentication.html.erb7
-rw-r--r--config/locales/de.yml1
-rw-r--r--config/locales/en.yml1
-rw-r--r--config/locales/fr.yml1
-rw-r--r--config/settings.yml2
6 files changed, 12 insertions, 2 deletions
diff --git a/app/views/account/register.html.erb b/app/views/account/register.html.erb
index 0cd0d8cff..ade00adfc 100644
--- a/app/views/account/register.html.erb
+++ b/app/views/account/register.html.erb
@@ -29,7 +29,7 @@
<p><%= f.text_field :identity_url %></p>
<% end %>
-<% @user.custom_field_values.select {|v| v.editable? || v.required?}.each do |value| %>
+<% @user.custom_field_values.select {|v| (Setting.show_custom_fields_on_registration? && v.editable?) || v.required?}.each do |value| %>
<p><%= custom_field_tag_with_label :user, value %></p>
<% end %>
</div>
diff --git a/app/views/settings/_authentication.html.erb b/app/views/settings/_authentication.html.erb
index fd3c65c28..4454bbae4 100644
--- a/app/views/settings/_authentication.html.erb
+++ b/app/views/settings/_authentication.html.erb
@@ -8,7 +8,12 @@
<p><%= setting_select :self_registration, [[l(:label_disabled), "0"],
[l(:label_registration_activation_by_email), "1"],
[l(:label_registration_manual_activation), "2"],
- [l(:label_registration_automatic_activation), "3"]] %></p>
+ [l(:label_registration_automatic_activation), "3"]],
+ :onchange =>
+ "if (this.value != '0') { $('#settings_show_custom_fields_on_registration').removeAttr('disabled'); } else { $('#settings_show_custom_fields_on_registration').attr('disabled', true); }" %></p>
+
+<p><%= setting_check_box :show_custom_fields_on_registration,
+ :disabled => !Setting.self_registration? %></p>
<p><%= setting_check_box :unsubscribe %></p>
diff --git a/config/locales/de.yml b/config/locales/de.yml
index a26e480e0..1d42b9bb5 100644
--- a/config/locales/de.yml
+++ b/config/locales/de.yml
@@ -1032,6 +1032,7 @@ de:
setting_repository_log_display_limit: Maximale Anzahl anzuzeigender Revisionen in der Historie einer Datei
setting_rest_api_enabled: REST-Schnittstelle aktivieren
setting_self_registration: Registrierung ermöglichen
+ setting_show_custom_fields_on_registration: Benutzerdefinierte Felder bei der Registrierung abfragen
setting_sequential_project_identifiers: Fortlaufende Projektkennungen generieren
setting_session_lifetime: Längste Dauer einer Sitzung
setting_session_timeout: Zeitüberschreitung bei Inaktivität
diff --git a/config/locales/en.yml b/config/locales/en.yml
index 58dad5646..a8eca2dfe 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -382,6 +382,7 @@ en:
setting_default_language: Default language
setting_login_required: Authentication required
setting_self_registration: Self-registration
+ setting_show_custom_fields_on_registration: Show custom fields on registration
setting_attachment_max_size: Maximum attachment size
setting_issues_export_limit: Issues export limit
setting_mail_from: Emission email address
diff --git a/config/locales/fr.yml b/config/locales/fr.yml
index 6a2e61053..653c49bab 100644
--- a/config/locales/fr.yml
+++ b/config/locales/fr.yml
@@ -394,6 +394,7 @@ fr:
setting_default_language: Langue par défaut
setting_login_required: Authentification obligatoire
setting_self_registration: Inscription des nouveaux utilisateurs
+ setting_show_custom_fields_on_registration: Afficher les champs personnalisés sur le formulaire d'inscription
setting_attachment_max_size: Taille maximale des fichiers
setting_issues_export_limit: Limite d'exportation des demandes
setting_mail_from: Adresse d'émission
diff --git a/config/settings.yml b/config/settings.yml
index bf577dedb..7520d8e84 100644
--- a/config/settings.yml
+++ b/config/settings.yml
@@ -31,6 +31,8 @@ login_required:
self_registration:
default: '2'
security_notifications: 1
+show_custom_fields_on_registration:
+ default: 1
lost_password:
default: 1
security_notifications: 1