diff --git a/app/controllers/dmsf_controller.rb b/app/controllers/dmsf_controller.rb index 4962862d..79a25f20 100644 --- a/app/controllers/dmsf_controller.rb +++ b/app/controllers/dmsf_controller.rb @@ -601,7 +601,7 @@ class DmsfController < ApplicationController @file_approval_allowed = User.current.allowed_to?(:file_approval, @project) tag = params[:custom_field_id].present? && params[:custom_value].present? @folder = nil if tag - @extra_columns = [l(:label_document_url), l(:label_last_revision_id)] + @extra_columns = [l(:field_project), l(:label_document_url), l(:label_last_revision_id)] if @tree_view @locked_for_user = false else diff --git a/app/models/dmsf_file.rb b/app/models/dmsf_file.rb index 69f3006c..2db788f2 100644 --- a/app/models/dmsf_file.rb +++ b/app/models/dmsf_file.rb @@ -541,6 +541,8 @@ class DmsfFile < ActiveRecord::Base def to_csv(columns, level) csv = [] + # Project + csv << self.project.name if columns.include?(l(:field_project)) # Id csv << self.id if columns.include?('id') # Title diff --git a/app/models/dmsf_folder.rb b/app/models/dmsf_folder.rb index f2342a1a..8445e54b 100644 --- a/app/models/dmsf_folder.rb +++ b/app/models/dmsf_folder.rb @@ -432,6 +432,8 @@ class DmsfFolder < ActiveRecord::Base def to_csv(columns, level) csv = [] + # Project + csv << self.project.name if columns.include?(l(:field_project)) # Id csv << self.id if columns.include?('id') # Title diff --git a/app/models/dmsf_link.rb b/app/models/dmsf_link.rb index 7afe3868..3c815f0b 100644 --- a/app/models/dmsf_link.rb +++ b/app/models/dmsf_link.rb @@ -153,6 +153,8 @@ class DmsfLink < ActiveRecord::Base def to_csv(columns, level) csv = [] if self.target_type == 'DmsfUrl' + # Project + csv << self.project.name if columns.include?(l(:field_project)) # Id csv << self.id if columns.include?('id') # Title diff --git a/app/views/settings/_dmsf_columns.html.erb b/app/views/settings/_dmsf_columns.html.erb index 0318f85f..0ed3313d 100644 --- a/app/views/settings/_dmsf_columns.html.erb +++ b/app/views/settings/_dmsf_columns.html.erb @@ -24,6 +24,11 @@ <%= content_tag(:label, l(:field_column_names)) %> <% columns = DmsfFolder::AVAILABLE_COLUMNS.dup %> <% columns.concat(extra_columns) if defined?(extra_columns) %> + <% index = columns.index(l(:field_project)) %> + <%# Move Project to the second position %> + <% if index %> + <% columns.insert(0, columns.delete_at(index)) %> + <% end %> <% cfs = CustomField.where(:type => 'DmsfFileRevisionCustomField').order(:position) %> <% columns.concat(cfs.map{ |c| c.name }) %> <% selected_columns = settings[:dmsf_columns] %>