redmine_extensions 0.1.15 → 0.1.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (134) hide show
  1. checksums.yaml +4 -4
  2. data/lib/generators/redmine_extensions/entity/entity_generator.rb +21 -24
  3. data/lib/generators/redmine_extensions/entity/templates/_form.html.erb.erb +4 -0
  4. data/lib/generators/redmine_extensions/entity/templates/_sidebar.html.erb.erb +1 -1
  5. data/lib/generators/redmine_extensions/entity/templates/context_menu.html.erb.erb +1 -1
  6. data/lib/generators/redmine_extensions/entity/templates/controller.rb.erb +19 -16
  7. data/lib/generators/redmine_extensions/entity/templates/custom_field.rb.erb +7 -7
  8. data/lib/generators/redmine_extensions/entity/templates/edit.js.erb.erb +10 -9
  9. data/lib/generators/redmine_extensions/entity/templates/en.yml.erb +1 -2
  10. data/lib/generators/redmine_extensions/entity/templates/index.api.rsb.erb +5 -5
  11. data/lib/generators/redmine_extensions/entity/templates/index.html.erb.erb +2 -0
  12. data/lib/generators/redmine_extensions/entity/templates/index.js.erb.erb +7 -6
  13. data/lib/generators/redmine_extensions/entity/templates/mail_added.html.erb.erb +1 -1
  14. data/lib/generators/redmine_extensions/entity/templates/mail_added.text.erb.erb +2 -2
  15. data/lib/generators/redmine_extensions/entity/templates/mail_updated.text.erb.erb +2 -2
  16. data/lib/generators/redmine_extensions/entity/templates/migration.rb.erb +3 -1
  17. data/lib/generators/redmine_extensions/entity/templates/model.rb.erb +4 -4
  18. data/lib/generators/redmine_extensions/entity/templates/new.js.erb.erb +10 -9
  19. data/lib/generators/redmine_extensions/entity/templates/query.rb.erb +8 -5
  20. data/lib/generators/redmine_extensions/entity/templates/routes.rb.erb +12 -12
  21. data/lib/generators/redmine_extensions/entity/templates/show.html.erb.erb +37 -37
  22. data/lib/generators/redmine_extensions/entity/templates/show.js.erb.erb +7 -6
  23. data/lib/generators/redmine_extensions/plugin/plugin_generator.rb +3 -1
  24. data/lib/generators/redmine_extensions/plugin/templates/after_init.rb.erb +22 -0
  25. data/lib/generators/redmine_extensions/plugin/templates/init.rb.erb +4 -22
  26. data/lib/generators/redmine_extensions/plugin/templates/javascript.js +1 -0
  27. data/lib/generators/redmine_extensions/plugin/templates/stylesheet.css +3 -0
  28. data/lib/redmine_extensions/version.rb +1 -1
  29. metadata +12 -216
  30. data/app/assets/javascripts/redmine_extensions/redmine_extensions.js.orig +0 -648
  31. data/app/views/easy_entity_assignments/_query_index.html.erb.orig +0 -16
  32. data/lib/redmine_extensions/redmine_patches/controllers/issues_controller_patch.rb +0 -9
  33. data/lib/redmine_extensions/version.rb.orig +0 -7
  34. data/spec/redmine/app/controllers/custom_field_enumerations_controller.rb +0 -75
  35. data/spec/redmine/app/controllers/imports_controller.rb +0 -121
  36. data/spec/redmine/app/helpers/imports_helper.rb +0 -47
  37. data/spec/redmine/app/models/custom_field_enumeration.rb +0 -90
  38. data/spec/redmine/app/models/import.rb +0 -249
  39. data/spec/redmine/app/models/import_item.rb +0 -22
  40. data/spec/redmine/app/models/issue_import.rb +0 -186
  41. data/spec/redmine/app/views/attachments/image.html.erb +0 -3
  42. data/spec/redmine/app/views/attachments/other.html.erb +0 -3
  43. data/spec/redmine/app/views/common/_image.html.erb +0 -1
  44. data/spec/redmine/app/views/common/_other.html.erb +0 -1
  45. data/spec/redmine/app/views/custom_field_enumerations/create.js.erb +0 -2
  46. data/spec/redmine/app/views/custom_field_enumerations/destroy.html.erb +0 -14
  47. data/spec/redmine/app/views/custom_field_enumerations/index.html.erb +0 -47
  48. data/spec/redmine/app/views/custom_fields/formats/_enumeration.erb +0 -12
  49. data/spec/redmine/app/views/imports/_fields_mapping.html.erb +0 -90
  50. data/spec/redmine/app/views/imports/mapping.html.erb +0 -52
  51. data/spec/redmine/app/views/imports/mapping.js.erb +0 -1
  52. data/spec/redmine/app/views/imports/new.html.erb +0 -15
  53. data/spec/redmine/app/views/imports/run.html.erb +0 -20
  54. data/spec/redmine/app/views/imports/run.js.erb +0 -11
  55. data/spec/redmine/app/views/imports/settings.html.erb +0 -30
  56. data/spec/redmine/app/views/imports/show.html.erb +0 -38
  57. data/spec/redmine/app/views/layouts/_file.html.erb +0 -15
  58. data/spec/redmine/app/views/mailer/security_notification.html.erb +0 -13
  59. data/spec/redmine/app/views/mailer/security_notification.text.erb +0 -8
  60. data/spec/redmine/app/views/mailer/settings_updated.html.erb +0 -14
  61. data/spec/redmine/app/views/mailer/settings_updated.text.erb +0 -12
  62. data/spec/redmine/app/views/queries/_query_form.html.erb +0 -62
  63. data/spec/redmine/app/views/repositories/_changeset.html.erb +0 -40
  64. data/spec/redmine/app/views/search/index.api.rsb +0 -12
  65. data/spec/redmine/app/views/settings/_api.html.erb +0 -10
  66. data/spec/redmine/app/views/settings/_attachments.html.erb +0 -21
  67. data/spec/redmine/app/views/wiki/_new_modal.html.erb +0 -21
  68. data/spec/redmine/app/views/wiki/new.html.erb +0 -17
  69. data/spec/redmine/app/views/wiki/new.js.erb +0 -2
  70. data/spec/redmine/appveyor.yml +0 -36
  71. data/spec/redmine/db/migrate/20150725112753_insert_allowed_statuses_for_new_issues.rb +0 -23
  72. data/spec/redmine/db/migrate/20150730122707_create_imports.rb +0 -13
  73. data/spec/redmine/db/migrate/20150730122735_create_import_items.rb +0 -10
  74. data/spec/redmine/db/migrate/20150921204850_change_time_entries_comments_limit_to_1024.rb +0 -9
  75. data/spec/redmine/db/migrate/20150921210243_change_wiki_contents_comments_limit_to_1024.rb +0 -11
  76. data/spec/redmine/db/migrate/20151020182334_change_attachments_filesize_limit_to_8.rb +0 -9
  77. data/spec/redmine/db/migrate/20151020182731_fix_comma_in_user_format_setting_value.rb +0 -13
  78. data/spec/redmine/db/migrate/20151021184614_change_issue_categories_name_limit_to_60.rb +0 -9
  79. data/spec/redmine/db/migrate/20151021185456_change_auth_sources_filter_to_text.rb +0 -9
  80. data/spec/redmine/db/migrate/20151021190616_change_user_preferences_hide_mail_default_to_true.rb +0 -9
  81. data/spec/redmine/db/migrate/20151024082034_add_tokens_updated_on.rb +0 -10
  82. data/spec/redmine/db/migrate/20151025072118_create_custom_field_enumerations.rb +0 -10
  83. data/spec/redmine/db/migrate/20151031095005_add_projects_default_version_id.rb +0 -12
  84. data/spec/redmine/db/migrate/20160404080304_force_password_reset_during_setup.rb +0 -9
  85. data/spec/redmine/db/migrate/20160416072926_remove_position_defaults.rb +0 -13
  86. data/spec/redmine/db/migrate/20160529063352_add_roles_settings.rb +0 -5
  87. data/spec/redmine/lib/redmine/acts/positioned.rb +0 -118
  88. data/spec/redmine/lib/redmine/helpers/url.rb +0 -35
  89. data/spec/redmine/lib/redmine/hook/listener.rb +0 -32
  90. data/spec/redmine/lib/redmine/hook/view_listener.rb +0 -78
  91. data/spec/redmine/log/test.log +0 -2
  92. data/spec/redmine/plugins/dummy_plugin/Gemfile +0 -1
  93. data/spec/redmine/plugins/dummy_plugin/app/controllers/dummy_autocompletes_controller.rb +0 -4
  94. data/spec/redmine/plugins/dummy_plugin/app/views/dummy_autocompletes/index.html.erb +0 -3
  95. data/spec/redmine/plugins/dummy_plugin/config/locales/en.yml +0 -2
  96. data/spec/redmine/plugins/dummy_plugin/config/routes.rb +0 -1
  97. data/spec/redmine/plugins/dummy_plugin/init.rb +0 -34
  98. data/spec/redmine/plugins/dummy_plugin/lib/dummy_plugin/easy_patch/redmine/controllers/issues_controller_patch.example +0 -30
  99. data/spec/redmine/plugins/dummy_plugin/lib/dummy_plugin/easy_patch/redmine/helpers/issues_helper_patch.example +0 -30
  100. data/spec/redmine/plugins/dummy_plugin/lib/dummy_plugin/easy_patch/redmine/models/issue_patch.example +0 -30
  101. data/spec/redmine/plugins/dummy_plugin/lib/dummy_plugin/hooks.rb +0 -5
  102. data/spec/redmine/plugins/dummy_plugin/lib/dummy_plugin/internals.rb +0 -4
  103. data/spec/redmine/public/images/jstoolbar/bt_precode.png +0 -0
  104. data/spec/redmine/public/images/reorder.png +0 -0
  105. data/spec/redmine/public/javascripts/jquery-1.11.1-ui-1.11.0-ujs-3.1.4.js +0 -21
  106. data/spec/redmine/public/javascripts/redmine_extensions/application.js +0 -13
  107. data/spec/redmine/public/javascripts/redmine_extensions/easy_togglers.js +0 -58
  108. data/spec/redmine/public/javascripts/redmine_extensions/jquery.entityarray.js +0 -130
  109. data/spec/redmine/public/javascripts/redmine_extensions/redmine_extensions.js +0 -642
  110. data/spec/redmine/public/javascripts/responsive.js +0 -83
  111. data/spec/redmine/public/stylesheets/responsive.css +0 -799
  112. data/spec/redmine/test/fixtures/files/import_dates.csv +0 -4
  113. data/spec/redmine/test/fixtures/files/import_iso8859-1.csv +0 -3
  114. data/spec/redmine/test/fixtures/files/import_issues.csv +0 -4
  115. data/spec/redmine/test/fixtures/ldap/slapd.centos6.conf +0 -24
  116. data/spec/redmine/test/fixtures/ldap/slapd.ubuntu.12.04.conf +0 -23
  117. data/spec/redmine/test/fixtures/mail_handler/issue_update_with_cc.eml +0 -19
  118. data/spec/redmine/test/fixtures/mail_handler/ticket_on_project_given_by_to_header.eml +0 -60
  119. data/spec/redmine/test/fixtures/mail_handler/ticket_with_text_attachment_iso-8859-2.eml +0 -31
  120. data/spec/redmine/test/functional/custom_field_enumerations_controller_test.rb +0 -115
  121. data/spec/redmine/test/functional/imports_controller_test.rb +0 -205
  122. data/spec/redmine/test/functional/sessions_controller_test.rb +0 -138
  123. data/spec/redmine/test/integration/api_test/search_test.rb +0 -92
  124. data/spec/redmine/test/integration/routing/imports_test.rb +0 -36
  125. data/spec/redmine/test/integration/sessions_test.rb +0 -97
  126. data/spec/redmine/test/ui/custom_fields_test_ui.rb +0 -38
  127. data/spec/redmine/test/unit/attachment_transaction_test.rb +0 -76
  128. data/spec/redmine/test/unit/helpers/journals_helper_test.rb +0 -48
  129. data/spec/redmine/test/unit/helpers/wiki_helper_test.rb +0 -45
  130. data/spec/redmine/test/unit/issue_import_test.rb +0 -178
  131. data/spec/redmine/test/unit/lib/redmine/acts/positioned_with_scope_test.rb +0 -53
  132. data/spec/redmine/test/unit/lib/redmine/acts/positioned_without_scope_test.rb +0 -55
  133. data/spec/redmine/test/unit/lib/redmine/field_format/enumeration_format_test.rb +0 -91
  134. data/spec/support/easy_queries_helpers.rb +0 -0
