Commit c12b486c authored by jplang's avatar jplang

Introduce setting to hide optional user custom fields on registration form (#24089).

Patch by Jan Schulz-Hofen.

git-svn-id: https://svn.redmine.org/redmine/trunk@16537 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent b3d13a63
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
<p><%= f.text_field :identity_url %></p> <p><%= f.text_field :identity_url %></p>
<% end %> <% 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> <p><%= custom_field_tag_with_label :user, value %></p>
<% end %> <% end %>
</div> </div>
......
...@@ -8,7 +8,12 @@ ...@@ -8,7 +8,12 @@
<p><%= setting_select :self_registration, [[l(:label_disabled), "0"], <p><%= setting_select :self_registration, [[l(:label_disabled), "0"],
[l(:label_registration_activation_by_email), "1"], [l(:label_registration_activation_by_email), "1"],
[l(:label_registration_manual_activation), "2"], [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> <p><%= setting_check_box :unsubscribe %></p>
......
...@@ -1032,6 +1032,7 @@ de: ...@@ -1032,6 +1032,7 @@ de:
setting_repository_log_display_limit: Maximale Anzahl anzuzeigender Revisionen in der Historie einer Datei setting_repository_log_display_limit: Maximale Anzahl anzuzeigender Revisionen in der Historie einer Datei
setting_rest_api_enabled: REST-Schnittstelle aktivieren setting_rest_api_enabled: REST-Schnittstelle aktivieren
setting_self_registration: Registrierung ermöglichen 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_sequential_project_identifiers: Fortlaufende Projektkennungen generieren
setting_session_lifetime: Längste Dauer einer Sitzung setting_session_lifetime: Längste Dauer einer Sitzung
setting_session_timeout: Zeitüberschreitung bei Inaktivität setting_session_timeout: Zeitüberschreitung bei Inaktivität
......
...@@ -382,6 +382,7 @@ en: ...@@ -382,6 +382,7 @@ en:
setting_default_language: Default language setting_default_language: Default language
setting_login_required: Authentication required setting_login_required: Authentication required
setting_self_registration: Self-registration setting_self_registration: Self-registration
setting_show_custom_fields_on_registration: Show custom fields on registration
setting_attachment_max_size: Maximum attachment size setting_attachment_max_size: Maximum attachment size
setting_issues_export_limit: Issues export limit setting_issues_export_limit: Issues export limit
setting_mail_from: Emission email address setting_mail_from: Emission email address
......
...@@ -394,6 +394,7 @@ fr: ...@@ -394,6 +394,7 @@ fr:
setting_default_language: Langue par défaut setting_default_language: Langue par défaut
setting_login_required: Authentification obligatoire setting_login_required: Authentification obligatoire
setting_self_registration: Inscription des nouveaux utilisateurs 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_attachment_max_size: Taille maximale des fichiers
setting_issues_export_limit: Limite d'exportation des demandes setting_issues_export_limit: Limite d'exportation des demandes
setting_mail_from: Adresse d'émission setting_mail_from: Adresse d'émission
......
...@@ -31,6 +31,8 @@ login_required: ...@@ -31,6 +31,8 @@ login_required:
self_registration: self_registration:
default: '2' default: '2'
security_notifications: 1 security_notifications: 1
show_custom_fields_on_registration:
default: 1
lost_password: lost_password:
default: 1 default: 1
security_notifications: 1 security_notifications: 1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment