CCS Redmine style

This commit is contained in:
Karel Picman 2016-03-09 14:53:09 +01:00
parent de8da43bc8
commit 417e80bbcf
29 changed files with 497 additions and 509 deletions

View File

@ -40,15 +40,15 @@ class DmsfFilesCopyController < ApplicationController
render :layout => !request.xhr?
end
def create
@target_project = DmsfFile.allowed_target_projects_on_copy.detect {|p| p.id.to_s == params[:target_project_id]} if params[:target_project_id]
unless @target_project
render_403
return
end
@target_folder = DmsfFolder.visible.find(params[:target_folder_id]) unless params[:target_folder_id].blank?
if !@target_folder.nil? && @target_folder.project != @target_project
@target_folder = DmsfFolder.visible.find_by_id(params[:target_folder_id]) unless params[:target_folder_id].blank?
if @target_folder && (@target_folder.project != @target_project)
raise DmsfAccessError, l(:error_entry_project_does_not_match_current_project)
end
@ -103,10 +103,10 @@ class DmsfFilesCopyController < ApplicationController
log_activity(@file, 'was moved (is copy)')
redirect_to dmsf_file_path(@file)
end
private
end
private
def log_activity(file, action)
Rails.logger.info "#{Time.now.strftime('%Y-%m-%d %H:%M:%S')} #{User.current.login}@#{request.remote_ip}/#{request.env['HTTP_X_FORWARDED_FOR']}: #{action} dmsf://#{file.project.identifier}/#{file.id}/#{file.last_revision.id}"
end

View File

@ -2,7 +2,7 @@
#
# Redmine plugin for Document Management System "Features"
#
# Copyright (C) 2011-15 Karel Pičman <karel.picman@kontron.com>
# Copyright (C) 2011-16 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
@ -31,8 +31,8 @@ class DmsfLinksController < ApplicationController
@dmsf_link.project_id = params[:project_id]
if params[:dmsf_link].present?
# Reload
@dmsf_link.dmsf_folder_id = params[:dmsf_link][:dmsf_folder_id] # TODO: Add stuff in here for external links so that if error occurs, repopulate the same
# Reload
@dmsf_link.dmsf_folder_id = params[:dmsf_link][:dmsf_folder_id]
@dmsf_file_id = params[:dmsf_link][:dmsf_file_id]
@type = params[:dmsf_link][:type]
@link_external = (@type == 'link_from') && (params[:external_link] == 'true')

View File

@ -34,8 +34,12 @@ class DmsfLink < ActiveRecord::Base
def validate_url
if self.target_type == 'DmsfUrl'
begin
URI.parse self.external_url
begin
if self.external_url.present?
URI.parse self.external_url
else
errors.add :external_url, :invalid
end
rescue URI::InvalidURIError
errors.add :external_url, :invalid
end
@ -124,7 +128,7 @@ class DmsfLink < ActiveRecord::Base
else
self.deleted = STATUS_DELETED
self.deleted_by_user = User.current
save
save(:validate => false)
end
end
@ -135,7 +139,7 @@ class DmsfLink < ActiveRecord::Base
end
self.deleted = STATUS_ACTIVE
self.deleted_by_user = nil
save
save(:validate => false)
end
end

View File

@ -1,7 +1,11 @@
<%# Redmine plugin for Document Management System "Features"
<%
# encoding: utf-8
#
# Copyright (C) 2011 Vít Jonáš <vit.jonas@gmail.com>
# Copyright (C) 2012 Daniel Munn <dan.munn@munnster.co.uk>
# Redmine plugin for Document Management System "Features"
#
# Copyright (C) 2011 Vít Jonáš <vit.jonas@gmail.com>
# Copyright (C) 2012 Daniel Munn <dan.munn@munnster.co.uk>
# Copyright (C) 2011-16 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
@ -18,11 +22,12 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.%>
<% if object %>
<div class="dmsf-customfields">
<div>
<% object.show_custom_field_values.each do |custom_value| %>
<div class="dmsf-customfield-<%= custom_value.custom_field.id %> dmsf-customfield customfield">
<%= label_tag('', "#{h(custom_value.custom_field.name)}:") %> <%= show_value(custom_value) %>
</div>
<p>
<%= label_tag('', h(custom_value.custom_field.name)) %>
<%= show_value custom_value %>
</p>
<% end %>
</div>
<% end %>

View File

