Redmine 4.1.1

This commit is contained in:
Manuel Cillero 2020-11-22 21:20:06 +01:00
parent 33e7b881a5
commit 3d976f1b3b
1593 changed files with 36180 additions and 19489 deletions

View file

@ -16,11 +16,20 @@
<%= link_to_issue(@time_entry.issue) if @time_entry.issue.try(:visible?) %>
</span>
</p>
<% if User.current.allowed_to?(:log_time_for_other_users, @project) %>
<p><%= f.select :user_id, user_collection_for_select_options(@time_entry), :required => true %></p>
<% elsif !@time_entry.new_record? %>
<p>
<%= f.label_for_field :user_id %>
<span><%= link_to_user(@time_entry.user) %></span>
</p>
<% end %>
<p><%= f.date_field :spent_on, :size => 10, :required => true %><%= calendar_for('time_entry_spent_on') %></p>
<p><%= f.hours_field :hours, :size => 6, :required => true %></p>
<p><%= f.text_field :comments, :size => 100, :maxlength => 1024, :required => Setting.timelog_required_fields.include?('comments') %></p>
<p><%= f.select :activity_id, activity_collection_for_select_options(@time_entry), :required => true %></p>
<% @time_entry.custom_field_values.each do |value| %>
<% @time_entry.editable_custom_field_values.each do |value| %>
<p><%= custom_field_tag_with_label :time_entry, value %></p>
<% end %>
<%= call_hook(:view_timelog_edit_form_bottom, { :time_entry => @time_entry, :form => f }) %>

View file

