Index: app/helpers/application_helper.rb =================================================================== --- app/helpers/application_helper.rb (revision 15949) +++ app/helpers/application_helper.rb (working copy) @@ -387,11 +387,18 @@ end # Returns a string for users/groups option tags - def principals_options_for_select(collection, selected=nil) + def principals_options_for_select(collection, selected = nil) s = '' if collection.include?(User.current) - s << content_tag('option', "<< #{l(:label_me)} >>", :value => User.current.id) + s << content_tag('option', "<< #{l(:label_me_accusative, default: l(:label_me))} >>", value: User.current.id) # corrected for proper german (mich instead of ich!) end + # TODO: add this to Redmine Core and throw away the reference to the @issue instance variable + # The instance variable is used (instead of another parameter) to avoid the necessity of overriding the issues/_attributes partial + unless @issue.nil? # do not add option in case of bulk and issue category edit + last_assignee_id = @issue.last_assigned_to + s << content_tag('option', "<< #{t('issue.last_assignee', name: User.find_by_id(last_assignee_id).try(:name))} >>", + value: last_assignee_id) if (last_assignee_id && (last_assignee_id != User.current.id)) + end groups = '' collection.sort.each do |element| selected_attribute = ' selected="selected"' if option_value_selected?(element, selected) || element.id.to_s == selected Index: app/models/issue.rb =================================================================== --- app/models/issue.rb (revision 15949) +++ app/models/issue.rb (working copy) @@ -806,6 +806,15 @@ scope end + # Returns the last assigned_to_id from the issue history + def last_assigned_to + journals.reverse_each do |j| + last_assignee_change = j.detail_for_attribute 'assigned_to_id' + return last_assignee_change.old_value.to_i if last_assignee_change && last_assignee_change.old_value + end + nil # return nil instead of an empty array + end + # Returns the initial status of the issue # Returns nil for a new issue def status_was Index: config/locales/de.yml =================================================================== --- config/locales/de.yml (revision 15949) +++ config/locales/de.yml (working copy) @@ -622,6 +622,8 @@ label_only: nur label_max_size: Maximale Größe label_me: ich + label_me_accusative: mich + last_assignee: "ZULETZT: %{name}" label_member: Mitglied label_member_new: Neues Mitglied label_member_plural: Mitglieder Index: config/locales/en.yml =================================================================== --- config/locales/en.yml (revision 15949) +++ config/locales/en.yml (working copy) @@ -816,6 +816,7 @@ label_disabled: disabled label_show_completed_versions: Show completed versions label_me: me + last_assignee: "LAST: %{name}" label_board: Forum label_board_new: New forum label_board_plural: Forums