Patch #2277 » new_setting-issue_startdate_is_adddate-r2614.diff
app/controllers/issues_controller.rb | ||
---|---|---|
136 | 136 |
end |
137 | 137 |
@issue.status = default_status |
138 | 138 |
@allowed_statuses = ([default_status] + default_status.find_new_statuses_allowed_to(User.current.role_for_project(@project), @issue.tracker)).uniq |
139 |
|
|
140 |
if request.get? || request.xhr?
|
|
141 |
@issue.start_date ||= Date.today |
|
142 |
else
|
|
139 | ||
140 |
if (request.get? || request.xhr?) && Setting.issue_startdate_is_adddate?
|
|
141 |
@issue.start_date ||= Date.today
|
|
142 |
elsif !request.get? && !request.xhr?
|
|
143 | 143 |
requested_status = IssueStatus.find_by_id(params[:issue][:status_id]) |
144 | 144 |
# Check that the user is allowed to apply the requested status |
145 | 145 |
@issue.status = (@allowed_statuses.include? requested_status) ? requested_status : default_status |
... | ... | |
151 | 151 |
redirect_to(params[:continue] ? { :action => 'new', :tracker_id => @issue.tracker } : |
152 | 152 |
{ :action => 'show', :id => @issue }) |
153 | 153 |
return |
154 |
end
|
|
155 |
end
|
|
154 |
end |
|
155 |
end |
|
156 | 156 |
@priorities = Enumeration.priorities |
157 | 157 |
render :layout => !request.xhr? |
158 | 158 |
end |
app/views/settings/_issues.rhtml | ||
---|---|---|
7 | 7 |
<p><label><%= l(:setting_display_subprojects_issues) %></label> |
8 | 8 |
<%= check_box_tag 'settings[display_subprojects_issues]', 1, Setting.display_subprojects_issues? %><%= hidden_field_tag 'settings[display_subprojects_issues]', 0 %></p> |
9 | 9 | |
10 |
<p><label><%= l(:setting_issue_startdate_is_adddate) %></label> |
|
11 |
<%= check_box_tag 'settings[issue_startdate_is_adddate]', 1, Setting.issue_startdate_is_adddate? %><%= hidden_field_tag 'settings[issue_startdate_is_adddate]', 0 %></p> |
|
12 | ||
10 | 13 |
<p><label><%= l(:setting_issues_export_limit) %></label> |
11 | 14 |
<%= text_field_tag 'settings[issues_export_limit]', Setting.issues_export_limit, :size => 6 %></p> |
12 | 15 |
</div> |
config/locales/en.yml | ||
---|---|---|
281 | 281 |
setting_mail_handler_api_key: API key |
282 | 282 |
setting_sequential_project_identifiers: Generate sequential project identifiers |
283 | 283 |
setting_gravatar_enabled: Use Gravatar user icons |
284 |
setting_issue_startdate_is_adddate: Use todays date as start date for new issues (otherwise leave empty, default) |
|
284 | 285 |
setting_diff_max_lines_displayed: Max number of diff lines displayed |
285 | 286 |
setting_file_max_size_displayed: Max size of text files displayed inline |
286 | 287 |
setting_repository_log_display_limit: Maximum number of revisions displayed on file log |
config/settings.yml | ||
---|---|---|
150 | 150 |
default: 0 |
151 | 151 |
openid: |
152 | 152 |
default: 0 |
153 |
issue_startdate_is_adddate: |
|
154 |
default: 0 |