From bc8499b2c8d7554b692ef3a74d64e93f48ddd2b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Pi=C4=8Dman?= Date: Mon, 2 Feb 2015 08:51:36 +0100 Subject: [PATCH] Checkboxes titles in the trash bin --- app/controllers/dmsf_controller.rb | 18 ++++++++++-------- app/controllers/dmsf_files_controller.rb | 2 +- app/controllers/dmsf_links_controller.rb | 2 +- app/models/dmsf_file.rb | 2 +- app/models/dmsf_link.rb | 2 +- app/views/dmsf/_dir_trash.html.erb | 4 ++-- app/views/dmsf/_file.html.erb | 2 +- app/views/dmsf/_file_trash.html.erb | 4 ++-- app/views/dmsf/_url_trash.html.erb | 5 +++-- app/views/dmsf/trash.html.erb | 4 ++-- config/locales/cs.yml | 8 +++++--- config/locales/de.yml | 4 +++- config/locales/en.yml | 8 +++++--- config/locales/es.yml | 6 ++++-- config/locales/fr.yml | 4 +++- config/locales/ja.yml | 4 +++- config/locales/pl.yml | 2 ++ config/locales/ru.yml | 4 +++- config/locales/sl.yml | 6 ++++-- config/locales/zh-TW.yml | 4 +++- config/locales/zh.yml | 6 ++++-- 21 files changed, 63 insertions(+), 38 deletions(-) diff --git a/app/controllers/dmsf_controller.rb b/app/controllers/dmsf_controller.rb index bbe14442..12c00876 100644 --- a/app/controllers/dmsf_controller.rb +++ b/app/controllers/dmsf_controller.rb @@ -164,9 +164,11 @@ class DmsfController < ApplicationController selected_files = params[:files] || [] selected_dir_links = params[:dir_links] || [] selected_file_links = params[:file_links] || [] + selected_url_links = params[:url_links] || [] if selected_folders.blank? && selected_files.blank? && - selected_dir_links.blank? && selected_file_links.blank? + selected_dir_links.blank? && selected_file_links.blank? && + selected_url_links.blank? flash[:warning] = l(:warning_no_entries_selected) redirect_to :back return @@ -189,13 +191,13 @@ class DmsfController < ApplicationController if params[:email_entries].present? email_entries(selected_folders, selected_files) elsif params[:restore_entries].present? - restore_entries(selected_folders, selected_files, selected_dir_links, selected_file_links) + restore_entries(selected_folders, selected_files, selected_dir_links, selected_file_links, selected_url_links) redirect_to :back elsif params[:delete_entries].present? - delete_entries(selected_folders, selected_files, selected_dir_links, selected_file_links, false) + delete_entries(selected_folders, selected_files, selected_dir_links, selected_file_links, selected_url_links, false) redirect_to :back elsif params[:destroy_entries].present? - delete_entries(selected_folders, selected_files, selected_dir_links, selected_file_links, true) + delete_entries(selected_folders, selected_files, selected_dir_links, selected_file_links, selected_url_links, true) redirect_to :back else download_entries(selected_folders, selected_files) @@ -464,7 +466,7 @@ class DmsfController < ApplicationController zip end - def restore_entries(selected_folders, selected_files, selected_dir_links, selected_file_links) + def restore_entries(selected_folders, selected_files, selected_dir_links, selected_file_links, selected_url_links) # Folders selected_folders.each do |id| folder = DmsfFolder.find_by_id id @@ -488,7 +490,7 @@ class DmsfController < ApplicationController end end # Links - (selected_dir_links + selected_file_links).each do |id| + (selected_dir_links + selected_file_links + selected_url_links).each do |id| link = DmsfLink.find_by_id id if link unless link.restore @@ -500,7 +502,7 @@ class DmsfController < ApplicationController end end - def delete_entries(selected_folders, selected_files, selected_dir_links, selected_file_links, commit) + def delete_entries(selected_folders, selected_files, selected_dir_links, selected_file_links, selected_url_links, commit) # Folders selected_folders.each do |id| folder = DmsfFolder.find_by_id id @@ -544,7 +546,7 @@ class DmsfController < ApplicationController flash[:warning] = l(:warning_some_entries_were_not_deleted, :entries => not_deleted_files.map{|e| e.title}.join(', ')) end # Links - (selected_dir_links + selected_file_links).each do |id| + (selected_dir_links + selected_file_links + selected_url_links).each do |id| link = DmsfLink.find_by_id id link.delete commit if link end diff --git a/app/controllers/dmsf_files_controller.rb b/app/controllers/dmsf_files_controller.rb index 58d1bc70..f8dbba96 100644 --- a/app/controllers/dmsf_files_controller.rb +++ b/app/controllers/dmsf_files_controller.rb @@ -1,7 +1,7 @@ # Redmine plugin for Document Management System "Features" # # Copyright (C) 2011 Vít Jonáš -# Copyright (C) 2011-14 Karel Pičman +# Copyright (C) 2011-15 Karel Pičman # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License diff --git a/app/controllers/dmsf_links_controller.rb b/app/controllers/dmsf_links_controller.rb index c5a1321e..167f3a56 100644 --- a/app/controllers/dmsf_links_controller.rb +++ b/app/controllers/dmsf_links_controller.rb @@ -1,6 +1,6 @@ # Redmine plugin for Document Management System "Features" # -# Copyright (C) 2011-14 Karel Pičman +# Copyright (C) 2011-15 Karel Pičman # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License diff --git a/app/models/dmsf_file.rb b/app/models/dmsf_file.rb index 3ac3adcd..562b3fe6 100644 --- a/app/models/dmsf_file.rb +++ b/app/models/dmsf_file.rb @@ -1,7 +1,7 @@ # Redmine plugin for Document Management System "Features" # # Copyright (C) 2011 Vít Jonáš -# Copyright (C) 2011-14 Karel Pičman +# Copyright (C) 2011-15 Karel Pičman # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License diff --git a/app/models/dmsf_link.rb b/app/models/dmsf_link.rb index c401f290..07a20a60 100644 --- a/app/models/dmsf_link.rb +++ b/app/models/dmsf_link.rb @@ -1,6 +1,6 @@ # Redmine plugin for Document Management System "Features" # -# Copyright (C) 2011-14 Karel Pičman +# Copyright (C) 2011-15 Karel Pičman # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License diff --git a/app/views/dmsf/_dir_trash.html.erb b/app/views/dmsf/_dir_trash.html.erb index f5f52776..f278603b 100644 --- a/app/views/dmsf/_dir_trash.html.erb +++ b/app/views/dmsf/_dir_trash.html.erb @@ -1,7 +1,7 @@ <%#= # Redmine plugin for Document Management System "Features" # -# Copyright (C) 2011-14 Karel Pičman +# Copyright (C) 2011-15 Karel Pičman # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License @@ -19,7 +19,7 @@ %> <%= check_box_tag(name, id, false, - :title => l(:title_check_for_zip_download_or_email)) %> + :title => l(:title_check_for_restore_or_delete)) %> <%= content_tag(:span, h(title), :title => h(title), diff --git a/app/views/dmsf/_file.html.erb b/app/views/dmsf/_file.html.erb index b6667643..06ee9b8e 100644 --- a/app/views/dmsf/_file.html.erb +++ b/app/views/dmsf/_file.html.erb @@ -1,7 +1,7 @@ <%#= # Redmine plugin for Document Management System "Features" # -# Copyright (C) 2011-14 Karel Pičman +# Copyright (C) 2011-15 Karel Pičman # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License diff --git a/app/views/dmsf/_file_trash.html.erb b/app/views/dmsf/_file_trash.html.erb index 279a4321..57a0d5d4 100644 --- a/app/views/dmsf/_file_trash.html.erb +++ b/app/views/dmsf/_file_trash.html.erb @@ -1,7 +1,7 @@ <%#= # Redmine plugin for Document Management System "Features" # -# Copyright (C) 2011-14 Karel Pičman +# Copyright (C) 2011-15 Karel Pičman # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License @@ -19,7 +19,7 @@ %> <%= check_box_tag(name, id, false, - :title => l(:title_check_for_zip_download_or_email)) %> + :title => l(:title_check_for_restore_or_delete)) %> <% file_download_url = url_for({:only_path => false, :controller => :dmsf_files, :action => 'show', :id => file, :download => ''}) %> <%= link_to(h(title), diff --git a/app/views/dmsf/_url_trash.html.erb b/app/views/dmsf/_url_trash.html.erb index 215e6729..ded80ab0 100644 --- a/app/views/dmsf/_url_trash.html.erb +++ b/app/views/dmsf/_url_trash.html.erb @@ -1,7 +1,7 @@ <%#= # Redmine plugin for Document Management System "Features" # -# Copyright (C) 2011-14 Karel Pičman +# Copyright (C) 2011-15 Karel Pičman # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License @@ -18,7 +18,8 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. %> - +<%= check_box_tag(name, id, false, + :title => l(:title_check_for_restore_or_delete)) %> <%= link_to(h(title), link.external_url, diff --git a/app/views/dmsf/trash.html.erb b/app/views/dmsf/trash.html.erb index 1837407b..22cb0d73 100644 --- a/app/views/dmsf/trash.html.erb +++ b/app/views/dmsf/trash.html.erb @@ -1,7 +1,7 @@ <%#= # Redmine plugin for Document Management System "Features" # -# Copyright (C) 2011-14 Karel Pičman +# Copyright (C) 2011-15 Karel Pičman # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License @@ -47,7 +47,7 @@ - + <%= l(:link_title) %> <%= l(:link_size) %> diff --git a/config/locales/cs.yml b/config/locales/cs.yml index 0a936f4f..adcc114c 100644 --- a/config/locales/cs.yml +++ b/config/locales/cs.yml @@ -1,7 +1,7 @@ # Redmine plugin for Document Management System "Features" # # Copyright (C) 2011 Vít Jonáš -# Copyright (C) 2011-14 Karel Pičman +# Copyright (C) 2011-15 Karel Pičman # # # This program is free software; you can redistribute it and/or @@ -60,13 +60,15 @@ cs: link_edit: "Upravit %{title}" submit_create: Vytvořit link_create_folder: Vytvořit složku - title_check_uncheck_all_for_zip_download_or_email: Vybrat/Nevybrat vše pro stažení jako Zip nebo emailem + title_check_uncheck_all_for_zip_download_or_email: Vybrat/Nevybrat vše pro stažení jako zip nebo emailem + title_check_uncheck_all_for_restore_or_delete: Vybrat/Nevybrat vše pro obnovení nebo smazání link_title: Název link_size: Velikost link_modified: Změněno link_ver: Ver. link_author: Autor - title_check_for_zip_download_or_email: Vybrat pro stažení jako Zip nebo emailem + title_check_for_zip_download_or_email: Vybrat pro stažení jako zip nebo emailem + title_check_for_restore_or_delete: Vybrat pro obnovení nebo smazání title_delete: Smazat title_notifications_active_deactivate: "Notifikace aktivní: Deaktivovat" title_notifications_not_active_activate: "Notifikace nejsou aktivní: Aktivovat" diff --git a/config/locales/de.yml b/config/locales/de.yml index e50cf00b..a961fd57 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -2,7 +2,7 @@ # # Copyright (C) 2011 Terrence Miller # Copyright (C) 2013 Christian Wetting -# Copyright (C) 2011-14 Karel Pičman +# Copyright (C) 2011-15 Karel Pičman # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License @@ -59,12 +59,14 @@ de: submit_create: Erstellen link_create_folder: Ordner erstellen title_check_uncheck_all_for_zip_download_or_email: Wähle alle/keine für ZIP-Download bzw. Email + title_check_uncheck_all_for_restore_or_delete: Wähle alle/keine für Rückstellen oder Löschen link_title: Titel link_size: Größe link_modified: Geändert link_ver: Version link_author: Autor title_check_for_zip_download_or_email: Wähle für ZIP-Download bzw. Email + title_check_for_restore_or_delete: Wähle für Rückstellen oder Löschen title_delete: Löschen title_notifications_active_deactivate: "Benachrichtigungen sind aktiv: Ausschalten" title_notifications_not_active_activate: "Benachrichtigungen sind nicht aktiv: Einschalten" diff --git a/config/locales/en.yml b/config/locales/en.yml index 30ae0746..0b88c7db 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -2,7 +2,7 @@ # # Copyright (C) 2011 Vít Jonáš # Copyright (C) 2012 Daniel Munn -# Copyright (C) 2011-14 Karel Pičman +# Copyright (C) 2011-15 Karel Pičman # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License @@ -60,13 +60,15 @@ en: link_edit: "Edit %{title}" submit_create: Create link_create_folder: Create folder - title_check_uncheck_all_for_zip_download_or_email: Check/Uncheck all for zip download or email + title_check_uncheck_all_for_zip_download_or_email: Check/Uncheck all for zip, download or email + title_check_uncheck_all_for_restore_or_delete: Check/Uncheck all for restore or delete link_title: Title link_size: Size link_modified: Modified link_ver: Ver. link_author: Author - title_check_for_zip_download_or_email: Check for Zip download or email + title_check_for_zip_download_or_email: Check for zip, download or email + title_check_for_restore_or_delete: Check for restore or delete title_delete: Delete title_notifications_active_deactivate: "Notifications active: Deactivate" title_notifications_not_active_activate: "Notifications not active: Activate" diff --git a/config/locales/es.yml b/config/locales/es.yml index 97f51ff1..8838c6d4 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -1,7 +1,7 @@ # Redmine plugin for Document Management System "Features" # # Copyright (C) 2011 Vít Jonáš -# +# Copyright (C) 2011-15 Karel Pičman # # # This program is free software; you can redistribute it and/or @@ -61,12 +61,14 @@ es: submit_create: Create link_create_folder: Create folder title_check_uncheck_all_for_zip_download_or_email: Check/Uncheck all for zip download or email + title_check_uncheck_all_for_restore_or_delete: Check/Uncheck all for restore or delete link_title: Title link_size: Size link_modified: Modified link_ver: Ver. link_author: Author - title_check_for_zip_download_or_email: Check for Zip download or email + title_check_for_zip_download_or_email: Check for zip, download or email + title_check_for_restore_or_delete: Check for restore or delete title_delete: Delete title_notifications_active_deactivate: "Notifications active: Deactivate" title_notifications_not_active_activate: "Notifications not active: Activate" diff --git a/config/locales/fr.yml b/config/locales/fr.yml index 7e8722e5..4ac05dd8 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -3,7 +3,7 @@ # Copyright (C) 2011 Vít Jonáš # Copyright (C) 2012 Daniel Munn # Copyright (C) 2014 Atmis -# +# Copyright (C) 2011-15 Karel Pičman # 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 @@ -61,12 +61,14 @@ fr: submit_create: Ajouter link_create_folder: Créer un sous-dossier title_check_uncheck_all_for_zip_download_or_email: Sélectionner/Ignorer tous les documents pour le téléchargement ou pour la transmission par mail + title_check_uncheck_all_for_restore_or_delete: Check/Uncheck all for restore or delete link_title: Titre link_size: Taille link_modified: Modifié link_ver: Version link_author: Auteur title_check_for_zip_download_or_email: Sélectionner pour le téléchargement ou la transmission par mail + title_check_for_restore_or_delete: Check for restore or delete title_delete: Supprimer title_notifications_active_deactivate: "Notifications activées : cliquer pour désactiver" title_notifications_not_active_activate: "Notifications désactivées : cliquer pour activer" diff --git a/config/locales/ja.yml b/config/locales/ja.yml index 365a0d8a..fe1c2939 100644 --- a/config/locales/ja.yml +++ b/config/locales/ja.yml @@ -1,7 +1,7 @@ # Redmine plugin for Document Management System "Features" # # Copyright (C) 2011 Vít Jonáš -# +# Copyright (C) 2011-15 Karel Pičman # # # This program is free software; you can redistribute it and/or @@ -61,6 +61,8 @@ ja: submit_create: 作成 link_create_folder: フォルダを作成します title_check_uncheck_all_for_zip_download_or_email: すべての Zip ダウンロードまたは電子メールのチェックをオン/オフします + title_check_uncheck_all_for_restore_or_delete: Check/Uncheck all for restore or delete + title_check_for_restore_or_delete: Check for restore or delete link_title: タイトル link_size: サイズ link_modified: 更新日時 diff --git a/config/locales/pl.yml b/config/locales/pl.yml index 42e8236c..af15103e 100644 --- a/config/locales/pl.yml +++ b/config/locales/pl.yml @@ -62,12 +62,14 @@ pl: submit_create: Utwórz link_create_folder: Utwórz folder title_check_uncheck_all_for_zip_download_or_email: Zaznacz/Odznacz wszystkie aby pobrać plik zip lub wysłać email + title_check_uncheck_all_for_restore_or_delete: Check/Uncheck all for restore or delete link_title: Tytuł link_size: Rozmiar link_modified: Zmodyfikowany link_ver: Ver. link_author: Autor title_check_for_zip_download_or_email: Zaznacz aby pobrać plik zip lub wysłać email + title_check_for_restore_or_delete: Check for restore or delete title_delete: Usuń title_notifications_active_deactivate: "Powiadomienia aktywne: Wyłącz" title_notifications_not_active_activate: "Powiadomienia wyłączone: Aktywuj" diff --git a/config/locales/ru.yml b/config/locales/ru.yml index e2e6f310..b9b73870 100644 --- a/config/locales/ru.yml +++ b/config/locales/ru.yml @@ -1,7 +1,7 @@ # Redmine plugin for Document Management System "Features" # # Copyright (C) 2011 Vít Jonáš -# +# Copyright (C) 2011-15 Karel Pičman # # # This program is free software; you can redistribute it and/or @@ -61,12 +61,14 @@ ru: submit_create: Создать link_create_folder: Создать папку title_check_uncheck_all_for_zip_download_or_email: Выбрать/Снять все документы для того, чтобы скачать или отправить их по электронной почте + title_check_uncheck_all_for_restore_or_delete: Check/Uncheck all for restore or delete link_title: Название link_size: Размер link_modified: Изменен link_ver: Версия link_author: Автор title_check_for_zip_download_or_email: Выберите документы, которые нужно скачать или отправить их по электронной почте + title_check_for_restore_or_delete: Check for restore or delete title_delete: Удалить title_notifications_active_deactivate: "Уведомления включены: Отключить" title_notifications_not_active_activate: "Уведомления не включены: Включить" diff --git a/config/locales/sl.yml b/config/locales/sl.yml index 9db3ef37..e0a975da 100644 --- a/config/locales/sl.yml +++ b/config/locales/sl.yml @@ -1,7 +1,7 @@ # Redmine plugin for Document Management System "Features" # # Copyright (C) 2011 -# +# Copyright (C) 2011-15 Karel Pičman # # # This program is free software; you can redistribute it and/or @@ -61,12 +61,14 @@ sl: submit_create: Kreiraj link_create_folder: Kreiraj mapo title_check_uncheck_all_for_zip_download_or_email: "Označi/Odznači vse za Zip prenašanje ali email" + title_check_uncheck_all_for_restore_or_delete: Check/Uncheck all for restore or delete link_title: Naslov link_size: Velikost link_modified: Spremenjeno link_ver: Ver. link_author: Autor - title_check_for_zip_download_or_email: Označi za Zip prenašanje ali email + title_check_for_zip_download_or_email: Označi za zip prenašanje ali email + title_check_for_restore_or_delete: Check for restore or delete title_delete: Izbriši title_notifications_active_deactivate: "Obveščanje aktivno: Deaktiviraj" title_notifications_not_active_activate: "Obveščanje ni aktivno: Aktiviraj" diff --git a/config/locales/zh-TW.yml b/config/locales/zh-TW.yml index d3d70a70..88797a00 100644 --- a/config/locales/zh-TW.yml +++ b/config/locales/zh-TW.yml @@ -1,7 +1,7 @@ # Redmine plugin for Document Management System "Features" # # Copyright (C) 2011 Vít Jonáš -# +# Copyright (C) 2011-15 Karel Pičman # # # This program is free software; you can redistribute it and/or @@ -62,12 +62,14 @@ submit_create: 建立 link_create_folder: 建立資料夾 title_check_uncheck_all_for_zip_download_or_email: 全選/全不選(下載或電子郵件發送) + title_check_uncheck_all_for_restore_or_delete: Check/Uncheck all for restore or delete link_title: 標題 link_size: 檔案大小 link_modified: 修改日期 link_ver: 版本 link_author: 作者 title_check_for_zip_download_or_email: 選取檔案 (下載或電子郵件發送) + title_check_for_restore_or_delete: Check for restore or delete title_delete: 刪除 title_notifications_active_deactivate: "通知啟用中: 點擊關閉通知" title_notifications_not_active_activate: "通知關閉中: 點擊啟用通知" diff --git a/config/locales/zh.yml b/config/locales/zh.yml index 07cb4cce..87b05216 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -1,7 +1,7 @@ # Redmine plugin for Document Management System "Features" # # Copyright (C) 2011 Vít Jonáš -# +# Copyright (C) 2011-15 Karel Pičman # # # This program is free software; you can redistribute it and/or @@ -61,12 +61,14 @@ zh: submit_create: 创建 link_create_folder: 创建文件夹 title_check_uncheck_all_for_zip_download_or_email: 全选/全不选(zip下载或邮件发送) + title_check_uncheck_all_for_restore_or_delete: Check/Uncheck all for restore or delete link_title: 主题 link_size: 大小 link_modified: 修改日期 link_ver: 版本. link_author: 作者 - title_check_for_zip_download_or_email: 选中用于Zip下载或邮件发送 + title_check_for_zip_download_or_email: 选中用于zip下载或邮件发送 + title_check_for_restore_or_delete: Check for restore or delete title_delete: 删除 title_notifications_active_deactivate: "通知有效:点击注销通知" title_notifications_not_active_activate: "通知无效:点击激活通知"