|
| 1 | +<% |
| 2 | +=begin |
| 3 | +XXX questa logica serve per vedere come integrare i nuovi campi della registrazione |
| 4 | + del tempo nell'update di una issue. da cancellare (deve stare nel partial comune |
| 5 | + con l'altra vista di edit). |
| 6 | +=end |
| 7 | +%> |
| 8 | +<% |
| 9 | + # TODO concettualmente questi metodi sono helper e andrebbero quindi definiti |
| 10 | + # nel file helper |
| 11 | + |
| 12 | + # Aggiunge uno "0" davanti al numero passato se è minore di 10 |
| 13 | + def hours_min_string(number) |
| 14 | + str = number.to_s |
| 15 | + str = "0#{number}" if number < 10 |
| 16 | + str |
| 17 | + end |
| 18 | + |
| 19 | + # Restituisce un array di interi da 0 a 55 andando di 5 in 5 |
| 20 | + def minutes |
| 21 | + mins = Array.new |
| 22 | + (0..3).each { |i| mins << 15 * i} |
| 23 | + mins |
| 24 | + end |
| 25 | +%> |
| 26 | + |
| 27 | + |
| 28 | +<% labelled_tabular_form_for :issue, @issue, |
| 29 | + :url => {:action => 'update', :id => @issue}, |
| 30 | + :html => {:id => 'issue-form', |
| 31 | + :class => nil, |
| 32 | + :method => :put, |
| 33 | + :multipart => true} do |f| %> |
| 34 | + <%= error_messages_for 'issue', 'time_entry' %> |
| 35 | + <div class="box"> |
| 36 | + <% if @edit_allowed || !@allowed_statuses.empty? %> |
| 37 | + <fieldset class="tabular"><legend><%= l(:label_change_properties) %> |
| 38 | + <% if !@issue.new_record? && !@issue.errors.any? && @edit_allowed %> |
| 39 | + <small>(<%= link_to l(:label_more), {}, :onclick => 'Effect.toggle("issue_descr_fields", "appear", {duration:0.3}); return false;' %>)</small> |
| 40 | + <% end %> |
| 41 | + </legend> |
| 42 | + <%= render :partial => (@edit_allowed ? 'form' : 'form_update'), :locals => {:f => f} %> |
| 43 | + </fieldset> |
| 44 | + <% end %> |
| 45 | + <% if authorize_for('timelog', 'edit') %> |
| 46 | + <fieldset class="tabular"><legend><%= l(:button_log_time) %></legend> |
| 47 | + <% fields_for :time_entry, @time_entry, { :builder => TabularFormBuilder, :lang => current_language} do |time_entry| %> |
| 48 | + <div class="splitcontentleft"> |
| 49 | + <p><%= time_entry.text_field :hours, :size => 6, :label => :label_spent_time %> <%= l(:field_hours) %></p> |
| 50 | + </div> |
| 51 | + <div class="splitcontentright"> |
| 52 | + <p><%= time_entry.select :activity_id, activity_collection_for_select_options %></p> |
| 53 | + </div> |
| 54 | + <div class="splitcontentleft"> |
| 55 | + <%= render :partial => 'common/custom_fields', :locals => {:time_entry => time_entry} %> |
| 56 | + </div> |
| 57 | + <p><%= time_entry.text_field :comments, :size => 60 %></p> |
| 58 | + <% @time_entry.custom_field_values.each do |value| %> |
| 59 | + <p><%= custom_field_tag_with_label :time_entry, value %></p> |
| 60 | + <% end %> |
| 61 | + <% end %> |
| 62 | + </fieldset> |
| 63 | + <% end %> |
| 64 | + |
| 65 | + <fieldset><legend><%= l(:field_notes) %></legend> |
| 66 | + <%= text_area_tag 'notes', @notes, :cols => 60, :rows => 10, :class => 'wiki-edit' %> |
| 67 | + <%= wikitoolbar_for 'notes' %> |
| 68 | + <%= call_hook(:view_issues_edit_notes_bottom, { :issue => @issue, :notes => @notes, :form => f }) %> |
| 69 | + |
| 70 | + <p><%=l(:label_attachment_plural)%><br /><%= render :partial => 'attachments/form' %></p> |
| 71 | + </fieldset> |
| 72 | + </div> |
| 73 | + |
| 74 | + <%= f.hidden_field :lock_version %> |
| 75 | + <%= submit_tag l(:button_submit) %> |
| 76 | + <%= link_to_remote l(:label_preview), |
| 77 | + { :url => { :controller => 'issues', :action => 'preview', :project_id => @project, :id => @issue }, |
| 78 | + :method => 'post', |
| 79 | + :update => 'preview', |
| 80 | + :with => 'Form.serialize("issue-form")', |
| 81 | + :complete => "Element.scrollTo('preview')" |
| 82 | + }, :accesskey => accesskey(:preview) %> |
| 83 | +<% end %> |
| 84 | + |
| 85 | +<div id="preview" class="wiki"></div> |
0 commit comments