EPM modules + new link form fix
This commit is contained in:
parent
598989f535
commit
7da6323675
@ -66,6 +66,27 @@ unless Redmine::Plugin.installed?(:easy_extensions)
|
||||
else
|
||||
ActiveSupport.on_load(:easyproject, yield: true) do
|
||||
init
|
||||
|
||||
require File.expand_path('../app/models/easy_page_modules/easy_dms/epm_dmsf_locked_documents', __FILE__)
|
||||
require File.expand_path('../app/models/easy_page_modules/easy_dms/epm_dmsf_open_approvals', __FILE__)
|
||||
|
||||
EpmDmsfLockedDocuments.register_to_all(:plugin => :easy_dms)
|
||||
EpmDmsfOpenApprovals.register_to_all(:plugin => :easy_dms)
|
||||
|
||||
EasyExtensions::AfterInstallScripts.add do
|
||||
page = EasyPage.where(:page_name => 'project-overview').first
|
||||
page_template = page.default_template if page
|
||||
|
||||
unless page_template
|
||||
page_template = EasyPageTemplate.create(:easy_pages_id => page.id, :template_name => 'Default template',
|
||||
:description => 'Default template', :is_default => true)
|
||||
EasyPageTemplateModule.create_template_module(page, page_template, EpmDmsfLockedDocuments.first,
|
||||
'top-left', HashWithIndifferentAccess.new, 1)
|
||||
EasyPageTemplateModule.create_template_module(page, page_template, EpmDmsfOpenApprovals.first,
|
||||
'top-left', HashWithIndifferentAccess.new, 1)
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@ -0,0 +1,35 @@
|
||||
# encoding: utf-8
|
||||
#
|
||||
# Redmine plugin for Document Management System "Features"
|
||||
#
|
||||
# Copyright (C) 2011-17 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.
|
||||
|
||||
class EpmDmsfLockedDocuments < EasyPageModule
|
||||
|
||||
def category_name
|
||||
@category_name ||= 'easy_dms'
|
||||
end
|
||||
|
||||
def get_show_data(settings, user, page_context = {})
|
||||
{}
|
||||
end
|
||||
|
||||
def get_edit_data(settings, user, page_context = {})
|
||||
{}
|
||||
end
|
||||
|
||||
end
|
||||
@ -0,0 +1,31 @@
|
||||
# encoding: utf-8
|
||||
#
|
||||
# Redmine plugin for Document Management System "Features"
|
||||
#
|
||||
# Copyright (C) 2011-17 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.
|
||||
|
||||
class EpmDmsfOpenApprovals < EasyPageModule
|
||||
|
||||
def category_name
|
||||
@category_name ||= 'easy_dms'
|
||||
end
|
||||
|
||||
def get_show_data(settings, user, page_context = {})
|
||||
{}
|
||||
end
|
||||
|
||||
end
|
||||
@ -87,7 +87,7 @@
|
||||
<% if (@type == 'link_from') && !@container %>
|
||||
<div id="link_external" style="display: none">
|
||||
<p>
|
||||
<%= f.text_field :external_url, :required => true %>
|
||||
<%= f.text_field :external_url, :required => false %>
|
||||
</p>
|
||||
</div>
|
||||
<% end %>
|
||||
@ -124,5 +124,11 @@
|
||||
$("input[name=external_link]:radio").change(function(){
|
||||
$("#link_internal").toggle();
|
||||
$("#link_external").toggle();
|
||||
$("#dmsf_link_external_url").toggleClass('required', $(this).val());
|
||||
var labelUrl = $('label[for="dmsf_link_external_url"]');
|
||||
labelUrl.toggleClass('required', $(this).val());
|
||||
if(labelUrl.find(".required").length == 0){
|
||||
labelUrl.append('<span class="required"> *</span>');
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
@ -0,0 +1,23 @@
|
||||
<%
|
||||
# encoding: utf-8
|
||||
#
|
||||
# Redmine plugin for Document Management System "Features"
|
||||
#
|
||||
# Copyright (C) 2011-17 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.
|
||||
%>
|
||||
|
||||
<% 'Nothing to show' %>
|
||||
@ -0,0 +1,23 @@
|
||||
<%
|
||||
# encoding: utf-8
|
||||
#
|
||||
# Redmine plugin for Document Management System "Features"
|
||||
#
|
||||
# Copyright (C) 2011-17 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.
|
||||
%>
|
||||
|
||||
<%= render :partial => 'my/blocks/open_approvals' %>
|
||||
@ -0,0 +1,23 @@
|
||||
<%
|
||||
# encoding: utf-8
|
||||
#
|
||||
# Redmine plugin for Document Management System "Features"
|
||||
#
|
||||
# Copyright (C) 2011-17 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.
|
||||
%>
|
||||
|
||||
<% 'Nothing to show' %>
|
||||
@ -0,0 +1,23 @@
|
||||
<%
|
||||
# encoding: utf-8
|
||||
#
|
||||
# Redmine plugin for Document Management System "Features"
|
||||
#
|
||||
# Copyright (C) 2011-17 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.
|
||||
%>
|
||||
|
||||
<%= render :partial => 'my/blocks/locked_documents' %>
|
||||
@ -369,3 +369,10 @@ cs:
|
||||
|
||||
label_dmsf_attachments: DMS přílohy
|
||||
label_basic_attachments: Souborové přílohy
|
||||
|
||||
easy_pages:
|
||||
modules:
|
||||
dmsf_locked_documents: My locked documents
|
||||
dmsf_open_approvals: My open approvals
|
||||
module_category:
|
||||
easy_dms: Easy DMS
|
||||
@ -366,3 +366,10 @@ de:
|
||||
|
||||
label_dmsf_attachments: DMS Anhänge
|
||||
label_basic_attachments: Dateianhängen
|
||||
|
||||
easy_pages:
|
||||
modules:
|
||||
dmsf_locked_documents: My locked documents
|
||||
dmsf_open_approvals: My open approvals
|
||||
module_category:
|
||||
easy_dms: Easy DMS
|
||||
@ -369,3 +369,10 @@ en:
|
||||
|
||||
label_dmsf_attachments: DMS Attachments
|
||||
label_basic_attachments: Basic Attachments
|
||||
|
||||
easy_pages:
|
||||
modules:
|
||||
dmsf_locked_documents: My locked documents
|
||||
dmsf_open_approvals: My open approvals
|
||||
module_category:
|
||||
easy_dms: Easy DMS
|
||||
@ -369,3 +369,10 @@ es:
|
||||
|
||||
label_dmsf_attachments: DMS Attachments
|
||||
label_basic_attachments: Basic Attachments
|
||||
|
||||
easy_pages:
|
||||
modules:
|
||||
dmsf_locked_documents: My locked documents
|
||||
dmsf_open_approvals: My open approvals
|
||||
module_category:
|
||||
easy_dms: Easy DMS
|
||||
@ -369,3 +369,10 @@ fr:
|
||||
|
||||
label_dmsf_attachments: Pièces-jointes DMS
|
||||
label_basic_attachments: Pièces-jointes standards
|
||||
|
||||
easy_pages:
|
||||
modules:
|
||||
dmsf_locked_documents: My locked documents
|
||||
dmsf_open_approvals: My open approvals
|
||||
module_category:
|
||||
easy_dms: Easy DMS
|
||||
@ -368,3 +368,10 @@ hu:
|
||||
|
||||
label_dmsf_attachments: DMS Attachments
|
||||
label_basic_attachments: Basic Attachments
|
||||
|
||||
easy_pages:
|
||||
modules:
|
||||
dmsf_locked_documents: My locked documents
|
||||
dmsf_open_approvals: My open approvals
|
||||
module_category:
|
||||
easy_dms: Easy DMS
|
||||
@ -369,3 +369,10 @@ it: # Italian strings thx 2 Matteo Arceci!
|
||||
|
||||
label_dmsf_attachments: DMS Attachments
|
||||
label_basic_attachments: Basic Attachments
|
||||
|
||||
easy_pages:
|
||||
modules:
|
||||
dmsf_locked_documents: My locked documents
|
||||
dmsf_open_approvals: My open approvals
|
||||
module_category:
|
||||
easy_dms: Easy DMS
|
||||
@ -369,3 +369,10 @@ ja:
|
||||
|
||||
label_dmsf_attachments: DMS Attachments
|
||||
label_basic_attachments: Basic Attachments
|
||||
|
||||
easy_pages:
|
||||
modules:
|
||||
dmsf_locked_documents: My locked documents
|
||||
dmsf_open_approvals: My open approvals
|
||||
module_category:
|
||||
easy_dms: Easy DMS
|
||||
@ -369,3 +369,10 @@ pl:
|
||||
|
||||
label_dmsf_attachments: DMS Attachments
|
||||
label_basic_attachments: Basic Attachments
|
||||
|
||||
easy_pages:
|
||||
modules:
|
||||
dmsf_locked_documents: My locked documents
|
||||
dmsf_open_approvals: My open approvals
|
||||
module_category:
|
||||
easy_dms: Easy DMS
|
||||
@ -369,3 +369,10 @@ pt-BR:
|
||||
|
||||
label_dmsf_attachments: DMS Attachments
|
||||
label_basic_attachments: Basic Attachments
|
||||
|
||||
easy_pages:
|
||||
modules:
|
||||
dmsf_locked_documents: My locked documents
|
||||
dmsf_open_approvals: My open approvals
|
||||
module_category:
|
||||
easy_dms: Easy DMS
|
||||
@ -369,3 +369,10 @@ ru:
|
||||
|
||||
label_dmsf_attachments: DMS Attachments
|
||||
label_basic_attachments: Basic Attachments
|
||||
|
||||
easy_pages:
|
||||
modules:
|
||||
dmsf_locked_documents: My locked documents
|
||||
dmsf_open_approvals: My open approvals
|
||||
module_category:
|
||||
easy_dms: Easy DMS
|
||||
@ -369,3 +369,10 @@ sl:
|
||||
|
||||
label_dmsf_attachments: DMS Attachments
|
||||
label_basic_attachments: Basic Attachments
|
||||
|
||||
easy_pages:
|
||||
modules:
|
||||
dmsf_locked_documents: My locked documents
|
||||
dmsf_open_approvals: My open approvals
|
||||
module_category:
|
||||
easy_dms: Easy DMS
|
||||
@ -369,3 +369,10 @@ zh-TW:
|
||||
|
||||
label_dmsf_attachments: DMS Attachments
|
||||
label_basic_attachments: Basic Attachments
|
||||
|
||||
easy_pages:
|
||||
modules:
|
||||
dmsf_locked_documents: My locked documents
|
||||
dmsf_open_approvals: My open approvals
|
||||
module_category:
|
||||
easy_dms: Easy DMS
|
||||
@ -369,3 +369,10 @@ zh:
|
||||
|
||||
label_dmsf_attachments: DMS Attachments
|
||||
label_basic_attachments: Basic Attachments
|
||||
|
||||
easy_pages:
|
||||
modules:
|
||||
dmsf_locked_documents: My locked documents
|
||||
dmsf_open_approvals: My open approvals
|
||||
module_category:
|
||||
easy_dms: Easy DMS
|
||||
@ -3,14 +3,14 @@ module RedmineDmsf
|
||||
|
||||
def self.included(base)
|
||||
base.send(:include, InstanceMethods)
|
||||
|
||||
base.class_eval do
|
||||
|
||||
unloadable
|
||||
before_action :controller_easy_crm_cases_before_save, only: [:create, :update, :bulk_update]
|
||||
after_action :controller_easy_crm_cases_after_save, only: [:create, :update, :bulk_update]
|
||||
alias_method_chain :easy_crm_after_save, :dmsf
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
private
|
||||
module InstanceMethods
|
||||
|
||||
def controller_easy_crm_cases_before_save
|
||||
easy_crm_cases = @easy_crm_cases
|
||||
@ -23,7 +23,8 @@ module RedmineDmsf
|
||||
end
|
||||
end
|
||||
|
||||
def controller_easy_crm_cases_after_save
|
||||
def easy_crm_after_save_with_dmsf
|
||||
easy_crm_after_save_without_dmsf
|
||||
easy_crm_cases = @easy_crm_cases
|
||||
easy_crm_cases ||= [@easy_crm_case]
|
||||
easy_crm_cases.each do |easy_crm_case|
|
||||
@ -90,12 +91,10 @@ module RedmineDmsf
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
module InstanceMethods
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Rails.configuration.to_prepare do
|
||||
unless EasyCrmCasesController.included_modules.include?(RedmineDmsf::EasyCrmCasesControllerPatch)
|
||||
EasyCrmCasesController.send(:include, RedmineDmsf::EasyCrmCasesControllerPatch)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user