v2.0.0 released

This commit is contained in:
Karel Pičman 2022-04-28 12:50:34 +02:00
commit 651da657e0
64 changed files with 186 additions and 261 deletions

View File

@ -1,7 +1,7 @@
# Redmine plugin for Custom Workflows
#
# Copyright © 2015-19 Anton Argirov
# Copyright © 2019-21 Karel Pičman <karel.picman@kontron.com>
# Copyright © 2019-22 Karel Pičman <karel.picman@kontron.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -1,6 +1,17 @@
Changelog for Custom Workflows
==============================
2.0.0 *2022-04-27*
------------------
Redmine 5.0
* New: #255 - Can you update it to Redmine 5.0.0
* New: #252 - Rails 6
* Bug: #248 - Redmine 4.2.3 doesn't start after installing custom workflow plugin
* New: #239 - Gitlab CI enhancement
1.0.7 *2021-10-20*
------------------

View File

@ -1,7 +1,7 @@
# Redmine plugin for Custom Workflows
#
# Copyright © 2015-19 Anton Argirov
# Copyright © 2019-21 Karel Pičman <karel.picman@kontron.com>
# Copyright © 2019-22 Karel Pičman <karel.picman@kontron.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -3,7 +3,7 @@
# Redmine plugin for Custom Workflows
#
# Copyright © 2015-19 Anton Argirov
# Copyright © 2019-21 Karel Pičman <karel.picman@kontron.com>
# Copyright © 2019-22 Karel Pičman <karel.picman@kontron.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@ -21,10 +21,4 @@
source 'https://rubygems.org' do
gem 'acts_as_list'
gem 'activemodel-serializers-xml'
# Redmine extensions
unless %w(easyproject easy_gantt).any? { |plugin| Dir.exist?(File.expand_path("../../#{plugin}", __FILE__)) }
gem 'redmine_extensions', '~> 0.3.9'
end
end

View File

