Skip to content
Snippets Groups Projects
Verified Commit f4154b4b authored by Andrej Ramašeuski's avatar Andrej Ramašeuski
Browse files

Aktualizace pluginu

parent 2ef67f1a
No related branches found
No related tags found
No related merge requests found
Pipeline #17882 passed
Showing
with 99 additions and 90 deletions
......@@ -2,7 +2,7 @@ image: docker:stable
variables:
DOCKER_TLS_CERTDIR: "/certs"
IMAGE_VER: 4.2.10-passenger-2
IMAGE_VER: 4.2.10-passenger-3
services:
- docker:dind
......
gem 'redmine_crm'
gem 'redmineup'
......@@ -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/>.
#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"
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.23'.freeze
CHECKLISTS_VERSION_TYPE = "Light version"
......
......@@ -16,15 +16,12 @@ local Pipeline(rubyVer, db, license, redmine, dependents) = {
};
[
Pipeline("2.7.3", "mysql", "pro", "trunk", "redmine_agile+pro"),
Pipeline("2.7.3", "mysql", "light", "trunk", "redmine_agile+light"),
Pipeline("2.7.3", "pg", "pro", "trunk", ""),
Pipeline("2.2.6", "mysql", "pro", "3.4", ""),
Pipeline("2.2.6", "mysql", "pro", "3.3", ""),
Pipeline("2.2.6", "mysql", "light", "3.3", ""),
Pipeline("2.2.6", "pg", "pro","3.3", ""),
Pipeline("2.2.6", "pg", "light", "3.3", ""),
Pipeline("2.4.1", "mysql", "light", "3.4", ""),
Pipeline("2.4.1", "pg", "pro", "3.4", "redmine_contacts+pro"),
Pipeline("2.2.6", "mysql", "pro", "3.0", "")
Pipeline("3.2.2", "mysql", "pro", "trunk", "redmine_agile+pro"),
Pipeline("3.2.2", "pg", "pro", "5.1", ""),
Pipeline("3.0.6", "mysql", "pro", "5.0", "redmine_agile+light"),
Pipeline("2.7.8", "mysql", "light", "4.2", ""),
Pipeline("2.7.8", "pg", "pro", "4.2", "redmine_contacts+pro"),
Pipeline("2.3.8", "mysql", "pro", "4.0", ""),
Pipeline("2.3.8", "mysql", "light", "4.0", ""),
Pipeline("2.3.8", "pg", "pro", "4.0", "")
]
gem 'redmine_crm'
gem 'redmineup'
# This file is a part of Redmine Tags (redmine_tags) plugin,
# customer relationship management plugin for Redmine
#
# Copyright (C) 2011-2021 RedmineUP
# Copyright (C) 2011-2024 RedmineUP
# http://www.redmineup.com/
#
# redmine_tags is free software: you can redistribute it and/or modify
......@@ -18,8 +18,6 @@
# along with redmine_tags. If not, see <http://www.gnu.org/licenses/>.
class IssueTagsController < ApplicationController
unloadable
before_action :find_issues, only: [:edit, :update]
def edit
......@@ -56,7 +54,7 @@ class IssueTagsController < ApplicationController
private
def update_tags(issues, tags)
if tags.present? && issues.size > 1
if (tags.present? && issues.size > 1) || params[:add_only]
add_issues_tags(issues, tags)
else
update_issues_tags(issues, tags)
......
# This file is a part of Redmine Tags (redmine_tags) plugin,
# customer relationship management plugin for Redmine
#
# Copyright (C) 2011-2021 RedmineUP
# Copyright (C) 2011-2024 RedmineUP
# http://www.redmineup.com/
#
# redmine_tags is free software: you can redistribute it and/or modify
......@@ -18,7 +18,6 @@
# along with redmine_tags. If not, see <http://www.gnu.org/licenses/>.
class TagsController < ApplicationController
unloadable
before_action :require_admin
before_action :find_tag, only: [:edit, :update]
before_action :bulk_find_tags, only: [:context_menu, :merge, :destroy]
......@@ -62,9 +61,10 @@ class TagsController < ApplicationController
def merge
if request.post? && params[:tag] && params[:tag][:name]
RedmineCrm::Tagging.transaction do
tag = RedmineCrm::Tag.find_by_name(params[:tag][:name]) || RedmineCrm::Tag.create(params[:tag])
RedmineCrm::Tagging.where(tag_id: @tags.map(&:id)).update_all(tag_id: tag.id)
params_hash = params[:tag].respond_to?(:to_unsafe_hash) ? params[:tag].to_unsafe_hash : params
Redmineup::Tagging.transaction do
tag = Redmineup::Tag.find_by_name(params_hash['name']) || Redmineup::Tag.create(params_hash)
Redmineup::Tagging.where(tag_id: @tags.map(&:id)).update_all(tag_id: tag.id)
@tags.select { |t| t.id != tag.id }.each{ |t| t.destroy }
redirect_to controller: 'settings', action: 'plugin', id: 'redmineup_tags', tab: 'manage_tags'
end
......@@ -74,15 +74,15 @@ class TagsController < ApplicationController
private
def bulk_find_tags
@tags = RedmineCrm::Tag.joins("JOIN #{RedmineCrm::Tagging.table_name} ON #{RedmineCrm::Tagging.table_name}.tag_id = #{RedmineCrm::Tag.table_name}.id ").
select("#{RedmineCrm::Tag.table_name}.*, COUNT(DISTINCT #{RedmineCrm::Tagging.table_name}.taggable_id) AS count").
@tags = Redmineup::Tag.joins("JOIN #{Redmineup::Tagging.table_name} ON #{Redmineup::Tagging.table_name}.tag_id = #{Redmineup::Tag.table_name}.id ").
select("#{Redmineup::Tag.table_name}.*, COUNT(DISTINCT #{Redmineup::Tagging.table_name}.taggable_id) AS count").
where(id: params[:id] ? [params[:id]] : params[:ids]).
group("#{RedmineCrm::Tag.table_name}.id, #{RedmineCrm::Tag.table_name}.name")
group("#{Redmineup::Tag.table_name}.id, #{Redmineup::Tag.table_name}.name")
raise ActiveRecord::RecordNotFound if @tags.empty?
end
def find_tag
@tag = RedmineCrm::Tag.find(params[:id])
@tag = Redmineup::Tag.find(params[:id])
rescue ActiveRecord::RecordNotFound
render_404
end
......
......@@ -3,7 +3,7 @@
# This file is a part of Redmine Tags (redmine_tags) plugin,
# customer relationship management plugin for Redmine
#
# Copyright (C) 2011-2021 RedmineUP
# Copyright (C) 2011-2024 RedmineUP
# http://www.redmineup.com/
#
# redmine_tags is free software: you can redistribute it and/or modify
......
......@@ -3,7 +3,7 @@
# This file is a part of Redmine Tags (redmine_tags) plugin,
# customer relationship management plugin for Redmine
#
# Copyright (C) 2011-2021 RedmineUP
# Copyright (C) 2011-2024 RedmineUP
# http://www.redmineup.com/
#
# redmine_tags is free software: you can redistribute it and/or modify
......@@ -22,7 +22,7 @@
require 'digest/md5'
module TagsHelper
include RedmineCrm::TagsHelper
include Redmineup::TagsHelper
def render_issue_tag_link(tag, options = {})
filters = [[:issue_tags, '=', tag.name]]
......
<%= raw @redmine_tags.map { |redmine_tag| {
'id' => redmine_tag.name,
'text' => redmine_tag.name
}
}.to_json
%>
<%= raw @tags.collect {|tag|
tag.name
}.to_json
%>
<%= raw @tags.collect {|tag|
tag.name
}.to_json
%>
......@@ -16,6 +16,7 @@
:method => :post,
:id => 'edit-issue-tags-form') do %>
<%= hidden_field_tag :add_only, 1 %>
<fieldset class="box">
<legend><%= l(:tags) %></legend>
<div id="issue_tags">
......@@ -23,7 +24,7 @@
[],
width: '100%',
multiple: true,
url: auto_complete_redmine_tags_url,
url: auto_complete_redmine_tags_path,
placeholder: @is_bulk_editing ? t(:label_no_change_option) : '+ add tag',
tags: User.current.allowed_to?(:create_tags, @project) %>
</div>
......
......@@ -10,7 +10,7 @@
:multiple => true,
:include_hidden => (params[:action] != 'bulk_edit'),
:style => 'width: 100%;',
:url => auto_complete_redmine_tags_url,
:url => auto_complete_redmine_tags_path,
:placeholder => params[:action] == 'bulk_edit' ? t(:label_no_change_option) : '+ add tag',
:tags => User.current.allowed_to?(:create_tags, @projects || @project) %>
......
<% tags = Issue.all_tag_counts(:order => :name) %>
<% unless tags.to_a.empty? %>
<table class = "list issues">
<thead>
<tr>
<th class="checkbox hide-when-print">
<%= link_to image_tag('toggle_check.png'), {},
:onclick => 'toggleIssuesSelection(this); return false;',
:title => "#{l(:button_check_all)}/#{l(:button_uncheck_all)}" %>
</th>
<th><%= l(:field_name) %></th>
<th align="center" style="width:10%;"> </th>
</tr>
</thead>
<tbody>
<% tags.each do |tag| %>
<tr id="<%= tag.id %>" class="<%= cycle("odd", "even") %> hascontextmenu ">
<td class="checkbox hide-when-print"><%= check_box_tag("ids[]", tag.id, false, :id => nil) %></td>
<td><%= render_issue_tag_link(tag) %></td>
<td class="buttons">
<%= link_to l(:button_edit), edit_tag_path(tag),
:class => 'icon icon-edit' %>
<%= link_to l(:button_delete), tags_path(:ids => tag),
:method => :delete,
:confirm => l(:text_are_you_sure),
:class => 'icon icon-del' %>
</td>
<table class = "list issues">
<thead>
<tr>
<th class="checkbox hide-when-print">
<%= link_to image_tag('toggle_check.png'), {},
:onclick => 'toggleIssuesSelection(this); return false;',
:title => "#{l(:button_check_all)}/#{l(:button_uncheck_all)}" %>
</th>
<th><%= l(:field_name) %></th>
<th align="center" style="width:10%;"> </th>
</tr>
</thead>
<tbody>
<% tags.each do |tag| %>
<tr id="<%= tag.id %>" class="<%= cycle("odd", "even") %> hascontextmenu ">
<td class="checkbox hide-when-print"><%= check_box_tag("ids[]", tag.id, false, :id => nil) %></td>
<td><%= render_issue_tag_link(tag) %></td>
<td class="buttons">
<%= link_to l(:button_edit), edit_tag_path(tag),
:class => 'icon icon-edit' %>
<%= link_to l(:button_delete), tags_path(:ids => tag),
:method => :delete,
:confirm => l(:text_are_you_sure),
:class => 'icon icon-del' %>
</td>
</tr>
<% end %>
</tbody>
</table>
<% end %>
</tbody>
</table>
<% if Redmine::VERSION.to_s < '3.4' && Redmine::VERSION::BRANCH == 'stable' %>
<%= context_menu tags_context_menu_path %>
<% else %>
<% content_for :header_tags do
javascript_include_tag('context_menu') + stylesheet_link_tag('context_menu')
end %>
......@@ -45,9 +39,8 @@
$('#settings form').data('cmUrl', '<%= tags_context_menu_path %>')
})
<% end %>
<% end %>
<% else %>
<p class="nodata"><%= l(:label_no_data) %></p>
<p class="nodata"><%= l(:label_no_data) %></p>
<% end %>
<%= transform_to_select2('issue_tags', url: auto_complete_redmine_tags_url) %>
<%= transform_to_select2('issue_tags', url: auto_complete_redmine_tags_path) %>
<h2><%= link_to l(:setting_issue_tags), :controller => 'settings', :action => 'plugin', :id => 'redmine_tags', :tab => 'manage_tags' %> &#187; <%=h (l(:issue_tags_tag) + ": " + @tag.name) %></h2>
<h2><%= link_to l(:setting_issue_tags), controller: 'settings', action: 'plugin', id: 'redmineup_tags', tab: 'manage_tags' %> &#187; <%=h (l(:issue_tags_tag) + ": " + @tag.name) %></h2>
<%= form_tag(tag_path(@tag, :tab => 'tags'), :class => "tabular", :method => :put) do %>
<%= error_messages_for 'tag' %>
......
ro:
tags: Etichete
field_tags: Etichete
field_tag_list: Etichete
label_add_tags: Adaugă etichete
notice_tags_added: Etichetele au fost adăugate
notice_failed_to_add_tags: Etichetele nu s-au putut adăuga
setting_issue_tags: Etichete de sarcini
issues_sidebar: Mod de afișare etichete în sidebar
issues_show_count: Afișează numărul de sarcini
issues_open_only: Afișează doar pentru sarcinile deschise
issues_sort_by: Sortează etichetele după
issues_use_colors: Folosește culori
issue_tags_sidebar_none: Deloc
issue_tags_sidebar_list: Listă
issue_tags_sidebar_cloud: Nor
issue_tags_sidebar_simple_cloud: Nor simplu
issues_sort_by_name: Denumire
issues_sort_by_count: Număr de sarcini
issues_sort_order_asc: Crescător
issues_sort_order_desc: Descrescător
auto_complete_new_tag: "Adaugă..."
issue_tags_label_add_tag: "+ adaugă etichetă"
issue_tags_manage_tags: Administrare etichete
issue_tags_tag: Etichetă
issue_tags_button_merge: Unește
issue_tags_label_merge: Unește etichetele selectate
tags_suggestion_order: Sugerează în ordine, pornind de la
tags_order_by_name: Denumire alfabetic
tags_order_by_last_created: Ultima creată
tags_order_by_most_used: Cea mai folosită
# This file is a part of Redmine Tags (redmine_tags) plugin,
# customer relationship management plugin for Redmine
#
# Copyright (C) 2011-2021 RedmineUP
# Copyright (C) 2011-2024 RedmineUP
# http://www.redmineup.com/
#
# redmine_tags is free software: you can redistribute it and/or modify
......@@ -18,8 +18,6 @@
# along with redmine_tags. If not, see <http://www.gnu.org/licenses/>.
RedmineApp::Application.routes.draw do
match '/issue_tags/auto_complete/:project_id', to: 'auto_completes#issue_tags', via: :get, as: 'auto_complete_issue_tags'
match '/wiki_tags/auto_complete/:project_id', to: 'auto_completes#wiki_tags', via: :get, as: 'auto_complete_wiki_tags'
match 'auto_completes/redmine_tags' => 'auto_completes#redmine_tags', via: :get, as: 'auto_complete_redmine_tags'
match '/tags/context_menu', to: 'tags#context_menu', as: 'tags_context_menu', via: [:get, :post]
match '/tags', controller: 'tags', action: 'destroy', via: :delete
......
# This file is a part of Redmine Tags (redmine_tags) plugin,
# customer relationship management plugin for Redmine
#
# Copyright (C) 2011-2021 RedmineUP
# Copyright (C) 2011-2024 RedmineUP
# http://www.redmineup.com/
#
# redmine_tags 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_tags. If not, see <http://www.gnu.org/licenses/>.
class AddTagsAndTaggings < (Rails.version < '5.1') ? ActiveRecord::Migration : ActiveRecord::Migration[4.2]
class AddTagsAndTaggings < ActiveRecord::Migration[4.2]
def up
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment