CCS revision

This commit is contained in:
Karel Pičman 2020-03-19 14:08:29 +01:00
parent 78f55e1596
commit 29b33edad4
31 changed files with 180 additions and 217 deletions

View File

@ -171,7 +171,7 @@ class DmsfLinksController < ApplicationController
if @dmsf_link.delete(commit) if @dmsf_link.delete(commit)
flash[:notice] = l(:notice_successful_delete) flash[:notice] = l(:notice_successful_delete)
else else
@dmsf_link.errors.each do |e, msg| @dmsf_link.errors.each do |_, msg|
flash[:error] = msg flash[:error] = msg
end end
end end

View File

@ -114,7 +114,7 @@ class DmsfUploadController < ApplicationController
if attachments if attachments
@folder = DmsfFolder.visible.find_by(id: attachments[:folder_id]) if attachments[:folder_id].present? @folder = DmsfFolder.visible.find_by(id: attachments[:folder_id]) if attachments[:folder_id].present?
# standard file input uploads # standard file input uploads
uploaded_files = attachments.select { |key, value| key == 'uploaded_file'} uploaded_files = attachments.select { |key, _| key == 'uploaded_file'}
uploaded_files.each do |_, uploaded_file| uploaded_files.each do |_, uploaded_file|
upload = DmsfUpload.create_from_uploaded_attachment(@project, @folder, uploaded_file) upload = DmsfUpload.create_from_uploaded_attachment(@project, @folder, uploaded_file)
if upload if upload

View File

@ -39,7 +39,7 @@ module DmsfWorkflowsHelper
class: 'objects-selection') class: 'objects-selection')
end end
links = pagination_links_full(principal_pages, principal_count, per_page_links: false) do |text, parameters, options| links = pagination_links_full(principal_pages, principal_count, per_page_links: false) do |text, parameters, _|
link_to text, link_to text,
autocomplete_for_user_dmsf_workflow_path(workflow, parameters.merge(q: params[:q], format: 'js')), autocomplete_for_user_dmsf_workflow_path(workflow, parameters.merge(q: params[:q], format: 'js')),
remote: true remote: true

View File

@ -92,7 +92,7 @@ class DmsfFileRevision < ActiveRecord::Base
remove_extension(filename).gsub(/_+/, ' '); remove_extension(filename).gsub(/_+/, ' ');
end end
def self.easy_activity_custom_project_scope(scope, options, event_type) def self.easy_activity_custom_project_scope(scope, options, _)
scope.where(dmsf_files: { project_id: options[:project_ids] }) scope.where(dmsf_files: { project_id: options[:project_ids] })
end end

View File

@ -534,15 +534,15 @@ class DmsfFolder < ActiveRecord::Base
classes = [] classes = []
if trash if trash
if title =~ /^\./ if title =~ /^\./
classes << 'dmsf_system' classes << 'dmsf-system'
else else
classes << 'hascontextmenu' classes << 'hascontextmenu'
if type =~ /link$/ if type =~ /link$/
classes << 'dmsf_gray' classes << 'dmsf-gray'
end end
end end
else else
classes << 'dmsf_tree' classes << 'dmsf-tree'
if type == 'folder' if type == 'folder'
classes << 'dmsf_collapsed' classes << 'dmsf_collapsed'
classes << 'dmsf-not-loaded' classes << 'dmsf-not-loaded'
@ -550,7 +550,7 @@ class DmsfFolder < ActiveRecord::Base
classes << 'dmsf_child' classes << 'dmsf_child'
end end
if title =~ /^\./ if title =~ /^\./
classes << 'dmsf_system' classes << 'dmsf-system'
else else
classes << 'hascontextmenu' classes << 'hascontextmenu'
classes << 'dmsf-draggable' classes << 'dmsf-draggable'
@ -558,7 +558,7 @@ class DmsfFolder < ActiveRecord::Base
classes << 'dmsf-droppable' classes << 'dmsf-droppable'
end end
if type =~ /link$/ if type =~ /link$/
classes << 'dmsf_gray' classes << 'dmsf-gray'
end end
end end
end end

View File

@ -23,7 +23,7 @@
class DmsfTitleQueryColumn < QueryColumn class DmsfTitleQueryColumn < QueryColumn
def css_classes def css_classes
'dmsf_title' 'dmsf-title'
end end
end end

View File

@ -99,7 +99,7 @@
<%= context_menu %> <%= context_menu %>
<% unless (@folder && @folder.system) %> <% unless @folder && @folder.system %>
<% other_formats_links do |f| %> <% other_formats_links do |f| %>
<%= f.link_to 'CSV', url: { action: :show, id: @project, dmsf_folder_id: @folder } %> <%= f.link_to 'CSV', url: { action: :show, id: @project, dmsf_folder_id: @folder } %>
<% end %> <% end %>

View File

@ -69,10 +69,10 @@
<%= radio_button_tag('version', 3) %> <%= radio_button_tag('version', 3) %>
<%= select_tag 'custom_version_major', options_for_select(DmsfUploadHelper::major_version_select_options, <%= select_tag 'custom_version_major', options_for_select(DmsfUploadHelper::major_version_select_options,
DmsfUploadHelper::gui_version(DmsfUploadHelper::increase_version(@file.last_revision.major_version, 2))), DmsfUploadHelper::gui_version(DmsfUploadHelper::increase_version(@file.last_revision.major_version, 2))),
onchange: '$("#version_3").prop("checked", true)', class: 'dmsf_select_version' %>. onchange: '$("#version_3").prop("checked", true)', class: 'dmsf-select-version' %>.
<%= select_tag 'custom_version_minor', options_for_select(DmsfUploadHelper::minor_version_select_options, <%= select_tag 'custom_version_minor', options_for_select(DmsfUploadHelper::minor_version_select_options,
DmsfUploadHelper::gui_version(DmsfUploadHelper.increase_version(@file.last_revision.minor_version, 1))), DmsfUploadHelper::gui_version(DmsfUploadHelper.increase_version(@file.last_revision.minor_version, 1))),
onchange: '$("#version_3").prop("checked", true)', class: 'dmsf_select_version' %> onchange: '$("#version_3").prop("checked", true)', class: 'dmsf-select-version' %>
<%= l(:option_version_custom) %> <%= l(:option_version_custom) %>
</p> </p>
</div> </div>

View File

@ -20,7 +20,7 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
%> %>
<% if link %> <% if link %>
<p class="dmsf_gray"> <p class="dmsf-gray">
<% else %> <% else %>
<p> <p>
<% end %> <% end %>

View File

@ -23,9 +23,9 @@
<% if links.present? %> <% if links.present? %>
<hr/> <hr/>
<strong><%= l(:menu_dmsf) %></strong> <strong><%= l(:menu_dmsf) %></strong>
<div class="attachments dmsf_parent_container"> <div class="attachments dmsf-parent-container">
<% # DMS documents & links %> <% # DMS documents & links %>
<% links.each do |dmsf_file, link, create_at| %> <% links.each do |dmsf_file, link, _| %>
<%= render partial: 'dmsf_files/link', locals: { dmsf_file: dmsf_file, link: link } %> <%= render partial: 'dmsf_files/link', locals: { dmsf_file: dmsf_file, link: link } %>
<% end %> <% end %>
<%= render partial: 'dmsf_files/thumbnails', locals: { links: links, thumbnails: thumbnails, link_to: true } %> <%= render partial: 'dmsf_files/thumbnails', locals: { links: links, thumbnails: thumbnails, link_to: true } %>

View File