@ -1,7 +1,7 @@
Custom Workflows plug-in
========================
The current version of Redmine CustomWorkflows is **1.0.7**
The current version of Redmine CustomWorkflows is **2.0.0**
[![pipeline status](https://gitlab.kontron.com/redmine-plugins/redmine_custom_workflows/badges/master/pipeline.svg)](https://gitlab.kontron.com/redmine-plugins/redmine_custom_workflows/-/commits/master)

View File

@ -4,7 +4,7 @@
# Redmine plugin for Custom Workflows
#
# Copyright © 2015-19 Anton Argirov
# Copyright © 2019-21 Karel Pičman <karel.picman@kontron.com>
# Copyright © 2019-22 Karel Pičman <karel.picman@kontron.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@ -22,8 +22,6 @@
require_dependency File.dirname(__FILE__) + '/lib/redmine_custom_workflows.rb'
ActiveSupport::Dependencies.autoload_paths << File.join(File.dirname(__FILE__), 'app')
def custom_workflows_init
# Administration menu extension
Redmine::MenuManager.map :admin_menu do |menu|

View File

@ -4,7 +4,7 @@
# Redmine plugin for Custom Workflows
#
# Copyright © 2015-19 Anton Argirov
# Copyright © 2019-21 Karel Pičman <karel.picman@kontron.com>
# Copyright © 2019-22 Karel Pičman <karel.picman@kontron.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -4,7 +4,7 @@
# Redmine plugin for Custom Workflows
#
# Copyright © 2015-19 Anton Argirov
# Copyright © 2019-21 Karel Pičman <karel.picman@kontron.com>
# Copyright © 2019-22 Karel Pičman <karel.picman@kontron.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -4,7 +4,7 @@
# Redmine plugin for Custom Workflows
#
# Copyright © 2015-19 Anton Argirov
# Copyright © 2019-21 Karel Pičman <karel.picman@kontron.com>
# Copyright © 2019-22 Karel Pičman <karel.picman@kontron.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -4,7 +4,7 @@
# Redmine plugin for Custom Workflows
#
# Copyright © 2015-19 Anton Argirov
# Copyright © 2019-21 Karel Pičman <karel.picman@kontron.com>
# Copyright © 2019-22 Karel Pičman <karel.picman@kontron.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -4,7 +4,7 @@
# Redmine plugin for Custom Workflows
#
# Copyright © 2015-19 Anton Argirov
# Copyright © 2019-21 Karel Pičman <karel.picman@kontron.com>
# Copyright © 2019-22 Karel Pičman <karel.picman@kontron.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -4,7 +4,7 @@
# Redmine plugin for Custom Workflows
#
# Copyright © 2015-19 Anton Argirov
# Copyright © 2019-21 Karel Pičman <karel.picman@kontron.com>
# Copyright © 2019-22 Karel Pičman <karel.picman@kontron.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -4,7 +4,7 @@
# Redmine plugin for Custom Workflows
#
# Copyright © 2015-19 Anton Argirov
# Copyright © 2019-21 Karel Pičman <karel.picman@kontron.com>
# Copyright © 2019-22 Karel Pičman <karel.picman@kontron.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -4,7 +4,7 @@
# Redmine plugin for Custom Workflows
#
# Copyright © 2015-19 Anton Argirov
# Copyright © 2019-21 Karel Pičman <karel.picman@kontron.com>
# Copyright © 2019-22 Karel Pičman <karel.picman@kontron.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -4,7 +4,7 @@
# Redmine plugin for Custom Workflows
#
# Copyright © 2015-19 Anton Argirov
# Copyright © 2019-21 Karel Pičman <karel.picman@kontron.com>
# Copyright © 2019-22 Karel Pičman <karel.picman@kontron.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -4,7 +4,7 @@
# Redmine plugin for Custom Workflows
#
# Copyright © 2015-19 Anton Argirov
# Copyright © 2019-21 Karel Pičman <karel.picman@kontron.com>
# Copyright © 2019-22 Karel Pičman <karel.picman@kontron.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -2,7 +2,7 @@
* Redmine plugin for Document Management System "Features"
*
* Copyright © 2015-19 Anton Argirov
* Copyright © 2019-21 Karel Pičman <karel.picman@kontron.com>
* Copyright © 2019-22 Karel Pičman <karel.picman@kontron.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License

View File

@ -3,7 +3,7 @@
# Redmine plugin for Custom Workflows
#
# Copyright © 2015-19 Anton Argirov
# Copyright © 2019-21 Karel Pičman <karel.picman@kontron.com>
# Copyright © 2019-22 Karel Pičman <karel.picman@kontron.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -3,7 +3,7 @@
# Redmine plugin for Custom Workflows
#
# Copyright © 2015-19 Anton Argirov
# Copyright © 2019-21 Karel Pičman <karel.picman@kontron.com>
# Copyright © 2019-22 Karel Pičman <karel.picman@kontron.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -3,7 +3,7 @@
# Redmine plugin for Custom Workflows
#
# Copyright © 2015-19 Anton Argirov
# Copyright © 2019-21 Karel Pičman <karel.picman@kontron.com>
# Copyright © 2019-22 Karel Pičman <karel.picman@kontron.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -3,7 +3,7 @@
# Redmine plugin for Custom Workflows
#
# Copyright © 2015-19 Anton Argirov
# Copyright © 2019-21 Karel Pičman <karel.picman@kontron.com>
# Copyright © 2019-22 Karel Pičman <karel.picman@kontron.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -1,123 +0,0 @@
# encoding: utf-8
#
# Redmine plugin for Custom Workflows
#
# Copyright © 2015-19 Anton Argirov
# Copyright © 2019-21 Karel Pičman <karel.picman@kontron.com>
#
# This program 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 2
# of the License, or (at your option) any later version.
#
# This program 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 this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
ru:
project_module_custom_workflows_module: Пользовательские рабочие процессы
permission_manage_project_workflow: Управление пользовательскими рабочими процессами в проекте
label_custom_workflow: Пользовательский рабочий процесс
label_custom_workflow_plural: Пользовательские рабочие процессы
label_custom_workflow_new: Новый процесс
label_workflow_scripts: Сценарии
label_custom_workflow_export: Экспорт
label_custom_workflow_import: Импорт процесса
label_save_workflows: Сохранение наблюдаемых объектов
label_destroy_workflows: Уничтожение наблюдаемых объектов
label_add_workflows: Добавление наблюдаемых объектов в коллекцию
label_remove_workflows: Удаление наблюдаемых объектов из коллекции
button_custom_workflow_deactivate: Деактивировать
field_after_save: Сценарий выполняемый после сохранения наблюдаемого объекта
field_before_save: Сценарий выполняемый перед сохранением наблюдаемого объекта
field_after_destroy: Сценарий выполняемый после уничтожения наблюдаемого объекта
field_before_destroy: Сценарий выполняемый перед уничтожением наблюдаемого объекта
field_after_add: Сценарий выполняемый после добавления наблюдаемого объекта в коллекцию
field_before_add: Сценарий выполняемый перед добавлением наблюдаемого объекта в коллекцию
field_after_remove: Сценарий выполняемый после удаления наблюдаемого объекта из коллекции
field_before_remove: Сценарий выполняемый перед удалением наблюдаемого объекта из коллекции
field_shared_code: Общий код
field_observable: Наблюдаемый объект
field_enabled_for_all_projects: Разрешен для всех проектов
field_custom_workflow_author: E-Mail адрес автора
field_custom_workflow_file: Выберите XML файл ранее экспортированного процесса
field_custom_workflow:
script: Сценарий
notice_successful_import: Рабочий процесс успешно импортирован
notice_successful_status_change: Статус успешно изменен
error_failed_import: Ошибка импорта рабочего процесса (неверный формат? смотри журнал)
activerecord:
errors:
messages:
invalid_script: "содержит ошибку: %{error}"
custom_workflow_error: Ошибка в сценарии рабочего процесса (Обратитесь к администратору)
new_status_invalid: "- переход от '%{old_status}' к '%{new_status}' невозможен"
scripts_absent: Хотя бы один скрипт должен быть определен
text_select_project_custom_workflows: Выберите процессы для данного проекта
text_custom_workflow_before_save_note: Здесь вы можете изменять свойства задачи. Не создавайте и не обновляйте
связанные задачи в этом сценарии. Чтобы завершить сценарий с произвольной ошибкой, используйте `raise WorkflowError, 'Message to user'`.
text_custom_workflow_after_save_note: Вы можете обновлять и создавать задачи (в том числе и связанные задачи) здесь.
Обратите внимание, что данный сценарий будет также выполняться и для вновь создаваемых задач. Поэтому используйте
дополнительные проверки, чтобы избежать бесконечной рекурсии.
text_custom_workflow_issue_code_note: Эти сценарии исполняются в контексте задачи, как и обычные обратные вызовы
before_save и after_save. Поэтому используйте методы и свойства задачи (Issue) напрямую или через ключевое слово
self.
text_custom_workflow_issue_relation_code_note: Scripts are executed in the context of IssueRelation object like ordinary
before_save and after_save callbacks. So use methods and properties of the issue relation directly (or through `self`).
Instance variables (@variable) are also allowed and may be used if needed.
text_custom_workflow_shared_code_note: Этот код будет исполняться перед любым другим процессом и может содержать общий
код, например, функции и классы, необходимые для работы других процессов.
text_custom_workflow_user_code_note: Эти сценарии исполняются в контексте объекта пользователя когда объект
пользователя изменяется (удаляется). Используйте методы и свойства объекта пользователя (User) напрямую или через ключевое слово `self`.
text_custom_workflow_group_code_note: Эти сценарии исполняются в контексте объекта группы когда объект группы
изменяется (удаляется). Используйте методы и свойства объекта группы (Group) напрямую или через ключевое слово `self`.
text_custom_workflow_group_users_code_note: Эти сценарии выполняются когда пользователь добавляется в группу/удаляется
из группы. Используйте переменные @user и @group для доступа к соответствующим объектам из Ваших сценариев.
text_custom_workflow_attachment_code_note: Эти сценарии исполняются в контексте объекта вложения когда объект вложения
изменяется (удаляется). Используйте методы и свойства объекта вложения (Attachment) напрямую или через ключевое
слово self. Обратите внимание на то, что данные сценарии выполняются при сохранении (удалении) вложения любого типа
(задача, документ, страница Wiki и т.д.), поэтому следует дополнительно проверять в коде поле container_type либо в качестве наблюдаемого объекта выбрать конкретный тип вложения.
text_custom_workflow_issue_attachments_code_note: Эти сценарии выполняются когда вложение прикладывается
к задаче/удаляется из задачи. Используйте переменные @issue и @attachment для доступа к соответствующим объектам из Ваших сценариев.
text_custom_workflow_project_code_note: Эти сценарии исполняются в контексте объекта проекта когда объект проекта
изменяется (удаляется). Используйте методы и свойства объекта группы (Project) напрямую или через ключевое слово `self`.
text_custom_workflow_project_attachments_code_note: Эти сценарии выполняются когда файл загружается в проект/удаляется
из проекта. Используйте переменные @project и @attachment для доступа к соответствующим объектам из Ваших сценариев.
text_custom_workflow_wiki_content_code_note: Эти сценарии исполняются в контексте объекта Wiki содержания когда объект
Wiki содержания изменяется (удаляется). Используйте методы и свойства объекта содержания Wiki (WikiContent) напрямую или через ключевое слово self.
text_custom_workflow_wiki_page_attachments_code_note: Эти сценарии выполняются когда файл загружается на Wiki
страницу/удаляется с Wiki страницы. Используйте переменные @page и @attachment для доступа к соответствующим объектам из Ваших сценариев.
text_custom_workflow_time_entry_code_note: Эти сценарии исполняются в контексте объекта затраченного времени когда
объект изменяется (удаляется). Используйте методы и свойства объекта затраченного времени (TimeEntry) напрямую или через ключевое слово self.
text_custom_workflow_version_code_note: Эти сценарии исполняются в контексте объекта версии когда объект изменяется
(удаляется). Используйте методы и свойства объекта версии (Version) напрямую или через ключевое слово `self`.
text_no_enabled_projects: Нет проектов
text_custom_workflow_author: Будет использован в XML файле при экспорте
text_custom_workflow_disabled: отключен администратором
text_custom_workflow_is_for_all: разрешен для всех проектов
custom_workflow_observable_shared: <общий код>
custom_workflow_observable_issue: Задача
custom_workflow_observable_issue_attachments: Вложения задач
custom_workflow_observable_group: Группа
custom_workflow_observable_user: Пользователь
custom_workflow_observable_attachment: Вложение
custom_workflow_observable_project: Проект
custom_workflow_observable_project_attachments: Вложения проекта / Файлы
custom_workflow_observable_wiki_content: Содержание Wiki
custom_workflow_observable_wiki_page_attachments: Вложения страниц Wiki
custom_workflow_observable_group_users: Пользователи группы
custom_workflow_observable_time_entry: Затраченное время
custom_workflow_observable_version: Версия

View File

@ -4,7 +4,7 @@
# Redmine plugin for Custom Workflows
#
# Copyright © 2015-19 Anton Argirov
# Copyright © 2019-21 Karel Pičman <karel.picman@kontron.com>
# Copyright © 2019-22 Karel Pičman <karel.picman@kontron.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -3,7 +3,7 @@
# Redmine plugin for Custom Workflows
#
# Copyright © 2015-19 Anton Argirov
# Copyright © 2019-21 Karel Pičman <karel.picman@kontron.com>
# Copyright © 2019-22 Karel Pičman <karel.picman@kontron.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -3,7 +3,7 @@
# Redmine plugin for Custom Workflows
#
# Copyright © 2015-19 Anton Argirov
# Copyright © 2019-21 Karel Pičman <karel.picman@kontron.com>
# Copyright © 2019-22 Karel Pičman <karel.picman@kontron.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -3,7 +3,7 @@
# Redmine plugin for Custom Workflows
#
# Copyright © 2015-19 Anton Argirov
# Copyright © 2019-21 Karel Pičman <karel.picman@kontron.com>
# Copyright © 2019-22 Karel Pičman <karel.picman@kontron.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -3,7 +3,7 @@
# Redmine plugin for Custom Workflows
#
# Copyright © 2015-19 Anton Argirov
# Copyright © 2019-21 Karel Pičman <karel.picman@kontron.com>
# Copyright © 2019-22 Karel Pičman <karel.picman@kontron.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -3,7 +3,7 @@
# Redmine plugin for Custom Workflows
#
# Copyright © 2015-19 Anton Argirov
# Copyright © 2019-21 Karel Pičman <karel.picman@kontron.com>
# Copyright © 2019-22 Karel Pičman <karel.picman@kontron.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -3,7 +3,7 @@
# Redmine plugin for Custom Workflows
#
# Copyright © 2015-19 Anton Argirov
# Copyright © 2019-21 Karel Pičman <karel.picman@kontron.com>
# Copyright © 2019-22 Karel Pičman <karel.picman@kontron.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -3,7 +3,7 @@
# Redmine plugin for Custom Workflows
#
# Copyright © 2015-19 Anton Argirov
# Copyright © 2019-21 Karel Pičman <karel.picman@kontron.com>
# Copyright © 2019-22 Karel Pičman <karel.picman@kontron.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -3,7 +3,7 @@
# Redmine plugin for Custom Workflows
#
# Copyright © 2015-19 Anton Argirov
# Copyright © 2019-21 Karel Pičman <karel.picman@kontron.com>
# Copyright © 2019-22 Karel Pičman <karel.picman@kontron.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -3,7 +3,7 @@
# Redmine plugin for Custom Workflows
#
# Copyright © 2015-19 Anton Argirov
# Copyright © 2019-21 Karel Pičman <karel.picman@kontron.com>
# Copyright © 2019-22 Karel Pičman <karel.picman@kontron.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -3,7 +3,7 @@
# Redmine plugin for Custom Workflows
#
# Copyright © 2015-19 Anton Argirov
# Copyright © 2019-21 Karel Pičman <karel.picman@kontron.com>
# Copyright © 2019-22 Karel Pičman <karel.picman@kontron.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -3,7 +3,7 @@
# Redmine plugin for Custom Workflows
#
# Copyright © 2015-19 Anton Argirov
# Copyright © 2019-21 Karel Pičman <karel.picman@kontron.com>
# Copyright © 2019-22 Karel Pičman <karel.picman@kontron.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -3,7 +3,7 @@
# Redmine plugin for Custom Workflows
#
# Copyright © 2015-19 Anton Argirov
# Copyright © 2019-21 Karel Pičman <karel.picman@kontron.com>
# Copyright © 2019-22 Karel Pičman <karel.picman@kontron.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -3,7 +3,7 @@
# Redmine plugin for Custom Workflows
#
# Copyright © 2015-19 Anton Argirov
# Copyright © 2019-21 Karel Pičman <karel.picman@kontron.com>
# Copyright © 2019-22 Karel Pičman <karel.picman@kontron.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -3,7 +3,7 @@
# Redmine plugin for Custom Workflows
#
# Copyright © 2015-19 Anton Argirov
# Copyright © 2019-21 Karel Pičman <karel.picman@kontron.com>
# Copyright © 2019-22 Karel Pičman <karel.picman@kontron.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -4,7 +4,7 @@
# Redmine plugin for Custom Workflows
#
# Copyright © 2015-19 Anton Argirov
# Copyright © 2019-21 Karel Pičman <karel.picman@kontron.com>
# Copyright © 2019-22 Karel Pičman <karel.picman@kontron.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@ -32,7 +32,7 @@ Redmine::Plugin.register :redmine_custom_workflows do
end
author 'Anton Argirov/Karel Pičman'
description 'It allows to create custom workflows for objects, defined in a plain Ruby language'
version '1.0.7'
version '2.0.0'
requires_redmine version_or_higher: '4.1.0'

View File

@ -4,7 +4,7 @@
# Redmine plugin for Custom Workflows
#
# Copyright © 2015-19 Anton Argirov
# Copyright © 2019-21 Karel Pičman <karel.picman@kontron.com>
# Copyright © 2019-22 Karel Pičman <karel.picman@kontron.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@ -21,20 +21,20 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
# Hooks
require 'redmine_custom_workflows/hooks/hooks'
require File.dirname(__FILE__) + '/redmine_custom_workflows/hooks/views/base_view_hooks'
# Errors
require 'redmine_custom_workflows/errors/workflow_error'
require File.dirname(__FILE__) + '/redmine_custom_workflows/errors/workflow_error'
# Patches
require 'redmine_custom_workflows/patches/attachment_patch'
require 'redmine_custom_workflows/patches/group_patch'
require 'redmine_custom_workflows/patches/issue_patch'
require 'redmine_custom_workflows/patches/issue_relation_patch'
require 'redmine_custom_workflows/patches/project_patch'
require 'redmine_custom_workflows/patches/projects_helper_patch'
require 'redmine_custom_workflows/patches/time_entry_patch'
require 'redmine_custom_workflows/patches/user_patch'
require 'redmine_custom_workflows/patches/version_patch'
require 'redmine_custom_workflows/patches/wiki_content_patch'
require 'redmine_custom_workflows/patches/wiki_page_patch'
require File.dirname(__FILE__) + '/redmine_custom_workflows/patches/attachment_patch'
require File.dirname(__FILE__) + '/redmine_custom_workflows/patches/group_patch'
require File.dirname(__FILE__) + '/redmine_custom_workflows/patches/issue_patch'
require File.dirname(__FILE__) + '/redmine_custom_workflows/patches/issue_relation_patch'
require File.dirname(__FILE__) + '/redmine_custom_workflows/patches/project_patch'
require File.dirname(__FILE__) + '/redmine_custom_workflows/patches/projects_helper_patch'
require File.dirname(__FILE__) + '/redmine_custom_workflows/patches/time_entry_patch'
require File.dirname(__FILE__) + '/redmine_custom_workflows/patches/user_patch'
require File.dirname(__FILE__) + '/redmine_custom_workflows/patches/version_patch'
require File.dirname(__FILE__) + '/redmine_custom_workflows/patches/wiki_content_patch'
require File.dirname(__FILE__) + '/redmine_custom_workflows/patches/wiki_page_patch'

View File

@ -4,7 +4,7 @@
# Redmine plugin for Custom Workflows
#
# Copyright © 2015-19 Anton Argirov
# Copyright © 2019-21 Karel Pičman <karel.picman@kontron.com>
# Copyright © 2019-22 Karel Pičman <karel.picman@kontron.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@ -20,11 +20,16 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
class WorkflowError < StandardError
attr_accessor :error
module RedmineCustomWorkflows
module Errors
def initialize(message)
@error = message
super message
class WorkflowError < StandardError
attr_accessor :error
def initialize(message)
@error = message
super message
end
end
end
end
end

View File

@ -4,7 +4,7 @@
# Redmine plugin for Custom Workflows
#
# Copyright © 2015-19 Anton Argirov
# Copyright © 2019-21 Karel Pičman <karel.picman@kontron.com>
# Copyright © 2019-22 Karel Pičman <karel.picman@kontron.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@ -21,14 +21,18 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
module RedmineCustomWorkflows
module Hooks
module Views
class Hooks < Redmine::Hook::ViewListener
class BaseViewHooks < Redmine::Hook::ViewListener
def view_layouts_base_html_head(context={})
return unless /^(CustomWorkflows|Projects)/.match?(context[:controller].class.name)
"\n".html_safe + stylesheet_link_tag('custom_workflows.css', plugin: :redmine_custom_workflows)
end
end
def view_layouts_base_html_head(context={})
return unless /^(CustomWorkflows|Projects)/.match?(context[:controller].class.name)
"\n".html_safe + stylesheet_link_tag('custom_workflows.css', plugin: :redmine_custom_workflows)
end
end
end

View File

@ -4,7 +4,7 @@
# Redmine plugin for Custom Workflows
#
# Copyright © 2015-19 Anton Argirov
# Copyright © 2019-21 Karel Pičman <karel.picman@kontron.com>
# Copyright © 2019-22 Karel Pičman <karel.picman@kontron.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@ -24,7 +24,7 @@ module RedmineCustomWorkflows
module Patches
module AttachmentPatch
def self.included(base)
def self.prepended(base)
base.class_eval do
before_save :before_save_custom_workflows
after_save :after_save_custom_workflows
@ -60,6 +60,9 @@ module RedmineCustomWorkflows
end
end
# Apply patch
RedmineExtensions::PatchManager.register_model_patch 'Attachment',
'RedmineCustomWorkflows::Patches::AttachmentPatch'
# Apply the patch
if Redmine::Plugin.installed?(:easy_extensions)
RedmineExtensions::PatchManager.register_model_patch 'Attachment', 'RedmineCustomWorkflows::Patches::AttachmentPatch'
else
Attachment.prepend RedmineCustomWorkflows::Patches::AttachmentPatch
end

View File

@ -4,7 +4,7 @@
# Redmine plugin for Custom Workflows
#
# Copyright © 2015-19 Anton Argirov
# Copyright © 2019-21 Karel Pičman <karel.picman@kontron.com>
# Copyright © 2019-22 Karel Pičman <karel.picman@kontron.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@ -24,7 +24,7 @@ module RedmineCustomWorkflows
module Patches
module GroupPatch
def self.included(base)
def self.prepended(base)
base.class_eval do
before_save :before_save_custom_workflows
after_save :after_save_custom_workflows
@ -74,6 +74,10 @@ module RedmineCustomWorkflows
end
end
# Apply patch
RedmineExtensions::PatchManager.register_model_patch 'Group',
'RedmineCustomWorkflows::Patches::GroupPatch'
# Apply the patch
if Redmine::Plugin.installed?(:easy_extensions)
RedmineExtensions::PatchManager.register_model_patch 'Group',
'RedmineCustomWorkflows::Patches::GroupPatch'
else
Group.prepend RedmineCustomWorkflows::Patches::GroupPatch
end

View File

@ -4,7 +4,7 @@
# Redmine plugin for Custom Workflows
#
# Copyright © 2015-19 Anton Argirov
# Copyright © 2019-21 Karel Pičman <karel.picman@kontron.com>
# Copyright © 2019-22 Karel Pičman <karel.picman@kontron.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@ -24,7 +24,7 @@ module RedmineCustomWorkflows
module Patches
module IssuePatch
def self.included(base)
def self.prepended(base)
base.class_eval do
before_save :before_save_custom_workflows
after_save :after_save_custom_workflows
@ -88,6 +88,9 @@ module RedmineCustomWorkflows
end
end
# Apply patch
RedmineExtensions::PatchManager.register_model_patch 'Issue',
'RedmineCustomWorkflows::Patches::IssuePatch'
# Apply the patch
if Redmine::Plugin.installed?(:easy_extensions)
RedmineExtensions::PatchManager.register_model_patch 'Issue', 'RedmineCustomWorkflows::Patches::IssuePatch'
else
Issue.prepend RedmineCustomWorkflows::Patches::IssuePatch
end

View File

@ -4,7 +4,7 @@
# Redmine plugin for Custom Workflows
#
# Copyright © 2015-19 Anton Argirov
# Copyright © 2019-21 Karel Pičman <karel.picman@kontron.com>
# Copyright © 2019-22 Karel Pičman <karel.picman@kontron.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@ -24,7 +24,7 @@ module RedmineCustomWorkflows
module Patches
module IssueRelationPatch
def self.included(base)
def self.prepended(base)
base.class_eval do
before_save :before_save_custom_workflows
after_save :after_save_custom_workflows
@ -73,6 +73,9 @@ module RedmineCustomWorkflows
end
end
# Apply patch
RedmineExtensions::PatchManager.register_model_patch 'IssueRelation',
'RedmineCustomWorkflows::Patches::IssueRelationPatch'
# Apply the patch
if Redmine::Plugin.installed?(:easy_extensions)
RedmineExtensions::PatchManager.register_model_patch 'IssueRelation', 'RedmineCustomWorkflows::Patches::IssueRelationPatch'
else
IssueRelation.prepend RedmineCustomWorkflows::Patches::IssueRelationPatch
end

View File

@ -4,7 +4,7 @@
# Redmine plugin for Custom Workflows
#
# Copyright © 2015-19 Anton Argirov
# Copyright © 2019-21 Karel Pičman <karel.picman@kontron.com>
# Copyright © 2019-22 Karel Pičman <karel.picman@kontron.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@ -51,5 +51,9 @@ module RedmineCustomWorkflows
end
end
RedmineExtensions::PatchManager.register_model_patch 'Mailer',
'RedmineCustomWorkflows::Patches::MailerPatch'
# Apply the patch
if Redmine::Plugin.installed?(:easy_extensions)
RedmineExtensions::PatchManager.register_model_patch 'Mailer', 'RedmineCustomWorkflows::Patches::MailerPatch'
else
Mailer.prepend RedmineCustomWorkflows::Patches::MailerPatch
end

View File

@ -4,7 +4,7 @@
# Redmine plugin for Custom Workflows
#
# Copyright © 2015-19 Anton Argirov
# Copyright © 2019-21 Karel Pičman <karel.picman@kontron.com>
# Copyright © 2019-22 Karel Pičman <karel.picman@kontron.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@ -24,7 +24,7 @@ module RedmineCustomWorkflows
module Patches
module ProjectPatch
def self.included(base)
def self.prepended(base)
base.class_eval do
has_and_belongs_to_many :custom_workflows
safe_attributes :custom_workflow_ids, if:
@ -75,6 +75,9 @@ module RedmineCustomWorkflows
end
end
# Apply patch
RedmineExtensions::PatchManager.register_model_patch 'Project',
'RedmineCustomWorkflows::Patches::ProjectPatch'
# Apply the patch
if Redmine::Plugin.installed?(:easy_extensions)
RedmineExtensions::PatchManager.register_model_patch 'Project', 'RedmineCustomWorkflows::Patches::ProjectPatch'
else
Project.prepend RedmineCustomWorkflows::Patches::ProjectPatch
end

View File

@ -4,7 +4,7 @@
# Redmine plugin for Custom Workflows
#
# Copyright © 2015-19 Anton Argirov
# Copyright © 2019-21 Karel Pičman <karel.picman@kontron.com>
# Copyright © 2019-22 Karel Pičman <karel.picman@kontron.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@ -35,6 +35,7 @@ module RedmineCustomWorkflows
end
end
# Apply the patch
if Redmine::Plugin.installed?(:easy_extensions)
RedmineExtensions::PatchManager.register_helper_patch 'ProjectsHelper',
'RedmineCustomWorkflows::Patches::ProjectsHelperPatch', prepend: true

View File

@ -4,7 +4,7 @@
# Redmine plugin for Custom Workflows
#
# Copyright © 2015-19 Anton Argirov
# Copyright © 2019-21 Karel Pičman <karel.picman@kontron.com>
# Copyright © 2019-22 Karel Pičman <karel.picman@kontron.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@ -24,7 +24,7 @@ module RedmineCustomWorkflows
module Patches
module TimeEntryPatch
def self.included(base)
def self.prepended(base)
base.class_eval do
before_save :before_save_custom_workflows
after_save :after_save_custom_workflows
@ -60,6 +60,9 @@ module RedmineCustomWorkflows
end
end
# Apply patch
RedmineExtensions::PatchManager.register_model_patch 'TimeEntry',
'RedmineCustomWorkflows::Patches::TimeEntryPatch'
# Apply the patch
if Redmine::Plugin.installed?(:easy_extensions)
RedmineExtensions::PatchManager.register_model_patch 'TimeEntry', 'RedmineCustomWorkflows::Patches::TimeEntryPatch'
else
TimeEntry.prepend RedmineCustomWorkflows::Patches::TimeEntryPatch
end

View File

@ -4,7 +4,7 @@
# Redmine plugin for Custom Workflows
#
# Copyright © 2015-19 Anton Argirov
# Copyright © 2019-21 Karel Pičman <karel.picman@kontron.com>
# Copyright © 2019-22 Karel Pičman <karel.picman@kontron.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@ -24,7 +24,7 @@ module RedmineCustomWorkflows
module Patches
module UserPatch
def self.included(base)
def self.prepended(base)
base.class_eval do
before_save :before_save_custom_workflows
after_save :after_save_custom_workflows
@ -60,6 +60,9 @@ module RedmineCustomWorkflows
end
end
# Apply patch
RedmineExtensions::PatchManager.register_model_patch 'User',
'RedmineCustomWorkflows::Patches::UserPatch'
# Apply the patch
if Redmine::Plugin.installed?(:easy_extensions)
RedmineExtensions::PatchManager.register_model_patch 'User', 'RedmineCustomWorkflows::Patches::UserPatch'
else
User.prepend RedmineCustomWorkflows::Patches::UserPatch
end

View File

@ -4,7 +4,7 @@
# Redmine plugin for Custom Workflows
#
# Copyright © 2015-19 Anton Argirov
# Copyright © 2019-21 Karel Pičman <karel.picman@kontron.com>
# Copyright © 2019-22 Karel Pičman <karel.picman@kontron.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@ -24,7 +24,7 @@ module RedmineCustomWorkflows
module Patches
module VersionPatch
def self.included(base)
def self.prepended(base)
base.class_eval do
before_save :before_save_custom_workflows
after_save :after_save_custom_workflows
@ -60,6 +60,9 @@ module RedmineCustomWorkflows
end
end
# Apply patch
RedmineExtensions::PatchManager.register_model_patch 'Version',
'RedmineCustomWorkflows::Patches::VersionPatch'
# Apply the patch
if Redmine::Plugin.installed?(:easy_extensions)
RedmineExtensions::PatchManager.register_model_patch 'Version', 'RedmineCustomWorkflows::Patches::VersionPatch'
else
Version.prepend RedmineCustomWorkflows::Patches::VersionPatch
end

View File

@ -4,7 +4,7 @@
# Redmine plugin for Custom Workflows
#
# Copyright © 2015-19 Anton Argirov
# Copyright © 2019-21 Karel Pičman <karel.picman@kontron.com>
# Copyright © 2019-22 Karel Pičman <karel.picman@kontron.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@ -24,7 +24,7 @@ module RedmineCustomWorkflows
module Patches
module WikiContentPatch
def self.included(base)
def self.prepended(base)
base.class_eval do
before_save :before_save_custom_workflows
after_save :after_save_custom_workflows
@ -60,6 +60,9 @@ module RedmineCustomWorkflows
end
end
# Apply patch
RedmineExtensions::PatchManager.register_model_patch 'WikiContent',
'RedmineCustomWorkflows::Patches::WikiContentPatch'
# Apply the patch
if Redmine::Plugin.installed?(:easy_extensions)
RedmineExtensions::PatchManager.register_model_patch 'WikiContent', 'RedmineCustomWorkflows::Patches::WikiContentPatch'
else
WikiContent.prepend RedmineCustomWorkflows::Patches::WikiContentPatch
end

View File

@ -4,7 +4,7 @@
# Redmine plugin for Custom Workflows
#
# Copyright © 2015-19 Anton Argirov
# Copyright © 2019-21 Karel Pičman <karel.picman@kontron.com>
# Copyright © 2019-22 Karel Pičman <karel.picman@kontron.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@ -24,7 +24,7 @@ module RedmineCustomWorkflows
module Patches
module WikiPagePatch
def self.included(base)
def self.prepended(base)
base.class_eval do
def self.attachments_callback(event, page, attachment)
page.instance_variable_set :@page, page
@ -43,6 +43,9 @@ module RedmineCustomWorkflows
end
end
# Apply patch
RedmineExtensions::PatchManager.register_model_patch 'WikiPage',
'RedmineCustomWorkflows::Patches::WikiPagePatch'
# Apply the patch
if Redmine::Plugin.installed?(:easy_extensions)
RedmineExtensions::PatchManager.register_model_patch 'WikiPage', 'RedmineCustomWorkflows::Patches::WikiPagePatch'
else
WikiPage.prepend RedmineCustomWorkflows::Patches::WikiPagePatch
end

View File

@ -4,7 +4,7 @@
# Redmine plugin for Custom Workflows
#
# Copyright © 2015-19 Anton Argirov
# Copyright © 2019-21 Karel Pičman <karel.picman@kontron.com>
# Copyright © 2019-22 Karel Pičman <karel.picman@kontron.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -4,7 +4,7 @@
# Redmine plugin for Custom Workflows
#
# Copyright © 2015-19 Anton Argirov
# Copyright © 2019-21 Karel Pičman <karel.picman@kontron.com>
# Copyright © 2019-22 Karel Pičman <karel.picman@kontron.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -2,7 +2,7 @@
# Redmine plugin for Custom Workflows
#
# Copyright © 2015-19 Anton Argirov
# Copyright © 2019-21 Karel Pičman <karel.picman@kontron.com>
# Copyright © 2019-22 Karel Pičman <karel.picman@kontron.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -1,7 +1,7 @@
# Redmine plugin for Custom Workflows
#
# Copyright © 2015-19 Anton Argirov
# Copyright © 2019-21 Karel Pičman <karel.picman@kontron.com>
# Copyright © 2019-22 Karel Pičman <karel.picman@kontron.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -1,7 +1,7 @@
# Redmine plugin for Custom Workflows
#
# Copyright © 2015-19 Anton Argirov
# Copyright © 2019-21 Karel Pičman <karel.picman@kontron.com>
# Copyright © 2019-22 Karel Pičman <karel.picman@kontron.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -1,7 +1,7 @@
# Redmine plugin for Custom Workflows
#
# Copyright © 2015-19 Anton Argirov
# Copyright © 2019-21 Karel Pičman <karel.picman@kontron.com>
# Copyright © 2019-22 Karel Pičman <karel.picman@kontron.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -4,7 +4,7 @@
# Redmine plugin for Custom Workflows
#
# Copyright © 2015-19 Anton Argirov
# Copyright © 2019-21 Karel Pičman <karel.picman@kontron.com>
# Copyright © 2019-22 Karel Pičman <karel.picman@kontron.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -4,7 +4,7 @@
# Redmine plugin for Custom Workflows
#
# Copyright © 2015-19 Anton Argirov
# Copyright © 2019-21 Karel Pičman <karel.picman@kontron.com>
# Copyright © 2019-22 Karel Pičman <karel.picman@kontron.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -4,7 +4,7 @@
# Redmine plugin for Custom Workflows
#
# Copyright © 2015-19 Anton Argirov
# Copyright © 2019-21 Karel Pičman <karel.picman@kontron.com>
# Copyright © 2019-22 Karel Pičman <karel.picman@kontron.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -4,7 +4,7 @@
# Redmine plugin for Custom Workflows
#
# Copyright © 2015-19 Anton Argirov
# Copyright © 2019-21 Karel Pičman <karel.picman@kontron.com>
# Copyright © 2019-22 Karel Pičman <karel.picman@kontron.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -4,7 +4,7 @@
# Redmine plugin for Custom Workflows
#
# Copyright © 2015-19 Anton Argirov
# Copyright © 2019-21 Karel Pičman <karel.picman@kontron.com>
# Copyright © 2019-22 Karel Pičman <karel.picman@kontron.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License