redmine_extensions 0.0.34 → 0.0.36

Sign up to get free protection for your applications and to get access to all the features.
Files changed (35) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/redmine_extensions/redmine_extensions.js +46 -20
  3. data/{spec/redmine/public/javascripts/redmine_extensions/redmine_extensions.js → app/assets/javascripts/redmine_extensions/redmine_extensions.js.orig} +48 -15
  4. data/app/helpers/redmine_extensions/application_helper.rb +2 -2
  5. data/app/helpers/redmine_extensions/application_helper.rb.orig +66 -109
  6. data/lib/redmine_extensions/version.rb +1 -1
  7. data/spec/redmine/{db/test.sqlite3 → tmp/pdf/empty} +0 -0
  8. data/spec/redmine/tmp/test/empty +0 -0
  9. data/spec/redmine/tmp/thumbnails/empty +0 -0
  10. metadata +9 -52
  11. data/app/views/easy_entity_assignments/_assignments_container.html.erb.orig +0 -45
  12. data/app/views/easy_queries/_entities.html.erb.orig +0 -67
  13. data/lib/redmine_extensions/easy_query_adapter.rb.orig +0 -185
  14. data/lib/redmine_extensions/version.rb.orig +0 -7
  15. data/spec/redmine/Gemfile.lock +0 -191
  16. data/spec/redmine/config/secrets.yml +0 -3
  17. data/spec/redmine/db/development.sqlite3 +0 -0
  18. data/spec/redmine/db/schema.rb +0 -678
  19. data/spec/redmine/log/development.log +0 -22900
  20. data/spec/redmine/log/test.scm.stderr.log +0 -11
  21. data/spec/redmine/plugins/easy_test_plugin/Gemfile +0 -1
  22. data/spec/redmine/plugins/easy_test_plugin/app/controllers/easy_issue_tests_controller.rb +0 -9
  23. data/spec/redmine/plugins/easy_test_plugin/app/models/easy_testing_query.rb +0 -90
  24. data/spec/redmine/plugins/easy_test_plugin/app/views/easy_issue_tests/index.html.erb +0 -2
  25. data/spec/redmine/plugins/easy_test_plugin/config/locales/en.yml +0 -2
  26. data/spec/redmine/plugins/easy_test_plugin/config/routes.rb +0 -2
  27. data/spec/redmine/plugins/easy_test_plugin/init.rb +0 -34
  28. data/spec/redmine/plugins/easy_test_plugin/lib/easy_test_plugin/hooks.rb +0 -5
  29. data/spec/redmine/plugins/easy_test_plugin/lib/easy_test_plugin/internals.rb +0 -4
  30. data/spec/redmine/plugins/easy_test_plugin/lib/easy_test_plugin/redmine_patch/controllers/issues_controller_patch.example +0 -30
  31. data/spec/redmine/plugins/easy_test_plugin/lib/easy_test_plugin/redmine_patch/helpers/issues_helper_patch.example +0 -30
  32. data/spec/redmine/plugins/easy_test_plugin/lib/easy_test_plugin/redmine_patch/models/issue_patch.example +0 -30
  33. data/spec/redmine/public/javascripts/redmine_extensions/application.js +0 -13
  34. data/spec/redmine/public/javascripts/redmine_extensions/jquery.easy_query.js +0 -235
  35. data/spec/redmine/public/javascripts/redmine_extensions/jquery.entityarray.js +0 -130
