diff --git a/app/controllers/dmsf_controller.rb b/app/controllers/dmsf_controller.rb index 4962862de..79a25f207 100644 --- a/app/controllers/dmsf_controller.rb +++ b/app/controllers/dmsf_controller.rb @@ -601,7 +601,7 @@ def get_display_params @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 69f3006c4..2db788f29 100644 --- a/app/models/dmsf_file.rb +++ b/app/models/dmsf_file.rb @@ -541,6 +541,8 @@ def extension 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 f2342a1a8..8445e54b2 100644 --- a/app/models/dmsf_folder.rb +++ b/app/models/dmsf_folder.rb @@ -432,6 +432,8 @@ def propfind_cache_key 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 7afe38686..3c815f0bf 100644 --- a/app/models/dmsf_link.rb +++ b/app/models/dmsf_link.rb @@ -153,6 +153,8 @@ def is_file? 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 0318f85fc..0ed3313dc 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] %>