@ -71,16 +71,16 @@
<%= render(partial: 'file_new_revision') %> <%= render(partial: 'file_new_revision') %>
<% end %> <% end %>
<div class="dmsf_id_box"> <div class="dmsf-id-box">
<strong><%= label_tag('', l(:label_document)) %></strong> <strong><%= label_tag('', l(:label_document)) %></strong>
#<%= "#{@file.id}" %> #<%= "#{@file.id}" %>
</div> </div>
<h3><%= l(:heading_revisions) %></h3> <h3><%= l(:heading_revisions) %></h3>
<% @file.dmsf_file_revisions.visible[@revision_pages.offset, @revision_pages.per_page].each do |revision| %> <% @file.dmsf_file_revisions.visible[@revision_pages.offset, @revision_pages.per_page].each do |revision| %>
<div class="dmsf_revision_box"> <div class="dmsf-revision-box">
<div id="dmsf_widget_header" class="fg-toolbar ui-toolbar ui-widget-header ui-corner-tl ui-corner-tr ui-helper-clearfix"> <div class="dmsf-widget-header fg-toolbar ui-toolbar ui-widget-header ui-corner-tl ui-corner-tr ui-helper-clearfix">
<div class="dmsf_controls contextual"> <div class="dmsf-controls contextual">
<%= actions_dropdown do %> <%= actions_dropdown do %>
<%= link_to_function l(:title_download_entries), <%= link_to_function l(:title_download_entries),
"$('#revision_access-#{revision.id}').toggle()", "$('#revision_access-#{revision.id}').toggle()",
@ -100,14 +100,14 @@
class: 'icon icon-del' if @file_delete_allowed && (@file.dmsf_file_revisions.visible.count > 1) %> class: 'icon icon-del' if @file_delete_allowed && (@file.dmsf_file_revisions.visible.count > 1) %>
<% end %> <% end %>
</div> </div>
<div id="dmsf_widget_header_text"> <div class="dmsf-widget-header-text">
<i><%= l(:info_revision, rev: revision.id) %></i> <i><%= l(:info_revision, rev: revision.id) %></i>
<%= (revision.source_revision.nil? ? l(:label_created) : l(:label_changed)).downcase %> <%= (revision.source_revision.nil? ? l(:label_created) : l(:label_changed)).downcase %>
<%= l(:info_changed_by_user, changed: format_time(revision.updated_at)) %> <%= l(:info_changed_by_user, changed: format_time(revision.updated_at)) %>
<%= link_to(revision.user.name, user_path(revision.user)) if revision.user %> <%= link_to(revision.user.name, user_path(revision.user)) if revision.user %>
</div> </div>
</div> </div>
<div class="attributes dmsf_revision_inner_box"> <div class="attributes dmsf-revision-inner-box">
<div class="splitcontent"> <div class="splitcontent">
<div class="splitcontentleft"> <div class="splitcontentleft">
<div class="status attribute"> <div class="status attribute">

View File

@ -21,7 +21,8 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
%> %>
<span id="public_url" <%= "class='hol'" unless Setting.plugin_redmine_dmsf['dmsf_documents_email_links_only'] %>"> <% classes = 'hol' unless Setting.plugin_redmine_dmsf['dmsf_documents_email_links_only'] %>
<span id="public_url" class="<%= classes %>">
<%= check_box_tag 'email[public_urls]', 1, false %> <%= l(:label_public_urls) %> <%= check_box_tag 'email[public_urls]', 1, false %> <%= l(:label_public_urls) %>
<%= date_field_tag('email[expired_at]', '', value: (DateTime.current + 3.days).to_date, size: 10) + <%= date_field_tag('email[expired_at]', '', value: (DateTime.current + 3.days).to_date, size: 10) +
calendar_for('email_expired_at') %> calendar_for('email_expired_at') %>

View File

@ -88,7 +88,7 @@
} %> } %>
</span> </span>
<% if defined?(container) && container %> <% if defined?(container) && container %>
<span class="dmsf_add_link"> <span class="dmsf-add-link">
<%= link_to l(:label_link_from), <%= link_to l(:label_link_from),
new_dmsf_link_path(project_id: container.project.id, type: 'link_from', container: container.class.name), new_dmsf_link_path(project_id: container.project.id, type: 'link_from', container: container.class.name),
title: l(:title_create_link), class: 'icon icon-add file_selector', remote: true %> title: l(:title_create_link), class: 'icon icon-add file_selector', remote: true %>

View File

@ -69,12 +69,12 @@
options_for_select(DmsfUploadHelper::major_version_select_options, options_for_select(DmsfUploadHelper::major_version_select_options,
DmsfUploadHelper::gui_version(DmsfUploadHelper::increase_version(upload.major_version, 2))), DmsfUploadHelper::gui_version(DmsfUploadHelper::increase_version(upload.major_version, 2))),
onchange: "$('#commited_files_#{i}_version_3').prop('checked', true)", onchange: "$('#commited_files_#{i}_version_3').prop('checked', true)",
class: 'dmsf_select_version'%>. class: 'dmsf-select-version'%>.
<%= select_tag "commited_files[#{i}][custom_version_minor]", <%= select_tag "commited_files[#{i}][custom_version_minor]",
options_for_select(DmsfUploadHelper::minor_version_select_options, options_for_select(DmsfUploadHelper::minor_version_select_options,
DmsfUploadHelper::gui_version(DmsfUploadHelper.increase_version(upload.minor_version, 1))), DmsfUploadHelper::gui_version(DmsfUploadHelper.increase_version(upload.minor_version, 1))),
onchange: "$('#commited_files_#{i}_version_3').prop('checked', true)", onchange: "$('#commited_files_#{i}_version_3').prop('checked', true)",
class: 'dmsf_select_version' %> class: 'dmsf-select-version' %>
<%= l(:option_version_custom) %> <%= l(:option_version_custom) %>
</p> </p>
</div> </div>

View File

@ -25,7 +25,7 @@
<%= form_tag({ controller: 'dmsf_upload', action: 'upload_files', id: @project, folder_id: @folder }, <%= form_tag({ controller: 'dmsf_upload', action: 'upload_files', id: @project, folder_id: @folder },
id: 'uploadform', method: :post, multipart: true) do %> id: 'uploadform', method: :post, multipart: true) do %>
<div> <div>
<span class="dmsf_uploader"> <span class="dmsf-uploader">
<%= render partial: 'dmsf_upload/form', <%= render partial: 'dmsf_upload/form',
locals: { multiple: true, container: nil, description: true, awf: false } %> locals: { multiple: true, container: nil, description: true, awf: false } %>
</span> </span>

View File

@ -23,8 +23,8 @@
<h3 class="title"><%= l(:title_dmsf_workflow_log) %></h3> <h3 class="title"><%= l(:title_dmsf_workflow_log) %></h3>
<p> <p>
<% if revision %> <% if revision %>
<div class="dmsf_log_header_box"> <div class="dmsf-log-header-box">
<div class="dmsf_log_header_left"> <div class="dmsf-log-header-left">
<%= label_tag 'workflow_name', "#{l(:link_workflow)} #{l(:field_name).downcase} " %> <%= label_tag 'workflow_name', "#{l(:link_workflow)} #{l(:field_name).downcase} " %>
<% if User.current.allowed_to?(:manage_workflows, @dmsf_workflow.project) %> <% if User.current.allowed_to?(:manage_workflows, @dmsf_workflow.project) %>
<%= link_to @dmsf_workflow.name, dmsf_workflow_path(@dmsf_workflow) %> <%= link_to @dmsf_workflow.name, dmsf_workflow_path(@dmsf_workflow) %>

View File

