kanbanworkflowstimelinescrumrubyroadmapproject-planningproject-managementopenprojectangularissue-trackerifcgantt-chartganttbug-trackerboardsbcf
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
3.0 KiB
45 lines
3.0 KiB
13 years ago
|
<%-
|
||
|
index ||= "INDEX"
|
||
15 years ago
|
new_or_existing = labor_budget_item.new_record? ? 'new' : 'existing'
|
||
13 years ago
|
id_or_index = labor_budget_item.new_record? ? index : labor_budget_item.id
|
||
15 years ago
|
prefix = "cost_object[#{new_or_existing}_labor_budget_item_attributes][]"
|
||
|
id_prefix = "cost_object_#{new_or_existing}_labor_budget_item_attributes_#{id_or_index}"
|
||
|
name_prefix = "cost_object[#{new_or_existing}_labor_budget_item_attributes][#{id_or_index}]"
|
||
|
classes ||= ""
|
||
|
|
||
|
@labor_budget_item = labor_budget_item
|
||
|
error_messages = error_messages_for 'labor_budget_item'
|
||
13 years ago
|
-%>
|
||
15 years ago
|
|
||
15 years ago
|
<% unless error_messages.blank? %><tr><td colspan="5"><%= error_messages %></td></tr><% end %>
|
||
15 years ago
|
<% fields_for prefix, labor_budget_item do |cost_form| %>
|
||
|
<tr class="cost_entry <%= classes %>" id="<%= id_prefix %>">
|
||
|
<td class="units">
|
||
13 years ago
|
<label class="hidden-for-sighted" for="<%= id_prefix %>_units"><%= l(:field_hours) %></label>
|
||
15 years ago
|
<%= cost_form.text_field :hours, :index => id_or_index, :size => 3 %>
|
||
|
</td>
|
||
|
<td class="user">
|
||
13 years ago
|
<label class="hidden-for-sighted" for="<%= id_prefix %>_user_id"><%= l(:label_user) %></label>
|
||
15 years ago
|
<%= cost_form.select :user_id, @project.assignable_users.sort.collect{|u| [u.name, u.id]}, {:prompt => true}, {:index => id_or_index} %>
|
||
|
</td>
|
||
|
<td class="comment">
|
||
13 years ago
|
<label class="hidden-for-sighted" for="<%= id_prefix %>_comments"><%= l(:field_comments) %></label>
|
||
15 years ago
|
<%= cost_form.text_field :comments, :index => id_or_index, :size => 40 %>
|
||
|
</td>
|
||
|
<td class="currency">
|
||
13 years ago
|
<a href="javascript:;" id="<%= "#{id_prefix}_costs" %>" class="icon icon-edit" title="<%= l(:help_click_to_edit) %>">
|
||
12 years ago
|
<%= number_to_currency(labor_budget_item.calculated_costs(@cost_object.fixed_date, @cost_object.project_id)) if labor_budget_item.costs_visible_by?(User.current) %>
|
||
13 years ago
|
</a>
|
||
15 years ago
|
<%= update_page_tag do |page|
|
||
|
page << "makeEditable('#{id_prefix}_costs', '#{name_prefix}[budget]');"
|
||
|
page << "edit($('#{id_prefix}_costs'), '#{name_prefix}[budget]', '#{number_to_currency(labor_budget_item.budget)}');" if labor_budget_item.budget
|
||
|
end %>
|
||
15 years ago
|
<%= observe_field( "#{id_prefix}_user_id", :url => {:action => :update_labor_budget_item, :project_id => @project.id}, :with => "'user_id=' + encodeURIComponent(value) + '&hours=' + encodeURIComponent(document.getElementById('#{id_prefix}_hours').value) + '&fixed_date=' + encodeURIComponent(document.getElementById('cost_object_fixed_date').value) + '&element_id=#{id_prefix}'") %>
|
||
|
<%= observe_field( "#{id_prefix}_hours", :frequency => 1, :url => {:action => :update_labor_budget_item, :project_id => @project.id}, :with => "'user_id=' + encodeURIComponent(document.getElementById('#{id_prefix}_user_id').value) + '&hours=' + encodeURIComponent(value) + '&fixed_date=' + encodeURIComponent(document.getElementById('cost_object_fixed_date').value) + '&element_id=#{id_prefix}'") %>
|
||
15 years ago
|
</td>
|
||
15 years ago
|
<td class="delete">
|
||
13 years ago
|
<%= link_to_function image_tag('delete.png', :alt => l(:button_delete), :title => l(:button_delete)), "deleteLaborBudgetItem('#{id_prefix}')" %>
|
||
15 years ago
|
</td>
|
||
|
</tr>
|
||
|
<% end %>
|