@@ -1,11 +0,0 @@
1
- sh: svn: příkaz nenalezen
2
- sh: darcs: příkaz nenalezen
3
- sh: cvs: příkaz nenalezen
4
- sh: bzr: příkaz nenalezen
5
- sh: svn: příkaz nenalezen
6
- sh: svn: příkaz nenalezen
7
- sh: svn: příkaz nenalezen
8
- fatal: Not a git repository: '/home/ondra/Documents/_prace/easy/redmine_extensions/spec/redmine/tmp/test/git_repository'
9
- fatal: Not a git repository: '/home/ondra/Documents/_prace/easy/redmine_extensions/spec/redmine/tmp/test/git_repository'
10
- fatal: Not a git repository: '/home/ondra/Documents/_prace/easy/redmine_extensions/spec/redmine/tmp/test/git_repository'
11
- fatal: Not a git repository: '/home/ondra/Documents/_prace/easy/redmine_extensions/spec/redmine/tmp/test/git_repository'
@@ -1 +0,0 @@
1
- gem 'redmine_extensions'
@@ -1,9 +0,0 @@
1
- class EasyIssueTestsController < ApplicationController
2
-
3
- include_query_helpers
4
-
5
- def index
6
- index_for_easy_query(EasyTestingQuery)
7
- end
8
-
9
- end
@@ -1,90 +0,0 @@
1
- class EasyTestingQuery < EasyQueryAdapter
2
-
3
- def entity
4
- Issue
5
- end
6
-
7
- self.available_columns = [
8
- QueryColumn.new(:id, :sortable => "#{Issue.table_name}.id", :default_order => 'desc', :caption => '#', :frozen => true),
9
- QueryColumn.new(:project, :sortable => "#{Project.table_name}.name", :groupable => true),
10
- QueryColumn.new(:tracker, :sortable => "#{Tracker.table_name}.position", :groupable => true),
11
- QueryColumn.new(:parent, :sortable => ["#{Issue.table_name}.root_id", "#{Issue.table_name}.lft ASC"], :default_order => 'desc', :caption => :field_parent_issue),
12
- QueryColumn.new(:status, :sortable => "#{IssueStatus.table_name}.position", :groupable => true),
13
- QueryColumn.new(:priority, :sortable => "#{IssuePriority.table_name}.position", :default_order => 'desc', :groupable => true),
14
- QueryColumn.new(:subject, :sortable => "#{Issue.table_name}.subject"),
15
- QueryColumn.new(:author, :sortable => lambda {User.fields_for_order_statement("authors")}, :groupable => true),
16
- QueryColumn.new(:assigned_to, :sortable => lambda {User.fields_for_order_statement}, :groupable => true),
17
- QueryColumn.new(:updated_on, :sortable => "#{Issue.table_name}.updated_on", :default_order => 'desc'),
18
- QueryColumn.new(:category, :sortable => "#{IssueCategory.table_name}.name", :groupable => true),
19
- QueryColumn.new(:fixed_version, :sortable => lambda {Version.fields_for_order_statement}, :groupable => true),
20
- QueryColumn.new(:start_date, :sortable => "#{Issue.table_name}.start_date"),
21
- QueryColumn.new(:due_date, :sortable => "#{Issue.table_name}.due_date"),
22
- QueryColumn.new(:estimated_hours, :sortable => "#{Issue.table_name}.estimated_hours"),
23
- QueryColumn.new(:done_ratio, :sortable => "#{Issue.table_name}.done_ratio", :groupable => true),
24
- QueryColumn.new(:created_on, :sortable => "#{Issue.table_name}.created_on", :default_order => 'desc'),
25
- QueryColumn.new(:closed_on, :sortable => "#{Issue.table_name}.closed_on", :default_order => 'desc'),
26
- QueryColumn.new(:relations, :caption => :label_related_issues),
27
- QueryColumn.new(:description, :inline => false)
28
- ]
29
-
30
- def initialize_available_filters
31
- principals = []
32
- subprojects = []
33
- versions = []
34
- categories = []
35
- issue_custom_fields = []
36
-
37
- if project
38
- principals += project.principals.visible
39
- unless project.leaf?
40
- subprojects = project.descendants.visible.to_a
41
- principals += Principal.member_of(subprojects).visible
42
- end
43
- versions = project.shared_versions.to_a
44
- categories = project.issue_categories.to_a
45
- issue_custom_fields = project.all_issue_custom_fields
46
- else
47
- if all_projects.any?
48
- principals += Principal.member_of(all_projects).visible
49
- end
50
- versions = Version.visible.where(:sharing => 'system').to_a
51
- issue_custom_fields = IssueCustomField.where(:is_for_all => true)
52
- end
53
- principals.uniq!
54
- principals.sort!
55
- principals.reject! {|p| p.is_a?(GroupBuiltin)}
56
- users = principals.select {|p| p.is_a?(User)}
57
-
58
- if project.nil?
59
- project_values = []
60
- if User.current.logged? && User.current.memberships.any?
61
- project_values << ["<< #{l(:label_my_projects).downcase} >>", "mine"]
62
- end
63
- project_values += all_projects_values
64
- add_available_filter("project_id",
65
- :type => :list, :values => project_values
66
- ) unless project_values.empty?
67
- end
68
-
69
- add_available_filter "tracker_id",
70
- :type => :list, :values => trackers.collect{|s| [s.name, s.id.to_s] }
71
- add_available_filter "priority_id",
72
- :type => :list, :values => IssuePriority.all.collect{|s| [s.name, s.id.to_s] }
73
-
74
- author_values = []
75
- author_values << ["<< #{l(:label_me)} >>", "me"] if User.current.logged?
76
- author_values += users.collect{|s| [s.name, s.id.to_s] }
77
- add_available_filter("author_id",
78
- :type => :list, :values => author_values
79
- ) unless author_values.empty?
80
-
81
- assigned_to_values = []
82
- assigned_to_values << ["<< #{l(:label_me)} >>", "me"] if User.current.logged?
83
- assigned_to_values += (Setting.issue_group_assignment? ?
84
- principals : users).collect{|s| [s.name, s.id.to_s] }
85
- add_available_filter("assigned_to_id",
86
- :type => :list_optional, :values => assigned_to_values
87
- ) unless assigned_to_values.empty?
88
- end
89
-
90
- end
@@ -1,2 +0,0 @@
1
- en:
2
- label: Hello
@@ -1,2 +0,0 @@
1
-
2
- resources :easy_issue_tests
@@ -1,34 +0,0 @@
1
- Redmine::Plugin.register :easy_test_plugin do
2
- name 'Easy Test Plugin'
3
- author ''
4
- author_url ''
5
- description ''
6
- version '2015.01.01'
7
-
8
- #into easy_settings goes available setting as a symbol key, default value as a value
9
- settings easy_settings: { }
10
- end
11
-
12
-
13
- Dir[File.dirname(__FILE__) + '/lib/easy_test_plugin/redmine_patch/*/*.rb'].each {|file| require file }
14
-
15
- # this block is executed once just after Redmine is started
16
- # means after all plugins are initialized
17
- # it is place for plain requires, not require_dependency
18
- # it should contain hooks, permissions - base class in Redmine is required thus is not reloaded
19
- ActiveSupport.on_load(:easyproject, yield: true) do
20
-
21
- require 'easy_test_plugin/internals'
22
- require 'easy_test_plugin/hooks'
23
-
24
- end
25
-
26
- # this block is called every time rails are reloading code
27
- # in development it means after each change in observed file
28
- # in production it means once just after server has started
29
- # in this block should be used require_dependency, but only if necessary.
30
- # better is to place a class in file named by rails naming convency and let it be loaded automatically
31
- # Here goes query registering, custom fields registering and so on
32
- ActionDispatch::Reloader.to_prepare do
33
-
34
- end
@@ -1,5 +0,0 @@
1
- module EasyTestPlugin
2
- class Hooks < Redmine::Hook::ViewListener
3
-
4
- end
5
- end
@@ -1,4 +0,0 @@
1
- # Use this module for static methods
2
- module EasyTestPlugin
3
-
4
- end
@@ -1,30 +0,0 @@
1
- module EasyTestPlugin
2
- module IssuesControllerPatch
3
-
4
- def self.included(base)
5
- base.extend(ClassMethods)
6
- base.send(:include, InstanceMethods)
7
-
8
- base.class_eval do
9
-
10
- alias_method_chain :index, :easy_test_plugin
11
-
12
- end
13
- end
14
-
15
- module InstanceMethods
16
-
17
- def index_with_easy_test_plugin
18
- index_without_easy_test_plugin
19
- end
20
-
21
- end
22
-
23
- module ClassMethods
24
-
25
- end
26
-
27
- end
28
-
29
- end
30
- RedmineExtensions::PatchManager.register_controller_patch 'IssuesController', 'EasyTestPlugin::IssuesControllerPatch'
@@ -1,30 +0,0 @@
1
- module EasyTestPlugin
2
- module IssuesHelperPatch
3
-
4
- def self.included(base)
5
- base.extend(ClassMethods)
6
- base.send(:include, InstanceMethods)
7
-
8
- base.class_eval do
9
-
10
- alias_method_chain :issue_heading, :easy_test_plugin
11
-
12
- end
13
- end
14
-
15
- module InstanceMethods
16
-
17
- def issue_heading_with_easy_test_plugin(issue)
18
- issue_heading_without_easy_test_plugin(issue)
19
- end
20
-
21
- end
22
-
23
- module ClassMethods
24
-
25
- end
26
-
27
- end
28
-
29
- end
30
- RedmineExtensions::PatchManager.register_helper_patch 'IssuesHelper', 'EasyTestPlugin::IssuesHelperPatch'
@@ -1,30 +0,0 @@
1
- module EasyTestPlugin
2
- module IssuePatch
3
-
4
- def self.included(base)
5
- base.extend(ClassMethods)
6
- base.send(:include, InstanceMethods)
7
-
8
- base.class_eval do
9
-
10
- alias_method_chain :to_s, :easy_test_plugin
11
-
12
- end
13
- end
14
-
15
- module InstanceMethods
16
-
17
- def to_s_with_easy_test_plugin
18
- 'issue'
19
- end
20
-
21
- end
22
-
23
- module ClassMethods
24
-
25
- end
26
-
27
- end
28
-
29
- end
30
- RedmineExtensions::PatchManager.register_model_patch 'Issue', 'EasyTestPlugin::IssuePatch'
@@ -1,13 +0,0 @@
1
- // This is a manifest file that'll be compiled into application.js, which will include all the files
2
- // listed below.
3
- //
4
- // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
5
- // or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
6
- //
7
- // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8
- // compiled file.
9
- //
10
- // Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
11
- // about supported directives.
12
- //
13
- //= require_tree .
@@ -1,235 +0,0 @@
1
- (function( $, undefined ) {
2
- $.widget('easy.easy_query', {
3
- options: {
4
- modul_uniq_id: null
5
- },
6
-
7
- _create: function() {
8
- var that = this;
9
-
10
- this.modul_uniq_id = this.options.modul_uniq_id || this.element.attr('id') || '';
11
- this.filters_container = $('.filters-table', this.element);
12
-
13
- $(this.element).on('change', '.add_filter_select', function(evt){
14
- var select = $(this),
15
- field = select.val();
16
-
17
- $('[id="' + that.modul_uniq_id + 'tr_' + field + '"]').show();
18
- $('[id="' + that.modul_uniq_id + 'cb_' + field + '"]').prop('checked', true);
19
- that.toggleFilter(field);
20
- select[0].selectedIndex = 0;
21
- $("option[value='" + field + "']", select).prop('disabled', true);
22
- });
23
-
24
- $("input[name='query[visibility]']", this.element).change(function(){
25
- var roles_checked = $('.query_visibility_roles', that.element).is(':checked');
26
- var private_checked = $('.query_visibility_private', that.element).is(':checked');
27
- $("input[name='query[role_ids][]'][type=checkbox]").attr('disabled', !roles_checked);
28
- if (!private_checked) $("input.disable-unless-private", that.element).attr('checked', false);
29
- $("input.disable-unless-private").attr('disabled', !private_checked);
30
- }).trigger('change');
31
-
32
- /* filters showing and hiding evts */
33
- if(this.filters_container.length > 0) {
34
- $.each(this.filters_container.data('enabled'), function(){
35
- that.toggleFilter(this);
36
- });
37
-
38
- $(this.filters_container).on('change', '.filter_select_operator', function(evt) {
39
- that.toggleOperator( $(this).data('field') );
40
- });
41
- $(this.filters_container).on('change', '.filters_checkbox', function(evt) {
42
- that.toggleFilter( $(this).val() );
43
- });
44
- }
45
-
46
- /* QUERY APPLY */
47
- $('.filter_buttons .apply-link', this.element).click(function(evt){
48
- var $this = $(this);
49
- evt.preventDefault();
50
- that.applyEasyQueryFilters($this.attr('href'), $($this.data('toserialize')) );
51
- });
52
- $('.filter_buttons .save-link', this.element).click(function(evt){
53
- var query_form_id = '#'+that.modul_uniq_id+'query_form';
54
- evt.preventDefault();
55
- that.applyEasyQueryFilters($(query_form_id).attr('action'), $(query_form_id + ' .query-form-addtional-hidden-fields input:hidden'));
56
- });
57
- },
58
-
59
- toggleFilter: function(field) {
60
- var check_box = $('#' + this.modul_uniq_id + 'cb_' + field);
61
-
62
- if (check_box.is(':checked')) {
63
- $('#' + this.modul_uniq_id + "operators_" + field).show();
64
- this.toggleOperator(field, this.modul_uniq_id);
65
- } else {
66
- $('#' + this.modul_uniq_id + "operators_" + field).hide();
67
- $('#' + this.modul_uniq_id + "div_values_" + field).hide();
68
- }
69
- },
70
-
71
-
72
- toggleOperator: function(field) {
73
- var operator = $('#' + this.modul_uniq_id + "operators_" + field);
74
- if (typeof(operator.val()) === 'undefined') {
75
- $('#' + this.modul_uniq_id + "div_values_" + field).show();
76
- } else {
77
- switch (operator.val()) {
78
- case "!*":
79
- case "*":
80
- case "t":
81
- case "ld":
82
- case "w":
83
- case "lw":
84
- case "l2w":
85
- case "m":
86
- case "lm":
87
- case "y":
88
- case "o":
89
- case "c":
90
- this.enableValues(field, []);
91
- break;
92
- case "><":
93
- this.enableValues(field, [0, 1]);
94
- break;
95
- case "<t+":
96
- case ">t+":
97
- case "><t+":
98
- case "t+":
99
- case ">t-":
100
- case "<t-":
101
- case "><t-":
102
- case "t-":
103
- this.enableValues(field, [2]);
104
- break;
105
- case "=p":
106
- case "=!p":
107
- case "!p":
108
- this.enableValues(field, [1]);
109
- break;
110
- default:
111
- this.enableValues(field, [0]);
112
- break;
113
- }
114
- }
115
- },
116
-
117
- enableValues: function(field, indexes) {
118
- var div_values = $('#' + this.modul_uniq_id + "div_values_" + field);
119
- div_values.find(".values_" + field).each(function(i) {
120
- if (indexes.indexOf(i) > -1) {
121
- $(this).prop('disabled', false).parent('span').show();
122
- } else {
123
- $(this).prop('disabled', true).val('').parent('span').hide();
124
- }
125
- });
126
- div_values.toggle(indexes.length > 0);
127
- },
128
-
129
- getEasyQueryFilterValue: function(filter_value_element) {
130
- var filter_value = '',
131
- val_el_val = [];
132
-
133
- if (filter_value_element.length > 0) {
134
- if (filter_value_element[0].tagName === 'SPAN') {
135
- filter_value_element.find('input[type="hidden"]').each(function(i, el) {
136
- val_el_val.push($(el).val());
137
- });
138
- } else if (filter_value_element[0].tagName === 'SELECT') {
139
- var value = filter_value_element.val();
140
- if ($.isArray(value)) {
141
- $.merge(val_el_val, value)
142
- } else {
143
- val_el_val.push(value);
144
- }
145
- } else if (filter_value_element.is("input:radio")) {
146
- val_el_val.push(filter_value_element.filter(":checked").val());
147
- } else {
148
- filter_value_element.each(function() {
149
- val_el_val.push($(this).val());
150
- });
151
- }
152
- filter_value = val_el_val && val_el_val.join('|');
153
- }
154
- return filter_value;
155
- },
156
-
157
- getEasyQueryFiltersForURL: function() {
158
- var modul_uniq_id = this.modul_uniq_id,
159
- that = this,
160
- filter_values = [];
161
-
162
- $('#' + modul_uniq_id + 'filters table.filters-table input:checkbox[name*="fields"]').filter(":checked").each(function(idx, el) {
163
- var filter_value = '';
164
- var el_val = el.value.replace('.', '_');
165
- var operator = $('#' + modul_uniq_id + 'operators_' + el_val).val();
166
- var val_el_single_value = $("tr#" + modul_uniq_id + "tr_"+el_val).children('td:last').find("input:not(.ui-autocomplete-input), select");
167
- var val_el_two_values_1 = $('#' + modul_uniq_id + 'values_' + el_val + '_1');
168
- var val_el_two_values_2 = $('#' + modul_uniq_id + 'values_' + el_val + '_2');
169
- if (operator === undefined) { operator = '='; }
170
-
171
- if (['=', '!', 'o', 'c', '*', '!*', '~', '!~', '^~', '=p', '=!p', '!p'].indexOf(operator) >= 0 && val_el_single_value.length > 0) {
172
- filter_value = that.getEasyQueryFilterValue(val_el_single_value);
173
- } else if (['=', '>=', '<=', '><', '!*', '*'].indexOf(operator) >= 0 && val_el_two_values_1.length > 0 && val_el_two_values_2.length > 0) {
174
- filter_value = that.getEasyQueryFilterValue(val_el_two_values_1);
175
- filter_value += '|' + that.getEasyQueryFilterValue(val_el_two_values_2);
176
- } else if (operator === '') {
177
- var p1 = $('#' + modul_uniq_id + '' + el_val + '_date_period_1');
178
- if (p1 && p1.is(':checked')) {
179
- filter_value = $('#' + modul_uniq_id + 'values_' + el_val + '_period').val();
180
- if (filter_value.indexOf('n_days') !== -1) {
181
- filter_value += '|' + $('#' + modul_uniq_id + 'values_' + el_val + '_period_days').val();
182
- }
183
- }
184
- var p2 = $('#' + modul_uniq_id + '' + el_val + '_date_period_2');
185
- if (p2 && p2.is(':checked')) {
186
- filter_value = $('#' + modul_uniq_id + '' + el_val + '_from').val();
187
- filter_value += '|' + $('#' + modul_uniq_id + '' + el_val + '_to').val();
188
- }
189
- }
190
-
191
- if (!filter_value) { filter_value = '0'; }
192
- filter_values.push(el.value + '=' + encodeURIComponent(operator + filter_value));
193
- });
194
- this._selectAllOptions(modul_uniq_id + 'selected_columns');
195
- if ($('#selected_project_columns').length > 0)
196
- this._selectAllOptions(modul_uniq_id + 'selected_project_columns');
197
- filter_values.push($('#' + modul_uniq_id + 'selected_columns').serialize());
198
- var show_sum_val = $('#' + modul_uniq_id + 'show_sum_row_1').serialize();
199
- if (show_sum_val.length === 0) {
200
- show_sum_val = $('#' + modul_uniq_id + 'show_sum_row_0').serialize();
201
- }
202
- var options = $(':input', $((modul_uniq_id === '' ? '' : '#' + modul_uniq_id) + ' .easy_query_additional_options')).serialize();
203
- filter_values.push(show_sum_val);
204
- filter_values.push(options);
205
- filter_values.push($('#' + modul_uniq_id + 'group_by').serialize());
206
- filter_values.push($('select.serialize, input.serialize', $('#' + modul_uniq_id + 'filters').closest('form')).serialize());
207
- // TODO razeni
208
- return filter_values.join('&');
209
- },
210
-
211
- applyEasyQueryFilters: function(url, additional_elements_to_serialize) {
212
- if (url.indexOf('?') >= 0) {
213
- url += '&';
214
- } else {
215
- url += '?';
216
- }
217
-
218
- var target_url = url + this.getEasyQueryFiltersForURL();
219
-
220
- if (additional_elements_to_serialize && (additional_elements_to_serialize instanceof jQuery)) {
221
- target_url += '&' + additional_elements_to_serialize.serialize();
222
- }
223
-
224
- window.location = target_url;
225
- },
226
-
227
- _selectAllOptions: function(id)
228
- {
229
- var select = $('#'+id);
230
- select.children('option').prop('selected', true);
231
- }
232
-
233
- });
234
-
235
- })(jQuery);