@ -45,7 +45,7 @@
</tr></thead> </tr></thead>
<tbody> <tbody>
<% @workflows.each do |workflow| %> <% @workflows.each do |workflow| %>
<tr id="workflow-<%= workflow.id %>" class="dmsf_workflows <%= workflow.active? ? 'active' : 'locked' %>"> <tr id="workflow-<%= workflow.id %>" class="dmsf-workflows <%= workflow.active? ? 'active' : 'locked' %>">
<td class="name"><%= link_to(h(workflow.name), dmsf_workflow_path(workflow)) %></td> <td class="name"><%= link_to(h(workflow.name), dmsf_workflow_path(workflow)) %></td>
<td class="buttons"> <td class="buttons">
<%= change_status_link(workflow) unless @project %> <%= change_status_link(workflow) unless @project %>

View File

@ -83,9 +83,9 @@
<div id="<%= "step-index-#{index}-approvers-form" %>" class="hol"> <div id="<%= "step-index-#{index}-approvers-form" %>" class="hol">
<%= form_for(@dmsf_workflow, url: update_step_dmsf_workflow_path(step: index), method: :put, <%= form_for(@dmsf_workflow, url: update_step_dmsf_workflow_path(step: index), method: :put,
html: { id: "step-index-operator-#{index}-form"}) do |_| %> html: { id: "step-index-operator-#{index}-form"}) do |_| %>
<div class="dmsf_parent_container"> <div class="dmsf-parent-container">
<% stps.each do |step| %> <% stps.each do |step| %>
<div class="dmsf_child_container"> <div class="dmsf-child-container">
<label> <label>
<%= radio_button_tag "operator_step[#{step.id}]", DmsfWorkflowStep::OPERATOR_AND, <%= radio_button_tag "operator_step[#{step.id}]", DmsfWorkflowStep::OPERATOR_AND,
step.operator == DmsfWorkflowStep::OPERATOR_AND %> step.operator == DmsfWorkflowStep::OPERATOR_AND %>
@ -100,7 +100,7 @@
<br/> <br/>
&nbsp;<%= delete_link delete_step_dmsf_workflow_path(step: step.id) %> &nbsp;<%= delete_link delete_step_dmsf_workflow_path(step: step.id) %>
</div> </div>
<div class="dmsf_child_container"> <div class="dmsf-child-container">
<%= select_tag "assignee[#{step.id}]", <%= select_tag "assignee[#{step.id}]",
principals_options_for_select(@approving_candidates | [step.user], step.user), principals_options_for_select(@approving_candidates | [step.user], step.user),
include_blank: false %> include_blank: false %>

View File

