WebGUI
      Click here to register.
      
PBWG Banner


     Request Features > Request For Enhancement

Reverse alphabetical order for folder assets.

User grnoc
Date 4/11/2007 3:54 pm
Version WebGUI
Views 1181
Rating -4    Rate [
|
]
Difficulty 1
Karma So Far 521
Karma Rank 521.000000
Transfer Karma
Previous · Next
User Message
grnoc

Having this display option of reverse alphabetizing
items contained within a folder asset would be a helpful feature.It exists in another asset (though i forget which).

When i get some time I will try to implement, if someone doesnt already beat me to it ;-)

 

Thanks, Chad 



Back to Top  
 
grnoc

I have implemented this in my own webgui installation. This might not be the best way to implement this functionality. i.e. having an additional radio button, which then permits users to select yes for both, which would get confusing.

 

 

Here is what i added to my webgui installation. Could someone please commit this to the branch. 

i18n/English/Asset_Folder.pm

add to our $I18N = {

        'reverse sort alphabetically' => {
                message => q|Sort reverse alphabetical order?|,
                lastUpdated => 0
                },

        'reverse sort alphabetically help' => {
                message => q|Do you want to sort the items in this folder in reverse alphabetical order? If you select no then it will sort according to rank.|,
                lastUpdated => 0
                },

        'reverseSort' => {
                message => q|A conditional that indicates that subfolders and files will be sorted in reverse alphabetical order.|,
                lastUpdated => 1167416930
        },

 

 Asset/Wobject/Folder.pm

in sub definition {

    properties => { 

                        reverseSort => {
                                fieldType => "yesNo",
                                defaultValue => 0,
                                tab => 'display',
                                label => $i18n->get('reverse sort alphabetically'),
                                hoverHelp => $i18n->get('reverse sort alphabetically help'),
                                },

 

and then further down in Folder.pm in sub view {

$rules{orderByClause} = 'assetData.title DESC' if ($self->get("reverseSort"));

add that just below the other $rules{orderByClause} 

 Finally modify the Folder table.

alter table Folder ADD reverseSort int(11) NOT NULL default 0;

 

 

I dont really like how this turned out. This  interface is not very intuitive. A drop down box would work better... 



Back to Top  
 
grnoc

Here is the code for adding a drop down box to the display tab of the folder asset to select what type of sorting to use. Using a drop down box is more intuitive than having multiple select boxes, and also allows for more sorting options in the future.

 

WebGUI/Asset/Wobject/Folder.pm

add to properties hash

 

                sortOrder =>{
                        fieldType=>"selectBox",
                        defaultValue=>'none',
                        tab=>'display',                                             
                        options=>{ none => $i18n->get('noSort'),
                                   asc => $i18n->get('sortAlphabetical'),
                                   desc => $i18n->get('reverseSortAlphabetical') },
                        label=>$i18n->get('sort order'),
                        hoverHelp=>$i18n->get('sort order  description'),
                        },

 

 farther on down in the sub view {

these rules must exist.

        $rules{orderByClause} = 'assetData.title' if ($self->get("sortOrder") eq 'asc');
        $rules{orderByClause} = 'assetData.title DESC' if ($self->get("sortOrder") eq 'desc');

 

add this to the database...

alter table Folder ADD sortOrder varchar(11) NOT NULL default '';


in i18n Asset_Folder.pm

         'sort order' => {
                message => q|Sort?|,
                lastUpdated => 0
                },

        'sort order description' => {
                message => q|How dDo you want to sort the items in this folder ?|,
                lastUpdated => 0
                },
        'noSort' => {
                message => q|None|,
                lastUpdated => 1113673330,
        },

 

That should be eveything. 



Back to Top  
 
grnoc
I'd like to see this in the next release please.


Back to Top  
 
JT
I'll have it vetted for 7.4. If the code is sound it will be included in the 7.4 release.


Back to Top