Redmine 3.4.4
This commit is contained in:
commit
64924a6376
2112 changed files with 259028 additions and 0 deletions
90
app/views/imports/_fields_mapping.html.erb
Normal file
90
app/views/imports/_fields_mapping.html.erb
Normal file
|
@ -0,0 +1,90 @@
|
|||
<p>
|
||||
<label><%= l(:label_project) %></label>
|
||||
<%= select_tag 'import_settings[mapping][project_id]',
|
||||
options_for_select(project_tree_options_for_select(@import.allowed_target_projects, :selected => @import.project)),
|
||||
:id => 'import_mapping_project_id' %>
|
||||
</p>
|
||||
<p>
|
||||
<label><%= l(:label_tracker) %></label>
|
||||
<%= mapping_select_tag @import, 'tracker', :required => true,
|
||||
:values => @import.allowed_target_trackers.sorted.map {|t| [t.name, t.id]} %>
|
||||
</p>
|
||||
<p>
|
||||
<label><%= l(:field_status) %></label>
|
||||
<%= mapping_select_tag @import, 'status' %>
|
||||
</p>
|
||||
|
||||
<div class="splitcontent">
|
||||
<div class="splitcontentleft">
|
||||
<p>
|
||||
<label><%= l(:field_subject) %></label>
|
||||
<%= mapping_select_tag @import, 'subject', :required => true %>
|
||||
</p>
|
||||
<p>
|
||||
<label><%= l(:field_description) %></label>
|
||||
<%= mapping_select_tag @import, 'description' %>
|
||||
</p>
|
||||
<p>
|
||||
<label><%= l(:field_priority) %></label>
|
||||
<%= mapping_select_tag @import, 'priority' %>
|
||||
</p>
|
||||
<p>
|
||||
<label><%= l(:field_category) %></label>
|
||||
<%= mapping_select_tag @import, 'category' %>
|
||||
<% if User.current.allowed_to?(:manage_categories, @import.project) %>
|
||||
<label class="block">
|
||||
<%= check_box_tag 'import_settings[mapping][create_categories]', '1', @import.create_categories? %>
|
||||
<%= l(:label_create_missing_values) %>
|
||||
</label>
|
||||
<% end %>
|
||||
</p>
|
||||
<p>
|
||||
<label><%= l(:field_assigned_to) %></label>
|
||||
<%= mapping_select_tag @import, 'assigned_to' %>
|
||||
</p>
|
||||
<p>
|
||||
<label><%= l(:field_fixed_version) %></label>
|
||||
<%= mapping_select_tag @import, 'fixed_version' %>
|
||||
<% if User.current.allowed_to?(:manage_versions, @import.project) %>
|
||||
<label class="block">
|
||||
<%= check_box_tag 'import_settings[mapping][create_versions]', '1', @import.create_versions? %>
|
||||
<%= l(:label_create_missing_values) %>
|
||||
</label>
|
||||
<% end %>
|
||||
</p>
|
||||
<% @custom_fields.each do |field| %>
|
||||
<p>
|
||||
<label><%= field.name %></label>
|
||||
<%= mapping_select_tag @import, "cf_#{field.id}" %>
|
||||
</p>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="splitcontentright">
|
||||
<p>
|
||||
<label><%= l(:field_is_private) %></label>
|
||||
<%= mapping_select_tag @import, 'is_private' %>
|
||||
</p>
|
||||
<p>
|
||||
<label><%= l(:field_parent_issue) %></label>
|
||||
<%= mapping_select_tag @import, 'parent_issue_id' %>
|
||||
</p>
|
||||
<p>
|
||||
<label><%= l(:field_start_date) %></label>
|
||||
<%= mapping_select_tag @import, 'start_date' %>
|
||||
</p>
|
||||
<p>
|
||||
<label><%= l(:field_due_date) %></label>
|
||||
<%= mapping_select_tag @import, 'due_date' %>
|
||||
</p>
|
||||
<p>
|
||||
<label><%= l(:field_estimated_hours) %></label>
|
||||
<%= mapping_select_tag @import, 'estimated_hours' %>
|
||||
</p>
|
||||
<p>
|
||||
<label><%= l(:field_done_ratio) %></label>
|
||||
<%= mapping_select_tag @import, 'done_ratio' %>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
52
app/views/imports/mapping.html.erb
Normal file
52
app/views/imports/mapping.html.erb
Normal file
|
@ -0,0 +1,52 @@
|
|||
<h2><%= l(:label_import_issues) %></h2>
|
||||
|
||||
<%= form_tag(import_mapping_path(@import), :id => "import-form") do %>
|
||||
<fieldset class="box tabular">
|
||||
<legend><%= l(:label_fields_mapping) %></legend>
|
||||
<div id="fields-mapping">
|
||||
<%= render :partial => 'fields_mapping' %>
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
<div class="autoscroll">
|
||||
<fieldset class="box">
|
||||
<legend><%= l(:label_file_content_preview) %></legend>
|
||||
|
||||
<table class="sample-data">
|
||||
<% @import.first_rows.each do |row| %>
|
||||
<tr>
|
||||
<%= row.map {|c| content_tag 'td', truncate(c.to_s, :length => 50) }.join("").html_safe %>
|
||||
</tr>
|
||||
<% end %>
|
||||
</table>
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
<p>
|
||||
<%= button_tag("\xc2\xab " + l(:label_previous), :name => 'previous') %>
|
||||
<%= submit_tag l(:button_import) %>
|
||||
</p>
|
||||
<% end %>
|
||||
|
||||
<% content_for :sidebar do %>
|
||||
<%= render :partial => 'issues/sidebar' %>
|
||||
<% end %>
|
||||
|
||||
|
||||
<%= javascript_tag do %>
|
||||
$(document).ready(function() {
|
||||
$('#fields-mapping').on('change', '#import_mapping_project_id, #import_mapping_tracker', function(){
|
||||
$.ajax({
|
||||
url: '<%= import_mapping_path(@import, :format => 'js') %>',
|
||||
type: 'post',
|
||||
data: $('#import-form').serialize()
|
||||
});
|
||||
});
|
||||
|
||||
$('#import-form').submit(function(){
|
||||
$('#import-details').show().addClass('ajax-loading');
|
||||
$('#import-progress').progressbar({value: 0, max: <%= @import.total_items || 0 %>});
|
||||
});
|
||||
|
||||
});
|
||||
<% end %>
|
1
app/views/imports/mapping.js.erb
Normal file
1
app/views/imports/mapping.js.erb
Normal file
|
@ -0,0 +1 @@
|
|||
$('#fields-mapping').html('<%= escape_javascript(render :partial => 'fields_mapping') %>');
|
15
app/views/imports/new.html.erb
Normal file
15
app/views/imports/new.html.erb
Normal file
|
@ -0,0 +1,15 @@
|
|||
<h2><%= l(:label_import_issues) %></h2>
|
||||
|
||||
<%= form_tag(imports_path, :multipart => true) do %>
|
||||
<fieldset class="box">
|
||||
<legend><%= l(:label_select_file_to_import) %> (CSV)</legend>
|
||||
<p>
|
||||
<%= file_field_tag 'file' %>
|
||||
</p>
|
||||
</fieldset>
|
||||
<p><%= submit_tag l(:label_next).html_safe + " »".html_safe, :name => nil %></p>
|
||||
<% end %>
|
||||
|
||||
<% content_for :sidebar do %>
|
||||
<%= render :partial => 'issues/sidebar' %>
|
||||
<% end %>
|
20
app/views/imports/run.html.erb
Normal file
20
app/views/imports/run.html.erb
Normal file
|
@ -0,0 +1,20 @@
|
|||
<h2><%= l(:label_import_issues) %></h2>
|
||||
|
||||
<div id="import-details">
|
||||
<div id="import-progress"><div id="progress-label">0 / <%= @import.total_items.to_i %></div></div>
|
||||
</div>
|
||||
|
||||
<% content_for :sidebar do %>
|
||||
<%= render :partial => 'issues/sidebar' %>
|
||||
<% end %>
|
||||
|
||||
<%= javascript_tag do %>
|
||||
$(document).ready(function() {
|
||||
$('#import-details').addClass('ajax-loading');
|
||||
$('#import-progress').progressbar({value: 0, max: <%= @import.total_items.to_i %>});
|
||||
$.ajax({
|
||||
url: '<%= import_run_path(@import, :format => 'js') %>',
|
||||
type: 'post'
|
||||
});
|
||||
});
|
||||
<% end %>
|
11
app/views/imports/run.js.erb
Normal file
11
app/views/imports/run.js.erb
Normal file
|
@ -0,0 +1,11 @@
|
|||
$('#import-progress').progressbar({value: <%= @current.to_i %>});
|
||||
$('#progress-label').text("<%= @current.to_i %> / <%= @import.total_items.to_i %>");
|
||||
|
||||
<% if @import.finished? %>
|
||||
window.location.href='<%= import_path(@import) %>';
|
||||
<% else %>
|
||||
$.ajax({
|
||||
url: '<%= import_run_path(@import, :format => 'js') %>',
|
||||
type: 'post'
|
||||
});
|
||||
<% end %>
|
30
app/views/imports/settings.html.erb
Normal file
30
app/views/imports/settings.html.erb
Normal file
|
@ -0,0 +1,30 @@
|
|||
<h2><%= l(:label_import_issues) %></h2>
|
||||
|
||||
<%= form_tag(import_settings_path(@import), :id => "import-form") do %>
|
||||
<fieldset class="box tabular">
|
||||
<legend><%= l(:label_options) %></legend>
|
||||
<p>
|
||||
<label><%= l(:label_fields_separator) %></label>
|
||||
<%= select_tag 'import_settings[separator]',
|
||||
options_for_select([[l(:label_comma_char), ','], [l(:label_semi_colon_char), ';']], @import.settings['separator']) %>
|
||||
</p>
|
||||
<p>
|
||||
<label><%= l(:label_fields_wrapper) %></label>
|
||||
<%= select_tag 'import_settings[wrapper]',
|
||||
options_for_select([[l(:label_quote_char), "'"], [l(:label_double_quote_char), '"']], @import.settings['wrapper']) %>
|
||||
</p>
|
||||
<p>
|
||||
<label><%= l(:label_encoding) %></label>
|
||||
<%= select_tag 'import_settings[encoding]', options_for_select(Setting::ENCODINGS, @import.settings['encoding']) %>
|
||||
</p>
|
||||
<p>
|
||||
<label><%= l(:setting_date_format) %></label>
|
||||
<%= select_tag 'import_settings[date_format]', options_for_select(date_format_options, @import.settings['date_format']) %>
|
||||
</p>
|
||||
</fieldset>
|
||||
<p><%= submit_tag l(:label_next).html_safe + " »".html_safe, :name => nil %></p>
|
||||
<% end %>
|
||||
|
||||
<% content_for :sidebar do %>
|
||||
<%= render :partial => 'issues/sidebar' %>
|
||||
<% end %>
|
38
app/views/imports/show.html.erb
Normal file
38
app/views/imports/show.html.erb
Normal file
|
@ -0,0 +1,38 @@
|
|||
<h2><%= l(:label_import_issues) %></h2>
|
||||
|
||||
<% if @import.saved_items.count > 0 %>
|
||||
<p><%= l(:notice_import_finished, :count => @import.saved_items.count) %>:</p>
|
||||
|
||||
<ul id="saved-items">
|
||||
<% @import.saved_objects.each do |issue| %>
|
||||
<li><%= link_to_issue issue %></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
|
||||
<p><%= link_to l(:label_issue_view_all), issues_path(:set_filter => 1, :status_id => '*', :issue_id => @import.saved_objects.map(&:id).join(',')) %></p>
|
||||
<% end %>
|
||||
|
||||
<% if @import.unsaved_items.count > 0 %>
|
||||
<p><%= l(:notice_import_finished_with_errors, :count => @import.unsaved_items.count, :total => @import.total_items) %>:</p>
|
||||
|
||||
<table id="unsaved-items" class="list">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Position</th>
|
||||
<th>Message</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @import.unsaved_items.each do |item| %>
|
||||
<tr>
|
||||
<td><%= item.position %></td>
|
||||
<td><%= simple_format_without_paragraph item.message %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
<% end %>
|
||||
|
||||
<% content_for :sidebar do %>
|
||||
<%= render :partial => 'issues/sidebar' %>
|
||||
<% end %>
|
Loading…
Add table
Add a link
Reference in a new issue