@ -96,7 +96,7 @@
<% end %> <% end %>
<% end %> <% end %>
</td> </td>
<td class="dmsf_buttons"> <td class="dmsf-buttons">
<%= render partial: 'dmsf_workflows/approval_workflow_button', <%= render partial: 'dmsf_workflows/approval_workflow_button',
locals: { file: assignment.dmsf_file_revision.dmsf_file, locals: { file: assignment.dmsf_file_revision.dmsf_file,
file_approval_allowed: User.current.allowed_to?(:file_approval, file_approval_allowed: User.current.allowed_to?(:file_approval,

Binary file not shown.

Before

Width:  |  Height:  |  Size: 393 B

View File

@ -23,11 +23,11 @@ function dmsfAddLink(linksSpan, linkId, linkName, title, project, awf) {
if (linksSpan.children().length < 10) { if (linksSpan.children().length < 10) {
var nextLinkId = dmsfAddLink.nextLinkId++; let nextLinkId = dmsfAddLink.nextLinkId++;
var linkSpan = $('<span>', { id: 'dmsf_links_attachments_' + nextLinkId, 'class': 'attachment' }); let linkSpan = $('<span>', { id: 'dmsf_links_attachments_' + nextLinkId, 'class': 'attachment' });
var iconDel = $('<a>').attr({href: '#', 'class': 'remove-upload icon-only icon-del'}); let iconDel = $('<a>').attr({href: '#', 'class': 'remove-upload icon-only icon-del'});
var inputId = $('<input>', {type: 'hidden', name: 'dmsf_links[' + nextLinkId + ']'}).val(linkId); let inputId = $('<input>', {type: 'hidden', name: 'dmsf_links[' + nextLinkId + ']'}).val(linkId);
var inputName = $('<input>', {type: 'text', class: 'filename readonly'}).val(linkName); let inputName = $('<input>', {type: 'text', class: 'filename readonly'}).val(linkName);
linkSpan.append(inputId); linkSpan.append(inputId);
linkSpan.append(inputName); linkSpan.append(inputName);
@ -35,7 +35,7 @@ function dmsfAddLink(linksSpan, linkId, linkName, title, project, awf) {
if(awf) { if(awf) {
var iconWf = $('<a>').attr({href: "/dmsf_workflows/" + project + "/assign?dmsf_link_id=" + linkId, let iconWf = $('<a>').attr({href: "/dmsf-workflows/" + project + "/assign?dmsf_link_id=" + linkId,
'class': 'modify-upload icon-only icon-ok', 'data-remote': 'true', 'title': title}); 'class': 'modify-upload icon-only icon-ok', 'data-remote': 'true', 'title': title});
linkSpan.append(iconWf); linkSpan.append(iconWf);
@ -49,14 +49,14 @@ dmsfAddLink.nextLinkId = 1000;
function dmsfAddFile(inputEl, file, eagerUpload) { function dmsfAddFile(inputEl, file, eagerUpload) {
var attachments = $('#dmsf_attachments_fields'); let attachments = $('#dmsf_attachments_fields');
if (attachments.children().length < 10) { if (attachments.children().length < 10) {
var attachmentId = dmsfAddFile.nextAttachmentId++; let attachmentId = dmsfAddFile.nextAttachmentId++;
var fileSpan = $('<span>', { id: 'dmsf_attachments_' + attachmentId, 'class': 'attachment' }); let fileSpan = $('<span>', { id: 'dmsf_attachments_' + attachmentId, 'class': 'attachment' });
var iconDel = $('<a>').attr({href: '#', 'class': 'remove-upload icon-only icon-del'}).toggle(!eagerUpload); let iconDel = $('<a>').attr({href: '#', 'class': 'remove-upload icon-only icon-del'}).toggle(!eagerUpload);
var fileName = $('<input>', {type: 'text', 'class': 'filename readonly', let fileName = $('<input>', {type: 'text', 'class': 'filename readonly',
name: 'dmsf_attachments[' + attachmentId + '][filename]', readonly: 'readonly'}).val(file.name); name: 'dmsf_attachments[' + attachmentId + '][filename]', readonly: 'readonly'}).val(file.name);
if($(inputEl).attr('multiple') == 'multiple') { if($(inputEl).attr('multiple') == 'multiple') {
@ -65,7 +65,7 @@ function dmsfAddFile(inputEl, file, eagerUpload) {
if($(inputEl).data('description')) { if($(inputEl).data('description')) {
var description = $('<input>', {type: 'text', 'class': 'description', let description = $('<input>', {type: 'text', 'class': 'description',
name: 'dmsf_attachments[' + attachmentId + '][description]', maxlength: 255, name: 'dmsf_attachments[' + attachmentId + '][description]', maxlength: 255,
placeholder: $(inputEl).data('description-placeholder') placeholder: $(inputEl).data('description-placeholder')
}).toggle(!eagerUpload); }).toggle(!eagerUpload);
@ -77,7 +77,7 @@ function dmsfAddFile(inputEl, file, eagerUpload) {
if($(inputEl).data('awf')) { if($(inputEl).data('awf')) {
var iconWf = $('<a>').attr({href: '/dmsf_workflows/' + $(inputEl).attr( let iconWf = $('<a>').attr({href: '/dmsf-workflows/' + $(inputEl).attr(
'data-project') + "/assign?attachment_id=" + attachmentId, 'class': 'modify-upload icon-only icon-ok', 'data-project') + "/assign?attachment_id=" + attachmentId, 'class': 'modify-upload icon-only icon-ok',
'data-remote': 'true'}); 'data-remote': 'true'});
@ -134,7 +134,7 @@ function dmsfAjaxUpload(file, attachmentId, fileSpan, inputEl) {
}).always(function() { }).always(function() {
dmsfAjaxUpload.uploading--; dmsfAjaxUpload.uploading--;
fileSpan.removeClass('ajax-loading'); fileSpan.removeClass('ajax-loading');
var form = fileSpan.parents('form'); let form = fileSpan.parents('form');
if ((form.queue('upload').length == 0) && (dmsfAjaxUpload.uploading == 0)) { if ((form.queue('upload').length == 0) && (dmsfAjaxUpload.uploading == 0)) {
$('input:submit', form).removeAttr('disabled'); $('input:submit', form).removeAttr('disabled');
} }
@ -142,11 +142,11 @@ function dmsfAjaxUpload(file, attachmentId, fileSpan, inputEl) {
}); });
} }
var progressSpan = $('<div>').insertAfter(fileSpan.find('input.filename')); let progressSpan = $('<div>').insertAfter(fileSpan.find('input.filename'));
progressSpan.progressbar(); progressSpan.progressbar();
fileSpan.addClass('ajax-waiting'); fileSpan.addClass('ajax-waiting');
var maxSyncUpload = $(inputEl).data('max-concurrent-uploads'); let maxSyncUpload = $(inputEl).data('max-concurrent-uploads');
if(maxSyncUpload == null || maxSyncUpload <= 0 || dmsfAjaxUpload.uploading < maxSyncUpload) if(maxSyncUpload == null || maxSyncUpload <= 0 || dmsfAjaxUpload.uploading < maxSyncUpload)
actualUpload(file, attachmentId, fileSpan, inputEl); actualUpload(file, attachmentId, fileSpan, inputEl);
@ -163,16 +163,16 @@ function dmsfRemoveFileLbl() {
return false; return false;
} }
function dmsfRemoveFile() { /*function dmsfRemoveFile() {
$(this).parent('span').parent('span').remove(); $(this).parent('span').parent('span').remove();
return false; return false;
} }*/
function dmsfUploadBlob(blob, uploadUrl, attachmentId, options) { function dmsfUploadBlob(blob, uploadUrl, attachmentId, options) {
var actualOptions = $.extend({ let actualOptions = $.extend({
loadstartEventHandler: $.noop, loadstartEventHandler: $.noop,
progressEventHandler: $.noop progressEventHandler: $.noop
}, options); }, options);
@ -192,7 +192,7 @@ function dmsfUploadBlob(blob, uploadUrl, attachmentId, options) {
settings.data = blob; settings.data = blob;
}, },
xhr: function() { xhr: function() {
var xhr = $.ajaxSettings.xhr(); let xhr = $.ajaxSettings.xhr();
xhr.upload.onloadstart = actualOptions.loadstartEventHandler; xhr.upload.onloadstart = actualOptions.loadstartEventHandler;
xhr.upload.onprogress = actualOptions.progressEventHandler; xhr.upload.onprogress = actualOptions.progressEventHandler;
return xhr; return xhr;
@ -205,8 +205,8 @@ function dmsfUploadBlob(blob, uploadUrl, attachmentId, options) {
function dmsfAddInputFiles(inputEl) { function dmsfAddInputFiles(inputEl) {
var clearedFileInput = $(inputEl).clone().val(''); let clearedFileInput = $(inputEl).clone().val('');
var addFileSpan = $('.dmsf_add_attachment'); let addFileSpan = $('.dmsf_add_attachment');
if ($.ajaxSettings.xhr().upload && inputEl.files) { if ($.ajaxSettings.xhr().upload && inputEl.files) {
// upload files using ajax // upload files using ajax
@ -214,8 +214,8 @@ function dmsfAddInputFiles(inputEl) {
$(inputEl).remove(); $(inputEl).remove();
} else { } else {
// browser not supporting the file API, upload on form submission // browser not supporting the file API, upload on form submission
var attachmentId; let attachmentId;
var aFilename = inputEl.value.split(/\/|\\/); let aFilename = inputEl.value.split(/\/|\\/);
attachmentId = dmsfAddFile(inputEl, {name: aFilename[aFilename.length - 1]}, false); attachmentId = dmsfAddFile(inputEl, {name: aFilename[aFilename.length - 1]}, false);
if (attachmentId) { if (attachmentId) {
$(inputEl).attr({name: 'dmsf_attachments[' + attachmentId + '][file]', style: 'display:none;'}).appendTo( $(inputEl).attr({name: 'dmsf_attachments[' + attachmentId + '][file]', style: 'display:none;'}).appendTo(
@ -236,10 +236,10 @@ function dmsfAddInputFiles(inputEl) {
function dmsfUploadAndAttachFiles(files, inputEl) { function dmsfUploadAndAttachFiles(files, inputEl) {
var maxFileSize = $(inputEl).data('max-file-size'); let maxFileSize = $(inputEl).data('max-file-size');
var maxFileSizeExceeded = $(inputEl).data('max-file-size-message'); let maxFileSizeExceeded = $(inputEl).data('max-file-size-message');
let sizeExceeded = false;
var sizeExceeded = false;
$.each(files, function() { $.each(files, function() {
if (this.size && maxFileSize != null && this.size > parseInt(maxFileSize)) {sizeExceeded=true;} if (this.size && maxFileSize != null && this.size > parseInt(maxFileSize)) {sizeExceeded=true;}
}); });
@ -277,7 +277,7 @@ function dmsfSetupFileDrop() {
$.event.fixHooks.drop = { props: [ 'dataTransfer' ] }; $.event.fixHooks.drop = { props: [ 'dataTransfer' ] };
$('form span.dmsf_uploader').has('input:file').each(function() { $('form span.dmsf-uploader').has('input:file').each(function() {
$(this).on({ $(this).on({
dragover: dmsfDragOverHandler, dragover: dmsfDragOverHandler,
dragleave: dmsfDragOutHandler, dragleave: dmsfDragOutHandler,
@ -287,9 +287,9 @@ function dmsfSetupFileDrop() {
} }
} }
$( document ).ready(function() { $(document).ready(function() {
EASY.schedule.late(function () { EASY.schedule.late(function () {
dmsfSetupFileDrop(); dmsfSetupFileDrop();
$(document).on("erui_new_dom", dmsfSetupFileDrop); $(document).on("erui_new_dom", dmsfSetupFileDrop);
}); });
}) });

View File

@ -22,35 +22,35 @@
/* Function to allow the projects to show up as a tree */ /* Function to allow the projects to show up as a tree */
function dmsfToggle(EL, PM, url) function dmsfToggle(EL, PM, url)
{ {
var els = document.querySelectorAll('tr.dmsf_tree'); let els = document.querySelectorAll('tr.dmsf-tree');
var elsLen = els.length; let elsLen = els.length;
var pattern = new RegExp("(^|\\s)" + EL + "(\\s|$)"); let pattern = new RegExp("(^|\\s)" + EL + "(\\s|$)");
var cpattern = new RegExp('span'); let cpattern = new RegExp('span');
var expand = new RegExp('dmsf_expanded'); let expand = new RegExp('dmsf_expanded');
var collapse = new RegExp('dmsf_collapsed'); let collapse = new RegExp('dmsf_collapsed');
var hide = new RegExp('dmsf_hidden'); let hide = new RegExp('dmsf-hidden');
var spanid = PM; let spanid = PM;
var classid = new RegExp('junk'); let classid = new RegExp('junk');
var oddeventoggle = 0; let oddeventoggle = 0;
// Expand not yet loaded selected row // Expand not yet loaded selected row
var selectedRow = document.getElementById(PM); let selectedRow = document.getElementById(PM);
if(selectedRow.className.indexOf('dmsf-not-loaded') >= 0){ if(selectedRow.className.indexOf('dmsf-not-loaded') >= 0){
dmsfExpandRows(EL, selectedRow, url); dmsfExpandRows(EL, selectedRow, url);
} }
for(var i = 0; i < elsLen; i++) for(let i = 0; i < elsLen; i++)
{ {
if(cpattern.test(els[i].id)) if(cpattern.test(els[i].id))
{ {
var tmpspanid = spanid; let tmpspanid = spanid;
var tmpclassid = classid; let tmpclassid = classid;
spanid = els[i].id; spanid = els[i].id;
classid = spanid; classid = spanid;
m = classid.match(/(\w+)span/); let m = classid.match(/(\w+)span/);
if(m) { if(m) {
classid = m[1]; classid = m[1];
} }
@ -70,11 +70,11 @@ function dmsfToggle(EL, PM, url)
{ {
let cnames = els[i].className; let cnames = els[i].className;
cnames = cnames.replace(/dmsf_hidden/g,''); cnames = cnames.replace(/dmsf-hidden/g,'');
if(expand.test(selectedRow.className)) if(expand.test(selectedRow.className))
{ {
cnames += ' dmsf_hidden'; cnames += ' dmsf-hidden';
} }
else else
{ {
@ -82,7 +82,7 @@ function dmsfToggle(EL, PM, url)
{ {
if(collapse.test(document.getElementById(spanid).className)) if(collapse.test(document.getElementById(spanid).className))
{ {
cnames += ' dmsf_hidden'; cnames += ' dmsf-hidden';
} }
} }
} }
@ -132,10 +132,10 @@ function dmsfExpandRows(EL, parentRow, url) {
parentRow.className = parentRow.className.replace(/dmsf-not-loaded/, ''); parentRow.className = parentRow.className.replace(/dmsf-not-loaded/, '');
var idnt = 0; let idnt = 0;
var pos = $(parentRow).find('.dmsf_position').text(); let pos = $(parentRow).find('.dmsf_position').text();
var classes = ''; let classes = '';
var m = parentRow.className.match(/idnt-(\d+)/); let m = parentRow.className.match(/idnt-(\d+)/);
if(m){ if(m){
idnt = m[1]; idnt = m[1];

View File

@ -19,41 +19,26 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/ */
.list .dmsf_title { .list .dmsf-title {
width: 40%; width: 40%;
text-align: left; text-align: left;
} }
.list .dmsf_buttons { .list .dmsf-buttons {
min-width: 18px; min-width: 18px;
} }
.list .dmsf_checkbox {
width: 15px;
padding: 2px 0 0 0;
}
.list .dmsf_checkbox input {
padding: 0;
}
.dmsf_entries {
margin-bottom: 10px;
display: block;
}
/* Revision's downloads box */ /* Revision's downloads box */
#dmsf_buttons.dmsf-controls {
#dmsf_buttons.dmsf_controls {
float: left float: left
} }
.dmsf_uploader span[id*="dmsf_"] .filename { .dmsf-uploader span[id*="dmsf_"] .filename {
-webkit-box-shadow: none !important; -webkit-box-shadow: none !important;
box-shadow: none !important; box-shadow: none !important;
} }
.dmsf_filename { .dmsf-filename {
padding: 0 10px 0 10px; padding: 0 10px 0 10px;
float: right; float: right;
font-size: 0.8em; font-size: 0.8em;
@ -63,36 +48,36 @@
/* Approval workflow */ /* Approval workflow */
#dmsf_users_for_delegate { height: 200px; overflow:auto; } #dmsf_users_for_delegate { height: 200px; overflow:auto; }
#dmsf_users_for_delegate label { display: block; } #dmsf_users_for_delegate label { display: block; }
.dmsf_workflows.locked a { color: #aaa; } .dmsf-workflows.locked a { color: #aaa; }
/* DMSF revision box */ /* DMSF revision box */
#new_revision_form_content { #new_revision_form_content {
display: none; display: none;
} }
.dmsf_revision_box { .dmsf-revision-box {
background-color:#f6f6f6; background-color:#f6f6f6;
} }
.dmsf_revision_inner_box { .dmsf-revision-inner-box {
border: 1px solid #e4e4e4; border: 1px solid #e4e4e4;
padding: 10px; padding: 10px;
} }
div.dmsf_revision_inner_box .attribute { div.dmsf-revision-inner-box .attribute {
padding-left: 180px; padding-left: 180px;
clear: left; clear: left;
min-height: 1.8em; min-height: 1.8em;
} }
div.dmsf_revision_inner_box .attribute .label { div.dmsf-revision-inner-box .attribute .label {
width: 170px; width: 170px;
margin-left: -180px; margin-left: -180px;
font-weight: bold; font-weight: bold;
float: left; float: left;
} }
.dmsf_id_box { .dmsf-id-box {
float: right; float: right;
white-space: nowrap; white-space: nowrap;
line-height: 24px; line-height: 24px;
@ -101,28 +86,28 @@ div.dmsf_revision_inner_box .attribute .label {
padding-left: 10px; padding-left: 10px;
} }
.dmsf_log_header_box{ .dmsf-log-header-box{
padding:6px; padding:6px;
margin-bottom: 10px; margin-bottom: 10px;
} }
.dmsf_log_header_left { .dmsf-log-header-left {
width: 50%; width: 50%;
float: left; float: left;
} }
.dmsf_log_header_box label { .dmsf-log-header-box label {
font-weight: bold; font-weight: bold;
margin-left: 0; margin-left: 0;
margin-right: 3px; margin-right: 3px;
padding: 3px 0 3px 0; padding: 3px 0 3px 0;
} }
#dmsf_widget_header { .dmsf-widget-header {
font-weight: normal; font-weight: normal;
padding: 0 10px 0 10px; padding: 0 10px 0 10px;
} }
#dmsf_widget_header_text { .dmsf-widget-header-text {
padding: 5px 0 0 0; padding: 5px 0 0 0;
} }
@ -136,9 +121,8 @@ div.dmsf_revision_inner_box .attribute .label {
height: 16px; height: 16px;
} }
.dmsf_gray .icon-folder { background-image: url(../images/folder_gray.png); } .dmsf-gray .icon-folder { background-image: url(../images/folder_gray.png); }
.dmsf_system .icon-folder { background-image: url(../images/folder_system.png); } .dmsf-system .icon-folder { background-image: url(../images/folder_system.png); }
.dmsf_system_closed .icon-folder { background-image: url(../images/folder_system_closed.png); }
.icon-file.filetype-doc, .icon-file.filetype-docx { background-image: url(../images/filetypes/doc.png); } .icon-file.filetype-doc, .icon-file.filetype-docx { background-image: url(../images/filetypes/doc.png); }
.icon-file.filetype-xls, .icon-file.filetype-xlsx { background-image: url(../images/filetypes/xls.png); } .icon-file.filetype-xls, .icon-file.filetype-xlsx { background-image: url(../images/filetypes/xls.png); }
@ -151,55 +135,55 @@ div.dmsf_revision_inner_box .attribute .label {
.icon-file.filetype-odp { background-image: url(../images/filetypes/odp.png); } .icon-file.filetype-odp { background-image: url(../images/filetypes/odp.png); }
.icon-file.filetype-odg { background-image: url(../images/filetypes/odg.png); } .icon-file.filetype-odg { background-image: url(../images/filetypes/odg.png); }
.dmsf_gray .icon-file.filetype-doc { background-image: url(../images/filetypes/doc_gray.png); } .dmsf-gray .icon-file.filetype-doc { background-image: url(../images/filetypes/doc_gray.png); }
.dmsf_gray .icon-file.filetype-docx { background-image: url(../images/filetypes/doc_gray.png); } .dmsf-gray .icon-file.filetype-docx { background-image: url(../images/filetypes/doc_gray.png); }
.dmsf_gray .icon-file.filetype-xls { background-image: url(../images/filetypes/xls_gray.png); } .dmsf-gray .icon-file.filetype-xls { background-image: url(../images/filetypes/xls_gray.png); }
.dmsf_gray .icon-file.filetype-xlsx { background-image: url(../images/filetypes/xls_gray.png); } .dmsf-gray .icon-file.filetype-xlsx { background-image: url(../images/filetypes/xls_gray.png); }
.dmsf_gray .icon-file.filetype-ppt { background-image: url(../images/filetypes/ppt_gray.png); } .dmsf-gray .icon-file.filetype-ppt { background-image: url(../images/filetypes/ppt_gray.png); }
.dmsf_gray .icon-file.filetype-pptx { background-image: url(../images/filetypes/ppt_gray.png); } .dmsf-gray .icon-file.filetype-pptx { background-image: url(../images/filetypes/ppt_gray.png); }
.dmsf_gray .icon-file.filetype-vsd { background-image: url(../images/filetypes/vsd_gray.png); } .dmsf-gray .icon-file.filetype-vsd { background-image: url(../images/filetypes/vsd_gray.png); }
.dmsf_gray .icon-file.filetype-vsdx { background-image: url(../images/filetypes/vsd_gray.png); } .dmsf-gray .icon-file.filetype-vsdx { background-image: url(../images/filetypes/vsd_gray.png); }
.dmsf_gray .icon-file.filetype-mpp { background-image: url(../images/filetypes/mpp_gray.png); } .dmsf-gray .icon-file.filetype-mpp { background-image: url(../images/filetypes/mpp_gray.png); }
.dmsf_gray .icon-file.filetype-odt { background-image: url(../images/filetypes/odt_gray.png); } .dmsf-gray .icon-file.filetype-odt { background-image: url(../images/filetypes/odt_gray.png); }
.dmsf_gray .icon-file.filetype-ott { background-image: url(../images/filetypes/ott_gray.png); } .dmsf-gray .icon-file.filetype-ott { background-image: url(../images/filetypes/ott_gray.png); }
.dmsf_gray .icon-file.filetype-ods { background-image: url(../images/filetypes/ods_gray.png); } .dmsf-gray .icon-file.filetype-ods { background-image: url(../images/filetypes/ods_gray.png); }
.dmsf_gray .icon-file.filetype-odp { background-image: url(../images/filetypes/odp_gray.png); } .dmsf-gray .icon-file.filetype-odp { background-image: url(../images/filetypes/odp_gray.png); }
.dmsf_gray .icon-file.filetype-odg { background-image: url(../images/filetypes/odg_gray.png); } .dmsf-gray .icon-file.filetype-odg { background-image: url(../images/filetypes/odg_gray.png); }
.dmsf_gray .icon-file.text-x-c { background-image: url(../images/filetypes/c_gray.png); } .dmsf-gray .icon-file.text-x-c { background-image: url(../images/filetypes/c_gray.png); }
.dmsf_gray .icon-file.text-x-csharp { background-image: url(../images/filetypes/csharp_gray.png); } .dmsf-gray .icon-file.text-x-csharp { background-image: url(../images/filetypes/csharp_gray.png); }
.dmsf_gray .icon-file.text-x-java { background-image: url(../images/filetypes/java_gray.png); } .dmsf-gray .icon-file.text-x-java { background-image: url(../images/filetypes/java_gray.png); }
.dmsf_gray .icon-file.text-x-javascript { background-image: url(../images/filetypes/js_gray.png); } .dmsf-gray .icon-file.text-x-javascript { background-image: url(../images/filetypes/js_gray.png); }
.dmsf_gray .icon-file.text-x-php { background-image: url(../images/filetypes/php_gray.png); } .dmsf-gray .icon-file.text-x-php { background-image: url(../images/filetypes/php_gray.png); }
.dmsf_gray .icon-file.text-x-ruby { background-image: url(../images/filetypes/ruby_gray.png); } .dmsf-gray .icon-file.text-x-ruby { background-image: url(../images/filetypes/ruby_gray.png); }
.dmsf_gray .icon-file.text-xml { background-image: url(../images/filetypes/xml_gray.png); } .dmsf-gray .icon-file.text-xml { background-image: url(../images/filetypes/xml_gray.png); }
.dmsf_gray .icon-file.text-css { background-image: url(../images/filetypes/css_gray.png); } .dmsf-gray .icon-file.text-css { background-image: url(../images/filetypes/css_gray.png); }
.dmsf_gray .icon-file.text-html { background-image: url(../images/filetypes/html_gray.png); } .dmsf-gray .icon-file.text-html { background-image: url(../images/filetypes/html_gray.png); }
.dmsf_gray .icon-file.image-gif { background-image: url(../images/filetypes/image_gray.png); } .dmsf-gray .icon-file.image-gif { background-image: url(../images/filetypes/image_gray.png); }
.dmsf_gray .icon-file.image-jpeg { background-image: url(../images/filetypes/image_gray.png); } .dmsf-gray .icon-file.image-jpeg { background-image: url(../images/filetypes/image_gray.png); }
.dmsf_gray .icon-file.image-png { background-image: url(../images/filetypes/image_gray.png); } .dmsf-gray .icon-file.image-png { background-image: url(../images/filetypes/image_gray.png); }
.dmsf_gray .icon-file.image-tiff { background-image: url(../images/filetypes/image_gray.png); } .dmsf-gray .icon-file.image-tiff { background-image: url(../images/filetypes/image_gray.png); }
.dmsf_gray .icon-file.application-pdf { background-image: url(../images/filetypes/pdf_gray.png); } .dmsf-gray .icon-file.application-pdf { background-image: url(../images/filetypes/pdf_gray.png); }
.dmsf_gray .icon-file.application-zip { background-image: url(../images/filetypes/zip_gray.png); } .dmsf-gray .icon-file.application-zip { background-image: url(../images/filetypes/zip_gray.png); }
.dmsf_gray .icon-file.application-x-gzip { background-image: url(../images/filetypes/zip_gray.png); } .dmsf-gray .icon-file.application-x-gzip { background-image: url(../images/filetypes/zip_gray.png); }
/* Activities */ /* Activities */
.icon-dmsf-file-revision { background-image: url(../../../images/document.png); } .icon-dmsf-file-revision { background-image: url(../../../images/document.png); }
/* Links */ /* Links */
.dmsf_gray { color: #AAA } .dmsf-gray { color: #AAA }
.dmsf_gray a, .dmsf_gray a:link, .dmsf_gray a:visited { .dmsf-gray a, .dmsf-gray a:link, .dmsf-gray a:visited {
color: #484848; color: #484848;
text-decoration: none; text-decoration: none;
} }
/* System folders */ /* System folders */
.dmsf_system { .dmsf-system {
color: #5C82AD color: #5C82AD
} }
.dmsf_system a, .dmsf_gray a:link, .dmsf_gray a:visited { .dmsf-system a, .dmsf-gray a:link, .dmsf-gray a:visited {
color: #484848; color: #484848;
text-decoration: none; text-decoration: none;
} }
@ -208,55 +192,42 @@ div.dmsf_revision_inner_box .attribute .label {
.icon-dmsf-file { background-image: url(../../../images/document.png); } .icon-dmsf-file { background-image: url(../../../images/document.png); }
/* DMSF tree view */ /* DMSF tree view */
.dmsf_hidden { display:none; } .dmsf-hidden { display:none; }
.dmsf_tree span.dmsf_expander { cursor: pointer; } .dmsf-tree span.dmsf_expander { cursor: pointer; }
.dmsf_tree.dmsf_expanded td.dmsf_title span { .dmsf-tree.dmsf_expanded td.dmsf-title span {
background: url(../../../images/arrow_down.png) no-repeat 0 50%; background: url(../../../images/arrow_down.png) no-repeat 0 50%;
padding-left: 16px; padding-left: 16px;
} }
.dmsf_tree.dmsf_child .dmsf_title span { padding-left: 16px; } .dmsf-tree.dmsf_child .dmsf-title span { padding-left: 16px; }
.dmsf_tree.dmsf_collapsed .dmsf_title span { .dmsf-tree.dmsf_collapsed .dmsf-title span {
background: url(../../../images/arrow_right.png) no-repeat 0 50%; background: url(../../../images/arrow_right.png) no-repeat 0 50%;
padding-left: 16px; padding-left: 16px;
} }
.dmsf_tree.idnt-1 .dmsf_title { padding-left: 1.5em; } .dmsf-tree.idnt-1 .dmsf-title { padding-left: 1.5em; }
.dmsf_tree.idnt-2 .dmsf_title { padding-left: 2em; } .dmsf-tree.idnt-2 .dmsf-title { padding-left: 2em; }
.dmsf_tree.idnt-3 .dmsf_title { padding-left: 2.5em; } .dmsf-tree.idnt-3 .dmsf-title { padding-left: 2.5em; }
.dmsf_tree.idnt-4 .dmsf_title { padding-left: 3em; } .dmsf-tree.idnt-4 .dmsf-title { padding-left: 3em; }
.dmsf_tree.idnt-5 .dmsf_title { padding-left: 3.5em; } .dmsf-tree.idnt-5 .dmsf-title { padding-left: 3.5em; }
.dmsf_tree.idnt-6 .dmsf_title { padding-left: 4em; } .dmsf-tree.idnt-6 .dmsf-title { padding-left: 4em; }
.dmsf_tree.idnt-7 .dmsf_title { padding-left: 4.5em; } .dmsf-tree.idnt-7 .dmsf-title { padding-left: 4.5em; }
.dmsf_tree.idnt-8 .dmsf_title { padding-left: 5em; } .dmsf-tree.idnt-8 .dmsf-title { padding-left: 5em; }
.dmsf_tree.idnt-9 .dmsf_title { padding-left: 5.5em; } .dmsf-tree.idnt-9 .dmsf-title { padding-left: 5.5em; }
.dmsf_select_version { .dmsf-select-version {
max-width: 50px; max-width: 50px;
} }
.dmsf_parent_container { .dmsf-parent-container {
overflow: hidden; overflow: hidden;
} }
.dmsf_child_container { .dmsf-child-container {
float: left;
text-align: left;
}
.dmsf_select_version {
max-width: 50px;
}
.dmsf_parent_container {
overflow: hidden;
}
.dmsf_child_container {
float: left; float: left;
text-align: left; text-align: left;
} }
/* DMSF file upload */ /* DMSF file upload */
.dmsf_uploader { .dmsf-uploader {
padding:10px; padding:10px;
margin-bottom: 20px; margin-bottom: 20px;
background-color:#f6f6f6; background-color:#f6f6f6;
@ -270,20 +241,13 @@ div.dmsf_revision_inner_box .attribute .label {
overflow: hidden; overflow: hidden;
} }
.dmsf_add_link { .dmsf-add-link {
display: block; display: block;
float: right; float: right;
margin-top: 10px; margin-top: 10px;
margin-bottom: 10px; margin-bottom: 10px;
} }
.dmsf_add_file {
display: block;
float: left;
margin-top: 10px;
margin-bottom: 10px;
}
#dmsf_attachments_fields input.description { #dmsf_attachments_fields input.description {
margin-left:4px; margin-left:4px;
width:340px; width:340px;

View File

@ -142,7 +142,7 @@ $stem_langs.each do | lang |
cmd << ' -v' if $verbose > 0 cmd << ' -v' if $verbose > 0
cmd << ' --retry-failed' if $retryfailed cmd << ' --retry-failed' if $retryfailed
log cmd log cmd
system_or_raise (cmd) system_or_raise cmd
end end
log 'Redmine DMS documents indexed' log 'Redmine DMS documents indexed'

View File

@ -39,7 +39,7 @@ module RedmineDmsf
html << "<label class=\"#{classes}\">" html << "<label class=\"#{classes}\">"
html << radio_button_tag('dmsf_attachments_upload_choice', 'Attachments', html << radio_button_tag('dmsf_attachments_upload_choice', 'Attachments',
User.current.pref.dmsf_attachments_upload_choice == 'Attachments', User.current.pref.dmsf_attachments_upload_choice == 'Attachments',
onchange: "$('.attachments-container:not(.dmsf_uploader)').show(); $('.dmsf_uploader').parent().hide(); return false;") onchange: "$('.attachments-container:not(.dmsf-uploader)').show(); $('.dmsf-uploader').parent().hide(); return false;")
html << l(:label_basic_attachments) html << l(:label_basic_attachments)
html << '</label>' html << '</label>'
unless context[:container] && context[:container].new_record? unless context[:container] && context[:container].new_record?
@ -48,12 +48,12 @@ module RedmineDmsf
html << "<label class=\"#{classes}\">" html << "<label class=\"#{classes}\">"
html << radio_button_tag('dmsf_attachments_upload_choice', 'DMSF', html << radio_button_tag('dmsf_attachments_upload_choice', 'DMSF',
User.current.pref.dmsf_attachments_upload_choice == 'DMSF', User.current.pref.dmsf_attachments_upload_choice == 'DMSF',
onchange: "$('.attachments-container:not(.dmsf_uploader)').hide(); $('.dmsf_uploader').parent().show(); return false;") onchange: "$('.attachments-container:not(.dmsf-uploader)').hide(); $('.dmsf-uploader').parent().show(); return false;")
html << l(:label_dmsf_attachments) html << l(:label_dmsf_attachments)
html << '</label>' html << '</label>'
html << '</p>' html << '</p>'
if User.current.pref.dmsf_attachments_upload_choice == 'DMSF' if User.current.pref.dmsf_attachments_upload_choice == 'DMSF'
html << context[:hook_caller].late_javascript_tag("$('.attachments-container:not(.dmsf_uploader)').hide();") html << context[:hook_caller].late_javascript_tag("$('.attachments-container:not(.dmsf-uploader)').hide();")
end end
end end
# Upload form # Upload form
@ -151,9 +151,9 @@ module RedmineDmsf
html << " style=\"#{(User.current.pref.dmsf_attachments_upload_choice == 'Attachments') ? 'display: none;' : ''}\">" html << " style=\"#{(User.current.pref.dmsf_attachments_upload_choice == 'Attachments') ? 'display: none;' : ''}\">"
if label if label
html << "<label>#{l(:label_document_plural)}</label>" html << "<label>#{l(:label_document_plural)}</label>"
html << "<span class=\"attachments-container dmsf_uploader\">" html << "<span class=\"attachments-container dmsf-uploader\">"
else else
html << "<span class=\"attachments-container dmsf_uploader\" style=\"border: 2px dashed #dfccaf; background: none;\">" html << "<span class=\"attachments-container dmsf-uploader\" style=\"border: 2px dashed #dfccaf; background: none;\">"
end end
html << context[:controller].send(:render_to_string, html << context[:controller].send(:render_to_string,
{ partial: 'dmsf_upload/form', { partial: 'dmsf_upload/form',
@ -191,7 +191,7 @@ module RedmineDmsf
def attachment_row(dmsf_file, link, issue, controller) def attachment_row(dmsf_file, link, issue, controller)
if link if link
html = +'<tr class="dmsf_gray">' html = +'<tr class="dmsf-gray">'
else else
html = +'<tr>' html = +'<tr>'
end end

View File

@ -161,7 +161,6 @@ module RedmineDmsf
# Adds a journal detail for an attachment that was added or removed # Adds a journal detail for an attachment that was added or removed
def journalize_dmsf_file(dmsf_file, added_or_removed) def journalize_dmsf_file(dmsf_file, added_or_removed)
init_journal(User.current) init_journal(User.current)
key = (added_or_removed == :removed ? :old_value : :value)
current_journal.details << JournalDetail.new( current_journal.details << JournalDetail.new(
property: 'dmsf_file', property: 'dmsf_file',
prop_key: dmsf_file.id, prop_key: dmsf_file.id,

View File

@ -164,7 +164,6 @@ module RedmineDmsf
# Adds a journal detail for an attachment that was added or removed # Adds a journal detail for an attachment that was added or removed
def journalize_dmsf_file(dmsf_file, added_or_removed) def journalize_dmsf_file(dmsf_file, added_or_removed)
init_journal(User.current) init_journal(User.current)
key = (added_or_removed == :removed ? :old_value : :value)
current_journal.details << JournalDetail.new( current_journal.details << JournalDetail.new(
property: 'dmsf_file', property: 'dmsf_file',
prop_key: dmsf_file.id, prop_key: dmsf_file.id,

View File

@ -42,7 +42,7 @@ module RedmineDmsf
link_to h(value), dmsf_file_path(id: item.id) link_to h(value), dmsf_file_path(id: item.id)
end end
when 'folder', 'folder-link' when 'folder', 'folder-link'
if(item.id) if item.id
if item.deleted && (item.deleted > 0) if item.deleted && (item.deleted > 0)
super column, item, value super column, item, value
else else
@ -76,7 +76,7 @@ module RedmineDmsf
class: 'icon icon-folder', class: 'icon icon-folder',
title: h(value)) title: h(value))
end end
tag + content_tag('div', item.filename, class: 'dmsf_filename', title: l(:title_filename_for_download)) tag + content_tag('div', item.filename, class: 'dmsf-filename', title: l(:title_filename_for_download))
when 'folder-link' when 'folder-link'
if item.deleted && (item.deleted > 0) if item.deleted && (item.deleted > 0)
tag = content_tag('span', value, class: 'icon icon-folder') tag = content_tag('span', value, class: 'icon icon-folder')
@ -87,7 +87,7 @@ module RedmineDmsf
class: 'icon icon-folder', class: 'icon icon-folder',
title: h(value)) title: h(value))
end end
tag + content_tag('div', item.filename, class: 'dmsf_filename', title: l(:label_target_folder)) tag + content_tag('div', item.filename, class: 'dmsf-filename', title: l(:label_target_folder))
when 'file', 'file-link' when 'file', 'file-link'
if item.deleted && (item.deleted > 0) if item.deleted && (item.deleted > 0)
tag = content_tag('span', value, class: "icon icon-file #{DmsfHelper.filetype_css(item.filename)}") tag = content_tag('span', value, class: "icon icon-file #{DmsfHelper.filetype_css(item.filename)}")
@ -103,7 +103,7 @@ module RedmineDmsf
title: h(value), title: h(value),
'data-downloadurl': "#{content_type}:#{h(value)}:#{file_view_url}") 'data-downloadurl': "#{content_type}:#{h(value)}:#{file_view_url}")
end end
tag + content_tag('div', item.filename, class: 'dmsf_filename', title: l(:title_filename_for_download)) tag + content_tag('div', item.filename, class: 'dmsf-filename', title: l(:title_filename_for_download))
when 'url-link' when 'url-link'
if item.deleted && (item.deleted > 0) if item.deleted && (item.deleted > 0)
tag = content_tag('span', value, class: 'icon icon-link') tag = content_tag('span', value, class: 'icon icon-link')
@ -111,7 +111,7 @@ module RedmineDmsf
tag = "<span class=\"dmsf_expander\"></span>".html_safe + tag = "<span class=\"dmsf_expander\"></span>".html_safe +
link_to(h(value), item.filename, target: '_blank', class: 'icon icon-link') link_to(h(value), item.filename, target: '_blank', class: 'icon icon-link')
end end
tag + content_tag('div', item.filename, class: 'dmsf_filename', title: l(:field_url)) tag + content_tag('div', item.filename, class: 'dmsf-filename', title: l(:field_url))
else else
h(value) h(value)
end end

View File

@ -32,8 +32,8 @@ clone()
# Exit if the cloning fails # Exit if the cloning fails
set -e set -e
rm -rf $PATH_TO_REDMINE rm -rf ${PATH_TO_REDMINE}
git clone -b $REDMINE_GIT_TAG --depth=100 --quiet $REDMINE_GIT_REPO $PATH_TO_REDMINE git clone -b ${REDMINE_GIT_TAG} --depth=100 --quiet ${REDMINE_GIT_REPO} ${PATH_TO_REDMINE}
} }
test() test()
@ -41,7 +41,7 @@ test()
# Exit if a test fails # Exit if a test fails
set -e set -e
cd $PATH_TO_REDMINE cd ${PATH_TO_REDMINE}
# Run tests within application # Run tests within application
bundle exec rake redmine:plugins:test:units NAME=redmine_dmsf RAILS_ENV=test bundle exec rake redmine:plugins:test:units NAME=redmine_dmsf RAILS_ENV=test
@ -54,7 +54,7 @@ uninstall()
# Exit if the migration fails # Exit if the migration fails
set -e set -e
cd $PATH_TO_REDMINE cd ${PATH_TO_REDMINE}
# clean up database # clean up database
bundle exec rake redmine:plugins:migrate NAME=redmine_dmsf VERSION=0 RAILS_ENV=test bundle exec rake redmine:plugins:migrate NAME=redmine_dmsf VERSION=0 RAILS_ENV=test
@ -66,14 +66,14 @@ install()
set -e set -e
# cd to redmine folder # cd to redmine folder
cd $PATH_TO_REDMINE cd ${PATH_TO_REDMINE}
echo current directory is `pwd` echo current directory is `pwd`
# Create a link to the dmsf plugin # Create a link to the dmsf plugin
ln -sf $PATH_TO_DMSF plugins/redmine_dmsf ln -sf ${PATH_TO_DMSF} plugins/redmine_dmsf
# Copy database.yml # Copy database.yml
cp $WORKSPACE/database.yml config/ cp ${WORKSPACE}/database.yml config/
# Install gems # Install gems
# Not ideal, but at present Travis-CI will not install with xapian enabled: # Not ideal, but at present Travis-CI will not install with xapian enabled:

View File

@ -130,7 +130,7 @@ class DmsfControllerTest < RedmineDmsf::Test::TestCase
assert_response :forbidden assert_response :forbidden
end end
def test_delete_not_empty def test_delete_with_parmission_but_not_empty
# Permissions OK but the folder is not empty # Permissions OK but the folder is not empty
@role.add_permission! :folder_manipulation @role.add_permission! :folder_manipulation
get :delete, params: { id: @project, folder_id: @folder1.id, commit: false} get :delete, params: { id: @project, folder_id: @folder1.id, commit: false}

View File

@ -78,13 +78,13 @@ class DmsfLockTest < RedmineDmsf::Test::UnitTest
def test_locked_folder_cannot_be_unlocked_by_someone_without_rights_or_anon def test_locked_folder_cannot_be_unlocked_by_someone_without_rights_or_anon
User.current = nil User.current = nil
assert_no_difference ('@folder2.lock.count') do assert_no_difference('@folder2.lock.count') do
assert_raise DmsfLockError do assert_raise DmsfLockError do
@folder2.unlock! @folder2.unlock!
end end
end end
User.current = @jsmith User.current = @jsmith
assert_no_difference ('@folder2.lock.count') do assert_no_difference('@folder2.lock.count') do
assert_raise DmsfLockError do assert_raise DmsfLockError do
@folder2.unlock! @folder2.unlock!
end end