Project

General

Profile

Patch #2277 » new_setting-issue_startdate_is_adddate-r2761.diff

Updated Dennis's (updated) patch against trunk at r2761 - Mischa The Evil, 2009-05-22 00:52

View differences:

app/controllers/issues_controller.rb (working copy)
148 148
    @issue.status = default_status
149 149
    @allowed_statuses = ([default_status] + default_status.find_new_statuses_allowed_to(User.current.roles_for_project(@project), @issue.tracker)).uniq
150 150
    
151
    if request.get? || request.xhr?
151
    if (request.get? || request.xhr?) && Setting.issue_startdate_is_adddate?
152 152
      @issue.start_date ||= Date.today
153
    else
153
    elsif !request.get? && !request.xhr?
154 154
      requested_status = IssueStatus.find_by_id(params[:issue][:status_id])
155 155
      # Check that the user is allowed to apply the requested status
156 156
      @issue.status = (@allowed_statuses.include? requested_status) ? requested_status : default_status
app/views/settings/_issues.rhtml (working copy)
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/settings.yml (working copy)
157 157
  default: 0
158 158
openid:
159 159
  default: 0
160
issue_startdate_is_adddate:
161
  default: 0
config/locales/en.yml (working copy)
292 292
  setting_openid: Allow OpenID login and registration
293 293
  setting_password_min_length: Minimum password length
294 294
  setting_new_project_user_role_id: Role given to a non-admin user who creates a project
295
  setting_issue_startdate_is_adddate: Use todays date as start date for new issues (otherwise leave empty, default)
295 296
  
296 297
  permission_add_project: Create project
297 298
  permission_edit_project: Edit project
(3-3/9)