diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0b97cb9a8b22fcdf66dcc98c08166d8e8ef056ce..422d2fe4a1642bda25bd7e8e9ced45a9db222f9f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,7 +2,7 @@ image: docker:stable variables: DOCKER_TLS_CERTDIR: "/certs" - IMAGE_VER: 4.2.10-passenger-1 + IMAGE_VER: 4.2.10-passenger-2 services: - docker:dind diff --git a/plugins/redmine_checklists/Gemfile b/plugins/redmine_checklists/Gemfile index c6b5df6354d30f2138757b8909c303344505b357..ffc40a370d778212b54e0bc95b50a91c6d3851b8 100644 --- a/plugins/redmine_checklists/Gemfile +++ b/plugins/redmine_checklists/Gemfile @@ -1 +1 @@ -gem 'redmine_crm' +gem 'redmineup' diff --git a/plugins/redmine_checklists/app/controllers/checklists_controller.rb b/plugins/redmine_checklists/app/controllers/checklists_controller.rb index e760c090ba5dff21f8032e6bcff7831f213a27f2..fc65f24db5a355b33e2bac40f5f3f98131d161e9 100644 --- a/plugins/redmine_checklists/app/controllers/checklists_controller.rb +++ b/plugins/redmine_checklists/app/controllers/checklists_controller.rb @@ -1,7 +1,7 @@ # This file is a part of Redmine Checklists (redmine_checklists) plugin, # issue checklists management plugin for Redmine # -# Copyright (C) 2011-2021 RedmineUP +# Copyright (C) 2011-2024 RedmineUP # http://www.redmineup.com/ # # redmine_checklists is free software: you can redistribute it and/or modify @@ -18,7 +18,6 @@ # along with redmine_checklists. If not, see <http://www.gnu.org/licenses/>. class ChecklistsController < ApplicationController - unloadable before_action :find_checklist_item, :except => [:index, :create] before_action :find_issue_by_id, :only => [:index, :create] diff --git a/plugins/redmine_checklists/app/helpers/checklists_helper.rb b/plugins/redmine_checklists/app/helpers/checklists_helper.rb index 16c73cb872bcff3573675b3016cb2c6c5afecbc6..cb5dfe7e210eb2ae72574250d40f453cf8051216 100644 --- a/plugins/redmine_checklists/app/helpers/checklists_helper.rb +++ b/plugins/redmine_checklists/app/helpers/checklists_helper.rb @@ -3,7 +3,7 @@ # This file is a part of Redmine Checklists (redmine_checklists) plugin, # issue checklists management plugin for Redmine # -# Copyright (C) 2011-2021 RedmineUP +# Copyright (C) 2011-2024 RedmineUP # http://www.redmineup.com/ # # redmine_checklists is free software: you can redistribute it and/or modify @@ -29,7 +29,7 @@ module ChecklistsHelper @new_object ||= f.object.class.reflect_on_association(association).klass.new end - def fields(f, association) + def checklist_fields(f, association) @fields ||= f.fields_for(association, new_object(f, association), :child_index => "new_#{association}") do |builder| render(association.to_s.singularize + "_fields", :f => builder) end diff --git a/plugins/redmine_checklists/app/models/checklist.rb b/plugins/redmine_checklists/app/models/checklist.rb index 97b964a6f769ac1753d68c159752a3cb60b5a120..3c61da98544dfc8ea70ad630759c73de32d4aa27 100644 --- a/plugins/redmine_checklists/app/models/checklist.rb +++ b/plugins/redmine_checklists/app/models/checklist.rb @@ -1,7 +1,7 @@ # This file is a part of Redmine Checklists (redmine_checklists) plugin, # issue checklists management plugin for Redmine # -# Copyright (C) 2011-2021 RedmineUP +# Copyright (C) 2011-2024 RedmineUP # http://www.redmineup.com/ # # redmine_checklists is free software: you can redistribute it and/or modify @@ -18,13 +18,11 @@ # along with redmine_checklists. If not, see <http://www.gnu.org/licenses/>. class Checklist < ActiveRecord::Base - unloadable + include Redmine::SafeAttributes belongs_to :issue belongs_to :author, :class_name => "User", :foreign_key => "author_id" - attr_protected :id if ActiveRecord::VERSION::MAJOR <= 4 - acts_as_event :datetime => :created_at, :url => Proc.new {|o| {:controller => 'issues', :action => 'show', :id => o.issue_id}}, :type => 'issue issue-closed', @@ -32,25 +30,15 @@ class Checklist < ActiveRecord::Base :description => Proc.new {|o| "#{l(:field_issue)}: #{o.issue.subject}" } - if ActiveRecord::VERSION::MAJOR >= 4 - acts_as_activity_provider :type => "checklists", - :permission => :view_checklists, - :scope => preload({:issue => :project}) - acts_as_searchable :columns => ["#{table_name}.subject"], - :scope => lambda { includes([:issue => :project]).order("#{table_name}.id") }, - :project_key => "#{Issue.table_name}.project_id" + acts_as_activity_provider :type => "checklists", + :permission => :view_checklists, + :scope => preload({:issue => :project}) + acts_as_searchable :columns => ["#{table_name}.subject"], + :scope => lambda { includes([:issue => :project]).order("#{table_name}.id") }, + :project_key => "#{Issue.table_name}.project_id" - else - acts_as_activity_provider :type => "checklists", - :permission => :view_checklists, - :find_options => {:issue => :project} - acts_as_searchable :columns => ["#{table_name}.subject"], - :include => [:issue => :project], - :project_key => "#{Issue.table_name}.project_id", - :order_column => "#{table_name}.id" - end - rcrm_acts_as_list + up_acts_as_list scope: :issue validates_presence_of :subject validates_length_of :subject, maximum: 512 diff --git a/plugins/redmine_checklists/app/models/journal_checklist_history.rb b/plugins/redmine_checklists/app/models/journal_checklist_history.rb index 76278ff1604ed33f68b92edf9be621a2140ba5b1..a82d84d0742665d0e373c24bab5332fd714595b2 100644 --- a/plugins/redmine_checklists/app/models/journal_checklist_history.rb +++ b/plugins/redmine_checklists/app/models/journal_checklist_history.rb @@ -1,7 +1,7 @@ # This file is a part of Redmine Checklists (redmine_checklists) plugin, # issue checklists management plugin for Redmine # -# Copyright (C) 2011-2021 RedmineUP +# Copyright (C) 2011-2024 RedmineUP # http://www.redmineup.com/ # # redmine_checklists is free software: you can redistribute it and/or modify diff --git a/plugins/redmine_checklists/app/views/checklists/_checklist_item.html.erb b/plugins/redmine_checklists/app/views/checklists/_checklist_item.html.erb index 0855cdb44b3a59203eb18365bdbacb3e2acf3681..186d6bdfdd3a50ed98367c0b2f23b9ae6a38184b 100644 --- a/plugins/redmine_checklists/app/views/checklists/_checklist_item.html.erb +++ b/plugins/redmine_checklists/app/views/checklists/_checklist_item.html.erb @@ -7,5 +7,5 @@ id: "checklist-checkbox-#{checklist_item.id}" %> <% end %> - <%= textilizable(checklist_item, :subject).gsub(/<\/?(p|h\d+|li|ul)>/, '').strip.html_safe %> + <%= textilizable(checklist_item, :subject).gsub(/<\/?(p|h\d+|li|ul|hr \/)>/, '').strip.html_safe %> </li> diff --git a/plugins/redmine_checklists/app/views/checklists/index.api.rsb b/plugins/redmine_checklists/app/views/checklists/index.api.rsb index 4d1411afe7c0e07df263aab26d4403ad7f9fd135..4dff4f01b0f5f2f0ddc81ebed10c5c795baae2a1 100644 --- a/plugins/redmine_checklists/app/views/checklists/index.api.rsb +++ b/plugins/redmine_checklists/app/views/checklists/index.api.rsb @@ -6,6 +6,7 @@ api.array :checklists, api_meta(:total_count => @checklists.size) do api.subject checklist.subject api.is_done checklist.is_done api.position checklist.position + api.is_section checklist.is_section api.created_at checklist.created_at api.updated_at checklist.updated_at diff --git a/plugins/redmine_checklists/app/views/checklists/show.api.rsb b/plugins/redmine_checklists/app/views/checklists/show.api.rsb index 083b463647bebaed62bf7f2e8448aa700f3b6010..37987b2debead4485db534efb68a67494b802396 100644 --- a/plugins/redmine_checklists/app/views/checklists/show.api.rsb +++ b/plugins/redmine_checklists/app/views/checklists/show.api.rsb @@ -4,6 +4,7 @@ api.checklist do api.subject @checklist_item.subject api.is_done @checklist_item.is_done api.position @checklist_item.position + api.is_section @checklist_item.is_section api.created_at @checklist_item.created_at api.updated_at @checklist_item.updated_at diff --git a/plugins/redmine_checklists/app/views/issues/_checklist.html.erb b/plugins/redmine_checklists/app/views/issues/_checklist.html.erb index 9ef810f85d18ffd2d02c107d21c70e53d0c0bee6..820589295af89d240dc22c12d823419ddaeb03dc 100644 --- a/plugins/redmine_checklists/app/views/issues/_checklist.html.erb +++ b/plugins/redmine_checklists/app/views/issues/_checklist.html.erb @@ -9,7 +9,6 @@ <ul id="checklist_items"> <% @issue.checklists.each do |checklist_item| %> <%= render :partial => 'checklists/checklist_item', :object => checklist_item %> - <% end %> </ul> </div> diff --git a/plugins/redmine_checklists/app/views/issues/_checklist_fields.html.erb b/plugins/redmine_checklists/app/views/issues/_checklist_fields.html.erb index f0daba943dab94e5fb677968364eec9970997c25..ec1a0d43f06dcc2b3525e6b71d37a26c2038efe7 100644 --- a/plugins/redmine_checklists/app/views/issues/_checklist_fields.html.erb +++ b/plugins/redmine_checklists/app/views/issues/_checklist_fields.html.erb @@ -4,7 +4,7 @@ <% end %> <span class="checklist-show checklist-subject <%= done_css(f) %>"> - <%= textilizable(f.object, :subject).gsub(/<\/?(p|h\d+|li|ul)>/, '').strip.html_safe %> + <%= f.object.subject.to_s.strip.html_safe %> </span> <span class="checklist-edit checklist-new checklist-edit-box"> diff --git a/plugins/redmine_checklists/app/views/issues/_checklist_form.html.erb b/plugins/redmine_checklists/app/views/issues/_checklist_form.html.erb index 0b5ab22dff57b6aef12e46873ba5aacb09aa0973..de1c0b28b04a639c9bfc4a0ee4f7e6c8ff74c9c5 100644 --- a/plugins/redmine_checklists/app/views/issues/_checklist_form.html.erb +++ b/plugins/redmine_checklists/app/views/issues/_checklist_form.html.erb @@ -3,8 +3,8 @@ <p id="checklist_form"> <label><%=l(:label_checklist_plural)%></label> <% @issue.checklists.build if @issue.checklists.blank? || @issue.checklists.last.subject.present? %> - <%= fields_for :issue, issue do |f| -%> - <span id="checklist_form_items" data-checklist-fields='<%= fields(f, :checklists) %>'> + <%= fields_for @issue do |f| -%> + <span id="checklist_form_items" data-checklist-fields='<%= checklist_fields(f, :checklists) %>'> <%= f.fields_for :checklists do |builder| %> <%= render :partial => 'checklist_fields', :locals => {:f => builder, :checklist => @checklist} %> <% end %> diff --git a/plugins/redmine_checklists/assets/javascripts/checklists.js b/plugins/redmine_checklists/assets/javascripts/checklists.js index 828ac52fc0cee6f08bd92932ffffedd4e73b0bdf..84ad103b541ac90506d888c7cd51b398c163d79c 100644 --- a/plugins/redmine_checklists/assets/javascripts/checklists.js +++ b/plugins/redmine_checklists/assets/javascripts/checklists.js @@ -357,11 +357,11 @@ Redmine.Checklist = $.klass({ }, enableUniquenessValidation: function() { - this.root.on('keyup', 'input.edit-box', $.proxy(function(event) { + this.root.on('input', 'input.edit-box', $.proxy(function(event) { value = $(event.target).val() span = this.findSpan(event) span.removeClass('invalid') - $('.checklist-item').each(function(i, elem) { + $('.checklist-item.existing').each(function(i, elem) { e = $(elem) if (!e.is('.edit') && !e.is('.new')) { diff --git a/plugins/redmine_checklists/assets/stylesheets/checklists.css b/plugins/redmine_checklists/assets/stylesheets/checklists.css index a254bdad1a867d6a39fd9d7aee10ca7596a8fbd1..649a8f96305f642863db9bdaad7a4863fe8732ab 100644 --- a/plugins/redmine_checklists/assets/stylesheets/checklists.css +++ b/plugins/redmine_checklists/assets/stylesheets/checklists.css @@ -127,6 +127,7 @@ table.list td.checklist_relations { text-align: left } list-style: none; padding: 2px; border-radius: 2px; + z-index: 10; } #checklist-menu li { diff --git a/plugins/redmine_checklists/config/locales/de.yml b/plugins/redmine_checklists/config/locales/de.yml index ac85201a0156ff33d18aacc33e9c56b4aa310165..6216dd93840afc148554f35486973f6555dc3b78 100644 --- a/plugins/redmine_checklists/config/locales/de.yml +++ b/plugins/redmine_checklists/config/locales/de.yml @@ -1,39 +1,44 @@ -# encoding: utf-8 -# German strings go here for Rails i18n -de: - label_checklist_plural: Checkliste - field_checklist: Checkliste - label_checklist_save_log: "Speichere Ă„nderungen in der Ticket-Historie" - label_checklist_done_ratio: Aktualisiere den Ticket-Fortschritt - permission_view_checklists: Checkliste anzeigen - permission_done_checklists: Checkliste anwenden - permission_edit_checklists: Checkliste bearbeiten - label_checklist_template_category_plural: Kategorien - label_checklist_template_category_new: Neue Kategorie - field_checklist_template_category: Kategorie - label_checklist_templates: Checklisten-Vorlagen - label_checklist_new_checklist_template: Neue Checklisten-Vorlage - field_template_items: "Einträge" - label_checklist_template: Checklisten-Vorlage - label_add_checklists_from_template: "Aus Vorlage wählen" - label_select_template: "-- Vorlage auswählen --" - label_checklist_category_not_specified: "-- Nicht spezifiziert --" - label_checklists_description: 'Mehrere Einträge erlaubt (ein Eintrag pro Zeile)' - label_checklist_item: Checklisten-Eintrag - label_checklist_deleted: gelöscht - label_checklist_changed_from: geändert von - label_checklist_changed_to: zu - label_checklist_added: hinzugefĂĽgt - label_checklist_done: als Erledigt markiert - label_checklist_undone: als Nicht erledigt markiert - label_checklist_updated: Checklisten-Eintrag editiert - label_checklist_status: Checklisten-Status - label_checklist_status_done: Erledigt - label_checklist_status_undone: Nicht erledigt - label_checklist_is_default: Standard - field_is_for_tracker: Tracker - label_checklists_must_be_completed: "Alle Checklisten-Einträge eines Tickets mĂĽssen vor dem SchlieĂźen erledigt werden." - label_checklist_block_issue_closing: "SchlieĂźen des Tickets blockieren" - label_checklist_show_closed: Zeige alle - label_checklist_hide_closed: Verberge geschlossene - label_checklist_new_section: Neue Unterteilung +# Deutsche Ăśbersetzungen fĂĽr Rails i18n +de: + activerecord: + attributes: + checklists: + subject: Checklisten-Thema + label_checklist_plural: Checklist + field_checklist: Checklist + label_checklist_save_log: Ă„nderungen im Problem-Log speichern + label_checklist_done_ratio: Fortschritt des Problems festlegen + permission_view_checklists: Checklist anzeigen + permission_done_checklists: Erledigte Checklistenelemente + permission_edit_checklists: Checklistenelemente bearbeiten + label_checklist_template_category_plural: Vorlagenkategorien + label_checklist_template_category_new: Neue Checklistenvorlage + field_checklist_template_category: Vorlagenelemente + label_checklist_templates: Checklistenvorlagen + label_checklist_new_checklist_template: Neue Checklistenvorlage + field_template_items: Vorlagenelemente + label_checklist_template: Checklistenvorlage + label_add_checklists_from_template: Von Vorlage hinzufĂĽgen + label_checklists_from_template: Von Vorlage + label_select_template: "-- Nicht angegeben --" + label_checklist_category_not_specified: "-- Nicht spezifiziert --" + label_checklists_description: Mehrere Werte erlaubt (eine Zeile fĂĽr jeden Wert) + label_checklist_item: Checklistenelement + label_checklist_section: Checklistensektion + label_checklist_deleted: gelöscht + label_checklist_changed_from: geändert von + label_checklist_changed_to: zu + label_checklist_added: hinzugefĂĽgt + label_checklist_done: auf Erledigt gesetzt + label_checklist_undone: auf Nicht erledigt gesetzt + label_checklist_updated: Checklistenelement bearbeitet + label_checklist_status: Checklistestatus + label_checklist_status_done: Erledigt + label_checklist_status_undone: Nicht erledigt + label_checklist_is_default: Standardmäßig + field_is_for_tracker: Tracker + label_checklists_must_be_completed: Alle Checklisten eines Problems mĂĽssen erledigt sein, bevor es geschlossen werden kann + label_checklist_block_issue_closing: Problemabschluss blockieren + label_checklist_show_closed: Geschlossene anzeigen + label_checklist_hide_closed: Geschlossene ausblenden + label_checklist_new_section: Neue Sektion diff --git a/plugins/redmine_checklists/config/locales/fr.yml b/plugins/redmine_checklists/config/locales/fr.yml old mode 100644 new mode 100755 index 5c1fe444bda5cc775e1eb2a769f349b502db2629..339ca027de1b847174b3b9977f1eae75f0fa77af --- a/plugins/redmine_checklists/config/locales/fr.yml +++ b/plugins/redmine_checklists/config/locales/fr.yml @@ -1,9 +1,44 @@ -# encoding: utf-8 -fr: - label_checklist_plural: Liste de Tâches - field_checklist: Tâche - label_checklist_templates: Template de checklists - label_checklist_new_checklist_template: Ajouter un template - field_is_for_tracker: - label_checklist_is_default: Checklist par d faut - field_template_items: ElĂ©ments +# Traductions en français pour Rails i18n +fr: + activerecord: + attributes: + checklists: + subject: Sujet de la checklist + label_checklist_plural: Checklist + field_checklist: Checklist + label_checklist_save_log: Enregistrer les modifications dans le journal des problèmes + label_checklist_done_ratio: DĂ©finir le taux d'avancement du problème + permission_view_checklists: Voir la checklist + permission_done_checklists: ÉlĂ©ments de la checklist terminĂ©s + permission_edit_checklists: Modifier les Ă©lĂ©ments de la checklist + label_checklist_template_category_plural: CatĂ©gories de modèles + label_checklist_template_category_new: Nouvelle catĂ©gorie + field_checklist_template_category: CatĂ©gorie + label_checklist_templates: Modèles de checklist + label_checklist_new_checklist_template: Nouveau modèle de checklist + field_template_items: ÉlĂ©ments de modèle + label_checklist_template: Modèle de checklist + label_add_checklists_from_template: Ajouter Ă partir du modèle + label_checklists_from_template: Ă€ partir du modèle + label_select_template: "-- SĂ©lectionner un modèle --" + label_checklist_category_not_specified: "-- Non spĂ©cifiĂ© --" + label_checklists_description: 'Plusieurs valeurs autorisĂ©es (une ligne pour chaque valeur)' + label_checklist_item: ÉlĂ©ment de checklist + label_checklist_section: Section de checklist + label_checklist_deleted: supprimĂ© + label_checklist_changed_from: changĂ© de + label_checklist_changed_to: Ă + label_checklist_added: ajoutĂ© + label_checklist_done: dĂ©fini comme TerminĂ© + label_checklist_undone: dĂ©fini comme Non terminĂ© + label_checklist_updated: ÉlĂ©ment de checklist modifiĂ© + label_checklist_status: Statut de la checklist + label_checklist_status_done: TerminĂ© + label_checklist_status_undone: Non terminĂ© + label_checklist_is_default: Par dĂ©faut + field_is_for_tracker: Tracker + label_checklists_must_be_completed: Toutes les checklists d'un problème doivent ĂŞtre terminĂ©es avant la clĂ´ture + label_checklist_block_issue_closing: Bloquer la clĂ´ture du problème + label_checklist_show_closed: Afficher les Ă©lĂ©ments clos + label_checklist_hide_closed: Masquer les Ă©lĂ©ments clos + label_checklist_new_section: Nouvelle section diff --git a/plugins/redmine_checklists/config/locales/hu.yml b/plugins/redmine_checklists/config/locales/hu.yml new file mode 100644 index 0000000000000000000000000000000000000000..917ce2730e927817e03625f1af804c93b65644ea --- /dev/null +++ b/plugins/redmine_checklists/config/locales/hu.yml @@ -0,0 +1,47 @@ +# Hungarian translations for redmine_checklists +# by Lilla Basilides basilides.h.lilla@gmail.com) +# Hungarian strings go here for Rails i18n +hu: + activerecord: + attributes: + checklists: + subject: EllenĹ‘rzĹ‘ lista tárgya + label_checklist_plural: EllenĹ‘rzĹ‘ lista + field_checklist: EllenĹ‘rzĹ‘ lista + label_checklist_save_log: Változások mentĂ©se a jegy naplĂłjába + label_checklist_done_ratio: ĂllĂtsa be az elkĂ©szĂĽlt jegyek arányát + permission_view_checklists: EllenĹ‘rzĹ‘ lista megtekintĂ©se + permission_done_checklists: ElkĂ©szĂĽlt ellenĹ‘rzĹ‘lista elemek + permission_edit_checklists: EllenĹ‘rzĹ‘lista elemeinek szerkesztĂ©se + label_checklist_template_category_plural: Sablon kategĂłriák + label_checklist_template_category_new: Ăšj kategĂłria + field_checklist_template_category: KategĂłria + label_checklist_templates: EllenĹ‘rzĹ‘lista sablonok + label_checklist_new_checklist_template: Ăšj ellenĹ‘rzĹ‘lista sablon + field_template_items: Sablon elemek + label_checklist_template: EllenĹ‘rzĹ‘lista sablon + label_add_checklists_from_template: Hozzáadás sablonbĂłl + label_checklists_from_template: A sablonbĂłl + label_select_template: "-- Sablon kiválasztása --" + label_checklist_category_not_specified: "-- Nincs meghatározva --" + label_checklists_description: 'Több Ă©rtĂ©k megengedett (Ă©rtĂ©kenkĂ©nt egy sor)' + label_checklist_item: EllenĹ‘rzĹ‘lista elem + label_checklist_section: EllenĹ‘rzĹ‘lista szakasz + label_checklist_deleted: törölve + label_checklist_changed_from: változott a következĹ‘bĹ‘l + label_checklist_changed_to: a cĂmre + label_checklist_added: hozzáadva + label_checklist_done: kĂ©szre állĂtva + label_checklist_undone: Nem kĂ©szre állĂtva + label_checklist_updated: Szerkesztett ellenĹ‘rzĹ‘lista elem + label_checklist_status: EllenĹ‘rzĹ‘lista állapota + label_checklist_status_done: ElkĂ©szĂĽlt + label_checklist_status_undone: visszavonva + label_checklist_is_default: AlapĂ©rtelmezett + field_is_for_tracker: NyomkövetĹ‘ + label_checklists_must_be_completed: A jegy összes ellenĹ‘rzĹ‘ listáját el kell vĂ©gezni a lezárás elĹ‘tt. + label_checklist_block_issue_closing: Blokkjegy zárás + label_checklist_show_closed: Mutasd a zártakat + label_checklist_hide_closed: Rejtsd el zártakat + label_checklist_new_section: Ăšj szakasz + \ No newline at end of file diff --git a/plugins/redmine_checklists/config/locales/ko.yml b/plugins/redmine_checklists/config/locales/ko.yml index 24ede9a962c73794332d851887b12239aa923fbd..aaa94ab78e73512514efc6d5c9eb04f9bf5432e0 100644 --- a/plugins/redmine_checklists/config/locales/ko.yml +++ b/plugins/redmine_checklists/config/locales/ko.yml @@ -1,9 +1,11 @@ -# Translation by Ki Won Kim (http://x10.iptime.org/redmine, http://xyz37.blog.me, xyz37@naver.com) -ko: - label_checklist_plural: "체í¬ë¦¬ěŠ¤íŠ¸" - field_checklist: "체í¬ë¦¬ěŠ¤íŠ¸" - label_checklist_save_log: "ěťĽę° ëˇśę·¸ě— ëł€ę˛˝ě‚¬í•ěť„ ě €ěžĄí•©ë‹ë‹¤." - label_checklist_done_ratio: "완료 비율 ěťĽę° ě„¤ě •" - permission_view_checklists: "체í¬ë¦¬ěŠ¤íŠ¸ 보기" - permission_done_checklists: "체í¬ë¦¬ěŠ¤íŠ¸ 완료" - permission_edit_checklists: "체í¬ë¦¬ěŠ¤íŠ¸ ěě •" +# Translation by Ki Won Kim (http://x10.iptime.org/redmine, http://xyz37.blog.me, xyz37@naver.com) +ko: + label_checklist_plural: "체í¬ë¦¬ěŠ¤íŠ¸" + field_checklist: "체í¬ë¦¬ěŠ¤íŠ¸" + label_checklist_save_log: "ěťĽę° ëˇśę·¸ě— ëł€ę˛˝ě‚¬í•ěť„ ě €ěžĄí•©ë‹ë‹¤." + label_checklist_done_ratio: "완료 비율 ěťĽę° ě„¤ě •" + permission_view_checklists: "체í¬ë¦¬ěŠ¤íŠ¸ 보기" + permission_done_checklists: "체í¬ë¦¬ěŠ¤íŠ¸ 완료" + permission_edit_checklists: "체í¬ë¦¬ěŠ¤íŠ¸ ěě •" + label_checklists_must_be_completed: "일ę°ěť„ 완료í•ë ¤ë©´ ëŞ¨ë“ ě˛´í¬ë¦¬ěŠ¤íŠ¸ę°€ 완료ëě–´ě•Ľ í•©ë‹ë‹¤." + label_checklist_block_issue_closing: "일ę°ěť´ 종료ë는 ę˛ěť„ 방지합ë‹ë‹¤." diff --git a/plugins/redmine_checklists/config/locales/nl.yml b/plugins/redmine_checklists/config/locales/nl.yml new file mode 100644 index 0000000000000000000000000000000000000000..359fb1e4c4aacc50e87e0ef9987cbc445ef0000a --- /dev/null +++ b/plugins/redmine_checklists/config/locales/nl.yml @@ -0,0 +1,44 @@ + +nl: + activerecord: + attributes: + checklists: + subject: Onderwerp van de checklist + label_checklist_plural: Checklists + field_checklist: Checklist + label_checklist_save_log: Wijzigingen in probleemlogboek opslaan + label_checklist_done_ratio: Stel voltooiingspercentage in + permission_view_checklists: View checklist + permission_done_checklists: Voltooide checklistitems + permission_edit_checklists: Bewerk checklistitems + label_checklist_template_category_plural: SjabloonscategorieĂ«n + label_checklist_template_category_new: Nieuwe categorie + field_checklist_template_category: Categorie + label_checklist_templates: Checklistsjablonen + label_checklist_new_checklist_template: Nieuw checklistsjabloon + field_template_items: Sjabloonitems + label_checklist_template: Checklistsjabloon + label_add_checklists_from_template: Toevoegen vanuit sjabloon + label_checklists_from_template: Van sjabloon + label_select_template: -- Selecteer sjabloon -- + label_checklist_category_not_specified: -- Niet gespecificeerd -- + label_checklists_description: Meerdere waarden toegestaan (Ă©Ă©n regel voor elke waarde) + label_checklist_item: Checklistitem + label_checklist_section: Checklistsectie + label_checklist_deleted: verwijderd + label_checklist_changed_from: veranderd van + label_checklist_changed_to: naar + label_checklist_added: toegevoegd + label_checklist_done: ingesteld op Voltooid + label_checklist_undone: ingesteld op Niet voltooid + label_checklist_updated: Checklistitem bewerkt + label_checklist_status: Checkliststatus + label_checklist_status_done: Voltooid + label_checklist_status_undone: Niet voltooid + label_checklist_is_default: Standaard + field_is_for_tracker: Tracker + label_checklists_must_be_completed: Alle checklists van een probleem moeten voltooid zijn voordat het gesloten wordt + label_checklist_block_issue_closing: Blokkeer het sluiten van het probleem + label_checklist_show_closed: Gesloten weergeven + label_checklist_hide_closed: Gesloten verbergen + label_checklist_new_section: Nieuwe sectie diff --git a/plugins/redmine_checklists/config/locales/tr.yml b/plugins/redmine_checklists/config/locales/tr.yml new file mode 100644 index 0000000000000000000000000000000000000000..9c5622888b406e0f7299ca9b3c564ca41e50db61 --- /dev/null +++ b/plugins/redmine_checklists/config/locales/tr.yml @@ -0,0 +1,44 @@ +# Turkish strings go here for Rails i18n +tr: + activerecord: + attributes: + checklists: + subject: Kontrol Listesi konusu + label_checklist_plural: Kontrol listeleri + field_checklist: Kontrol Listesi + label_checklist_save_log: DeÄźiĹźiklikleri iĹź geçmiĹźine kaydet + label_checklist_done_ratio: Ä°Ĺź tamamlanma oranını ayarla + permission_view_checklists: Kontrol listesini görĂĽntĂĽle + permission_done_checklists: Kontrol Listesi elemanlarını tamamlandı olarak iĹźaretle + permission_edit_checklists: Kontrol Listesini dĂĽzenle + label_checklist_template_category_plural: Taslak kategorileri + label_checklist_template_category_new: Yeni kategori + field_checklist_template_category: Kategori + label_checklist_templates: Kontrol listesi taslakları + label_checklist_new_checklist_template: Yeni kontrol listesi taslağı + field_template_items: Taslak elemanları + label_checklist_template: Kontrol listesi taslağı + label_add_checklists_from_template: Taslaktan ekle + label_checklists_from_template: Taslaktan + label_select_template: "-- Taslak seç --" + label_checklist_category_not_specified: "-- BelirtilmemiĹź --" + label_checklists_description: 'Birden fazla deÄźer kabul edilir (her deÄźer için bir satır)' + label_checklist_item: Kontrol listesi elemanı + label_checklist_section: Kontrol listesi kısmı + label_checklist_deleted: silindi + label_checklist_changed_from: '' + label_checklist_changed_to: '>>' + label_checklist_added: eklendi + label_checklist_done: Bitti olarak iĹźaretlendi + label_checklist_undone: Bitti iĹźareti kaldırıldı + label_checklist_updated: Kontrol listesi elemanı eklendi + label_checklist_status: Kontrol listesi durumu + label_checklist_status_done: Bitti + label_checklist_status_undone: Bitmedi + label_checklist_is_default: Varsayılan + field_is_for_tracker: Ä°Ĺź tipi + label_checklists_must_be_completed: Ä°Ĺź kapatılmadan önce tĂĽm kontrol listeleri elemanlarının bitti olarak iĹźaretlemesi mecburi olsun. + label_checklist_block_issue_closing: Block issue closing + label_checklist_show_closed: Kapalıları göster + label_checklist_hide_closed: Kapalıları gizle + label_checklist_new_section: Yeni kısım diff --git a/plugins/redmine_checklists/config/locales/zh-TW.yml b/plugins/redmine_checklists/config/locales/zh-TW.yml index 2fe53c2df59e8cbcf50ea385c5791f8cae3d48df..f3f377a7c7fd22ac69cb9e4317e410b14d10191b 100644 --- a/plugins/redmine_checklists/config/locales/zh-TW.yml +++ b/plugins/redmine_checklists/config/locales/zh-TW.yml @@ -4,29 +4,41 @@ # Based on file: en.yml zh-TW: - label_checklist_plural: Checklist - field_checklist: Checklist - label_checklist_save_log: äżťĺ檢查清單變更ĺ°ĺ•ŹéˇŚć—ĄčŞŚ + label_checklist_plural: 檢查清單 + field_checklist: 檢查清單 + label_checklist_save_log: äżťĺ檢查清單的變更ĺ°ĺ•ŹéˇŚć—ĄčŞŚ label_checklist_done_ratio: č¨ç˝®ĺ—表完ć比率 - permission_view_checklists: 查看Checklist - permission_done_checklists: 完ćChecklist - permission_edit_checklists: 編輯Checklist + permission_view_checklists: 查看檢查清單 + permission_done_checklists: 完ć檢查清單 + permission_edit_checklists: 編輯檢查清單 label_checklist_template_category_plural: çŻ„ćś¬éˇžĺĄ label_checklist_template_category_new: ć–°éˇžĺĄ field_checklist_template_category: éˇžĺĄ label_checklist_templates: 檢查清單範本 - label_checklist_new_checklist_template: 新檢查清單範本 - field_template_items: çŻ„ćś¬é … + label_checklist_new_checklist_template: 新增檢查清單範本 + field_template_items: çŻ„ćś¬é …ç›® label_checklist_template: 檢查清單範本 label_add_checklists_from_template: 從範本新建 + label_checklists_from_template: 從範本ä¸ć–°ĺ˘ž label_select_template: "-- é¸ć“‡çŻ„本 --" label_checklist_category_not_specified: "-- 未指定 --" label_checklists_description: 'ĺ…許多重值 (每一行的值)' - label_checklist_item: Checklist item + label_checklist_item: ćŞ˘ćźĄć¸…ĺ–®é …ç›® label_checklist_deleted: ĺŞé™¤ label_checklist_changed_from: 改變自 label_checklist_changed_to: ĺ° label_checklist_added: ć·»ĺŠ label_checklist_done: č¨ç˝®ĺ®Ść label_checklist_undone: č¨ç˝®ćśŞĺ®Ść - label_checklist_updated: Checklist item編輯 \ No newline at end of file + label_checklist_updated: ćŞ˘ćźĄć¸…ĺ–®é …ç›®ç·¨čĽŻ + + label_checklist_status: 檢查清單狀態 + label_checklist_status_done: 已完ć + label_checklist_status_undone: 未完ć + label_checklist_is_default: é č¨ + field_is_for_tracker: 追蹤標籤 + label_checklists_must_be_completed: č°éˇŚä¸çš„所有檢查清單必é ĺ…¨é¨ĺ®Ść才č˝é—śé–‰ + label_checklist_block_issue_closing: é»ć“‹č°éˇŚé—śé–‰ + label_checklist_show_closed: 顯示已完ć + label_checklist_hide_closed: 隱藏已完ć + label_checklist_new_section: 新增區塊 \ No newline at end of file diff --git a/plugins/redmine_checklists/config/routes.rb b/plugins/redmine_checklists/config/routes.rb index dab24820e5e156cdc14c53082acf0005ccc62735..26f894fc94088dacaa368f3245c7356649f1f073 100644 --- a/plugins/redmine_checklists/config/routes.rb +++ b/plugins/redmine_checklists/config/routes.rb @@ -1,7 +1,7 @@ # This file is a part of Redmine Checklists (redmine_checklists) plugin, # issue checklists management plugin for Redmine # -# Copyright (C) 2011-2021 RedmineUP +# Copyright (C) 2011-2024 RedmineUP # http://www.redmineup.com/ # # redmine_checklists is free software: you can redistribute it and/or modify diff --git a/plugins/redmine_checklists/db/migrate/001_create_checklists.rb b/plugins/redmine_checklists/db/migrate/001_create_checklists.rb index 24089341f9b4467b40fc5d3e2cfc8e659ccf2bdb..715f8222fd7f2f8aacc70774d089d2e23132647c 100644 --- a/plugins/redmine_checklists/db/migrate/001_create_checklists.rb +++ b/plugins/redmine_checklists/db/migrate/001_create_checklists.rb @@ -1,7 +1,7 @@ # This file is a part of Redmine Checklists (redmine_checklists) plugin, # issue checklists management plugin for Redmine # -# Copyright (C) 2011-2021 RedmineUP +# Copyright (C) 2011-2024 RedmineUP # http://www.redmineup.com/ # # redmine_checklists is free software: you can redistribute it and/or modify @@ -17,7 +17,7 @@ # You should have received a copy of the GNU General Public License # along with redmine_checklists. If not, see <http://www.gnu.org/licenses/>. -class CreateChecklists < Rails.version < '5.1' ? ActiveRecord::Migration : ActiveRecord::Migration[4.2] +class CreateChecklists < ActiveRecord::Migration[4.2] def self.up if ActiveRecord::Base.connection.table_exists? :issue_checklists diff --git a/plugins/redmine_checklists/db/migrate/002_add_time_stamps_to_checklists.rb b/plugins/redmine_checklists/db/migrate/002_add_time_stamps_to_checklists.rb index 03e3c9908f6933949af09c14a7441f8b181c6681..fd7e02e11fb0e51608dec5ef9cd7615bfcccad22 100644 --- a/plugins/redmine_checklists/db/migrate/002_add_time_stamps_to_checklists.rb +++ b/plugins/redmine_checklists/db/migrate/002_add_time_stamps_to_checklists.rb @@ -1,7 +1,7 @@ # This file is a part of Redmine Checklists (redmine_checklists) plugin, # issue checklists management plugin for Redmine # -# Copyright (C) 2011-2021 RedmineUP +# Copyright (C) 2011-2024 RedmineUP # http://www.redmineup.com/ # # redmine_checklists is free software: you can redistribute it and/or modify @@ -17,7 +17,7 @@ # You should have received a copy of the GNU General Public License # along with redmine_checklists. If not, see <http://www.gnu.org/licenses/>. -class AddTimeStampsToChecklists < Rails.version < '5.1' ? ActiveRecord::Migration : ActiveRecord::Migration[4.2] +class AddTimeStampsToChecklists < ActiveRecord::Migration[4.2] def change add_column :checklists, :created_at, :timestamp add_column :checklists, :updated_at, :timestamp diff --git a/plugins/redmine_checklists/db/migrate/003_create_checklist_template_category.rb b/plugins/redmine_checklists/db/migrate/003_create_checklist_template_category.rb index ebb7987d763021a4804ecb3e797832b8ed91c390..ba26d4e2329867b4af58129e1e79d3b933b2e658 100644 --- a/plugins/redmine_checklists/db/migrate/003_create_checklist_template_category.rb +++ b/plugins/redmine_checklists/db/migrate/003_create_checklist_template_category.rb @@ -1,7 +1,7 @@ # This file is a part of Redmine Checklists (redmine_checklists) plugin, # issue checklists management plugin for Redmine # -# Copyright (C) 2011-2021 RedmineUP +# Copyright (C) 2011-2024 RedmineUP # http://www.redmineup.com/ # # redmine_checklists is free software: you can redistribute it and/or modify @@ -17,7 +17,7 @@ # You should have received a copy of the GNU General Public License # along with redmine_checklists. If not, see <http://www.gnu.org/licenses/>. -class CreateChecklistTemplateCategory < Rails.version < '5.1' ? ActiveRecord::Migration : ActiveRecord::Migration[4.2] +class CreateChecklistTemplateCategory < ActiveRecord::Migration[4.2] def self.up create_table :checklist_template_categories do |t| diff --git a/plugins/redmine_checklists/db/migrate/004_create_checklist_templates.rb b/plugins/redmine_checklists/db/migrate/004_create_checklist_templates.rb index 8de06924f925efab99cbe1f022db685752719025..670f8da8cab35401576ebac20212c70be31e4e99 100644 --- a/plugins/redmine_checklists/db/migrate/004_create_checklist_templates.rb +++ b/plugins/redmine_checklists/db/migrate/004_create_checklist_templates.rb @@ -1,7 +1,7 @@ # This file is a part of Redmine Checklists (redmine_checklists) plugin, # issue checklists management plugin for Redmine # -# Copyright (C) 2011-2021 RedmineUP +# Copyright (C) 2011-2024 RedmineUP # http://www.redmineup.com/ # # redmine_checklists is free software: you can redistribute it and/or modify @@ -17,7 +17,7 @@ # You should have received a copy of the GNU General Public License # along with redmine_checklists. If not, see <http://www.gnu.org/licenses/>. -class CreateChecklistTemplates < Rails.version < '5.1' ? ActiveRecord::Migration : ActiveRecord::Migration[4.2] +class CreateChecklistTemplates < ActiveRecord::Migration[4.2] def self.up create_table :checklist_templates do |t| diff --git a/plugins/redmine_checklists/db/migrate/005_modify_checklist_subject_length.rb b/plugins/redmine_checklists/db/migrate/005_modify_checklist_subject_length.rb index 5538b2b87d2b517f8aa35b4de0be66ea0a91d5dd..77a6ea505b4f81bcb4dde8324f40629155101f4e 100644 --- a/plugins/redmine_checklists/db/migrate/005_modify_checklist_subject_length.rb +++ b/plugins/redmine_checklists/db/migrate/005_modify_checklist_subject_length.rb @@ -1,7 +1,7 @@ # This file is a part of Redmine Checklists (redmine_checklists) plugin, # issue checklists management plugin for Redmine # -# Copyright (C) 2011-2021 RedmineUP +# Copyright (C) 2011-2024 RedmineUP # http://www.redmineup.com/ # # redmine_checklists is free software: you can redistribute it and/or modify @@ -17,7 +17,7 @@ # You should have received a copy of the GNU General Public License # along with redmine_checklists. If not, see <http://www.gnu.org/licenses/>. -class ModifyChecklistSubjectLength < Rails.version < '5.1' ? ActiveRecord::Migration : ActiveRecord::Migration[4.2] +class ModifyChecklistSubjectLength < ActiveRecord::Migration[4.2] def self.up change_column :checklists, :subject, :string, :limit => 512 end diff --git a/plugins/redmine_checklists/db/migrate/006_add_fields_to_checklist_template.rb b/plugins/redmine_checklists/db/migrate/006_add_fields_to_checklist_template.rb index ce38cb167fad0cefda038390c535ca34b928b2da..922bda529a001e240977cec7f33ffb79f69228f0 100644 --- a/plugins/redmine_checklists/db/migrate/006_add_fields_to_checklist_template.rb +++ b/plugins/redmine_checklists/db/migrate/006_add_fields_to_checklist_template.rb @@ -1,7 +1,7 @@ # This file is a part of Redmine Checklists (redmine_checklists) plugin, # issue checklists management plugin for Redmine # -# Copyright (C) 2011-2021 RedmineUP +# Copyright (C) 2011-2024 RedmineUP # http://www.redmineup.com/ # # redmine_checklists is free software: you can redistribute it and/or modify @@ -17,7 +17,7 @@ # You should have received a copy of the GNU General Public License # along with redmine_checklists. If not, see <http://www.gnu.org/licenses/>. -class AddFieldsToChecklistTemplate < Rails.version < '5.1' ? ActiveRecord::Migration : ActiveRecord::Migration[4.2] +class AddFieldsToChecklistTemplate < ActiveRecord::Migration[4.2] def self.up add_column :checklist_templates, :is_default, :boolean, :default => false add_column :checklist_templates, :tracker_id, :integer diff --git a/plugins/redmine_checklists/db/migrate/007_add_is_section_to_checklists.rb b/plugins/redmine_checklists/db/migrate/007_add_is_section_to_checklists.rb index 23812c55130122f193d25229e68cadb255d02e0e..311351152b9c124c45bf2d8bdeb016745e59ca02 100644 --- a/plugins/redmine_checklists/db/migrate/007_add_is_section_to_checklists.rb +++ b/plugins/redmine_checklists/db/migrate/007_add_is_section_to_checklists.rb @@ -1,7 +1,7 @@ # This file is a part of Redmine Checklists (redmine_checklists) plugin, # issue checklists management plugin for Redmine # -# Copyright (C) 2011-2021 RedmineUP +# Copyright (C) 2011-2024 RedmineUP # http://www.redmineup.com/ # # redmine_checklists is free software: you can redistribute it and/or modify diff --git a/plugins/redmine_checklists/doc/CHANGELOG b/plugins/redmine_checklists/doc/CHANGELOG index dec076cb089dd3a9b75e868d8c5691a974e5987d..6268bcc125c8a9788590cba88218957eb962ccee 100644 --- a/plugins/redmine_checklists/doc/CHANGELOG +++ b/plugins/redmine_checklists/doc/CHANGELOG @@ -1,9 +1,35 @@ == Redmine Checklists plugin changelog Redmine Checklists plugin - managing issue checklists plugin for Redmine -Copyright (C) 2011-2021 RedmineUP +Copyright (C) 2011-2024 Kirill Bezrukov (RedmineUP) http://www.redmineup.com/ +== 2024-02-14 v3.1.23 + +* Dropped Redmine 3 support +* Added Taiwanese(Traditional chinese) translation (Tomy) +* Updated Dutch, French, German locales (Jan Catrysse) +* Fixed notification bug + +== 2023-01-16 v3.1.22 + +* Added is_section API property +* Added Hungarian locale (Krisztian Engi, Lilla Basilides) +* Added Turkish locale (Adnan Topçu) +* Updated Korean locale (Ki Won Kim) +* Updated German locale (Joachim Mathes) +* Fixed name validation for item checkbox +* Fixed items sorting + +== 2022-02-21 v3.1.21 + +* Redmine 5.0 compatibility fixes + +== 2021-10-12 v3.1.20 + +* Fixed subtask checklists copy +* Fixed checklist formating error + == 2021-05-21 v3.1.19 * Added Redmine 4.2 compatibility diff --git a/plugins/redmine_checklists/init.rb b/plugins/redmine_checklists/init.rb index 32507295def683e1e1945c46d8615e8aa6d69554..dea25228610a6f355df1001fb28c009d9b3f7413 100644 --- a/plugins/redmine_checklists/init.rb +++ b/plugins/redmine_checklists/init.rb @@ -1,7 +1,7 @@ # This file is a part of Redmine Checklists (redmine_checklists) plugin, # issue checklists management plugin for Redmine # -# Copyright (C) 2011-2021 RedmineUP +# Copyright (C) 2011-2024 RedmineUP # http://www.redmineup.com/ # # redmine_checklists is free software: you can redistribute it and/or modify @@ -17,10 +17,9 @@ # You should have received a copy of the GNU General Public License # along with redmine_checklists. If not, see <http://www.gnu.org/licenses/>. -require 'redmine' -require 'redmine_checklists/redmine_checklists' +requires_redmineup version_or_higher: '1.0.5' rescue raise "\n\033[31mRedmine requires newer redmineup gem version.\nPlease update with 'bundle update redmineup'.\033[0m" -CHECKLISTS_VERSION_NUMBER = '3.1.19'.freeze +CHECKLISTS_VERSION_NUMBER = '3.1.23'.freeze CHECKLISTS_VERSION_TYPE = "Light version" Redmine::Plugin.register :redmine_checklists do @@ -31,7 +30,7 @@ Redmine::Plugin.register :redmine_checklists do url 'https://www.redmineup.com/pages/plugins/checklists' author_url 'mailto:support@redmineup.com' - requires_redmine :version_or_higher => '3.0' + requires_redmine :version_or_higher => '4.0' settings :default => { :save_log => true, @@ -45,8 +44,9 @@ Redmine::Plugin.register :redmine_checklists do map.permission :edit_checklists, { :checklists => [:done, :create, :destroy, :update] } end end +end - Redmine::Search.map do |search| - # search.register :checklists - end +if (Rails.configuration.respond_to?(:autoloader) && Rails.configuration.autoloader == :zeitwerk) || Rails.version > '7.0' + Rails.autoloaders.each { |loader| loader.ignore(File.dirname(__FILE__) + '/lib') } end +require File.dirname(__FILE__) + '/lib/redmine_checklists' diff --git a/plugins/redmine_checklists/lib/redmine_checklists/redmine_checklists.rb b/plugins/redmine_checklists/lib/redmine_checklists.rb similarity index 57% rename from plugins/redmine_checklists/lib/redmine_checklists/redmine_checklists.rb rename to plugins/redmine_checklists/lib/redmine_checklists.rb index 6db0db47059db317a29a8107565de32351f183e2..88425e9f5ec80188b4fe582b3664a26805506164 100644 --- a/plugins/redmine_checklists/lib/redmine_checklists/redmine_checklists.rb +++ b/plugins/redmine_checklists/lib/redmine_checklists.rb @@ -1,7 +1,7 @@ # This file is a part of Redmine Checklists (redmine_checklists) plugin, # issue checklists management plugin for Redmine # -# Copyright (C) 2011-2021 RedmineUP +# Copyright (C) 2011-2024 RedmineUP # http://www.redmineup.com/ # # redmine_checklists is free software: you can redistribute it and/or modify @@ -17,23 +17,6 @@ # You should have received a copy of the GNU General Public License # along with redmine_checklists. If not, see <http://www.gnu.org/licenses/>. -Rails.configuration.to_prepare do - require 'redmine_checklists/patches/compatibility/application_helper_patch' - - require 'redmine_checklists/hooks/views_issues_hook' - require 'redmine_checklists/hooks/views_layouts_hook' - require 'redmine_checklists/hooks/controller_issues_hook' - - require 'redmine_checklists/patches/issue_patch' - require 'redmine_checklists/patches/project_patch' - require 'redmine_checklists/patches/issues_controller_patch' - require 'redmine_checklists/patches/add_helpers_for_checklists_patch' - require 'redmine_checklists/patches/compatibility_patch' - require 'redmine_checklists/patches/issues_helper_patch' - require 'redmine_checklists/patches/compatibility/open_struct_patch' - require 'redmine_checklists/patches/compatibility/journal_patch' -end - module RedmineChecklists def self.settings() Setting.plugin_redmine_checklists.blank? ? {} : Setting.plugin_redmine_checklists end @@ -45,3 +28,19 @@ module RedmineChecklists settings['issue_done_ratio'].to_i > 0 end end + +REDMINE_CHECKLISTS_REQUIRED_FILES = [ + 'redmine_checklists/patches/compatibility/application_helper_patch', + 'redmine_checklists/hooks/views_issues_hook', + 'redmine_checklists/hooks/views_layouts_hook', + 'redmine_checklists/hooks/controller_issues_hook', + 'redmine_checklists/patches/issue_patch', + 'redmine_checklists/patches/project_patch', + 'redmine_checklists/patches/issues_controller_patch', + 'redmine_checklists/patches/helper_for_checklists_patch', + 'redmine_checklists/patches/issues_helper_patch', + 'redmine_checklists/patches/compatibility/open_struct_patch', +] + +base_url = File.dirname(__FILE__) +REDMINE_CHECKLISTS_REQUIRED_FILES.each { |file| require(base_url + '/' + file) } diff --git a/plugins/redmine_checklists/lib/redmine_checklists/hooks/controller_issues_hook.rb b/plugins/redmine_checklists/lib/redmine_checklists/hooks/controller_issues_hook.rb index 2a8cde023e9762eeee94cb31626894c07e4e8723..fd4d639f827d73e1bdc83da6d9e985c533920c5a 100644 --- a/plugins/redmine_checklists/lib/redmine_checklists/hooks/controller_issues_hook.rb +++ b/plugins/redmine_checklists/lib/redmine_checklists/hooks/controller_issues_hook.rb @@ -1,7 +1,7 @@ # This file is a part of Redmine Checklists (redmine_checklists) plugin, # issue checklists management plugin for Redmine # -# Copyright (C) 2011-2021 RedmineUP +# Copyright (C) 2011-2024 RedmineUP # http://www.redmineup.com/ # # redmine_checklists is free software: you can redistribute it and/or modify diff --git a/plugins/redmine_checklists/lib/redmine_checklists/hooks/views_issues_hook.rb b/plugins/redmine_checklists/lib/redmine_checklists/hooks/views_issues_hook.rb index 79c2294c76a13d3c8c1286bf66a240aa82698a70..8fc562a35b8cef3f6613d75e3ad5b09f80abab97 100644 --- a/plugins/redmine_checklists/lib/redmine_checklists/hooks/views_issues_hook.rb +++ b/plugins/redmine_checklists/lib/redmine_checklists/hooks/views_issues_hook.rb @@ -1,7 +1,7 @@ # This file is a part of Redmine Checklists (redmine_checklists) plugin, # issue checklists management plugin for Redmine # -# Copyright (C) 2011-2021 RedmineUP +# Copyright (C) 2011-2024 RedmineUP # http://www.redmineup.com/ # # redmine_checklists is free software: you can redistribute it and/or modify diff --git a/plugins/redmine_checklists/lib/redmine_checklists/hooks/views_layouts_hook.rb b/plugins/redmine_checklists/lib/redmine_checklists/hooks/views_layouts_hook.rb index 852f30a54298a50cb058c285200f9060588a4021..f54450db524b70d10dd9e2faf2936ad948b2311e 100644 --- a/plugins/redmine_checklists/lib/redmine_checklists/hooks/views_layouts_hook.rb +++ b/plugins/redmine_checklists/lib/redmine_checklists/hooks/views_layouts_hook.rb @@ -1,7 +1,7 @@ # This file is a part of Redmine Checklists (redmine_checklists) plugin, # issue checklists management plugin for Redmine # -# Copyright (C) 2011-2021 RedmineUP +# Copyright (C) 2011-2024 RedmineUP # http://www.redmineup.com/ # # redmine_checklists is free software: you can redistribute it and/or modify diff --git a/plugins/redmine_checklists/lib/redmine_checklists/patches/compatibility/2.1/redmine_api_test_patch.rb b/plugins/redmine_checklists/lib/redmine_checklists/patches/compatibility/2.1/redmine_api_test_patch.rb deleted file mode 100644 index d15bcfd872cab3e1408b0de179902507cdbe0f74..0000000000000000000000000000000000000000 --- a/plugins/redmine_checklists/lib/redmine_checklists/patches/compatibility/2.1/redmine_api_test_patch.rb +++ /dev/null @@ -1,275 +0,0 @@ -# This file is a part of Redmine Checklists (redmine_checklists) plugin, -# issue checklists management plugin for Redmine -# -# Copyright (C) 2011-2021 RedmineUP -# http://www.redmineup.com/ -# -# redmine_checklists is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# redmine_checklists is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with redmine_checklists. If not, see <http://www.gnu.org/licenses/>. - -module Redmine - module ApiTest - # Base class for API tests - class Base < ActionDispatch::IntegrationTest - # Test that a request allows the three types of API authentication - # - # * HTTP Basic with username and password - # * HTTP Basic with an api key for the username - # * Key based with the key=X parameter - # - # @param [Symbol] http_method the HTTP method for request (:get, :post, :put, :delete) - # @param [String] url the request url - # @param [optional, Hash] parameters additional request parameters - # @param [optional, Hash] options additional options - # @option options [Symbol] :success_code Successful response code (:success) - # @option options [Symbol] :failure_code Failure response code (:unauthorized) - def self.should_allow_api_authentication(http_method, url, parameters={}, options={}) - should_allow_http_basic_auth_with_username_and_password(http_method, url, parameters, options) - should_allow_http_basic_auth_with_key(http_method, url, parameters, options) - should_allow_key_based_auth(http_method, url, parameters, options) - end - - # Test that a request allows the username and password for HTTP BASIC - # - # @param [Symbol] http_method the HTTP method for request (:get, :post, :put, :delete) - # @param [String] url the request url - # @param [optional, Hash] parameters additional request parameters - # @param [optional, Hash] options additional options - # @option options [Symbol] :success_code Successful response code (:success) - # @option options [Symbol] :failure_code Failure response code (:unauthorized) - def self.should_allow_http_basic_auth_with_username_and_password(http_method, url, parameters={}, options={}) - success_code = options[:success_code] || :success - failure_code = options[:failure_code] || :unauthorized - - context "should allow http basic auth using a username and password for #{http_method} #{url}" do - context "with a valid HTTP authentication" do - setup do - @user = User.generate! do |user| - user.admin = true - user.password = 'my_password' - end - send(http_method, url, parameters, credentials(@user.login, 'my_password')) - end - - should_respond_with success_code - should_respond_with_content_type_based_on_url(url) - should "login as the user" do - assert_equal @user, User.current - end - end - - context "with an invalid HTTP authentication" do - setup do - @user = User.generate! - send(http_method, url, parameters, credentials(@user.login, 'wrong_password')) - end - - should_respond_with failure_code - should_respond_with_content_type_based_on_url(url) - should "not login as the user" do - assert_equal User.anonymous, User.current - end - end - - context "without credentials" do - setup do - send(http_method, url, parameters) - end - - should_respond_with failure_code - should_respond_with_content_type_based_on_url(url) - should "include_www_authenticate_header" do - assert @controller.response.headers.has_key?('WWW-Authenticate') - end - end - end - end - - # Test that a request allows the API key with HTTP BASIC - # - # @param [Symbol] http_method the HTTP method for request (:get, :post, :put, :delete) - # @param [String] url the request url - # @param [optional, Hash] parameters additional request parameters - # @param [optional, Hash] options additional options - # @option options [Symbol] :success_code Successful response code (:success) - # @option options [Symbol] :failure_code Failure response code (:unauthorized) - def self.should_allow_http_basic_auth_with_key(http_method, url, parameters={}, options={}) - success_code = options[:success_code] || :success - failure_code = options[:failure_code] || :unauthorized - - context "should allow http basic auth with a key for #{http_method} #{url}" do - context "with a valid HTTP authentication using the API token" do - setup do - @user = User.generate! do |user| - user.admin = true - end - @token = Token.create!(:user => @user, :action => 'api') - send(http_method, url, parameters, credentials(@token.value, 'X')) - end - should_respond_with success_code - should_respond_with_content_type_based_on_url(url) - should_be_a_valid_response_string_based_on_url(url) - should "login as the user" do - assert_equal @user, User.current - end - end - - context "with an invalid HTTP authentication" do - setup do - @user = User.generate! - @token = Token.create!(:user => @user, :action => 'feeds') - send(http_method, url, parameters, credentials(@token.value, 'X')) - end - should_respond_with failure_code - should_respond_with_content_type_based_on_url(url) - should "not login as the user" do - assert_equal User.anonymous, User.current - end - end - end - end - - # Test that a request allows full key authentication - # - # @param [Symbol] http_method the HTTP method for request (:get, :post, :put, :delete) - # @param [String] url the request url, without the key=ZXY parameter - # @param [optional, Hash] parameters additional request parameters - # @param [optional, Hash] options additional options - # @option options [Symbol] :success_code Successful response code (:success) - # @option options [Symbol] :failure_code Failure response code (:unauthorized) - def self.should_allow_key_based_auth(http_method, url, parameters={}, options={}) - success_code = options[:success_code] || :success - failure_code = options[:failure_code] || :unauthorized - - context "should allow key based auth using key=X for #{http_method} #{url}" do - context "with a valid api token" do - setup do - @user = User.generate! do |user| - user.admin = true - end - @token = Token.create!(:user => @user, :action => 'api') - # Simple url parse to add on ?key= or &key= - request_url = if url.match(/\?/) - url + "&key=#{@token.value}" - else - url + "?key=#{@token.value}" - end - send(http_method, request_url, parameters) - end - should_respond_with success_code - should_respond_with_content_type_based_on_url(url) - should_be_a_valid_response_string_based_on_url(url) - should "login as the user" do - assert_equal @user, User.current - end - end - - context "with an invalid api token" do - setup do - @user = User.generate! do |user| - user.admin = true - end - @token = Token.create!(:user => @user, :action => 'feeds') - # Simple url parse to add on ?key= or &key= - request_url = if url.match(/\?/) - url + "&key=#{@token.value}" - else - url + "?key=#{@token.value}" - end - send(http_method, request_url, parameters) - end - should_respond_with failure_code - should_respond_with_content_type_based_on_url(url) - should "not login as the user" do - assert_equal User.anonymous, User.current - end - end - end - - context "should allow key based auth using X-Redmine-API-Key header for #{http_method} #{url}" do - setup do - @user = User.generate! do |user| - user.admin = true - end - @token = Token.create!(:user => @user, :action => 'api') - send(http_method, url, parameters, {'X-Redmine-API-Key' => @token.value.to_s}) - end - should_respond_with success_code - should_respond_with_content_type_based_on_url(url) - should_be_a_valid_response_string_based_on_url(url) - should "login as the user" do - assert_equal @user, User.current - end - end - end - - # Uses should_respond_with_content_type based on what's in the url: - # - # '/project/issues.xml' => should_respond_with_content_type :xml - # '/project/issues.json' => should_respond_with_content_type :json - # - # @param [String] url Request - def self.should_respond_with_content_type_based_on_url(url) - case - when url.match(/xml/i) - should "respond with XML" do - assert_equal 'application/xml', @response.content_type - end - when url.match(/json/i) - should "respond with JSON" do - assert_equal 'application/json', @response.content_type - end - else - raise "Unknown content type for should_respond_with_content_type_based_on_url: #{url}" - end - end - - # Uses the url to assert which format the response should be in - # - # '/project/issues.xml' => should_be_a_valid_xml_string - # '/project/issues.json' => should_be_a_valid_json_string - # - # @param [String] url Request - def self.should_be_a_valid_response_string_based_on_url(url) - case - when url.match(/xml/i) - should_be_a_valid_xml_string - when url.match(/json/i) - should_be_a_valid_json_string - else - raise "Unknown content type for should_be_a_valid_response_based_on_url: #{url}" - end - end - - # Checks that the response is a valid JSON string - def self.should_be_a_valid_json_string - should "be a valid JSON string (or empty)" do - assert(response.body.blank? || ActiveSupport::JSON.decode(response.body)) - end - end - - # Checks that the response is a valid XML string - def self.should_be_a_valid_xml_string - should "be a valid XML string" do - assert REXML::Document.new(response.body) - end - end - - def self.should_respond_with(status) - should "respond with #{status}" do - assert_response status - end - end - end - end -end diff --git a/plugins/redmine_checklists/lib/redmine_checklists/patches/compatibility/application_helper_patch.rb b/plugins/redmine_checklists/lib/redmine_checklists/patches/compatibility/application_helper_patch.rb index 47ed55ef92787092147dbb0074d9590ba456caa9..4b439300d4e5c1b816a334dadd2ca0dcd091fa44 100644 --- a/plugins/redmine_checklists/lib/redmine_checklists/patches/compatibility/application_helper_patch.rb +++ b/plugins/redmine_checklists/lib/redmine_checklists/patches/compatibility/application_helper_patch.rb @@ -1,7 +1,7 @@ # This file is a part of Redmine Checklists (redmine_checklists) plugin, # issue checklists management plugin for Redmine # -# Copyright (C) 2011-2021 RedmineUP +# Copyright (C) 2011-2024 RedmineUP # http://www.redmineup.com/ # # redmine_checklists is free software: you can redistribute it and/or modify @@ -22,8 +22,6 @@ module RedmineChecklists module ApplicationHelperPatch def self.included(base) # :nodoc: base.class_eval do - unloadable # Send unloadable so it will not be unloaded in development - def stocked_reorder_link(object, name = nil, url = {}, method = :post) Redmine::VERSION.to_s > '3.3' ? reorder_handle(object, :param => name) : reorder_links(name, url, method) end diff --git a/plugins/redmine_checklists/lib/redmine_checklists/patches/compatibility/journal_patch.rb b/plugins/redmine_checklists/lib/redmine_checklists/patches/compatibility/journal_patch.rb deleted file mode 100644 index 9892dd184a33b08159614a0652e67756646999ac..0000000000000000000000000000000000000000 --- a/plugins/redmine_checklists/lib/redmine_checklists/patches/compatibility/journal_patch.rb +++ /dev/null @@ -1,74 +0,0 @@ -# This file is a part of Redmine Checklists (redmine_checklists) plugin, -# issue checklists management plugin for Redmine -# -# Copyright (C) 2011-2021 RedmineUP -# http://www.redmineup.com/ -# -# redmine_checklists is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# redmine_checklists is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with redmine_checklists. If not, see <http://www.gnu.org/licenses/>. - -require_dependency 'journal' - -module RedmineChecklists - module Patches - module JournalPatch - def self.included(base) # :nodoc: - base.send(:include, InstanceMethods) - base.class_eval do - end - end - - module InstanceMethods - - if Redmine::VERSION.to_s < '2.6' - def send_notification - if notify? && - (Setting.notified_events.include?('issue_updated') || - (Setting.notified_events.include?('issue_note_added') && notes.present?) || - (Setting.notified_events.include?('issue_status_updated') && new_status.present?) || - (Setting.notified_events.include?('issue_priority_updated') && new_value_for('priority_id').present?) - ) - deliver_checklist_notification - end - end - - def detail_for_attribute(attribute) - details.detect { |detail| detail.prop_key == attribute } - end - end - - def deliver_checklist_notification - if Redmine::VERSION.to_s >= '4.0' - (notified_watchers | notified_users).each do |user| - Mailer.issue_edit(user, self).deliver - end - else - checklist_email_notification(self).deliver - end - end - - def checklist_email_notification(journal) - if Redmine::VERSION.to_s < '2.4' - Mailer.issue_edit(journal) - else - Mailer.issue_edit(journal, journal.notified_users, journal.notified_watchers - journal.notified_users) - end - end - end - end - end -end - -unless Journal.included_modules.include?(RedmineChecklists::Patches::JournalPatch) - Journal.send(:include, RedmineChecklists::Patches::JournalPatch) -end diff --git a/plugins/redmine_checklists/lib/redmine_checklists/patches/compatibility/open_struct_patch.rb b/plugins/redmine_checklists/lib/redmine_checklists/patches/compatibility/open_struct_patch.rb index 36c0395da877ab7d277330879534b02c9e7f0b7c..dc9900c27b32731ab3c9314bc92e3a998cc2c15b 100644 --- a/plugins/redmine_checklists/lib/redmine_checklists/patches/compatibility/open_struct_patch.rb +++ b/plugins/redmine_checklists/lib/redmine_checklists/patches/compatibility/open_struct_patch.rb @@ -1,7 +1,7 @@ # This file is a part of Redmine Checklists (redmine_checklists) plugin, # issue checklists management plugin for Redmine # -# Copyright (C) 2011-2021 RedmineUP +# Copyright (C) 2011-2024 RedmineUP # http://www.redmineup.com/ # # redmine_checklists is free software: you can redistribute it and/or modify diff --git a/plugins/redmine_checklists/lib/redmine_checklists/patches/compatibility_patch.rb b/plugins/redmine_checklists/lib/redmine_checklists/patches/compatibility_patch.rb deleted file mode 100644 index c347ab2b23db37244d0dd8eae41daf73d04ef88b..0000000000000000000000000000000000000000 --- a/plugins/redmine_checklists/lib/redmine_checklists/patches/compatibility_patch.rb +++ /dev/null @@ -1,22 +0,0 @@ -# This file is a part of Redmine Checklists (redmine_checklists) plugin, -# issue checklists management plugin for Redmine -# -# Copyright (C) 2011-2021 RedmineUP -# http://www.redmineup.com/ -# -# redmine_checklists is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# redmine_checklists is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with redmine_checklists. If not, see <http://www.gnu.org/licenses/>. - -if Redmine::VERSION.to_s < '2.3' - Dir[File.dirname(__FILE__) + '/compatibility/2.1/*.rb'].each { |f| require f } -end diff --git a/plugins/redmine_checklists/lib/redmine_checklists/patches/add_helpers_for_checklists_patch.rb b/plugins/redmine_checklists/lib/redmine_checklists/patches/helper_for_checklists_patch.rb similarity index 86% rename from plugins/redmine_checklists/lib/redmine_checklists/patches/add_helpers_for_checklists_patch.rb rename to plugins/redmine_checklists/lib/redmine_checklists/patches/helper_for_checklists_patch.rb index 660da28f021992f7c830fa3bf412dfa13164e7d5..c0777eed087331b49f1a720b161ac81728b84a50 100644 --- a/plugins/redmine_checklists/lib/redmine_checklists/patches/add_helpers_for_checklists_patch.rb +++ b/plugins/redmine_checklists/lib/redmine_checklists/patches/helper_for_checklists_patch.rb @@ -1,7 +1,7 @@ # This file is a part of Redmine Checklists (redmine_checklists) plugin, # issue checklists management plugin for Redmine # -# Copyright (C) 2011-2021 RedmineUP +# Copyright (C) 2011-2024 RedmineUP # http://www.redmineup.com/ # # redmine_checklists is free software: you can redistribute it and/or modify @@ -19,8 +19,7 @@ module RedmineChecklists module Patches - - module AddHelpersForChecklistPatch + module HelperForChecklistsPatch def self.apply(controller) controller.send(:helper, 'checklists') end @@ -29,5 +28,5 @@ module RedmineChecklists end [IssuesController].each do |controller| - RedmineChecklists::Patches::AddHelpersForChecklistPatch.apply(controller) + RedmineChecklists::Patches::HelperForChecklistsPatch.apply(controller) end diff --git a/plugins/redmine_checklists/lib/redmine_checklists/patches/issue_patch.rb b/plugins/redmine_checklists/lib/redmine_checklists/patches/issue_patch.rb index 8cfc0c617e40ad75828a7b23dc525b33a493bbc7..cf136fd1b4ea32aeaee1433b9944fea48dfdbe54 100644 --- a/plugins/redmine_checklists/lib/redmine_checklists/patches/issue_patch.rb +++ b/plugins/redmine_checklists/lib/redmine_checklists/patches/issue_patch.rb @@ -1,7 +1,7 @@ # This file is a part of Redmine Checklists (redmine_checklists) plugin, # issue checklists management plugin for Redmine # -# Copyright (C) 2011-2021 RedmineUP +# Copyright (C) 2011-2024 RedmineUP # http://www.redmineup.com/ # # redmine_checklists is free software: you can redistribute it and/or modify @@ -25,20 +25,16 @@ module RedmineChecklists def self.included(base) # :nodoc: base.send(:include, InstanceMethods) base.class_eval do - unloadable # Send unloadable so it will not be unloaded in development attr_accessor :old_checklists attr_accessor :removed_checklist_ids + attr_accessor :checklists_from_params attr_reader :copied_from alias_method :copy_without_checklist, :copy alias_method :copy, :copy_with_checklist after_save :copy_subtask_checklists - if ActiveRecord::VERSION::MAJOR >= 4 - has_many :checklists, lambda { order("#{Checklist.table_name}.position") }, :class_name => 'Checklist', :dependent => :destroy, :inverse_of => :issue - else - has_many :checklists, :class_name => 'Checklist', :dependent => :destroy, :inverse_of => :issue, :order => 'position' - end + has_many :checklists, lambda { order("#{Checklist.table_name}.position") }, :class_name => 'Checklist', :dependent => :destroy, :inverse_of => :issue accepts_nested_attributes_for :checklists, :allow_destroy => true, :reject_if => proc { |attrs| attrs['subject'].blank? } @@ -52,15 +48,16 @@ module RedmineChecklists module InstanceMethods def copy_checklists(arg) issue = arg.is_a?(Issue) ? arg : Issue.visible.find(arg) - if issue - issue.checklists.each do |checklist| - Checklist.create(checklist.attributes.except('id', 'issue_id').merge(issue: self)) - end + return unless issue + + issue.checklists.each do |checklist| + Checklist.create(checklist.attributes.except('id', 'issue_id').merge(issue: self)) end end def copy_subtask_checklists - return if !copy? || parent_id.nil? || checklists.reload.any? + return if checklists_from_params || !copy? || parent_id.nil? || checklists.reload.any? + copy_checklists(@copied_from) end diff --git a/plugins/redmine_checklists/lib/redmine_checklists/patches/issue_query_patch.rb b/plugins/redmine_checklists/lib/redmine_checklists/patches/issue_query_patch.rb index 4e613f9c272bb08131aa476718ef763142f10310..5a768c0faf391bc3f55a0a784536f9513965ea15 100644 --- a/plugins/redmine_checklists/lib/redmine_checklists/patches/issue_query_patch.rb +++ b/plugins/redmine_checklists/lib/redmine_checklists/patches/issue_query_patch.rb @@ -1,7 +1,7 @@ # This file is a part of Redmine Checklists (redmine_checklists) plugin, # issue checklists management plugin for Redmine # -# Copyright (C) 2011-2021 RedmineUP +# Copyright (C) 2011-2024 RedmineUP # http://www.redmineup.com/ # # redmine_checklists is free software: you can redistribute it and/or modify diff --git a/plugins/redmine_checklists/lib/redmine_checklists/patches/issues_controller_patch.rb b/plugins/redmine_checklists/lib/redmine_checklists/patches/issues_controller_patch.rb index f927fd43761f88f85f84408d9e4409715fc09b8b..f007eb7cc6be446766b76e1781caf82060868e90 100644 --- a/plugins/redmine_checklists/lib/redmine_checklists/patches/issues_controller_patch.rb +++ b/plugins/redmine_checklists/lib/redmine_checklists/patches/issues_controller_patch.rb @@ -1,7 +1,7 @@ # This file is a part of Redmine Checklists (redmine_checklists) plugin, # issue checklists management plugin for Redmine # -# Copyright (C) 2011-2021 RedmineUP +# Copyright (C) 2011-2024 RedmineUP # http://www.redmineup.com/ # # redmine_checklists is free software: you can redistribute it and/or modify @@ -24,8 +24,6 @@ module RedmineChecklists def self.included(base) # :nodoc: base.send(:include, InstanceMethods) base.class_eval do - unloadable # Send unloadable so it will not be unloaded in development - alias_method :build_new_issue_from_params_without_checklist, :build_new_issue_from_params alias_method :build_new_issue_from_params, :build_new_issue_from_params_with_checklist before_action :save_before_state, :only => [:update] @@ -46,6 +44,7 @@ module RedmineChecklists end end build_new_issue_from_params_without_checklist + @issue.checklists_from_params = true end def save_before_state diff --git a/plugins/redmine_checklists/lib/redmine_checklists/patches/issues_helper_patch.rb b/plugins/redmine_checklists/lib/redmine_checklists/patches/issues_helper_patch.rb index 07333cfdfcc88a50e6c6be19b63a3d0c06c92401..e0e8f9e6efac57f3778d5988ad49b7f03b758a72 100644 --- a/plugins/redmine_checklists/lib/redmine_checklists/patches/issues_helper_patch.rb +++ b/plugins/redmine_checklists/lib/redmine_checklists/patches/issues_helper_patch.rb @@ -1,7 +1,7 @@ # This file is a part of Redmine Checklists (redmine_checklists) plugin, # issue checklists management plugin for Redmine # -# Copyright (C) 2011-2021 RedmineUP +# Copyright (C) 2011-2024 RedmineUP # http://www.redmineup.com/ # # redmine_checklists is free software: you can redistribute it and/or modify @@ -24,8 +24,6 @@ module RedmineChecklists base.send(:include, InstanceMethods) base.class_eval do - unloadable - alias_method :details_to_strings_without_checklists, :details_to_strings alias_method :details_to_strings, :details_to_strings_with_checklists end diff --git a/plugins/redmine_checklists/lib/redmine_checklists/patches/notifiable_patch.rb b/plugins/redmine_checklists/lib/redmine_checklists/patches/notifiable_patch.rb index c0fa95b834243bab5ae5efd7f729a0365420eac7..a6daac4dc68172cf23519e0d7bbd37375f66051a 100644 --- a/plugins/redmine_checklists/lib/redmine_checklists/patches/notifiable_patch.rb +++ b/plugins/redmine_checklists/lib/redmine_checklists/patches/notifiable_patch.rb @@ -1,7 +1,7 @@ # This file is a part of Redmine Checklists (redmine_checklists) plugin, # issue checklists management plugin for Redmine # -# Copyright (C) 2011-2021 RedmineUP +# Copyright (C) 2011-2024 RedmineUP # http://www.redmineup.com/ # # redmine_checklists is free software: you can redistribute it and/or modify diff --git a/plugins/redmine_checklists/lib/redmine_checklists/patches/project_patch.rb b/plugins/redmine_checklists/lib/redmine_checklists/patches/project_patch.rb index d2985db8039ecf1549eca2a56f27b7f9c39cc95c..66636e9aa7e7dbf92b85d91981d7aa4620bcdbaa 100644 --- a/plugins/redmine_checklists/lib/redmine_checklists/patches/project_patch.rb +++ b/plugins/redmine_checklists/lib/redmine_checklists/patches/project_patch.rb @@ -1,7 +1,7 @@ # This file is a part of Redmine Checklists (redmine_checklists) plugin, # issue checklists management plugin for Redmine # -# Copyright (C) 2011-2021 RedmineUP +# Copyright (C) 2011-2024 RedmineUP # http://www.redmineup.com/ # # redmine_checklists is free software: you can redistribute it and/or modify @@ -25,7 +25,6 @@ module RedmineChecklists def self.included(base) # :nodoc: base.send(:include, InstanceMethods) base.class_eval do - unloadable # Send unloadable so it will not be unloaded in development alias_method :copy_issues_without_checklist, :copy_issues alias_method :copy_issues, :copy_issues_with_checklist end diff --git a/plugins/redmine_checklists/test/functional/checklists_controller_test.rb b/plugins/redmine_checklists/test/functional/checklists_controller_test.rb index 29d7a591c20fdadd120dd9d1c69758fed97afcaa..855fe3c5c0b3e2de6266d69f265a61066e1d7616 100644 --- a/plugins/redmine_checklists/test/functional/checklists_controller_test.rb +++ b/plugins/redmine_checklists/test/functional/checklists_controller_test.rb @@ -3,7 +3,7 @@ # This file is a part of Redmine Checklists (redmine_checklists) plugin, # issue checklists management plugin for Redmine # -# Copyright (C) 2011-2021 RedmineUP +# Copyright (C) 2011-2024 RedmineUP # http://www.redmineup.com/ # # redmine_checklists is free software: you can redistribute it and/or modify diff --git a/plugins/redmine_checklists/test/functional/issues_controller_test.rb b/plugins/redmine_checklists/test/functional/issues_controller_test.rb index ad83748c82c15ddd3a7fd36ca0841aadc829ca8d..f36646b1dfaec958981bf77521ae82a03b3d8aab 100644 --- a/plugins/redmine_checklists/test/functional/issues_controller_test.rb +++ b/plugins/redmine_checklists/test/functional/issues_controller_test.rb @@ -3,7 +3,7 @@ # This file is a part of Redmine Checklists (redmine_checklists) plugin, # issue checklists management plugin for Redmine # -# Copyright (C) 2011-2021 RedmineUP +# Copyright (C) 2011-2024 RedmineUP # http://www.redmineup.com/ # # redmine_checklists is free software: you can redistribute it and/or modify @@ -59,7 +59,7 @@ class IssuesControllerTest < ActionController::TestCase def test_new_issue_without_project compatible_request :get, :new assert_response :success - end if Redmine::VERSION.to_s > '3.0' + end def test_get_show_issue issue = Issue.find(1) @@ -91,11 +91,7 @@ class IssuesControllerTest < ActionController::TestCase @request.session[:user_id] = 1 issue = Issue.find(1) - if Redmine::VERSION.to_s > '2.3' && Redmine::VERSION.to_s < '3.0' - compatible_xhr_request :put, :update_form, :issue => parameters, :project_id => issue.project - else - compatible_xhr_request :put, :new, :issue => parameters, :project_id => issue.project - end + compatible_xhr_request :put, :new, :issue => parameters, :project_id => issue.project assert_response :success assert_match 'text/javascript', response.content_type assert_match 'FirstChecklist', response.body @@ -178,6 +174,20 @@ class IssuesControllerTest < ActionController::TestCase assert_not_nil issue end + def test_delete_issue_with_checklists + @request.session[:user_id] = 1 + other_checklist = Checklist.first + other_checklist.update(position: 2) + + assert_difference('Issue.count', -1) do + assert_difference('Checklist.count', -2) do + compatible_request :post, :destroy, id: '2' + assert_response :redirect + end + end + assert_equal other_checklist.position, other_checklist.reload.position + end + def test_create_issue_using_json old_value = Setting.rest_api_enabled Setting.rest_api_enabled = '1' diff --git a/plugins/redmine_checklists/test/integration/api_test/checklists_test.rb b/plugins/redmine_checklists/test/integration/api_test/checklists_test.rb index 9ad8c35f4092fa3cf02ed606f40029e64d38a3c0..6d7bc56b61f673554e9eaf0bac3af7814e6f8010 100644 --- a/plugins/redmine_checklists/test/integration/api_test/checklists_test.rb +++ b/plugins/redmine_checklists/test/integration/api_test/checklists_test.rb @@ -3,7 +3,7 @@ # This file is a part of Redmine Checklists (redmine_checklists) plugin, # issue checklists management plugin for Redmine # -# Copyright (C) 2011-2021 RedmineUP +# Copyright (C) 2011-2024 RedmineUP # http://www.redmineup.com/ # # redmine_checklists is free software: you can redistribute it and/or modify @@ -63,6 +63,18 @@ class Redmine::ApiTest::ChecklistsTest < Redmine::ApiTest::Base end end + def test_get_checklists_with_section_xml + compatible_api_request :get, '/issues/2/checklists.xml', {}, credentials('admin') + + assert_select 'checklists[type=array]' do + assert_select 'checklist' do + assert_select 'id', :text => '4' + assert_select 'subject', :text => 'New section' + assert_select 'is_section', :text => 'true' + end + end + end + def test_get_checklists_1_xml compatible_api_request :get, '/checklists/1.xml', {}, credentials('admin') @@ -72,6 +84,26 @@ class Redmine::ApiTest::ChecklistsTest < Redmine::ApiTest::Base end end + def test_get_checklists_2_with_section_xml + compatible_api_request :get, '/checklists/4.xml', {}, credentials('admin') + + assert_select 'checklist' do + assert_select 'id', :text => '4' + assert_select 'subject', :text => 'New section' + assert_select 'is_section', :text => 'true' + end + end + + def test_checklists_2_should_not_section_xml + compatible_api_request :get, '/checklists/3.xml', {}, credentials('admin') + + assert_select 'checklist' do + assert_select 'id', :text => '3' + assert_select 'subject', :text => 'Third todo' + assert_select 'is_section', :text => 'false' + end + end + def test_post_checklists_xml parameters = { :checklist => { :issue_id => 1, :subject => 'api_test_001', diff --git a/plugins/redmine_checklists/test/integration/common_issue_test.rb b/plugins/redmine_checklists/test/integration/common_issue_test.rb index 47520a189aa5c02aed509bd0d22053cecd74df1f..458c628f8644fdedebec9f157e54a4341611096a 100644 --- a/plugins/redmine_checklists/test/integration/common_issue_test.rb +++ b/plugins/redmine_checklists/test/integration/common_issue_test.rb @@ -3,7 +3,7 @@ # This file is a part of Redmine Checklists (redmine_checklists) plugin, # issue checklists management plugin for Redmine # -# Copyright (C) 2011-2021 RedmineUP +# Copyright (C) 2011-2024 RedmineUP # http://www.redmineup.com/ # # redmine_checklists is free software: you can redistribute it and/or modify diff --git a/plugins/redmine_checklists/test/test_helper.rb b/plugins/redmine_checklists/test/test_helper.rb index 0d949e78c7ab4e9be640339926f1a71426296354..39fc8e90a043655b58fd63afc125a40bb76a17cf 100644 --- a/plugins/redmine_checklists/test/test_helper.rb +++ b/plugins/redmine_checklists/test/test_helper.rb @@ -3,7 +3,7 @@ # This file is a part of Redmine Checklists (redmine_checklists) plugin, # issue checklists management plugin for Redmine # -# Copyright (C) 2011-2021 RedmineUP +# Copyright (C) 2011-2024 RedmineUP # http://www.redmineup.com/ # # redmine_checklists is free software: you can redistribute it and/or modify @@ -55,19 +55,11 @@ end include RedmineChecklists::TestHelper -if ActiveRecord::VERSION::MAJOR >= 4 - class RedmineChecklists::IntegrationTest < Redmine::IntegrationTest; end -else - class RedmineChecklists::IntegrationTest < ActionController::IntegrationTest; end -end +class RedmineChecklists::IntegrationTest < Redmine::IntegrationTest; end class RedmineChecklists::TestCase def self.create_fixtures(fixtures_directory, table_names, class_names = {}) - if ActiveRecord::VERSION::MAJOR >= 4 - ActiveRecord::FixtureSet.create_fixtures(fixtures_directory, table_names, class_names = {}) - else - ActiveRecord::Fixtures.create_fixtures(fixtures_directory, table_names, class_names = {}) - end + ActiveRecord::FixtureSet.create_fixtures(fixtures_directory, table_names, class_names = {}) end def self.prepare diff --git a/plugins/redmine_checklists/test/unit/checklist_test.rb b/plugins/redmine_checklists/test/unit/checklist_test.rb index 63e498fc349547b471c4b01c3ffb663b0f8dca99..8034beba997f50e7730b20acc01e57d2484dcf84 100644 --- a/plugins/redmine_checklists/test/unit/checklist_test.rb +++ b/plugins/redmine_checklists/test/unit/checklist_test.rb @@ -3,7 +3,7 @@ # This file is a part of Redmine Checklists (redmine_checklists) plugin, # issue checklists management plugin for Redmine # -# Copyright (C) 2011-2021 RedmineUP +# Copyright (C) 2011-2024 RedmineUP # http://www.redmineup.com/ # # redmine_checklists is free software: you can redistribute it and/or modify diff --git a/plugins/redmine_checklists/test/unit/issue_test.rb b/plugins/redmine_checklists/test/unit/issue_test.rb index 8ea4c0550422af8241dd209edb3d973f416137b2..87fe01f64fd252f3a2ddea471ccad5888b2219fb 100644 --- a/plugins/redmine_checklists/test/unit/issue_test.rb +++ b/plugins/redmine_checklists/test/unit/issue_test.rb @@ -3,7 +3,7 @@ # This file is a part of Redmine Checklists (redmine_checklists) plugin, # issue checklists management plugin for Redmine # -# Copyright (C) 2011-2021 RedmineUP +# Copyright (C) 2011-2024 RedmineUP # http://www.redmineup.com/ # # redmine_checklists is free software: you can redistribute it and/or modify diff --git a/plugins/redmine_checklists/test/unit/project_test.rb b/plugins/redmine_checklists/test/unit/project_test.rb index 5e8775cb0f0e32392b6b29f13b16bd046de10267..d32ff1404050bb326ab0b0b240c8eaf3a86c336b 100644 --- a/plugins/redmine_checklists/test/unit/project_test.rb +++ b/plugins/redmine_checklists/test/unit/project_test.rb @@ -3,7 +3,7 @@ # This file is a part of Redmine Checklists (redmine_checklists) plugin, # issue checklists management plugin for Redmine # -# Copyright (C) 2011-2021 RedmineUP +# Copyright (C) 2011-2024 RedmineUP # http://www.redmineup.com/ # # redmine_checklists is free software: you can redistribute it and/or modify