Initial Redmine tooling and local plugin forks

This commit is contained in:
Jason Thistlethwaite
2026-04-24 22:01:18 +00:00
commit 9f682af0eb
683 changed files with 56878 additions and 0 deletions
@@ -0,0 +1,18 @@
<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>
@@ -0,0 +1,12 @@
<h2><%= l(:label_crm_csv_import) %></h2>
<%= form_tag(importer_link, :multipart => true, :project => @project) do %>
<%= error_messages_for @import %>
<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 + " &#187;".html_safe, :name => nil %></p>
<% end %>
@@ -0,0 +1,12 @@
<h2><%= l(:label_crm_csv_import) %></h2>
<%= render :partial => "importers/mapping/#{@import.klass.name.downcase}" %>
<%= javascript_tag do %>
$(document).ready(function() {
$('#import-form').submit(function(){
$('#import-details').show().addClass('ajax-loading');
$('#import-progress').progressbar({value: 0, max: <%= @import.total_items || 0 %>});
});
});
<% end %>
@@ -0,0 +1,10 @@
<%= form_tag(mapping_project_contact_import_path(:id => @import, :project => @project), :id => "import-form") do %>
<fieldset class="box tabular">
<legend><%= l(:label_fields_mapping) %></legend>
<div id="fields-mapping">
<%= render :partial => 'importers/mapping/contact_fields_mapping' %>
</div>
</fieldset>
<%= render :partial => 'importers/preview' %>
<% end %>
@@ -0,0 +1,86 @@
<div class="splitcontent">
<div class="splitcontentleft">
<p>
<label><%= l(:field_is_company) %></label>
<%= mapping_select_tag @import, 'is_company' %>
</p>
<p>
<label><%= l(:field_first_name) %></label>
<%= mapping_select_tag @import, 'first_name', :required => true %>
</p>
<p>
<label><%= l(:field_middle_name) %></label>
<%= mapping_select_tag @import, 'middle_name' %>
</p>
<p>
<label><%= l(:field_last_name) %></label>
<%= mapping_select_tag @import, 'last_name' %>
</p>
<p>
<label><%= l(:field_job_title) %></label>
<%= mapping_select_tag @import, 'job_title' %>
</p>
<p>
<label><%= l(:field_company) %></label>
<%= mapping_select_tag @import, 'company' %>
</p>
<p>
<label><%= l(:field_phone) %></label>
<%= mapping_select_tag @import, 'phone' %>
</p>
<p>
<label><%= l(:field_email) %></label>
<%= mapping_select_tag @import, 'email' %>
</p>
<p>
<label><%= l(:field_tags) %></label>
<%= mapping_select_tag @import, 'tag_list' %>
</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(:label_crm_address) %></label>
<%= mapping_select_tag @import, 'address_street' %>
</p>
<p>
<label><%= l(:label_crm_city) %></label>
<%= mapping_select_tag @import, 'address_city' %>
</p>
<p>
<label><%= l(:label_crm_region) %></label>
<%= mapping_select_tag @import, 'address_state' %>
</p>
<p>
<label><%= l(:label_crm_postcode) %></label>
<%= mapping_select_tag @import, 'address_zip' %>
</p>
<p>
<label><%= l(:label_crm_country_code) %></label>
<%= mapping_select_tag @import, 'address_country_code' %>
</p>
<p>
<label><%= l(:field_contact_skype) %></label>
<%= mapping_select_tag @import, 'skype_name' %>
</p>
<p>
<label><%= l(:field_contact_website) %></label>
<%= mapping_select_tag @import, 'website' %>
</p>
<p>
<label><%= l(:field_birthday) %></label>
<%= mapping_select_tag @import, 'birthday' %>
</p>
<p>
<label><%= l(:field_background) %></label>
<%= mapping_select_tag @import, 'background' %>
</p>
</div>
</div>
@@ -0,0 +1,10 @@
<%= form_tag(mapping_project_deal_import_path(:id => @import, :project => @project), :id => "import-form") do %>
<fieldset class="box tabular">
<legend><%= l(:label_fields_mapping) %></legend>
<div id="fields-mapping">
<%= render :partial => 'importers/mapping/deal_fields_mapping' %>
</div>
</fieldset>
<%= render :partial => 'importers/preview' %>
<% end %>
@@ -0,0 +1,51 @@
<div class="splitcontent">
<div class="splitcontentleft">
<p>
<label><%= l(:field_deal_name) %></label>
<%= mapping_select_tag @import, 'name', :required => true %>
</p>
<p>
<label><%= l(:field_deal_background) %></label>
<%= mapping_select_tag @import, 'background' %>
</p>
<p>
<label><%= l(:field_currency) %></label>
<%= mapping_select_tag @import, 'currency' %>
</p>
<p>
<label><%= l(:field_deal_price) %></label>
<%= mapping_select_tag @import, 'price' %>
</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(:label_crm_probability) %></label>
<%= mapping_select_tag @import, 'probability' %>
</p>
<p>
<label><%= l(:field_contact_status) %></label>
<%= mapping_select_tag @import, 'status' %>
</p>
<p>
<label><%= l(:field_contact) %></label>
<%= mapping_select_tag @import, 'contact' %>
</p>
<p>
<label><%= l(:label_crm_assigned_to) %></label>
<%= mapping_select_tag @import, 'assigned_to' %>
</p>
<p>
<label><%= l(:field_category) %></label>
<%= mapping_select_tag @import, 'category' %>
</p>
</div>
</div>
@@ -0,0 +1,18 @@
<h2><%= l(:label_crm_csv_import) %></h2>
<%= labelled_form_for @importer, :url => {:action => 'create', :project_id => @project}, :html => { :multipart => true, :id => 'import_form'} do |f| %>
<%= error_messages_for 'importer' %>
<div class="box tabular">
<p><%= f.file_field :file, :label => l(:label_crm_csv_file), :accept => "text/csv" %></p>
<% if @importer.respond_to? :tag_list %>
<p id="add_tags" class="contacts-tags-edit">
<%= f.text_field :tag_list, :value => "import-#{Time.now.strftime('%Y-%m-%d-%H:%M:%S')}", :label => :field_add_tags, :size => 10 %><%= tagsedit_with_source_for("#contact_import_tag_list", auto_complete_contact_tags_path(:project_id => @project)) %>
</p>
<% end %>
<p>
<%= f.select :quotes_type, options_for_select([[l(:label_crm_double_quotes), "\""], [l(:label_crm_single_quotes),"'"]]), :label => :label_crm_quotes_type %>
</p>
</div>
<%= submit_tag l(:button_save) -%>
<% end -%>
@@ -0,0 +1,16 @@
<h2><%= l(:label_crm_csv_import) %></h2>
<div id="import-details">
<div id="import-progress"><div id="progress-label">0 / <%= @import.total_items.to_i %></div></div>
</div>
<%= javascript_tag do %>
$(document).ready(function() {
$('#import-details').addClass('ajax-loading');
$('#import-progress').progressbar({value: 0, max: <%= @import.total_items.to_i %>});
$.ajax({
url: '<%= importer_run_link(@import, @project) %>',
type: 'post'
});
});
<% end %>
@@ -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='<%= importer_show_link(@import, @project) %>';
<% else %>
$.ajax({
url: '<%= importer_run_link(@import, @project) %>',
type: 'post'
});
<% end %>
@@ -0,0 +1,26 @@
<h2><%= l(:label_crm_csv_import) %></h2>
<%= form_tag(importer_settings_link(@import, @project), :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 + " &#187;".html_safe, :name => nil %></p>
<% end %>
@@ -0,0 +1,26 @@
<h2><%= l(:label_crm_csv_import) %></h2>
<% if @import.unsaved_items.count == 0 %>
<p><%= l(:notice_import_finished, :count => @import.saved_items.count) %></p>
<ol>
<% @import.saved_objects.each do |imported_object| %>
<li><%= importer_link_to_object imported_object %></li>
<% end %>
</ul>
<% else %>
<p><%= l(:notice_import_finished_with_errors, :count => @import.unsaved_items.count, :total => @import.total_items) %></p>
<table id="unsaved-items" class="list">
<tr>
<th>Position</th>
<th>Message</th>
</tr>
<% @import.unsaved_items.each do |item| %>
<tr>
<td><%= item.position %></td>
<td><%= simple_format_without_paragraph item.message %></td>
</tr>
<% end %>
</table>
<% end %>