64 lines
2.7 KiB
Plaintext
64 lines
2.7 KiB
Plaintext
<%# Redmine plugin for Document Management System "Features"
|
|
#
|
|
# Copyright (C) 2014 Karel Pičman <karel.picman@lbcfree.net>
|
|
#
|
|
# 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.%>
|
|
|
|
<% html_title(l(:dmsf)) %>
|
|
|
|
<div class="contextual">
|
|
</div>
|
|
|
|
<%= render(:partial => '/dmsf/path', :locals => {:folder => @dmsf_link.folder, :filename => nil}) %>
|
|
|
|
<%= labelled_form_for @dmsf_link do |f| %>
|
|
<%= error_messages_for @dmsf_link %>
|
|
<%= f.hidden_field :project_id, :value => @dmsf_link.project_id %>
|
|
<%= f.hidden_field :dmsf_folder_id, :value => @dmsf_link.dmsf_folder_id if @dmsf_link.dmsf_folder_id %>
|
|
<div class="box dmsf_detail">
|
|
<p>
|
|
<%= f.select(:target_project_id,
|
|
project_tree_options_for_select(DmsfFile.allowed_target_projects_on_copy,
|
|
:selected => @dmsf_link.target_project),
|
|
{:required => true}) %>
|
|
</p>
|
|
<p>
|
|
<%= f.select(:target_folder_id,
|
|
folder_tree_options_for_select(DmsfFolder.directory_tree(@dmsf_link.target_project),
|
|
:selected => @target_folder_id),
|
|
{:required => true}) %>
|
|
</p>
|
|
<p>
|
|
<%= f.select(:target_file_id,
|
|
options_for_select(
|
|
DmsfFolder.file_list(
|
|
(@target_folder_id ? DmsfFolder.find(@target_folder_id).files : @dmsf_link.target_project.dmsf_files).visible),
|
|
@target_file_id)) %>
|
|
</p>
|
|
<p>
|
|
<%= f.text_field :name, :size => 40, :maxlength => 255, :required => true, :value => @dmsf_link.name %>
|
|
</p>
|
|
</div>
|
|
<%= f.submit l(:button_create) %>
|
|
<% end %>
|
|
|
|
<script type="text/javascript">
|
|
$('#dmsf_link_target_project_id').change(function () {
|
|
$('#content').load("<%= url_for(:action => 'new', :project_id => @project.id, :dmsf_folder_id => @dmsf_link.dmsf_folder_id, :reload => true) %>", $('#new_dmsf_link').serialize());
|
|
});
|
|
$('#dmsf_link_target_folder_id').change(function () {
|
|
$('#content').load("<%= url_for(:action => 'new', :project_id => @project.id, :dmsf_folder_id => @dmsf_link.dmsf_folder_id) %>", $('#new_dmsf_link').serialize());
|
|
});
|
|
</script> |