Patch #2277 » new_setting-issue_startdate_is_adddate-r2087.diff
| app/controllers/issues_controller.rb (working copy) | ||
|---|---|---|
|
@issue.status = default_status
|
||
|
@allowed_statuses = ([default_status] + default_status.find_new_statuses_allowed_to(User.current.role_for_project(@project), @issue.tracker)).uniq
|
||
|
|
||
|
if Setting.issue_startdate_is_adddate?
|
||
|
if request.get? || request.xhr?
|
||
|
@issue.start_date ||= Date.today
|
||
|
else
|
||
| ... | ... | |
|
Mailer.deliver_issue_add(@issue) if Setting.notified_events.include?('issue_added')
|
||
|
redirect_to :controller => 'issues', :action => 'show', :id => @issue
|
||
|
return
|
||
|
end
|
||
|
end
|
||
|
end
|
||
|
end
|
||
|
elsif !Setting.issue_startdate_is_adddate
|
||
|
if !request.get? && !request.xhr?
|
||
|
requested_status = IssueStatus.find_by_id(params[:issue][:status_id])
|
||
|
# Check that the user is allowed to apply the requested status
|
||
|
@issue.status = (@allowed_statuses.include? requested_status) ? requested_status : default_status
|
||
|
if @issue.save
|
||
|
attach_files(@issue, params[:attachments])
|
||
|
flash[:notice] = l(:notice_successful_create)
|
||
|
Mailer.deliver_issue_add(@issue) if Setting.notified_events.include?('issue_added')
|
||
|
redirect_to :controller => 'issues', :action => 'show', :id => @issue
|
||
|
return
|
||
|
end
|
||
|
end
|
||
|
end
|
||
|
@priorities = Enumeration::get_values('IPRI')
|
||
|
render :layout => !request.xhr?
|
||
|
end
|
||
| app/views/settings/_issues.rhtml (working copy) | ||
|---|---|---|
|
<p><label><%= l(:setting_display_subprojects_issues) %></label>
|
||
|
<%= check_box_tag 'settings[display_subprojects_issues]', 1, Setting.display_subprojects_issues? %><%= hidden_field_tag 'settings[display_subprojects_issues]', 0 %></p>
|
||
|
<p><label><%= l(:setting_issue_startdate_is_adddate) %></label>
|
||
|
<%= check_box_tag 'settings[issue_startdate_is_adddate]', 1, Setting.issue_startdate_is_adddate? %><%= hidden_field_tag 'settings[issue_startdate_is_adddate]', 0 %></p>
|
||
|
<p><label><%= l(:setting_issues_export_limit) %></label>
|
||
|
<%= text_field_tag 'settings[issues_export_limit]', Setting.issues_export_limit, :size => 6 %></p>
|
||
|
</div>
|
||
| config/settings.yml (working copy) | ||
|---|---|---|
|
To change your notification preferences, please click here: http://hostname/my/account
|
||
|
gravatar_enabled:
|
||
|
default: 0
|
||
|
issue_startdate_is_adddate:
|
||
|
default: 0
|
||
| lang/en.yml (working copy) | ||
|---|---|---|
|
setting_mail_handler_api_key: API key
|
||
|
setting_sequential_project_identifiers: Generate sequential project identifiers
|
||
|
setting_gravatar_enabled: Use Gravatar user icons
|
||
|
setting_issue_startdate_is_adddate: Use todays date as start date for new issues (otherwise leave empty, default)
|
||
|
permission_edit_project: Edit project
|
||
|
permission_select_project_modules: Select project modules
|
||