Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Implemented: EZP-23045: In the admin interface: make it possible to s…
…ort by visibility
  • Loading branch information
patrickallaert committed Jun 19, 2014
1 parent a7a0b4c commit 1355ed5
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion design/admin/javascript/ezajaxsubitems_datatable.js
Expand Up @@ -110,7 +110,7 @@ var sortableSubitems = function () {
{key:"crank", label:"", sortable:false, formatter:customMenu, resizeable:false},
{key:"thumbnail", label:labelsObj.DATA_TABLE_COLS.thumbnail, sortable:false, formatter:thumbView, resizeable:false},
{key:"name", label:labelsObj.DATA_TABLE_COLS.name, sortable:true, resizeable:true, formatter:formatName},
{key:"hidden_status_string", label: labelsObj.DATA_TABLE_COLS.visibility, sortable:false, resizeable:true},
{key:"hidden_status_string", label: labelsObj.DATA_TABLE_COLS.visibility, sortable:true, resizeable:true},
{key:"class_name", label:labelsObj.DATA_TABLE_COLS.type, sortable:true, resizeable:true},
{key:"creator", label:labelsObj.DATA_TABLE_COLS.modifier, sortable:false, resizeable:true},
{key:"modified_date", label:labelsObj.DATA_TABLE_COLS.modified, sortable:true, resizeable:true},
Expand Down
3 changes: 3 additions & 0 deletions extension/ezjscore/classes/ezjscserverfunctionsnode.php
Expand Up @@ -234,6 +234,9 @@ protected static function sortMap( $sort )
case 'published_date':
$sortKey = 'published';
break;
case 'hidden_status_string':
$sortKey = 'visibility';
break;
default:
$sortKey = $sort;
}
Expand Down
9 changes: 9 additions & 0 deletions kernel/classes/ezcontentobjecttreenode.php
Expand Up @@ -27,6 +27,7 @@ class eZContentObjectTreeNode extends eZPersistentObject
const SORT_FIELD_MODIFIED_SUBNODE = 10;
const SORT_FIELD_NODE_ID = 11;
const SORT_FIELD_CONTENTOBJECT_ID = 12;
const SORT_FIELD_VISIBILITY = 13;

const SORT_ORDER_DESC = 0;
const SORT_ORDER_ASC = 1;
Expand Down Expand Up @@ -643,6 +644,10 @@ static function createSortingSQLStrings( $sortList, $treeTableName = 'ezcontento
{
$sortingFields .= $treeTableName . '.priority';
} break;
case 'visibility':
{
$sortingFields .= $treeTableName . '.is_invisible';
} break;
case 'name':
{
$sortingFields .= 'ezcontentobject_name.name';
Expand Down Expand Up @@ -2718,6 +2723,8 @@ static function sortFieldName( $sortFieldID )
return 'node_id';
case self::SORT_FIELD_CONTENTOBJECT_ID:
return 'contentobject_id';
case self::SORT_FIELD_VISIBILITY:
return 'is_invisible';
}
}

Expand Down Expand Up @@ -2755,6 +2762,8 @@ static function sortFieldID( $sortFieldName )
return self::SORT_FIELD_NODE_ID;
case 'contentobject_id':
return self::SORT_FIELD_CONTENTOBJECT_ID;
case 'is_invisible':
return self::SORT_FIELD_VISIBILITY;
}
}

Expand Down

0 comments on commit 1355ed5

Please sign in to comment.