:order => 'name')
@project = Project.new(params[:project])
if request.get?
+ @project.identifier = Project.next_identifier if Setting.sequential_project_identifiers?
@project.trackers = Tracker.all
@project.is_public = Setting.default_projects_public?
@project.enabled_module_names = Redmine::AccessControl.available_project_modules
def administration_settings_tabs
tabs = [{:name => 'general', :partial => 'settings/general', :label => :label_general},
{:name => 'authentication', :partial => 'settings/authentication', :label => :label_authentication},
+ {:name => 'projects', :partial => 'settings/projects', :label => :label_project_plural},
{:name => 'issues', :partial => 'settings/issues', :label => :label_issue_tracking},
{:name => 'notifications', :partial => 'settings/notifications', :label => l(:field_mail_notification)},
{:name => 'mail_handler', :partial => 'settings/mail_handler', :label => l(:label_incoming_emails)},
enabled_modules << EnabledModule.new(:name => name.to_s)
end
end
+
+ # Returns an auto-generated project identifier based on the last identifier used
+ def self.next_identifier
+ p = Project.find(:first, :order => 'created_on DESC')
+ p.nil? ? nil : p.identifier.to_s.succ
+ end
protected
def validate
<p><label><%= l(:setting_feeds_limit) %></label>
<%= text_field_tag 'settings[feeds_limit]', Setting.feeds_limit, :size => 6 %></p>
-
-<p><label><%= l(:setting_default_projects_public) %></label>
-<%= check_box_tag 'settings[default_projects_public]', 1, Setting.default_projects_public? %><%= hidden_field_tag 'settings[default_projects_public]', 0 %></p>
</div>
<%= submit_tag l(:button_save) %>
--- /dev/null
+<% form_tag({:action => 'edit', :tab => 'projects'}) do %>
+
+<div class="box tabular settings">
+<p><label><%= l(:setting_default_projects_public) %></label>
+<%= check_box_tag 'settings[default_projects_public]', 1, Setting.default_projects_public? %><%= hidden_field_tag 'settings[default_projects_public]', 0 %></p>
+
+<p><label><%= l(:setting_sequential_project_identifiers) %></label>
+<%= check_box_tag 'settings[sequential_project_identifiers]', 1, Setting.sequential_project_identifiers? %><%= hidden_field_tag 'settings[sequential_project_identifiers]', 0 %></p>
+</div>
+
+<%= submit_tag l(:button_save) %>
+<% end %>
default: 1
default_projects_public:
default: 1
+sequential_project_identifiers:
+ default: 0
# encodings used to convert repository files content to UTF-8
# multiple values accepted, comma separated
repositories_encodings:
label_issue_watchers: Watchers
setting_commit_logs_encoding: Commit messages encoding
button_quote: Quote
+setting_sequential_project_identifiers: Generate sequential project identifiers
label_issue_watchers: Watchers
setting_commit_logs_encoding: Commit messages encoding
button_quote: Quote
+setting_sequential_project_identifiers: Generate sequential project identifiers
label_issue_watchers: Watchers
setting_commit_logs_encoding: Commit messages encoding
button_quote: Quote
+setting_sequential_project_identifiers: Generate sequential project identifiers
label_issue_watchers: Watchers
setting_commit_logs_encoding: Commit messages encoding
button_quote: Quote
+setting_sequential_project_identifiers: Generate sequential project identifiers
setting_enabled_scm: Enabled SCM
setting_mail_handler_api_enabled: Enable WS for incoming emails
setting_mail_handler_api_key: API key
+setting_sequential_project_identifiers: Generate sequential project identifiers
project_module_issue_tracking: Issue tracking
project_module_time_tracking: Time tracking
label_issue_watchers: Watchers
setting_commit_logs_encoding: Commit messages encoding
button_quote: Quote
+setting_sequential_project_identifiers: Generate sequential project identifiers
label_issue_watchers: Watchers
setting_commit_logs_encoding: Commit messages encoding
button_quote: Quote
+setting_sequential_project_identifiers: Generate sequential project identifiers
setting_enabled_scm: SCM activés
setting_mail_handler_api_enabled: "Activer le WS pour la réception d'emails"
setting_mail_handler_api_key: Clé de protection de l'API
+setting_sequential_project_identifiers: Générer des identifiants de projet séquentiels
project_module_issue_tracking: Suivi des demandes
project_module_time_tracking: Suivi du temps passé
label_issue_watchers: Watchers
setting_commit_logs_encoding: Commit messages encoding
button_quote: Quote
+setting_sequential_project_identifiers: Generate sequential project identifiers
label_issue_watchers: Watchers
setting_commit_logs_encoding: Commit messages encoding
button_quote: Quote
+setting_sequential_project_identifiers: Generate sequential project identifiers
label_issue_watchers: Watchers
setting_commit_logs_encoding: Commit messages encoding
button_quote: Quote
+setting_sequential_project_identifiers: Generate sequential project identifiers
label_issue_watchers: Watchers
setting_commit_logs_encoding: Commit messages encoding
button_quote: Quote
+setting_sequential_project_identifiers: Generate sequential project identifiers
label_issue_watchers: Watchers
setting_commit_logs_encoding: Commit messages encoding
button_quote: Quote
+setting_sequential_project_identifiers: Generate sequential project identifiers
label_issue_watchers: Watchers
setting_commit_logs_encoding: Commit messages encoding
button_quote: Quote
+setting_sequential_project_identifiers: Generate sequential project identifiers
label_issue_watchers: Watchers
setting_commit_logs_encoding: Commit messages encoding
button_quote: Quote
+setting_sequential_project_identifiers: Generate sequential project identifiers
label_issue_watchers: Watchers
setting_commit_logs_encoding: Commit messages encoding
button_quote: Quote
+setting_sequential_project_identifiers: Generate sequential project identifiers
label_issue_watchers: Watchers
setting_commit_logs_encoding: Commit messages encoding
button_quote: Quote
+setting_sequential_project_identifiers: Generate sequential project identifiers
label_issue_watchers: Watchers\r
setting_commit_logs_encoding: Commit messages encoding\r
button_quote: Quote\r
+setting_sequential_project_identifiers: Generate sequential project identifiers\r
label_issue_watchers: Watchers
setting_commit_logs_encoding: Commit messages encoding
button_quote: Quote
+setting_sequential_project_identifiers: Generate sequential project identifiers
label_issue_watchers: Watchers
setting_commit_logs_encoding: Commit messages encoding
button_quote: Quote
+setting_sequential_project_identifiers: Generate sequential project identifiers
label_issue_watchers: Watchers
setting_commit_logs_encoding: Commit messages encoding
button_quote: Quote
+setting_sequential_project_identifiers: Generate sequential project identifiers
label_issue_watchers: Watchers
setting_commit_logs_encoding: Commit messages encoding
button_quote: Quote
+setting_sequential_project_identifiers: Generate sequential project identifiers
label_issue_watchers: Watchers
setting_commit_logs_encoding: Commit messages encoding
button_quote: Quote
+setting_sequential_project_identifiers: Generate sequential project identifiers
label_issue_watchers: Watchers
setting_commit_logs_encoding: Commit messages encoding
button_quote: Quote
+setting_sequential_project_identifiers: Generate sequential project identifiers
label_issue_watchers: Watchers
setting_commit_logs_encoding: Commit messages encoding
button_quote: Quote
+setting_sequential_project_identifiers: Generate sequential project identifiers
label_issue_watchers: Watchers
setting_commit_logs_encoding: Commit messages encoding
button_quote: Quote
+setting_sequential_project_identifiers: Generate sequential project identifiers
enumeration_doc_categories: 文档类别
enumeration_activities: 活动(时间跟踪)
button_quote: Quote
+setting_sequential_project_identifiers: Generate sequential project identifiers
assert_equal [1, 2, 3], parent.rolled_up_trackers.collect(&:id)\r
assert_equal [2, 3], child.rolled_up_trackers.collect(&:id)\r
end\r
+ \r
+ def test_next_identifier\r
+ ProjectCustomField.delete_all\r
+ Project.create!(:name => 'last', :identifier => 'p2008040')\r
+ assert_equal 'p2008041', Project.next_identifier\r
+ end\r
+ \r
+ def test_next_identifier_first_project\r
+ Project.delete_all\r
+ assert_nil Project.next_identifier\r
+ end\r
end\r