]> source.dussan.org Git - redmine.git/commitdiff
Introduce setting to hide optional user custom fields on registration form (#24089).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 9 Apr 2017 09:34:24 +0000 (09:34 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 9 Apr 2017 09:34:24 +0000 (09:34 +0000)
Patch by Jan Schulz-Hofen.

git-svn-id: http://svn.redmine.org/redmine/trunk@16537 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/views/account/register.html.erb
app/views/settings/_authentication.html.erb
config/locales/de.yml
config/locales/en.yml
config/locales/fr.yml
config/settings.yml

index 0cd0d8cff972c4e7c66069578e8b9012fce98b8e..ade00adfc6c3ad1fb4dd486e8fab113be0d025d0 100644 (file)
@@ -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>
index fd3c65c286c511599533da748de1435986502733..4454bbae4be3eb0ba46ffe18d5c4b45145d4dc54 100644 (file)
@@ -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>
 
index a26e480e00753c29b2528838eed9dfccc880f4b2..1d42b9bb546ed6f6fc79b6a8cf431e72aab27878 100644 (file)
@@ -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
index 58dad5646ff0e757f0507354ed5c2730ceeff545..a8eca2dfeb2eee0b316f474e80dd9001120a476c 100644 (file)
@@ -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
index 6a2e6105387b5fb34bb05a3e04726bb4bcb5a374..653c49bab7311e31f7dd78c451c7f8154cd08b3f 100644 (file)
@@ -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
index bf577dedb4484590e66c76bedacfb123c44ea8b8..7520d8e8447da2f1f67e879c8cd190cc27f08fd1 100644 (file)
@@ -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