@@ -1,49 +1,49 | |||
|
1 | 1 | <%= error_messages_for 'time_entry' %> |
|
2 | 2 | <%= back_url_hidden_field_tag %> |
|
3 | 3 | |
|
4 | 4 | <div class="box tabular"> |
|
5 | 5 | <% if @time_entry.new_record? %> |
|
6 | 6 | <% if params[:project_id] %> |
|
7 | 7 | <%= hidden_field_tag 'project_id', params[:project_id] %> |
|
8 | 8 | <% elsif params[:issue_id] %> |
|
9 | 9 | <%= hidden_field_tag 'issue_id', params[:issue_id] %> |
|
10 | 10 | <% else %> |
|
11 | <p><%= f.select :project_id, project_tree_options_for_select(Project.allowed_to(:log_time).to_a, :selected => @time_entry.project, :include_blank => true) %></p> | |
|
11 | <p><%= f.select :project_id, project_tree_options_for_select(Project.allowed_to(:log_time).to_a, :selected => @time_entry.project, :include_blank => true), :required => true %></p> | |
|
12 | 12 | <% end %> |
|
13 | 13 | <% end %> |
|
14 | 14 | <p> |
|
15 | 15 | <%= f.text_field :issue_id, :size => 6 %> |
|
16 | 16 | <% if @time_entry.issue.try(:visible?) %> |
|
17 | 17 | <span id="time_entry_issue"><%= "#{@time_entry.issue.tracker.name} ##{@time_entry.issue.id}: #{@time_entry.issue.subject}" %></span> |
|
18 | 18 | <% end %> |
|
19 | 19 | </p> |
|
20 | 20 | <p><%= f.date_field :spent_on, :size => 10, :required => true %><%= calendar_for('time_entry_spent_on') %></p> |
|
21 | 21 | <p><%= f.text_field :hours, :size => 6, :required => true %></p> |
|
22 | 22 | <p><%= f.text_field :comments, :size => 100, :maxlength => 1024 %></p> |
|
23 | 23 | <p><%= f.select :activity_id, activity_collection_for_select_options(@time_entry), :required => true %></p> |
|
24 | 24 | <% @time_entry.custom_field_values.each do |value| %> |
|
25 | 25 | <p><%= custom_field_tag_with_label :time_entry, value %></p> |
|
26 | 26 | <% end %> |
|
27 | 27 | <%= call_hook(:view_timelog_edit_form_bottom, { :time_entry => @time_entry, :form => f }) %> |
|
28 | 28 | </div> |
|
29 | 29 | |
|
30 | 30 | <%= javascript_tag do %> |
|
31 | 31 | <% if @time_entry.new_record? %> |
|
32 | 32 | $(document).ready(function(){ |
|
33 | 33 | $('#time_entry_project_id, #time_entry_issue_id').change(function(){ |
|
34 | 34 | $.ajax({ |
|
35 | 35 | url: '<%= escape_javascript new_time_entry_path(:format => 'js') %>', |
|
36 | 36 | type: 'post', |
|
37 | 37 | data: $('#new_time_entry').serialize() |
|
38 | 38 | }); |
|
39 | 39 | }); |
|
40 | 40 | }); |
|
41 | 41 | <% end %> |
|
42 | 42 | |
|
43 | 43 | observeAutocompleteField('time_entry_issue_id', '<%= escape_javascript auto_complete_issues_path(:project_id => @project, :scope => (@project ? nil : 'all'))%>', { |
|
44 | 44 | select: function(event, ui) { |
|
45 | 45 | $('#time_entry_issue').text(ui.item.label); |
|
46 | 46 | $('#time_entry_issue_id').blur(); |
|
47 | 47 | } |
|
48 | 48 | }); |
|
49 | 49 | <% end %> |
General Comments 0
You need to be logged in to leave comments.
Login now