Project

General

Profile

Defect #1283 » scrum_start_date_16.2.patch

Angelinsky7 Angelinsky7, 2017-01-10 17:59

View differences:

app/controllers/sprints_controller.rb (working copy)
98 98
    @issue.init_journal(User.current)
99 99
    @issue.status = IssueStatus.find(params[:status].to_i)
100 100
    raise 'New status is not allowed' unless @issue.new_statuses_allowed_to.include?(@issue.status)
101
	  if (@issue.start_date.nil?) and
102
       @issue.status != @old_status and
103
       !(Scrum::Setting.status_id_set_startdate.nil?) and
104
       @issue.status.id == Scrum::Setting.status_id_set_startdate.to_i
105
      @issue.start_date = Date.today
106
    end
107
    if (@issue.due_date.nil?) and
108
       @issue.status != @old_status and
109
       !(Scrum::Setting.status_id_set_enddate.nil?) and
110
       @issue.status.id == Scrum::Setting.status_id_set_enddate.to_i
111
      @issue.due_date = Date.today
112
    end
101 113
    @issue.save!
102 114
    respond_to do |format|
103 115
      format.js { render 'scrum/update_task' }
app/views/settings/_scrum_settings.html.erb (working copy)
55 55
                      Scrum::Setting.auto_update_pbi_status) %>
56 56
    <em><%= l(:label_setting_auto_update_pbi_status_explanation) %></em>
57 57
  </p>
58
  <p>
59
    <label><%= l(:label_setting_status_set_startdate) %>:</label>
60
    <%- statuses = IssueStatus.all.collect{|s| [s.name, s.id]} -%>
61
    <%- options = options_for_select(statuses, Scrum::Setting.status_id_set_startdate) -%>
62
    <%= select_tag 'settings[status_id_set_startdate]', options, :include_blank => true %>
63
  </p>
64
  <p>
65
    <label><%= l(:label_setting_status_set_enddate) %>:</label>
66
    <%- statuses = IssueStatus.all.collect{|s| [s.name, s.id]} -%>
67
    <%- options = options_for_select(statuses, Scrum::Setting.status_id_set_enddate) -%>
68
    <%= select_tag 'settings[status_id_set_enddate]', options, :include_blank => true %>
69
  </p>
58 70
</fieldset>
59 71

  
60 72
<fieldset>
config/locales/en.yml (working copy)
97 97
  label_setting_story_points_custom_field: "Story points custom field"
98 98
  label_setting_task_statuses: "Task statuses for Sprint board"
99 99
  label_setting_verification_activities: "Verification activities"
100
  label_setting_status_set_startdate: "Status that set the start date of the task"
101
  label_setting_status_set_enddate: "Status that set the end date of the task"
100 102
  label_scrum: "Scrum"
101 103
  label_sprint: "Sprint"
102 104
  label_sprint_board: "Sprint board"
config/locales/fr.yml (working copy)
87 87
  label_setting_story_points_custom_field: "Champ personnalisé des points scrum"
88 88
  label_setting_task_statuses: "Statut des tâches pour le tableau de bord"
89 89
  label_setting_verification_activities: "Vérification des activités"
90
  label_setting_status_set_startdate: "Statut qui ecrit la date de debut"
91
  label_setting_status_set_enddate: "Statut qui ecrit la date de fin"
90 92
  label_scrum: "Scrum"
91 93
  label_sprint: "Sprint"
92 94
  label_sprint_board: "Tableau de bord du Sprint"
init.rb (working copy)
107 107
                                 :lowest_speed => 70,
108 108
                                 :low_speed => 80,
109 109
                                 :high_speed => 140,
110
                                 :render_plugin_tips => '1'},
110
                                 :render_plugin_tips => '1',
111
                                 :status_id_set_startdate => nil,
112
                                 :status_id_set_enddate => nil},
111 113
                    :partial => 'settings/scrum_settings'
112 114
end
lib/scrum/setting.rb (working copy)
64 64
      class_eval src, __FILE__, __LINE__
65 65
    end
66 66

  
67
    %w(status_id_set_startdate
68
        status_id_set_enddate).each do |setting|
69
      src = <<-END_SRC
70
      def self.#{setting}
71
        ::Setting.plugin_scrum[:#{setting}]
72
      end
73
      END_SRC
74
      class_eval src, __FILE__, __LINE__
75
    end
76

  
67 77
    module TrackerFields
68 78
      FIELDS = 'fields'
69 79
      CUSTOM_FIELDS = 'custom_fields'
    (1-1/1)