From 17d2a6d71ec130db3e510becb0fe98c856809fbf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20G=C3=BCnther?= Date: Fri, 27 May 2016 12:36:14 +0200 Subject: [PATCH 1/3] Bump VERSION to 5.0.19 --- lib/open_project/costs/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/open_project/costs/version.rb b/lib/open_project/costs/version.rb index a69883af67..a235c13623 100644 --- a/lib/open_project/costs/version.rb +++ b/lib/open_project/costs/version.rb @@ -19,6 +19,6 @@ module OpenProject module Costs - VERSION = "5.0.18" + VERSION = "5.0.19" end end From 8d1ae7949af885dd310d5ab52216af713f6937d0 Mon Sep 17 00:00:00 2001 From: Henriette Dinger Date: Fri, 6 May 2016 13:29:51 +0200 Subject: [PATCH 2/3] Remove empty options from required select box --- app/helpers/costlog_helper.rb | 9 ++------- app/views/costlog/edit.html.erb | 7 +++++-- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/app/helpers/costlog_helper.rb b/app/helpers/costlog_helper.rb index 6ae9e20dec..da40b1fd6b 100644 --- a/app/helpers/costlog_helper.rb +++ b/app/helpers/costlog_helper.rb @@ -35,17 +35,12 @@ module CostlogHelper cost_types << selected_type cost_types.sort end - collection = [] - collection << ["--- #{t(:actionview_instancetag_blank_option)} ---", ''] unless cost_types.detect(&:is_default?) - cost_types.each do |t| collection << [t.name, t.id] end - collection + cost_types.map { |t| [t.name, t.id] } end def user_collection_for_select_options(_options = {}) users = @project.possible_assignees - collection = [] - users.each do |u| collection << [u.name, u.id] end - collection + users.map { |t| [t.name, t.id] } end def extended_progress_bar(pcts, options = {}) diff --git a/app/views/costlog/edit.html.erb b/app/views/costlog/edit.html.erb index f748cd54df..475903ba52 100644 --- a/app/views/costlog/edit.html.erb +++ b/app/views/costlog/edit.html.erb @@ -46,17 +46,20 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
<%= f.text_field :spent_on, size: 10, required: true %> + <%= calendar_for('cost_entry_spent_on') %>
<% if User.current.allowed_to? :log_costs, @project %>
- <%= f.select :user_id, user_collection_for_select_options, required: true %> + <%# Without knowing why `prompt` is in this case responsible for no blank line in the selection options %> + <%= f.select :user_id, user_collection_for_select_options, required: true, prompt: true, prompt: true %>
<% else %> <%= f.hidden_field :user_id, value: User.current.id %> <% end %>
- <%= f.select :cost_type_id, cost_types_collection_for_select_options, required: true %>

+ <%# see above %> + <%= f.select :cost_type_id, cost_types_collection_for_select_options, required: true, prompt: true %>

<% if @cost_entry.cost_type.nil? %> From 2a8cc7bdbc453ce57158ffdd0795fc119085da89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20G=C3=BCnther?= Date: Mon, 13 Jun 2016 16:32:42 +0200 Subject: [PATCH 3/3] Remove invalid callback :attachment_removed does not exist on `CostObject`. --- app/models/cost_object.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/models/cost_object.rb b/app/models/cost_object.rb index cc813f7505..3d59dd0f32 100644 --- a/app/models/cost_object.rb +++ b/app/models/cost_object.rb @@ -29,8 +29,7 @@ class CostObject < ActiveRecord::Base include ActiveModel::ForbiddenAttributesProtection - acts_as_attachable after_remove: :attachment_removed - + acts_as_attachable acts_as_journalized acts_as_event type: 'cost-objects',