@@ -1,22 +0,0 @@
1
- # Redmine - project management software
2
- # Copyright (C) 2006-2016 Jean-Philippe Lang
3
- #
4
- # This program is free software; you can redistribute it and/or
5
- # modify it under the terms of the GNU General Public License
6
- # as published by the Free Software Foundation; either version 2
7
- # of the License, or (at your option) any later version.
8
- #
9
- # This program is distributed in the hope that it will be useful,
10
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
11
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
- # GNU General Public License for more details.
13
- #
14
- # You should have received a copy of the GNU General Public License
15
- # along with this program; if not, write to the Free Software
16
- # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17
-
18
- class ImportItem < ActiveRecord::Base
19
- belongs_to :import
20
-
21
- validates_presence_of :import_id, :position
22
- end
@@ -1,186 +0,0 @@
1
- # Redmine - project management software
2
- # Copyright (C) 2006-2016 Jean-Philippe Lang
3
- #
4
- # This program is free software; you can redistribute it and/or
5
- # modify it under the terms of the GNU General Public License
6
- # as published by the Free Software Foundation; either version 2
7
- # of the License, or (at your option) any later version.
8
- #
9
- # This program is distributed in the hope that it will be useful,
10
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
11
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
- # GNU General Public License for more details.
13
- #
14
- # You should have received a copy of the GNU General Public License
15
- # along with this program; if not, write to the Free Software
16
- # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17
-
18
- class IssueImport < Import
19
-
20
- # Returns the objects that were imported
21
- def saved_objects
22
- object_ids = saved_items.pluck(:obj_id)
23
- objects = Issue.where(:id => object_ids).order(:id).preload(:tracker, :priority, :status)
24
- end
25
-
26
- # Returns a scope of projects that user is allowed to
27
- # import issue to
28
- def allowed_target_projects
29
- Project.allowed_to(user, :import_issues)
30
- end
31
-
32
- def project
33
- project_id = mapping['project_id'].to_i
34
- allowed_target_projects.find_by_id(project_id) || allowed_target_projects.first
35
- end
36
-
37
- # Returns a scope of trackers that user is allowed to
38
- # import issue to
39
- def allowed_target_trackers
40
- Issue.allowed_target_trackers(project, user)
41
- end
42
-
43
- def tracker
44
- if mapping['tracker'].to_s =~ /\Avalue:(\d+)\z/
45
- tracker_id = $1.to_i
46
- allowed_target_trackers.find_by_id(tracker_id)
47
- end
48
- end
49
-
50
- # Returns true if missing categories should be created during the import
51
- def create_categories?
52
- user.allowed_to?(:manage_categories, project) &&
53
- mapping['create_categories'] == '1'
54
- end
55
-
56
- # Returns true if missing versions should be created during the import
57
- def create_versions?
58
- user.allowed_to?(:manage_versions, project) &&
59
- mapping['create_versions'] == '1'
60
- end
61
-
62
- def mappable_custom_fields
63
- if tracker
64
- issue = Issue.new
65
- issue.project = project
66
- issue.tracker = tracker
67
- issue.editable_custom_field_values(user).map(&:custom_field)
68
- elsif project
69
- project.all_issue_custom_fields
70
- else
71
- []
72
- end
73
- end
74
-
75
- private
76
-
77
- def build_object(row)
78
- issue = Issue.new
79
- issue.author = user
80
- issue.notify = false
81
-
82
- tracker_id = nil
83
- if tracker
84
- tracker_id = tracker.id
85
- elsif tracker_name = row_value(row, 'tracker')
86
- tracker_id = allowed_target_trackers.named(tracker_name).first.try(:id)
87
- end
88
-
89
- attributes = {
90
- 'project_id' => mapping['project_id'],
91
- 'tracker_id' => tracker_id,
92
- 'subject' => row_value(row, 'subject'),
93
- 'description' => row_value(row, 'description')
94
- }
95
- if status_name = row_value(row, 'status')
96
- if status_id = IssueStatus.named(status_name).first.try(:id)
97
- attributes['status_id'] = status_id
98
- end
99
- end
100
- issue.send :safe_attributes=, attributes, user
101
-
102
- attributes = {}
103
- if priority_name = row_value(row, 'priority')
104
- if priority_id = IssuePriority.active.named(priority_name).first.try(:id)
105
- attributes['priority_id'] = priority_id
106
- end
107
- end
108
- if issue.project && category_name = row_value(row, 'category')
109
- if category = issue.project.issue_categories.named(category_name).first
110
- attributes['category_id'] = category.id
111
- elsif create_categories?
112
- category = issue.project.issue_categories.build
113
- category.name = category_name
114
- if category.save
115
- attributes['category_id'] = category.id
116
- end
117
- end
118
- end
119
- if assignee_name = row_value(row, 'assigned_to')
120
- if assignee = Principal.detect_by_keyword(issue.assignable_users, assignee_name)
121
- attributes['assigned_to_id'] = assignee.id
122
- end
123
- end
124
- if issue.project && version_name = row_value(row, 'fixed_version')
125
- if version = issue.project.versions.named(version_name).first
126
- attributes['fixed_version_id'] = version.id
127
- elsif create_versions?
128
- version = issue.project.versions.build
129
- version.name = version_name
130
- if version.save
131
- attributes['fixed_version_id'] = version.id
132
- end
133
- end
134
- end
135
- if is_private = row_value(row, 'is_private')
136
- if yes?(is_private)
137
- attributes['is_private'] = '1'
138
- end
139
- end
140
- if parent_issue_id = row_value(row, 'parent_issue_id')
141
- if parent_issue_id =~ /\A(#)?(\d+)\z/
142
- parent_issue_id = $2
143
- if $1
144
- attributes['parent_issue_id'] = parent_issue_id
145
- elsif issue_id = items.where(:position => parent_issue_id).first.try(:obj_id)
146
- attributes['parent_issue_id'] = issue_id
147
- end
148
- else
149
- attributes['parent_issue_id'] = parent_issue_id
150
- end
151
- end
152
- if start_date = row_date(row, 'start_date')
153
- attributes['start_date'] = start_date
154
- end
155
- if due_date = row_date(row, 'due_date')
156
- attributes['due_date'] = due_date
157
- end
158
- if estimated_hours = row_value(row, 'estimated_hours')
159
- attributes['estimated_hours'] = estimated_hours
160
- end
161
- if done_ratio = row_value(row, 'done_ratio')
162
- attributes['done_ratio'] = done_ratio
163
- end
164
-
165
- attributes['custom_field_values'] = issue.custom_field_values.inject({}) do |h, v|
166
- value = case v.custom_field.field_format
167
- when 'date'
168
- row_date(row, "cf_#{v.custom_field.id}")
169
- else
170
- row_value(row, "cf_#{v.custom_field.id}")
171
- end
172
- if value
173
- h[v.custom_field.id.to_s] = v.custom_field.value_from_keyword(value, issue)
174
- end
175
- h
176
- end
177
-
178
- issue.send :safe_attributes=, attributes, user
179
-
180
- if issue.tracker_id != tracker_id
181
- issue.tracker_id = nil
182
- end
183
-
184
- issue
185
- end
186
- end
@@ -1,3 +0,0 @@
1
- <%= render :layout => 'layouts/file' do %>
2
- <%= render :partial => 'common/image', :locals => {:path => download_named_attachment_url(@attachment, @attachment.filename), :alt => @attachment.filename} %>
3
- <% end %>
@@ -1,3 +0,0 @@
1
- <%= render :layout => 'layouts/file' do %>
2
- <%= render :partial => 'common/other' %>
3
- <% end %>
@@ -1 +0,0 @@
1
- <%= image_tag path, :alt => alt, :class => 'filecontent image' %>
@@ -1 +0,0 @@
1
- <p class="nodata"><%= l(:label_no_preview) %></p>
@@ -1,2 +0,0 @@
1
- $('#content').html('<%= escape_javascript(render(:template => 'custom_field_enumerations/index')) %>');
2
- $('#custom_field_enumeration_name').focus();
@@ -1,14 +0,0 @@
1
- <%= title [l(:label_custom_field_plural), custom_fields_path],
2
- [l(@custom_field.type_name), custom_fields_path(:tab => @custom_field.class.name)],
3
- @custom_field.name %>
4
-
5
- <%= form_tag(custom_field_enumeration_path(@custom_field, @value), :method => :delete) do %>
6
- <div class="box">
7
- <p><strong><%= l(:text_enumeration_destroy_question, :name => @value.name, :count => @value.objects_count) %></strong></p>
8
- <p><label for='reassign_to_id'><%= l(:text_enumeration_category_reassign_to) %></label>
9
- <%= select_tag('reassign_to_id', content_tag('option', "--- #{l(:actionview_instancetag_blank_option)} ---", :value => '') + options_from_collection_for_select(@enumerations, 'id', 'name')) %></p>
10
- </div>
11
-
12
- <%= submit_tag l(:button_apply) %>
13
- <%= link_to l(:button_cancel), custom_field_enumerations_path(@custom_field) %>
14
- <% end %>
@@ -1,47 +0,0 @@
1
- <%= custom_field_title @custom_field %>
2
-
3
- <% if @custom_field.enumerations.any? %>
4
- <%= form_tag custom_field_enumerations_path(@custom_field), :method => 'put' do %>
5
- <div class="box">
6
- <ul id="custom_field_enumerations" class="flat">
7
- <% @custom_field.enumerations.each_with_index do |value, position| %>
8
- <li>
9
- <span class="sort-handle"></span>
10
- <%= hidden_field_tag "custom_field_enumerations[#{value.id}][position]", position, :class => 'position' %>
11
- <%= text_field_tag "custom_field_enumerations[#{value.id}][name]", value.name, :size => 40 %>
12
- <%= hidden_field_tag "custom_field_enumerations[#{value.id}][active]", 0 %>
13
- <label>
14
- <%= check_box_tag "custom_field_enumerations[#{value.id}][active]", 1, value.active? %>
15
- <%= l(:field_active) %>
16
- </label>
17
- <%= delete_link custom_field_enumeration_path(@custom_field, value) %>
18
- </li>
19
- <% end %>
20
- </ul>
21
- </div>
22
- <p>
23
- <%= submit_tag(l(:button_save)) %> |
24
- <%= link_to l(:button_back), edit_custom_field_path(@custom_field) %>
25
- </p>
26
- <% end %>
27
- <% end %>
28
-
29
- <p><%= l(:label_enumeration_new) %></p>
30
-
31
- <%= form_tag custom_field_enumerations_path(@custom_field), :method => 'post', :remote => true do %>
32
- <p><%= text_field_tag 'custom_field_enumeration[name]', '', :size => 40 %>
33
- <%= submit_tag(l(:button_add)) %></p>
34
- <% end %>
35
-
36
- <%= javascript_tag do %>
37
- $(function() {
38
- $("#custom_field_enumerations").sortable({
39
- handle: ".sort-handle",
40
- update: function(event, ui) {
41
- $("#custom_field_enumerations li").each(function(){
42
- $(this).find("input.position").val($(this).index()+1);
43
- });
44
- }
45
- });
46
- });
47
- <% end %>
@@ -1,12 +0,0 @@
1
- <% unless @custom_field.new_record? %>
2
- <p>
3
- <label><%= l(:field_possible_values) %></label>
4
- <%= link_to l(:button_edit), custom_field_enumerations_path(@custom_field), :class => 'icon icon-edit' %>
5
- </p>
6
- <% if @custom_field.enumerations.active.any? %>
7
- <p><%= f.select :default_value, @custom_field.enumerations.active.map{|v| [v.name, v.id.to_s]}, :include_blank => true %></p>
8
- <% end %>
9
- <% end %>
10
-
11
- <p><%= f.text_field :url_pattern, :size => 50, :label => :label_link_values_to %></p>
12
- <p><%= edit_tag_style_tag f %></p>
@@ -1,90 +0,0 @@
1
- <p>
2
- <label><%= l(:label_project) %></label>
3
- <%= select_tag 'import_settings[mapping][project_id]',
4
- options_for_select(project_tree_options_for_select(@import.allowed_target_projects, :selected => @import.project)),
5
- :id => 'import_mapping_project_id' %>
6
- </p>
7
- <p>
8
- <label><%= l(:label_tracker) %></label>
9
- <%= mapping_select_tag @import, 'tracker', :required => true,
10
- :values => @import.allowed_target_trackers.sorted.map {|t| [t.name, t.id]} %>
11
- </p>
12
- <p>
13
- <label><%= l(:field_status) %></label>
14
- <%= mapping_select_tag @import, 'status' %>
15
- </p>
16
-
17
- <div class="splitcontent">
18
- <div class="splitcontentleft">
19
- <p>
20
- <label><%= l(:field_subject) %></label>
21
- <%= mapping_select_tag @import, 'subject', :required => true %>
22
- </p>
23
- <p>
24
- <label><%= l(:field_description) %></label>
25
- <%= mapping_select_tag @import, 'description' %>
26
- </p>
27
- <p>
28
- <label><%= l(:field_priority) %></label>
29
- <%= mapping_select_tag @import, 'priority' %>
30
- </p>
31
- <p>
32
- <label><%= l(:field_category) %></label>
33
- <%= mapping_select_tag @import, 'category' %>
34
- <% if User.current.allowed_to?(:manage_categories, @import.project) %>
35
- <label class="block">
36
- <%= check_box_tag 'import_settings[mapping][create_categories]', '1', @import.create_categories? %>
37
- <%= l(:label_create_missing_values) %>
38
- </label>
39
- <% end %>
40
- </p>
41
- <p>
42
- <label><%= l(:field_assigned_to) %></label>
43
- <%= mapping_select_tag @import, 'assigned_to' %>
44
- </p>
45
- <p>
46
- <label><%= l(:field_fixed_version) %></label>
47
- <%= mapping_select_tag @import, 'fixed_version' %>
48
- <% if User.current.allowed_to?(:manage_versions, @import.project) %>
49
- <label class="block">
50
- <%= check_box_tag 'import_settings[mapping][create_versions]', '1', @import.create_versions? %>
51
- <%= l(:label_create_missing_values) %>
52
- </label>
53
- <% end %>
54
- </p>
55
- <% @custom_fields.each do |field| %>
56
- <p>
57
- <label><%= field.name %></label>
58
- <%= mapping_select_tag @import, "cf_#{field.id}" %>
59
- </p>
60
- <% end %>
61
- </div>
62
-
63
- <div class="splitcontentright">
64
- <p>
65
- <label><%= l(:field_is_private) %></label>
66
- <%= mapping_select_tag @import, 'is_private' %>
67
- </p>
68
- <p>
69
- <label><%= l(:field_parent_issue) %></label>
70
- <%= mapping_select_tag @import, 'parent_issue_id' %>
71
- </p>
72
- <p>
73
- <label><%= l(:field_start_date) %></label>
74
- <%= mapping_select_tag @import, 'start_date' %>
75
- </p>
76
- <p>
77
- <label><%= l(:field_due_date) %></label>
78
- <%= mapping_select_tag @import, 'due_date' %>
79
- </p>
80
- <p>
81
- <label><%= l(:field_estimated_hours) %></label>
82
- <%= mapping_select_tag @import, 'estimated_hours' %>
83
- </p>
84
- <p>
85
- <label><%= l(:field_done_ratio) %></label>
86
- <%= mapping_select_tag @import, 'done_ratio' %>
87
- </p>
88
- </div>
89
- </div>
90
-
@@ -1,52 +0,0 @@
1
- <h2><%= l(:label_import_issues) %></h2>
2
-
3
- <%= form_tag(import_mapping_path(@import), :id => "import-form") do %>
4
- <fieldset class="box tabular">
5
- <legend><%= l(:label_fields_mapping) %></legend>
6
- <div id="fields-mapping">
7
- <%= render :partial => 'fields_mapping' %>
8
- </div>
9
- </fieldset>
10
-
11
- <div class="autoscroll">
12
- <fieldset class="box">
13
- <legend><%= l(:label_file_content_preview) %></legend>
14
-
15
- <table class="sample-data">
16
- <% @import.first_rows.each do |row| %>
17
- <tr>
18
- <%= row.map {|c| content_tag 'td', truncate(c.to_s, :length => 50) }.join("").html_safe %>
19
- </tr>
20
- <% end %>
21
- </table>
22
- </fieldset>
23
- </div>
24
-
25
- <p>
26
- <%= button_tag("\xc2\xab " + l(:label_previous), :name => 'previous') %>
27
- <%= submit_tag l(:button_import) %>
28
- </p>
29
- <% end %>
30
-
31
- <% content_for :sidebar do %>
32
- <%= render :partial => 'issues/sidebar' %>
33
- <% end %>
34
-
35
-
36
- <%= javascript_tag do %>
37
- $(document).ready(function() {
38
- $('#fields-mapping').on('change', '#import_mapping_project_id, #import_mapping_tracker', function(){
39
- $.ajax({
40
- url: '<%= import_mapping_path(@import, :format => 'js') %>',
41
- type: 'post',
42
- data: $('#import-form').serialize()
43
- });
44
- });
45
-
46
- $('#import-form').submit(function(){
47
- $('#import-details').show().addClass('ajax-loading');
48
- $('#import-progress').progressbar({value: 0, max: <%= @import.total_items || 0 %>});
49
- });
50
-
51
- });
52
- <% end %>