Wrong sorting by columns Modified and Version in the main view

This commit is contained in:
Karel Picman 2014-04-02 13:41:02 +02:00
parent 76c620ec51
commit b30d895656
4 changed files with 15 additions and 2 deletions

View File

@ -227,5 +227,10 @@ class DmsfFileRevision < ActiveRecord::Base
def available_custom_fields
DmsfFileRevisionCustomField.all
end
def iversion
parts = self.version.split '.'
parts.size == 2 ? parts[0].to_i * 1000 + parts[1].to_i : 0
end
end

View File

@ -104,3 +104,5 @@
</td>
<td class="hidden">0</td>
<td class="hidden">0</td>
<td class="hidden"><%= subfolder.updated_at.to_i %></td>
<td class="hidden">0</td>

View File

@ -178,4 +178,6 @@
<% end %>
</td>
<td class="hidden">1</td>
<td class="hidden"><%= file.last_revision.size %></td>
<td class="hidden"><%= file.last_revision.size %></td>
<td class="hidden"><%= file.last_revision.updated_at.to_i %></td>
<td class="hidden"><%= file.last_revision.iversion %></td>

View File

@ -134,6 +134,8 @@
<th></th>
<th class="hidden"></th>
<th class="hidden"></th>
<th class="hidden"></th>
<th class="hidden"></th>
</tr>
</thead>
<tbody>
@ -242,7 +244,9 @@
'aoColumnDefs': [
{ 'bSearchable': false, 'aTargets': [0, 7, 8, 9] },
{ 'bSortable': false, 'aTargets': [0, 7, 8] },
{ 'iDataSort': 9, 'aTargets': [ 2 ] }
{ 'iDataSort': 9, 'aTargets': [ 2 ] },
{ 'iDataSort': 10, 'aTargets': [ 3 ] },
{ 'iDataSort': 11, 'aTargets': [ 4 ] }
],
'fnInitComplete': function() {
jQuery('div.controls').prependTo(jQuery('#browser_wrapper div.fg-toolbar')[0]);