@ -20,10 +20,10 @@
<% reset_cycle %>
<tr class="group open">
<td colspan="<%= @query.inline_columns.size + 2 %>">
<span class="expander" onclick="toggleRowGroup(this);">&nbsp;</span>
<span class="expander icon icon-expended" onclick="toggleRowGroup(this);">&nbsp;</span>
<span class="name"><%= group_name %></span>
<% if group_count %>
<span class="count"><%= group_count %></span>
<span class="badge badge-count count"><%= group_count %></span>
<% end %>
<span class="totals"><%= group_totals %></span>
<%= link_to_function("#{l(:button_collapse_all)}/#{l(:button_expand_all)}",
@ -47,13 +47,15 @@
:title => l(:button_delete),
:class => 'icon-only icon-del' %>
<% end -%>
<%= link_to_context_menu %>
</td>
</tr>
<% @query.block_columns.each do |column|
if (text = column_content(column, issue)) && text.present? -%>
if (text = column_content(column, entry)) && text.present? -%>
<tr class="<%= current_cycle %>">
<td colspan="<%= @query.inline_columns.size + 1 %>" class="<%= column.css_classes %>">
<% if query.block_columns.count > 1 %>
<% if @query.block_columns.count > 1 %>
<span><%= column.caption %></span>
<% end %>
<%= text %>

View file

@ -0,0 +1 @@
<%= render_sidebar_queries(TimeEntryQuery, @project) %>

View file

@ -18,8 +18,13 @@
<ul id="bulk-selection">
<% @time_entries.each do |entry| %>
<%= content_tag 'li',
link_to("#{format_date(entry.spent_on)} - #{entry.project}: #{l(:label_f_hour_plural, :value => entry.hours)}", edit_time_entry_path(entry)) %>
<%=
content_tag 'li',
link_to(
"#{format_date(entry.spent_on)} - #{entry.project}: #{l(:label_f_hour_plural, :value => entry.hours)} (#{entry.user})",
edit_time_entry_path(entry)
)
%>
<% end %>
</ul>
@ -27,35 +32,43 @@
<%= @time_entries.collect {|i| hidden_field_tag('ids[]', i.id, :id => nil)}.join.html_safe %>
<div class="box tabular">
<div>
<p>
<label><%= l(:field_project) %></label>
<%= select_tag('time_entry[project_id]', project_tree_options_for_select(@target_projects,
:include_blank => l(:label_no_change_option), :selected => @target_project),
:onchange => "updateBulkEditFrom('#{escape_javascript url_for(:action => 'bulk_edit', :format => 'js')}')" ) %>
</p>
<p>
<label for="time_entry_issue_id"><%= l(:field_issue) %></label>
<%= text_field :time_entry, :issue_id, :size => 6 %>
<label class="inline"><%= check_box_tag 'time_entry[issue_id]', 'none', (@time_entry_params[:issue_id] == 'none'), :id => nil, :data => {:disables => '#time_entry_issue_id'} %><%= l(:button_clear) %></label>
<span id="time_entry_issue"></span>
</p>
<p>
<label for="time_entry_spent_on"><%= l(:field_spent_on) %></label>
<%= date_field :time_entry, :spent_on, :size => 10 %><%= calendar_for('time_entry_spent_on') %>
<%= date_field :time_entry, :spent_on, :size => 10, :value => @time_entry_params[:spent_on] %><%= calendar_for('time_entry_spent_on') %>
</p>
<p>
<label for="time_entry_hours"><%= l(:field_hours) %></label>
<%= text_field :time_entry, :hours, :size => 6 %>
<%= text_field :time_entry, :hours, :size => 6, :value => @time_entry_params[:hours] %>
</p>
<% if @available_activities.any? %>
<p>
<label for="time_entry_activity_id"><%= l(:field_activity) %></label>
<%= select_tag('time_entry[activity_id]', content_tag('option', l(:label_no_change_option), :value => '') + options_from_collection_for_select(@available_activities, :id, :name)) %>
<%= select_tag('time_entry[activity_id]', content_tag('option', l(:label_no_change_option), :value => '') + options_from_collection_for_select(@available_activities, :id, :name, @time_entry_params[:activity_id])) %>
</p>
<% end %>
<p>
<label for="time_entry_comments"><%= l(:field_comments) %></label>
<%= text_field(:time_entry, :comments, :size => 100) %>
<%= text_field(:time_entry, :comments, :size => 100, :value => @time_entry_params[:comments]) %>
</p>
<% @custom_fields.each do |custom_field| %>
<p><label><%= h(custom_field.name) %></label> <%= custom_field_tag_for_bulk_edit('time_entry', custom_field, @time_entries) %></p>
<p><label><%= h(custom_field.name) %></label> <%= custom_field_tag_for_bulk_edit('time_entry', custom_field, @time_entries, @time_entry_params[:custom_field_values][custom_field.id.to_s]) %></p>
<% end %>
<%= call_hook(:view_time_entries_bulk_edit_details_bottom, { :time_entries => @time_entries }) %>
@ -64,3 +77,47 @@
<p><%= submit_tag l(:button_submit) %></p>
<% end %>
<%= javascript_tag do %>
$(document).ready(function(){
$('#time_entry_project_id').change(function(){
<!-- $('#time_entry_issue_id').val(''); -->
$('#time_entry_issue').text('');
});
});
<% if @project || @target_project %>
observeAutocompleteField('time_entry_issue_id',
function(request, callback) {
var url = '<%= j auto_complete_issues_path %>';
var data = {
term: request.term
};
var project_id;
<% if @project %>
project_id = '<%= @project.id %>';
<% end %>
current_project_id = $('#time_entry_project_id').val();
if(current_project_id === ''){
data['project_id'] = project_id;
} else {
data['project_id'] = current_project_id;
}
$.get(url, data, null, 'json')
.done(function(data){
callback(data);
})
.fail(function(jqXHR, status, error){
callback([]);
});
},
{
select: function(event, ui, data) {
$('#time_entry_issue').text(ui.item.label);
}
}
);
<% end %>
<% end %>

View file

@ -0,0 +1 @@
$('#content').html('<%= escape_javascript(render :template => 'timelog/bulk_edit', :formats => [:html]) %>');

View file

@ -3,4 +3,5 @@
<%= labelled_form_for @time_entry, :url => time_entry_path(@time_entry), :html => {:multipart => true} do |f| %>
<%= render :partial => 'form', :locals => {:f => f} %>
<%= submit_tag l(:button_save) %>
<%= cancel_button_tag_for_time_entry(@project) %>
<% end %>

View file

@ -12,7 +12,7 @@ api.array :time_entries, api_meta(:total_count => @entry_count, :offset => @offs
api.created_on time_entry.created_on
api.updated_on time_entry.updated_on
render_api_custom_values time_entry.custom_field_values, api
render_api_custom_values time_entry.visible_custom_field_values, api
end
end
end

View file

@ -1,7 +1,16 @@
<div class="contextual">
<%= link_to l(:button_log_time),
<%= link_to l(:button_log_time),
_new_time_entry_path(@project, @query.filtered_issue_id),
:class => 'icon icon-time-add' if User.current.allowed_to?(:log_time, @project, :global => true) %>
<%= actions_dropdown do %>
<% if User.current.allowed_to?(:import_time_entries, @project, :global => true) %>
<%= link_to l(:button_import), new_time_entries_import_path(:project_id => @project), :class => 'icon icon-import' %>
<% end %>
<%= link_to_if_authorized l(:label_settings),
{:controller => 'projects', :action => 'settings', :id => @project, :tab => 'activities'},
:class => 'icon icon-settings' if User.current.allowed_to?(:manage_project_activities, @project) %>
<% end %>
</div>
<h2><%= @query.new_record? ? l(:label_spent_time) : @query.name %></h2>
@ -31,9 +40,20 @@
<label><%= radio_button_tag 'c[]', '', true %> <%= l(:description_selected_columns) %></label><br />
<label><%= radio_button_tag 'c[]', 'all_inline' %> <%= l(:description_all_columns) %></label>
</p>
<% if @query.available_block_columns.any? %>
<fieldset id="csv-export-block-columns">
<legend>
<%= toggle_checkboxes_link('#csv-export-block-columns input[type=checkbox]') %>
</legend>
<% @query.available_block_columns.each do |column| %>
<label><%= check_box_tag 'c[]', column.name, @query.has_column?(:column), :id => nil %> <%= column.caption %></label>
<% end %>
</fieldset>
<% end %>
<%= export_csv_encoding_select_tag %>
<p class="buttons">
<%= submit_tag l(:button_export), :name => nil, :onclick => "hideModal(this);" %>
<%= submit_tag l(:button_cancel), :name => nil, :onclick => "hideModal(this);", :type => 'button' %>
<%= submit_tag l(:button_export), :name => nil, :onclick => "hideModal(this);", :data => { :disable_with => false } %>
<%= link_to_function l(:button_cancel), "hideModal(this);" %>
</p>
<% end %>
</div>
@ -41,7 +61,7 @@
<% end %>
<% content_for :sidebar do %>
<%= render_sidebar_queries(TimeEntryQuery, @project) %>
<%= render :partial => 'timelog/sidebar' %>
<% end %>
<% html_title(@query.new_record? ? l(:label_spent_time) : @query.name, l(:label_details)) %>

View file

@ -4,4 +4,5 @@
<%= render :partial => 'form', :locals => {:f => f} %>
<%= submit_tag l(:button_create) %>
<%= submit_tag l(:button_create_and_continue), :name => 'continue' %>
<%= cancel_button_tag_for_time_entry(@project) %>
<% end %>

View file

@ -1,7 +1,10 @@
<div class="contextual">
<%= link_to l(:button_log_time),
<%= link_to l(:button_log_time),
_new_time_entry_path(@project, @issue),
:class => 'icon icon-time-add' if User.current.allowed_to?(:log_time, @project, :global => true) %>
<%= link_to_if_authorized l(:label_settings),
{:controller => 'projects', :action => 'settings', :id => @project, :tab => 'activities'},
:class => 'icon icon-settings' if User.current.allowed_to?(:manage_project_activities, @project) %>
</div>
<h2><%= @query.new_record? ? l(:label_spent_time) : @query.name %></h2>
@ -24,6 +27,7 @@
:disabled => (@report.criteria.length >= 3),
:id => "criterias") %>
<%= link_to l(:button_clear), {:params => request.query_parameters.merge(:criteria => nil)}, :class => 'icon icon-reload' %></p>
<%= hidden_field_tag 'encoding', l(:general_csv_encoding) unless l(:general_csv_encoding).casecmp('UTF-8') == 0 %>
<% end %>
<% if @query.valid? %>
@ -62,15 +66,34 @@
</div>
<% other_formats_links do |f| %>
<%= f.link_to_with_query_parameters 'CSV' %>
<%= f.link_to_with_query_parameters 'CSV', {}, :onclick => "showModal('csv-export-options', '330px'); return false;" %>
<% end %>
<% end %>
<div id="csv-export-options" style="display: none;">
<h3 class="title"><%= l(:label_export_options, :export_format => 'CSV') %></h3>
<%= export_csv_encoding_select_tag %>
<p class="buttons">
<%= submit_tag l(:button_export), :name => nil, :id => 'csv-export-button' %>
<%= submit_tag l(:button_cancel), :name => nil, :onclick => 'hideModal(this);', :type => 'button' %>
</p>
</div>
<% end %>
<% end %>
<% content_for :sidebar do %>
<%= render_sidebar_queries(TimeEntryQuery, @project) %>
<%= render :partial => 'sidebar' %>
<% end %>
<% html_title(@query.new_record? ? l(:label_spent_time) : @query.name, l(:label_report)) %>
<%= javascript_tag do %>
$(document).ready(function(){
$('input#csv-export-button').click(function(){
$('form input#encoding').val($('select#encoding option:selected').val());
$('form#query_form').attr('action', '<%= _report_time_entries_path(@project, nil, :format => 'csv') %>').submit();
$('form#query_form').attr('action', '<%= _report_time_entries_path(@project, nil) %>');
hideModal(this);
});
});
<% end %>