@ -1,4 +1,4 @@
<%#=
<%
# encoding: utf-8
#
# Redmine plugin for Document Management System "Features"
@ -23,9 +23,9 @@
<% locked_for_user = subfolder && subfolder.locked_for_user? %>
<% locked = subfolder && subfolder.locked? %>
<td class="check"><%= check_box_tag(name, id, false,
<td class="dmsf_check"><%= check_box_tag(name, id, false,
:title => l(:title_check_for_zip_download_or_email), :id => "subfolder_#{id}") %></td>
<td class="title">
<td class="dmsf_title">
<%= link_to(h(title),
dmsf_folder_path(:id => project, :folder_id => subfolder),
:class => 'icon icon-folder') %>
@ -36,7 +36,7 @@
<% end %>
</td>
<td class="size"></td>
<td class="modified"><%= format_time(subfolder.modified) if subfolder %>
<td class="dmsf_modified"><%= format_time(subfolder.modified) if subfolder %>
<% if locked_for_user %>
<% if subfolder.lock.reverse[0].user %>
<%= link_to(image_tag(link ? 'locked_gray.png' : 'locked.png', :plugin => 'redmine_dmsf'),
@ -54,7 +54,7 @@
<td class="version"></td>
<td class="workflow"></td>
<td class="author"><%= h(subfolder.user) if subfolder %></td>
<td class="buttons">
<td class="dmsf_buttons">
<% if @folder_manipulation_allowed %>
<% unless locked_for_user %>
<%= link_to(image_tag('edit.png'),

View File

@ -1,4 +1,4 @@
<%#=
<%
# encoding: utf-8
#
# Redmine plugin for Document Management System "Features"
@ -20,9 +20,9 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
%>
<td class="check"><%= check_box_tag(name, id, false,
<td class="dmsf_check"><%= check_box_tag(name, id, false,
:title => l(:title_check_for_restore_or_delete), :id => "subfolder_#{id}") %></td>
<td class="title">
<td class="dmsf_title">
<%= content_tag(:span, h(title),
:title => h(title),
:class => 'icon icon-folder') %>
@ -33,13 +33,13 @@
<% end %>
</td>
<td class="size"></td>
<td class="modified">
<td class="dmsf_modified">
<%= format_time(subfolder.modified) if subfolder %>
</td>
<td class="version"></td>
<td class="workflow"></td>
<td class="author"><%= h(subfolder.user) %></td>
<td class="buttons">
<td class="dmsf_buttons">
<% if @folder_manipulation_allowed %>
<%= link_to(image_tag('restore.png', :plugin => 'redmine_dmsf'),
restore_dmsf_path(:id => project, :folder_id => subfolder),

View File

@ -1,4 +1,4 @@
<%#=
<%
# encode: utf-8
#
# Redmine plugin for Document Management System "Features"
@ -22,9 +22,9 @@
<% wf = DmsfWorkflow.find_by_id(file.last_revision.dmsf_workflow_id) %>
<td class="check"><%= check_box_tag(name, id, false,
<td class="dmsf_check"><%= check_box_tag(name, id, false,
:title => l(:title_check_for_zip_download_or_email), :id => "file_#{id}") %></td>
<td class="title">
<td class="dmsf_title">
<% file_view_url = url_for({:controller => :dmsf_files, :action => 'view', :id => file}) %>
<%= link_to(h(title),
file_view_url,
@ -35,7 +35,7 @@
<div class="filename" title="<%= l(:title_filename_for_download)%>"><%= h(link ? link.path : file.display_name) %></div>
</td>
<td class="size"><%= number_to_human_size(file.last_revision.size) %></td>
<td class="modified">
<td class="dmsf_modified">
<%= format_time(file.last_revision.updated_at) %>
<% if file.locked_for_user? %>
<% if file.lock.reverse[0].user %>
@ -67,7 +67,7 @@
<% end %>
</td>
<td class="author"><%= h(file.last_revision.user) %></td>
<td class="buttons">
<td class="dmsf_buttons">
<% if @file_manipulation_allowed %>
<%= link_to(image_tag('filedetails.png', :plugin => 'redmine_dmsf'),
dmsf_file_path(:id => file),

View File

@ -1,4 +1,4 @@
<%#=
<%
# encoding: utf-8
#
# Redmine plugin for Document Management System "Features"
@ -20,16 +20,16 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
%>
<td class="check"><%= check_box_tag(name, id, false,
<td class="dmsf_check"><%= check_box_tag(name, id, false,
:title => l(:title_check_for_restore_or_delete), :id => "file_#{id}") %></td>
<td class="title">
<td class="dmsf_title">
<%= content_tag(:span, h(title),
:title => h(title),
:class => "icon icon-file #{DmsfHelper.filetype_css(file.name)}") %>
<div class="filename" title="<%= l(:title_filename_for_download)%>"><%= h(link ? link.path : file.display_name) %></div>
</td>
<td class="size"><%= number_to_human_size(file.last_revision.size) %></td>
<td class="modified">
<td class="dmsf_modified">
<%= format_time(file.last_revision.updated_at) %>
</td>
<td class="version" title="<%= file.last_revision.comment %>"><%= file.last_revision.version %></td>
@ -37,7 +37,7 @@
<%= file.last_revision.workflow_str(false) %>
</td>
<td class="author"><%= h(file.last_revision.user) %></td>
<td class="buttons">
<td class="dmsf_buttons">
<% if @file_manipulation_allowed %>
<% if link %>
<%= link_to(image_tag('restore.png', :plugin => 'redmine_dmsf'),

View File

@ -17,14 +17,15 @@
#
# 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.%>
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
%>
<h2>
<% if folder %>
<%= link_to l(:link_documents), dmsf_folder_path(:id => @project) %>
<% folder.dmsf_path.each do |path_element| %>
/
<% if !filename && path_element == folder.dmsf_path.last %>
<% if filename.blank? && (path_element == folder.dmsf_path.last) %>
<%= h(path_element.title) %>
<% else %>
<%= link_to h(path_element.title), dmsf_folder_path(:id => @project, :folder_id => path_element) %>
@ -37,4 +38,7 @@
/
<%= h(filename) %>
<% end %>
</h2>
<% if title %>
&#187; <%= title %>
<% end %>
</h2>

View File

@ -1,4 +1,4 @@
<%#=
<%
# encoding: utf-8
#
# Redmine plugin for Document Management System "Features"
@ -20,8 +20,8 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
%>
<td class="check"></td>
<td class="title">
<td class="dmsf_check"></td>
<td class="dmsf_title">
<%= link_to(h(title),
link.external_url,
:target => '_blank',
@ -31,11 +31,11 @@
</div>
</td>
<td class="size"></td>
<td class="modified"><%= format_time(link.updated_at) %></td>
<td class="dmsf_modified"><%= format_time(link.updated_at) %></td>
<td class="version"></td>
<td class="workflow"></td>
<td class="author"><%= h(link.user) %></td>
<td class="buttons">
<td class="dmsf_buttons">
<span class="icon"></span>
<span class="icon"></span>
<span class="icon"></span>

View File

@ -1,9 +1,9 @@
<%#=
<%
# encoding: utf-8
#
# Redmine plugin for Document Management System "Features"
#
# Copyright (C) 2011-15 Karel Pičman <karel.picman@kontron.com>
# Copyright (C) 2011-16 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,9 +20,9 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
%>
<td class="check"><%= check_box_tag(name, id, false,
<td class="dmsf_check"><%= check_box_tag(name, id, false,
:title => l(:title_check_for_restore_or_delete)) %></td>
<td class="title">
<td class="dmsf_title">
<%= link_to(h(title),
link.external_url,
:target => "_blank",
@ -30,11 +30,11 @@
<div class="filename" title="<%= l(:label_target_folder)%>"><%= link.external_url %></div>
</td>
<td class="size"></td>
<td class="modified"><%= format_time(link.updated_at) %></td>
<td class="dmsf_modified"><%= format_time(link.updated_at) %></td>
<td class="version"></td>
<td class="workflow"></td>
<td class="author"><%= h(link.user) %></td>
<td class="buttons">
<td class="dmsf_buttons">
<% if @file_manipulation_allowed %>
<%= link_to(image_tag('restore.png', :plugin => 'redmine_dmsf'),
restore_dmsf_link_path(:id => link),

View File

@ -1,4 +1,4 @@
<%#
<%
# encoding: utf-8
#
# Redmine plugin for Document Management System "Features"
@ -19,7 +19,8 @@
#
# 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.%>
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
%>
<% html_title(l(:dmsf)) %>
@ -64,41 +65,34 @@
</div>
<% create = @pathfolder == @parent %>
<%= render(:partial => 'path', :locals => {:folder => @pathfolder, :filename => create ? l(:heading_new_folder) : nil}) %>
<%= render(:partial => 'path',
:locals => {:folder => @pathfolder, :filename => create ? l(:heading_new_folder) : nil, :title => nil}) %>
<%= form_for(@folder, :url => {:action => create ? 'create' : 'save', :id => @project, :folder_id => @folder, :parent_id => @parent},
:html => {:method=>:post}) do |f| %>
<%= error_messages_for(@folder) %>
<div class="box dmsf_detail">
<div class="clear">
<div class="splitcontentleft">
<p>
<%= label_tag('dmsf_folder_title', "#{l(:label_title)}:") %>
<%= f.text_field(:title, :size => '32', :required => true) %>
</p>
</div>
<div class="splitcontentright">
<p>
<%= label_tag('', "#{l(:field_folder)}:") %>
<%= f.select(:dmsf_folder_id,
options_for_select(DmsfFolder.directory_tree(@project, @folder),
:selected => @parent? @parent.id : (@pathfolder.id if @pathfolder)))
%>
</p>
</div>
</div>
<p class="no-ident">
<%= label_tag('dmsf_folder_description', "#{l(:label_description)}:") %>
<div class="box tabular">
<p>
<label for="dmsf_folder_title"><%= l(:label_title) %><span class="required">*</span></label>
<%= f.text_field(:title, :size => '32', :required => true) %>
</p>
<p>
<%= label_tag('', l(:field_folder)) %>
<%= f.select(:dmsf_folder_id,
options_for_select(DmsfFolder.directory_tree(@project, @folder),
:selected => @parent? @parent.id : (@pathfolder.id if @pathfolder)))
%>
</p>
<p>
<%= label_tag('dmsf_folder_description', l(:label_description)) %>
<%= f.text_area :description, :rows => 8, :class => 'wiki-edit' %>
</p>
<div class="wiki data clear">
<%= f.text_area(:description, :rows => 15, :class => 'wiki-edit') %>
</div>
<% values = @folder ? @folder.custom_field_values : @parent ? @parent.custom_field_values : DmsfFolder.new(:project => @project).custom_field_values %>
<% values.each do |value| %>
<p><%= custom_field_tag_with_label(:dmsf_folder, value) %></p>
<% end %>
</div>
<%= submit_tag(create ? l(:submit_create) : l(:submit_save)) %>
<% end %>
</div>
<p><%= submit_tag(create ? l(:submit_create) : l(:submit_save)) %></p>
<% end %>
<%= wikitoolbar_for 'dmsf_folder_description' %>
<%= wikitoolbar_for 'dmsf_folder_description' %>

View File

@ -1,7 +1,11 @@
<%# Redmine plugin for Document Management System "Features"
<%
# encoding: utf-8
#
# Copyright (C) 2011 Vít Jonáš <vit.jonas@gmail.com>
# Copyright (C) 2012 Daniel Munn <dan.munn@munnster.co.uk>
# Redmine plugin for Document Management System "Features"
#
# Copyright (C) 2011 Vít Jonáš <vit.jonas@gmail.com>
# Copyright (C) 2012 Daniel Munn <dan.munn@munnster.co.uk>
# Copyright (C) 2011-16 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
@ -15,7 +19,8 @@
#
# 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.%>
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
%>
<% html_title(l(:dmsf)) %>
@ -35,17 +40,16 @@
<% end %>
</div>
<%= render(:partial => 'path', :locals => {:folder => nil, :filename => nil}) %>
<%= render(:partial => 'path',
:locals => {:folder => nil, :filename => nil, :title => nil}) %>
<%= form_for(@project, :url => {:action => 'save_root', :id => @project},
:html => {:method=>:post}) do |f| %>
<div class="box dmsf_detail">
<p class="no-ident">
<%= label_tag('project_dmsf_description', "#{l(:label_description)}:") %>
<div class="box tabular">
<p>
<%= label_tag('project_dmsf_description', l(:label_description)) %>
<%= f.text_area(:dmsf_description, :rows => 8, :class => 'wiki-edit') %>
</p>
<div class="wiki data clear">
<%= f.text_area(:dmsf_description, :rows => 15, :class => 'wiki-edit') %>
</div>
</div>
<%= submit_tag(l(:submit_save)) %>
<% end %>

View File

@ -1,8 +1,11 @@
<%# Redmine plugin for Document Management System "Features"
<%
# encoding: utf-8
#
# Redmine plugin for Document Management System "Features"
#
# Copyright (C) 2011 Vít Jonáš <vit.jonas@gmail.com>
# Copyright (C) 2012 Daniel Munn <dan.munn@munnster.co.uk>
# Copyright (C) 2011-14 Karel Pičman <karel.picman@kontron.com>
# Copyright (C) 2011-16 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
@ -16,50 +19,50 @@
#
# 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.%>
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
%>
<% html_title(l(:dmsf)) %>
<div class="contextual">
</div>
<%= render(:partial => 'path',
:locals => {:folder => @folder, :filename => nil, :title => l(:heading_send_documents_by_email)}) %>
<%= render(:partial => 'path', :locals => {:folder => @folder, :filename => nil}) %>
<h3><%= l(:heading_send_documents_by_email) %></h3>
<%= form_tag({:action => 'entries_email', :id => @project, :folder_id => @folder},
{ :method=>:post, :class => 'tabular'}) do %>
<%= form_tag({ :action => 'entries_email', :id => @project, :folder_id => @folder },
{ :method => :post }) do %>
<%= hidden_field_tag('email[zipped_content]', @email_params[:zipped_content]) %>
<%= hidden_field_tag('email[folders]', @email_params[:folders].to_json) %>
<%= hidden_field_tag('email[files]', @email_params[:files].to_json) %>
<div class="box">
<div class="box tabular">
<p>
<%= label_tag('', "#{l(:label_email_from)}:") %>
<i><%= h(Setting.mail_from) %></i>
<%= label_tag('', l(:label_email_from)) %>
<%= text_field_tag('email[from]', h(Setting.mail_from), :style => 'width: 90%;', :disabled => true) %>
</p>
<p>
<%= label_tag('email[to]', "#{l(:label_email_to)}:") %>
<%= label_tag('email[to]', l(:label_email_to)) %>
<%= text_field_tag('email[to]', @email_params['to'], :style => 'width: 90%;') %>
</p>
<p>
<%= label_tag('email[cc]', "#{l(:label_email_cc)}:") %>
<%= label_tag('email[cc]', l(:label_email_cc)) %>
<%= text_field_tag('email[cc]', @email_params['cc'], :style => 'width: 90%;') %>
</p>
<p>
<%= label_tag('email[subject]', "#{l(:label_email_subject)}:") %>
<%= label_tag('email[subject]', l(:label_email_subject)) %>
<%= text_field_tag('email[subject]', @email_params['subject'], :style => 'width: 90%;') %>
</p>
<p>
<%= label_tag('', "#{l(:label_email_documents)}:") %>
<%= link_to 'Documents.zip', download_email_entries_path(:id => @project, :folder_id => @folder, :path => @email_params[:zipped_content]) %>
<%= l(:label_or) %> <%= check_box_tag('email[links_only]') %> <%= l(:label_links_only) %>
<%= label_tag('', l(:label_email_documents)) %>
<span>
<%= link_to 'Documents.zip', download_email_entries_path(:id => @project, :folder_id => @folder, :path => @email_params[:zipped_content]) %>
<%= l(:label_or) %>
<%= check_box_tag('email[links_only]') %> <%= l(:label_links_only) %>
</span>
</p>
<p>
<%= label_tag('email[body]', "#{l(:label_email_body)}:") %>
<%= text_area_tag('email[body]', @email_params['body'], :rows=> '20', :style => 'width: 90%;') %>
</p>
<p><%= submit_tag(l(:label_email_send)) %></p>
<%= label_tag('email[body]', l(:label_email_body)) %>
<%= text_area_tag('email[body]', @email_params['body'], :rows => '20', :style => 'width: 90%;') %>
</p>
</div>
<p><%= submit_tag(l(:label_email_send)) %></p>
<% end %>
<%= wikitoolbar_for 'email_body' %>
<%= wikitoolbar_for 'email_body' %>

View File

@ -1,4 +1,4 @@
<%#=
<%
# encoding: utf-8
#
# Redmine plugin for Document Management System "Features"
@ -71,7 +71,8 @@
:title => l(:link_trash_bin), :class => 'icon icon-del') if @trash_visible %>
</div>
<%= render(:partial => 'path', :locals => {:folder => @folder, :filename => nil}) %>
<%= render(:partial => 'path',
:locals => {:folder => @folder, :filename => nil, :title => nil}) %>
<div class="dmsf-header">
<div class="wiki">
@ -98,11 +99,12 @@
:dmsf_folder,
CustomValue.new(:custom_field_id => params[:custom_field_id].present? ? params[:custom_field_id] : values.first.custom_field_id, :value => params[:custom_value])) %>
</div>
<% end %>
<table class="display entries" id="browser">
<% end %>
<div class="autoscroll">
<table class="display list" id="browser">
<thead>
<tr id="root">
<th class="check">
<th class="dmsf_check">
<input id="check_all_entries" title="<%= l(:title_check_uncheck_all_for_zip_download_or_email) %>" type="checkbox" />
</th>
<th><%= l(:link_title) %></th>
@ -189,7 +191,8 @@
</tr>
<% end %>
</tbody>
</table>
</table>
</div>
<% end %>
<script type="text/javascript">

View File

@ -1,9 +1,9 @@
<%#=
<%
# encoding: utf-8
#
# Redmine plugin for Document Management System "Features"
#
# Copyright (C) 2011-15 Karel Pičman <karel.picman@kontron.com>
# Copyright (C) 2011-16 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,8 @@
%>
<% html_title(l(:dmsf)) %>
<div class="contextual">
</div>
<h2><%= l(:link_trash_bin) %></h2>
<h2><%= l(:link_trash_bin) %></h2>
<div class="dmsf-header">
<div class="wiki">
@ -44,11 +42,12 @@
<%= submit_tag(l(:button_delete), :title => l(:title_delete_checked), :name => 'destroy_entries') %>
<% end %>
<% end %>
</div>
<table class="display entries" id="browser">
</div>
<div class="autoscroll">
<table class="display list" id="browser">
<thead>
<tr id="root">
<th class="check">
<th class="dmsf_check">
<input id="check_all_entries" title="<%= l(:title_check_uncheck_all_for_restore_or_delete) %>" type="checkbox" />
</th>
<th><%= l(:link_title) %></th>
@ -131,7 +130,8 @@
</tr>
<% end %>
</tbody>
</table>
</table>
</div>
<% end %>
<script type="text/javascript">

View File

@ -1,4 +1,4 @@
<%#=
<%
# encoding: utf-8
#
# Redmine plugin for Document Management System "Features"
@ -22,7 +22,7 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
%>
<div class="box dmsf_detail">
<div class="box tabular">
<strong><%= l(:heading_new_revision) %> <a href="#" id="newRevisionFormContentToggle">[-]</a></strong>
<div id="newRevisionFormContent">
<% if @file.locked_for_user? %>
@ -30,93 +30,77 @@
<% else %>
<%= form_for(@revision, :url => { :action => 'create_revision', :id => @file },
:html => { :method => :post, :multipart => true, :id => 'new_revision_form' }) do |f| %>
<div class="clear">
<div class="clear">
<div class="splitcontentleft">
<p>
<%= label_tag('dmsf_file_revision_title', "#{l(:label_title)}:") %>
<p>
<%= label_tag('dmsf_file_revision_title', l(:label_title)) %>
<%= f.text_field(:title, :size => 32) %>
</p>
</div>
<div class="splitcontentright">
<p style="white-space: nowrap;">
<%= label_tag('', "#{l(:label_file)}:") %>
<%= f.text_field(:name, :size => 22) %>
</p>
</div>
</div>
<p class="no-ident">
<%= label_tag('dmsf_file_revision_description', "#{l(:label_description)}:") %>
</p>
<div class="wiki data clear">
<%= f.text_area(:description, :rows => 6, :class => 'wiki-edit') %>
</div>
<div class="splitcontentleft">
<div class="splitcontentright">
<p>
<%= label_tag('', l(:label_file)) %>
<%= f.text_field(:name, :size => 22) %>
</p>
</div>
</div>
<p>
<%= label_tag('version_0', "#{l(:label_version)}:") %>
</p>
<div class="data clear">
<%= radio_button_tag('version', 0,
@revision.version == @file.last_revision.version) %>
<%= @file.last_revision.major_version %>.<%= @file.last_revision.minor_version %>
<%= l(:option_version_same) %><br/>
<%= radio_button_tag('version', 1,
@revision.major_version == @file.last_revision.major_version &&
@revision.minor_version != @file.last_revision.minor_version) %>
<%= @file.last_revision.major_version %>.<%= @file.last_revision.minor_version + 1 %>
<%= l(:option_version_minor) %><br/>
<%= radio_button_tag('version', 2,
@revision.major_version != @file.last_revision.major_version) %>
<%= @file.last_revision.major_version + 1 %>.0
<%= l(:option_version_major) %><br/>
<%= radio_button_tag('version', 3) %>
<%= select_tag 'custom_version_major',
options_for_select(0..99, @file.last_revision.major_version + 2),
:onchange => '$("#version_3").prop("checked", true)'%>.
<%= select_tag 'custom_version_minor',
options_for_select(0..99, @file.last_revision.minor_version + 1),
:onchange => '$("#version_3").prop("checked", true)'%>
<%= l(:option_version_custom) %>
</div>
</div>
<div class="splitcontentright clear">
<p>
<%= label_tag('file_upload', "#{l(:label_new_content)}:") %>
</p>
<span class="add_attachment">
<%= file_field_tag 'file_upload',
:id => 'file_upload',
:class => 'file_selector',
:multiple => false,
:onchange => "$('#dmsf_file_revision_name').val(this.files[0].name)",
:data => {
:max_file_size => Setting.attachment_max_size.to_i.kilobytes,
:max_file_size_message => l(:error_attachment_too_big, :max_size => number_to_human_size(Setting.attachment_max_size.to_i.kilobytes)),
:max_concurrent_uploads => 1,
:upload_path => uploads_path(:format => 'js')
}
%>
(<%= l(:label_max_size) %>: <%= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %>)
</span>
</div>
<br style="clear: both"/>
<%= label_tag('dmsf_file_revision_description', l(:label_description)) %>
<%= f.text_area(:description, :rows => 6, :class => 'wiki-edit') %>
</p>
<div class="clear">
<div class="splitcontentleft">
<p>
<%= label_tag('version_0', l(:label_version)) %>
<%= radio_button_tag('version', 0, @revision.version == @file.last_revision.version) %>
<%= @file.last_revision.major_version %>.<%= @file.last_revision.minor_version %>
<%= l(:option_version_same) %><br/>
<%= radio_button_tag('version', 1, @revision.major_version == @file.last_revision.major_version && @revision.minor_version != @file.last_revision.minor_version) %>
<%= @file.last_revision.major_version %>.<%= @file.last_revision.minor_version + 1 %>
<%= l(:option_version_minor) %><br/>
<%= radio_button_tag('version', 2, @revision.major_version != @file.last_revision.major_version) %>
<%= @file.last_revision.major_version + 1 %>.0
<%= l(:option_version_major) %><br/>
<%= radio_button_tag('version', 3) %>
<%= select_tag 'custom_version_major', options_for_select(0..99, @file.last_revision.major_version + 2), :onchange => '$("#version_3").prop("checked", true)' %>.
<%= select_tag 'custom_version_minor', options_for_select(0..99, @file.last_revision.minor_version + 1), :onchange => '$("#version_3").prop("checked", true)' %>
<%= l(:option_version_custom) %>
</p>
</div>
<div class="splitcontentright">
<p>
<%= label_tag('file_upload', l(:label_new_content)) %>
<span class="add_attachment">
<%= file_field_tag 'file_upload',
:id => 'file_upload',
:class => 'file_selector',
:multiple => false,
:onchange => "$('#dmsf_file_revision_name').val(this.files[0].name)",
:data => {
:max_file_size => Setting.attachment_max_size.to_i.kilobytes,
:max_file_size_message => l(:error_attachment_too_big, :max_size => number_to_human_size(Setting.attachment_max_size.to_i.kilobytes)),
:max_concurrent_uploads => 1,
:upload_path => uploads_path(:format => 'js')
}
%>
(<%= l(:label_max_size) %>: <%= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %>)
</span>
</p>
</div>
</div>
<div class="custom_fields">
<% @revision.custom_field_values.each do |value| %>
<p><%= custom_field_tag_with_label(:dmsf_file_revision, value) %></p>
<% end %>
</div>
<div class="comment">
<p>
<%= label_tag('dmsf_file_revision_comment', "#{l(:label_comment)}:") %>
</p>
<div class="data">
<%= f.text_area(:comment, :rows=> 2, :style => 'width: 99%;') %>
</div>
</div>
<br/>
<%= submit_tag(l(:submit_create)) %>
</div>
<p>
<%= label_tag('dmsf_file_revision_comment', l(:label_comment)) %>
<%= f.text_area(:comment, :rows => 2) %>
</p>
<%= submit_tag(l(:submit_create)) %>
<% end %>
<% end %>
</div>
<% end %>
</div>
</div>
<%= wikitoolbar_for 'dmsf_file_revision_description' %>

View File

@ -1,9 +1,11 @@
<%#=
<%
# encoding: utf-8
#
# Redmine plugin for Document Management System "Features"
#
# Copyright (C) 2011 Vít Jonáš <vit.jonas@gmail.com>
# Copyright (C) 2012 Daniel Munn <dan.munn@munnster.co.uk>
# Copyright (C) 2013 Karel Pičman <karel.picman@kontron.com>
# Copyright (C) 2011 Vít Jonáš <vit.jonas@gmail.com>
# Copyright (C) 2012 Daniel Munn <dan.munn@munnster.co.uk>
# Copyright (C) 2011-16 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
@ -19,7 +21,7 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
%>
<br/>
<table class="display access-table list">
<thead>
<tr>
@ -33,9 +35,9 @@
<% revision.access_grouped.each do |access| %>
<tr>
<td><%= link_to_user(access.user) %></td>
<td><%= access['count'] %></td>
<td><%= format_time(DmsfHelper::to_time(access.first_at)) %></td>
<td><%= format_time(DmsfHelper::to_time(access.last_at)) %></td>
<td class="version"><%= access['count'] %></td>
<td class="dmsf_modified"><%= format_time(DmsfHelper::to_time(access.first_at)) %></td>
<td class="dmsf_modified"><%= format_time(DmsfHelper::to_time(access.last_at)) %></td>
</tr>
<% end %>
</tbody>

View File

@ -1,4 +1,4 @@
<%#=
<%
# encoding: utf-8
#
# Redmine plugin for Document Management System "Features"
@ -61,7 +61,8 @@
<% end %>
</div>
<%= render(:partial => '/dmsf/path', :locals => {:folder => @file.folder, :filename => @file.title}) %>
<%= render(:partial => '/dmsf/path',
:locals => {:folder => @file.folder, :filename => @file.title, :title => nil}) %>
<% if User.current.allowed_to?(:file_manipulation, @file.project) && !@file.locked_for_user? %>
<%= error_messages_for('file') %>
@ -69,14 +70,14 @@
<%= render(:partial => 'file_new_revision') %>
<% end %>
<div class="dmsf_id_box dmsf_detail">
<%= label_tag('', "#{l(:label_document)}:") %>
<div class="dmsf_id_box tabular">
<%= label_tag('', l(:label_document)) %>
<%= "##{@file.id}" %>
</div>
<h3><%= l(:heading_revisions) %></h3>
<% @file.revisions.visible[@revision_pages.offset,@revision_pages.per_page].each do |revision| %>
<div class="revision_box dmsf_detail dataTables_wrapper">
<% @file.revisions.visible[@revision_pages.offset, @revision_pages.per_page].each do |revision| %>
<div class="revision_box tabular dataTables_wrapper">
<div class="fg-toolbar ui-toolbar ui-widget-header ui-corner-tl ui-corner-tr ui-helper-clearfix">
<div class="dataTables_lenght">
<div class="controls" style="float: right">
@ -99,54 +100,68 @@
</div>
<div class="dmsf_revision_inner_box">
<div class="clear">
<div class="splitcontentleft">
<%= label_tag('', "#{l(:label_title)}:") %>
<%= h(revision.title) %>
<div class="splitcontentleft">
<p>
<%= label_tag('', l(:label_title)) %>
<%= h(revision.title) %>
</p>
</div>
<div class="splitcontentright">
<%= label_tag('', "#{l(:label_file)}:") %>
<%= ("#{h(revision.file.folder.dmsf_path_str)}/") if revision.file.folder %><%= h(revision.name) %>
<div class="splitcontentright">
<p>
<%= label_tag('', l(:label_file)) %>
<%= ("#{h(revision.file.folder.dmsf_path_str)}/") if revision.file.folder %><%= h(revision.name) %>
</p>
</div>
</div>
<p class="no-ident">
<%= label_tag('', "#{l(:label_description)}:") %>
</p>
<div class="wiki clear" style="margin-left: 110px">
<%= textilizable(revision.description) %>
</div>
<div class="splitcontentleft">
<%= label_tag('', "#{l(:label_version)}:") %>
<%= revision.major_version %>.<%= revision.minor_version %>
<br/>
<%= label_tag('', "#{l(:link_workflow)}:") %>
<% wf = DmsfWorkflow.find_by_id(revision.dmsf_workflow_id) %>
<% if wf %>
<%= "#{wf.name} - " %>
<%= link_to(revision.workflow_str(false),
log_dmsf_workflow_path(:project_id => @project.id,
:id => wf.id, :dmsf_file_revision_id => revision.id),
:title => DmsfWorkflow.assignments_to_users_str(wf.next_assignments(revision.id)),
:remote => true) %>
<% else %>
<%= revision.workflow_str(true) %>
<% end %>
</div>
<div class="splitcontentright clear">
<%= label_tag('', "#{l(:label_mime)}:") %>
<%= h(revision.mime_type) %>
<br/>
<%= label_tag('', "#{l(:label_size)}:") %>
<%= number_to_human_size(revision.size) %>
</div>
<div class="no-ident clear">
<%= render 'dmsf/custom_fields', :object => revision %>
</div>
<p class="no-ident">
<%= label_tag('', "#{l(:label_comment)}:") %>
</p>
<div class="wiki clear" style="margin-left: 110px">
<%= textilizable(revision.comment) %>
</div>
<% if revision.description.present? %>
<p>
<%= label_tag('', l(:label_description)) %>
<div class="wiki">
<%= textilizable(revision.description) %>
</div>
</p>
<% end %>
<div class="clear">
<div class="splitcontentleft">
<p>
<%= label_tag('', l(:label_version)) %>
<%= revision.major_version %>.<%= revision.minor_version %>
</p>
<p>
<%= label_tag('', l(:link_workflow)) %>
<% wf = DmsfWorkflow.find_by_id(revision.dmsf_workflow_id) %>
<% if wf %>
<%= "#{wf.name} - " %>
<%= link_to(revision.workflow_str(false),
log_dmsf_workflow_path(:project_id => @project.id,
:id => wf.id, :dmsf_file_revision_id => revision.id),
:title => DmsfWorkflow.assignments_to_users_str(wf.next_assignments(revision.id)),
:remote => true) %>
<% else %>
<%= revision.workflow_str(true) %>
<% end %>
</p>
</div>
<div class="splitcontentright">
<p>
<%= label_tag('', l(:label_mime)) %>
<%= h(revision.mime_type) %>
</p>
<p>
<%= label_tag('', l(:label_size)) %>
<%= number_to_human_size(revision.size) %>
</p>
</div>
</div>
<%= render 'dmsf/custom_fields', :object => revision %>
<% if revision.comment.present? %>
<p>
<%= label_tag('', l(:label_comment)) %>
<div class="wiki">
<%= textilizable(revision.comment) %>
</div>
</p>
<% end %>
<div id="<%= "revision_access-#{revision.id}" %>" style="display:none">
<%= render(:partial => 'revision_access', :locals => {:revision => revision}) if User.current.allowed_to?(:file_manipulation, @file.project) %>
</div>

View File

@ -1,7 +1,11 @@
<%# Redmine plugin for Document Management System "Features"
<%
# encoding: utf-8
#
# Copyright (C) 2011 Vít Jonáš <vit.jonas@gmail.com>
# Copyright (C) 2012 Daniel Munn <dan.munn@munnster.co.uk>
# Redmine plugin for Document Management System "Features"
#
# Copyright (C) 2011 Vít Jonáš <vit.jonas@gmail.com>
# Copyright (C) 2012 Daniel Munn <dan.munn@munnster.co.uk>
# Copyright (C) 2011-16 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
@ -15,8 +19,8 @@
#
# 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.%>
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
%>
<!--Select2 Files-->
<%= stylesheet_link_tag 'select2.min.css', :plugin => 'redmine_dmsf' %>
@ -24,30 +28,32 @@
<% html_title(l(:dmsf)) %>
<div class="contextual">
</div>
<%= render(:partial => '/dmsf/path', :locals => {:folder => @file.folder, :filename => @file.title}) %>
<%= render(:partial => '/dmsf/path',
:locals => {:folder => @file.folder, :filename => @file.title,
:title => "#{l(:button_copy)}/#{l(:button_move)}"}) %>
<% if DmsfFile.allowed_target_projects_on_copy.present? %>
<%= form_tag({:action => 'create', :id => @file}, :id => 'copyForm') do |f| %>
<div class="box dmsf_detail">
<p>
<label for="target_project_id"><%=l(:field_target_project)%>:</label>
<div class="box tabular">
<p>
<%= label_tag('target_project_id', l(:field_target_project)) %>
<%= select_tag('target_project_id',
project_tree_options_for_select(DmsfFile.allowed_target_projects_on_copy, :selected => @target_project)) %>
project_tree_options_for_select(DmsfFile.allowed_target_projects_on_copy,
:selected => @target_project)) %>
</p>
<p>
<%= label_tag('target_folder_id', "#{l(:field_target_folder)}:") %>
<%= label_tag('target_folder_id', l(:field_target_folder)) %>
<%= select_tag('target_folder_id',
options_for_select(DmsfFolder.directory_tree(@target_project),
:selected => (@target_folder.id if @target_folder))) %>
</p>
</div>
<%= submit_tag(l(:button_copy)) %>
<% if User.current.allowed_to?(:file_manipulation, @project) %>
<button type="button" id="move_button" title="<%= l(:button_move) %>"><%= l(:button_move) %></button>
<% end %>
<p>
<%= submit_tag(l(:button_copy)) %>
<% if User.current.allowed_to?(:file_manipulation, @project) %>
<%= submit_tag(l(:button_move), :id => 'move_button') %>
<% end %>
</p>
<% end %>
<% end %>

View File

@ -1,7 +1,11 @@
<%# Redmine plugin for Document Management System "Features"
<%
# encoding: utf-8
#
# Copyright (C) 2011 Vít Jonáš <vit.jonas@gmail.com>
# Copyright (C) 2012 Daniel Munn <dan.munn@munnster.co.uk>
# Redmine plugin for Document Management System "Features"
#
# Copyright (C) 2011 Vít Jonáš <vit.jonas@gmail.com>
# Copyright (C) 2012 Daniel Munn <dan.munn@munnster.co.uk>
# Copyright (C) 2011-16 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
@ -15,8 +19,8 @@
#
# 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.%>
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
%>
<!--Select2 Files-->
<%= stylesheet_link_tag 'select2.min.css', :plugin => 'redmine_dmsf' %>
@ -24,20 +28,19 @@
<% html_title(l(:dmsf)) %>
<div class="contextual"></div>
<%= render(:partial => '/dmsf/path', :locals => {:folder => @folder, :filename => nil}) %>
<%= render(:partial => '/dmsf/path',
:locals => {:folder => @folder, :filename => nil, :title => l(:button_copy)}) %>
<% unless DmsfFolder.allowed_target_projects_on_copy.blank? %>
<%= form_tag({:action => 'copy_to', :id => @folder}, :id => 'copyForm') do |f| %>
<div class="box dmsf_detail">
<div class="box tabular">
<p>
<label for="target_project_id"><%= l(:field_target_project) %>:</label>
<%= select_tag('target_project_id',
project_tree_options_for_select(DmsfFolder.allowed_target_projects_on_copy, :selected => @target_project)) %>
</p>
<p>
<%= label_tag('target_folder_id', "#{l(:field_target_folder)}:") %>
<%= label_tag('target_folder_id', l(:field_target_folder)) %>
<%= select_tag('target_folder_id',
options_for_select(DmsfFolder.directory_tree(@target_project, @folder),
:selected => (@target_folder.id if @target_folder))) %>

View File

@ -1,6 +1,9 @@
<%# Redmine plugin for Document Management System "Features"
<%
# encoding: utf-8
#
# Copyright (C) 2011-15 Karel Pičman <karel.picman@lbcfree.net>
# Redmine plugin for Document Management System "Features"
#
# Copyright (C) 2011-16 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
@ -18,15 +21,14 @@
<% html_title l(:dmsf) %>
<div class="contextual">
</div>
<% if @dmsf_file_id %>
<% file = DmsfFile.find_by_id @dmsf_file_id%>
<% title = file.title if file %>
<% end %>
<%= render(:partial => '/dmsf/path', :locals => {:folder => @dmsf_link.folder, :filename => title}) %>
<%= render(:partial => '/dmsf/path',
:locals => {:folder => @dmsf_link.folder, :filename => nil,
:title => (@type == 'link_from') ? l(:label_link_from) : l(:label_link_to) }) %>
<%= labelled_form_for @dmsf_link do |f| %>
<%= error_messages_for @dmsf_link %>
@ -34,7 +36,7 @@
<%= f.hidden_field :dmsf_folder_id, :value => @dmsf_link.dmsf_folder_id if @dmsf_link.dmsf_folder_id %>
<%= f.hidden_field :type, :value => @type %>
<%= f.hidden_field :dmsf_file_id, :value => @dmsf_file_id %>
<div class="box dmsf_detail">
<div class="box tabular">
<% if @type == 'link_from' %>
<p>
<%= radio_button_tag(:external_link, 'false', @link_external == false) %> <%= l(:label_internal) %><br/>
@ -43,10 +45,10 @@
<% end %>
<div id="link_internal" style="<%= @link_external ? 'display:none' : '' %>">
<p>
<% if @type == 'link_from' %>
<%= label_tag('dmsf_link[target_project_id]', l(:label_source_project), :class => 'required') %>
<% else %>
<%= label_tag('dmsf_link[target_project_id]', l(:label_target_project), :class => 'required') %>
<% if @type == 'link_from' %>
<label for="dmsf_link[target_project_id]"><%= l(:label_source_project) %><span class="required">*</span></label>
<% else %>
<label for="dmsf_link[target_project_id]"><%= l(:label_target_project) %><span class="required">*</span></label>
<% end %>
<%= select_tag('dmsf_link[target_project_id]',
project_tree_options_for_select(DmsfFile.allowed_target_projects_on_copy,
@ -62,29 +64,31 @@
folder_tree_options_for_select(DmsfFolder.directory_tree(@dmsf_link.target_project),
:selected => @target_folder_id)) %>
</p>
<% if @type == 'link_from' %>
<p>
<% if @target_folder_id %>
<% folder = DmsfFolder.find_by_id @target_folder_id %>
<% files = folder.files.visible if folder %>
<% else %>
<% files = @dmsf_link.target_project.dmsf_files.visible if @dmsf_link.target_project %>
<% end %>
<%= f.select(:target_file_id,
options_for_select(DmsfFolder.file_list(files), @target_file_id)) %>
</p>
<% end %>
<% if @type == 'link_from' %>
<p>
</div>
<div id="link_external" style="<%= @link_external ? '' : 'display:none' %>">
<%= label_tag('dmsf_link[external_url]', l(:label_link_external_url), :class => 'required') %>
<%= text_field_tag 'dmsf_link[external_url]', @dmsf_link.external_url, :size => 40, :maxlength => 255 %>
</div>
<%= label_tag('dmsf_link[name]', l(:label_link_name), :class => 'required') %>
<%= text_field_tag 'dmsf_link[name]', @dmsf_link.name, :size => 40, :maxlength => 255 %>
<!--</p>-->
<% if @target_folder_id %>
<% folder = DmsfFolder.find_by_id @target_folder_id %>
<% files = folder.files.visible if folder %>
<% else %>
<% files = @dmsf_link.target_project.dmsf_files.visible if @dmsf_link.target_project %>
<% end %>
<%= f.select(:target_file_id,
options_for_select(DmsfFolder.file_list(files), @target_file_id)) %>
</p>
<% end %>
</div>
<div id="link_external" style="<%= @link_external ? '' : 'display:none' %>">
<p>
<label for="dmsf_link[external_url]"><%= l(:label_link_external_url) %><span class="required">*</span></label>
<%= text_field_tag 'dmsf_link[external_url]', @dmsf_link.external_url, :size => 40, :maxlength => 255 %>
</p>
</div>
<p>
<label for="dmsf_link[name]"><%= l(:label_link_name) %><span class="required">*</span></label>
<%= text_field_tag 'dmsf_link[name]', @dmsf_link.name, :size => 40, :maxlength => 255 %>
</p>
</div>
<%= f.submit l(:button_create) %>
<p><%= f.submit l(:button_create) %></p>
<% end %>
<script type="text/javascript">

View File

@ -1,11 +1,11 @@
<%#=
<%
# encoding: utf-8
#
# Redmine plugin for Document Management System "Features"
#
# Copyright (C) 2011 Vít Jonáš <vit.jonas@gmail.com>
# Copyright (C) 2012 Daniel Munn <dan.munn@munnster.co.uk>
# Copyright (C) 2011-15 Karel Pičman <karel.picman@kontron.com>
# Copyright (C) 2011-16 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,65 +21,62 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
%>
<div class="box dmsf_detail">
<div class="box tabular">
<%= hidden_field_tag("commited_files[#{i}][disk_filename]", upload.disk_filename) %>
<div class="clear">
<div class="splitcontentleft">
<p>
<%= label_tag("commited_files[#{i}][title]", "#{l(:label_title)}:") %>
<%= label_tag("commited_files[#{i}][title]", l(:label_title)) %>
<%= text_field_tag("commited_files[#{i}][title]", upload.title, :size => 32) %>
</p>
</div>
<div class="splitcontentright">
<p>
<%= label_tag('', "#{l(:label_filename)}:") %>
<%= label_tag('', l(:label_filename)) %>
<%= h(upload.name) %>
<%= hidden_field_tag("commited_files[#{i}][name]", upload.name) %>
</p>
</div>
</div>
<p class="no-ident">
<%= label_tag("commited_files[#{i}][description]", "#{l(:label_description)}:") %>
<p>
<%= label_tag("commited_files[#{i}][description]", l(:label_description)) %>
<%= text_area_tag("commited_files[#{i}][description]", upload.description, :rows => 6, :class => 'wiki-edit') %>
</p>
<div class="wiki data clear">
<%= text_area_tag("commited_files[#{i}][description]", upload.description, :rows=> 6, :class => 'wiki-edit') %>
<div class="clear">
<div class="splitcontentleft">
<p>
<%= label_tag("commited_files[#{i}][version]_minor", l(:label_version)) %>
<%= radio_button_tag("commited_files[#{i}][version]", 1, true) %>
<%= upload.major_version %>.<%= upload.minor_version + 1 %>
<%= l(:option_version_minor) %><br/>
<%= radio_button_tag("commited_files[#{i}][version]", 2) %>
<%= upload.major_version + 1 %>.0
<%= l(:option_version_major) %><br/>
<%= radio_button_tag("commited_files[#{i}][version]", 3) %>
<%= select_tag "commited_files[#{i}][custom_version_major]", options_for_select(0..99, upload.major_version + 2), :onchange => "$('#commited_files_#{i}_version_3').prop('checked', true)" %>.
<%= select_tag "commited_files[#{i}][custom_version_minor]", options_for_select(0..99, upload.minor_version + 1), :onchange => "$('#commited_files_#{i}_version_3').prop('checked', true)" %>
<%= l(:option_version_custom) %>
</p>
</div>
<div class="splitcontentright">
<p>
<%= label_tag('', l(:label_mime)) %>
<%= h(upload.mime_type) %>
</p>
<p>
<%= label_tag('', l(:label_size)) %>
<%= number_to_human_size(upload.size) %>
</p>
</div>
</div>
<div class="splitcontentleft">
<p>
<%= label_tag("commited_files[#{i}][version]_minor", "#{l(:label_version)}:") %>
</p>
<div class="data clear">
<%= radio_button_tag("commited_files[#{i}][version]", 1, true) %>
<%= upload.major_version %>.<%= upload.minor_version + 1 %>
<%= l(:option_version_minor) %><br/>
<%= radio_button_tag("commited_files[#{i}][version]", 2) %>
<%= upload.major_version + 1 %>.0
<%= l(:option_version_major) %><br/>
<%= radio_button_tag("commited_files[#{i}][version]", 3) %>
<%= select_tag "commited_files[#{i}][custom_version_major]", options_for_select(0..99, upload.major_version + 2) %>.<%= select_tag "commited_files[#{i}][custom_version_minor]", options_for_select(0..99, upload.minor_version + 1) %>
<%= l(:option_version_custom) %>
</div>
</div>
<div class="splitcontentright clear">
<p>
<%= label_tag('', "#{l(:label_mime)}:") %>
<%= h(upload.mime_type) %>
</p>
<p>
<%= label_tag('', "#{l(:label_size)}:") %>
<%= number_to_human_size(upload.size) %>
</p>
</div>
<br style="clear: both"/>
<% upload.custom_values.each do |value| %>
<p><%= custom_field_tag_with_label("commited_files[#{i}][dmsf_file_revision]", value) %></p>
<% end %>
<p>
<%= label_tag("commited_files[#{i}][comment]", "#{l(:label_comment)}:") %>
<%= label_tag("commited_files[#{i}][comment]", l(:label_comment)) %>
<%= text_area_tag("commited_files[#{i}][comment]", upload.comment, :rows => 2) %>
</p>
<div class="data">
<%= text_area_tag("commited_files[#{i}][comment]", upload.comment, :rows => 2, :style => 'width: 99%;') %>
</div>
</div>
<%= wikitoolbar_for "commited_files_#{i}_description" %>
<%= wikitoolbar_for "commited_files_#{i}_description" %>

View File

@ -1,7 +1,11 @@
<%# Redmine plugin for Document Management System "Features"
<%
# encoding: utf-8
#
# Redmine plugin for Document Management System "Features"
#
# Copyright (C) 2011 Vít Jonáš <vit.jonas@gmail.com>
# Copyright (C) 2012 Daniel Munn <dan.munn@munnster.co.uk>
# Copyright (C) 2011-16 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
@ -15,48 +19,57 @@
#
# 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.%>
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
%>
<div class="box dmsf_detail">
<div class="box tabular">
<%= hidden_field_tag("commited_files[#{i}][disk_filename]", upload.disk_filename) %>
<%= hidden_field_tag("commited_files[#{i}][name]", upload.name) %>
<p class="warning"><%= l(:info_file_locked) %></p>
<div class="clear">
<div class="splitcontentleft">
<p>
<%= label_tag('', "#{l(:label_title)}:") %>
<%= label_tag('', l(:label_title)) %>
<%= h(upload.title) %>
</p>
</div>
<div class="splitcontentright">
<p>
<%= label_tag('', "#{l(:label_filename)}:") %>
<%= label_tag('', l(:label_filename)) %>
<%= h(upload.name) %>
</p>
</div>
</div>
<p class="no-ident">
<%= label_tag('', "#{l(:label_description)}:") %>
</p>
<div class="wiki data clear">
<%= textilizable(upload.description) %>
</div>
<div class="splitcontentleft">
<% if upload.description.present? %>
<p>
<%= label_tag('', "#{l(:label_version)}:") %>
<%= upload.major_version %>.<%= upload.minor_version %>
</p>
</div>
<div class="splitcontentright clear">
<p>
<%= label_tag('', "#{l(:label_mime)}:") %>
<%= h(upload.mime_type) %>
<%= label_tag('', l(:label_description)) %>
<div class="wiki">
<%= textilizable(upload.description) %>
</div>
</p>
<% end %>
<div class="clear">
<div class="splitcontentleft">
<p>
<%= label_tag('', l(:label_version)) %>
<%= upload.major_version %>.<%= upload.minor_version %>
</p>
</div>
<div class="splitcontentright">
<p>
<%= label_tag('', l(:label_mime)) %>
<%= h(upload.mime_type) %>
</p>
<p>
<%= label_tag('', l(:label_size)) %>
<%= number_to_human_size(upload.size) %>
</p>
</div>
</div>
<% if upload.comment.present? %>
<p>
<%= label_tag('', "#{l(:label_size)}:") %>
<%= number_to_human_size(upload.size) %>
<%= label_tag('', l(:label_comment)) %>
<div class="wiki"><%= textilizable(upload.comment) %></div>
</p>
</div>
<br style="clear: both"/>
</div>
<% end %>
</div>

View File

@ -1,7 +1,11 @@
<%# Redmine plugin for Document Management System "Features"
<%
# encoding: utf-8
#
# Copyright (C) 2011 Vít Jonáš <vit.jonas@gmail.com>
# Copyright (C) 2012 Daniel Munn <dan.munn@munnster.co.uk>
# Redmine plugin for Document Management System "Features"
#
# Copyright (C) 2011 Vít Jonáš <vit.jonas@gmail.com>
# Copyright (C) 2012 Daniel Munn <dan.munn@munnster.co.uk>
# Copyright (C) 2011-16 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
@ -19,9 +23,6 @@
<% html_title(l(:dmsf)) %>
<div class="contextual">
</div>
<%= render(:partial => '/dmsf/path', :locals => {:folder => @folder, :filename => nil}) %>
<div class="wiki">

View File

@ -1,4 +1,7 @@
<%# Redmine plugin for Document Management System "Features"
<%
# encoding: utf-8
#
# Redmine plugin for Document Management System "Features"
#
# Copyright (C) 2011-16 Karel Pičman <karel.picman@kontron.com>
#
@ -29,7 +32,7 @@
<fieldset>
<legend><%= l(:label_filter_plural) %></legend>
<label for='status'><%= l(:field_status) %>:</label>
<%= select_tag 'status', workflows_status_options_for_select(@status), :class => 'small', :onchange => "this.form.submit(); return false;" %>
<%= select_tag 'status', workflows_status_options_for_select(@status), :class => 'small', :onchange => 'this.form.submit(); return false;' %>
</fieldset>
<% end %>
&nbsp;

View File

@ -18,9 +18,9 @@
<% project = Project.find_by_id params[:project_id] if params[:project_id] %>
<% if project %>
<h2><%= link_to l(:label_dmsf_workflow_plural), settings_project_path(project, :tab => 'dmsf_workflow') %> &#187; <%=l(:label_dmsf_workflow_new)%></h2>
<h2><%= link_to l(:label_dmsf_workflow_plural), settings_project_path(project, :tab => 'dmsf_workflow') %> &#187; <%= l(:label_dmsf_workflow_new) %></h2>
<% else %>
<h2><%= link_to l(:label_dmsf_workflow_plural), dmsf_workflows_path %> &#187; <%=l(:label_dmsf_workflow_new)%></h2>
<h2><%= link_to l(:label_dmsf_workflow_plural), dmsf_workflows_path %> &#187; <%= l(:label_dmsf_workflow_new) %></h2>
<% end %>
<%= labelled_form_for @dmsf_workflow do |f| %>

View File

@ -25,50 +25,49 @@ button {
margin-bottom: 1px;
}
/* DMSF entries list */
table.entries tbody td, table.entries tbody tr:hover td {
border-left: solid 1px #D7D7D7;
border-right: solid 1px #D7D7D7;
/* DMSF table.list modifications */
table.list th.ui-state-default {
border: none;
}
table.entries td.modified {
table.list td.dmsf_modified {
min-width: 127px;
width: 127px;
font-size: 0.8em;
}
table.entries td.actions {
table.list td.dmsf_title {
width: 40%;
text-align: left;
}
table.list td.dmsf_buttons {
min-width: 96px;
width: 96px;
text-align: left;
}
table.entries td.title {
width: 40%;
}
table.entries th.check, table.entries td.check {
table.list th.dmsf_check, table.list td.dmsf_check {
width: 17px;
padding: 2px;
text-align: left;
}
table.entries th.check div.DataTables_sort_wrapper {
table.list th.dmsf_check div.DataTables_sort_wrapper {
padding: 0;
}
table.display th {
font-weight: bold;
table.list td.note {
width: 20%;
}
table.display tbody tr.even {
background-color: #F8F8F8;
table.list td.reorder {
width: 15%;
}
table.display tbody tr.odd {
background-color: #FFFFFF;
}
table.display tbody tr:hover {
background-color:#ffffdd;
table.list td.step {
text-align: center;
width: 16px;
}
form.dmfs_entries {
@ -76,12 +75,8 @@ form.dmfs_entries {
display: block;
}
div.dataTables_wrapper div.fg-toolbar {
font-size: 0.9em;
}
div.dataTables_wrapper div.fg-toolbar input, div.dataTables_wrapper div.fg-toolbar button,
div.dataTables_wrapper div.fg-toolbar select {
div.dataTables_wrapper div.fg-toolbar select, div.dataTables_wrapper div.fg-toolbar {
font-size: 0.9em;
}
@ -99,10 +94,6 @@ td.size {
white-space: nowrap;
}
td.modified {
font-size: 0.8em;
}
td.modified img {
vertical-align:text-top;
}
@ -126,7 +117,6 @@ td.workflow {
}
/* DMSF entries upload control */
.dmsf_upload textarea {
width: 90%;
}
@ -148,10 +138,7 @@ td.workflow {
}
div.upload_select {
float: right;
white-space: nowrap;
line-height: 1.4em;
padding-left: 10px;
float: right;
font-size: 0.9em;
}
@ -168,45 +155,6 @@ div.upload_select input, div.upload_select select {
bottom: 0px;
}
/* DMSF detail/commit page */
.dmsf_detail .warning {
padding: 4px 4px 4px 30px;
}
.dmsf_detail div.data {
margin-left: 110px;
}
.dmsf_detail label {
font-weight: bold;
width: 100px;
float: left;
text-align: right;
padding-right: 10px;
}
p.no-ident {
margin-bottom: 0;
margin-top: 0;
}
table.access-table tbody td, table.access-table tbody tr:hover td {
border: solid 1px #D7D7D7;
}
/* Custom field */
.dmsf-customfields {
margin: 5px 0px 5px 0px;
}
.dmsf-customfields .customfield label {
font-weight: bold;
width: 100px;
display: block;
float: left;
}
/* Approval workflow */
#admin-menu a.approvalworkflows { background-image: url(../../../images/ticket_go.png); }
#users_for_delegate { height: 200px; overflow:auto; }
@ -238,23 +186,6 @@ div.revision_box .ui-widget-header {
font-weight: normal;
}
table.list th {
text-align: left;
}
table.list td.note {
width: 20%;
}
table.list td.reorder {
width: 15%;
}
table.list td.step {
text-align: center;
width: 16px;
}
.log_header_box{
padding:6px;
margin-bottom: 10px;
@ -331,11 +262,6 @@ tr.gray .icon-file.application-x-gzip { background-image: url(../images/filetype
.gray { color: #AAA }
.gray a, .gray a:link, .gray a:visited{ color: #484848; text-decoration: none; }
label.required:after {
content: " *";
color: #bb0000;
}
/* Search results */
dt.dmsf-file { background-image: url(../../../images/document.png); }
dt.dmsf-folder { background-image: url(../../../images/folder.png); }

View File

@ -94,11 +94,28 @@ class DmsfLinksTest < RedmineDmsf::Test::UnitTest
"Folder link #{@folder_link.name} should have not been saved"
assert_equal 1, @folder_link.errors.count
end
def test_validate_external_url_length
@file_link.target_type = 'DmsfUrl'
@file_link.external_url = 'https://localhost/' + 'a' * 256
assert !@file_link.save,
"External URL link #{@file_link.name} should have not been saved"
assert_equal 1, @file_link.errors.count
end
def test_validate_external_url_presence
@file_link.target_type = 'DmsfUrl'
@file_link.external_url = ''
assert !@file_link.save,
"External URL link #{@file_link.name} should have not been saved"
assert_equal 1, @file_link.errors.count
end
def test_validate_external_url
@file_link.target_type = 'DmsfUrl'
@file_link.external_url = nil
assert !@file_link.save, 'External link should have not been saved'
@file_link.external_url = 'htt ps://abc.xyz'
assert !@file_link.save,
"External URL link #{@file_link.name} should have not been saved"
assert_equal 1, @file_link.errors.count
end