Forums / General / How to sort the information collected in the back office?

How to sort the information collected in the back office?

Author Message

Madani Aziz

Thursday 24 April 2008 11:03:21 am

Hello

I want to khnow if there are possiblites to sort the information collected in the back office and how can i do this ?

Thank you

Carlos Revillo

Thursday 24 April 2008 3:12:45 pm

I think it is not possible "by default" if you don't want to hack some eZPublish code. So, i would do a new extension for this. maybe you can have a look at http://ez.no/ezpublish/documentation/development/extensions.
That is a good point to start.

Anyway, you can still hack ezPublish to order recolected information, maybe by the the date that information was created or modified
You can have a look at kernel/infocollection/collectionlist.php and kernel/classes/informationcollection.php

This class are perfectly documented by eZ crew. if you look at the code you will find

/*!
     \static
     \param $creatorID       - optional, default false, limits the fetched set to a creator_id
     \param $contentObjectID - optional, default false, limits the fetched set of collection to
                               a specific content object
     \param $userIdentifier  - optional, default false, limits the fetched set to a user_identifier
     \param $limitArray      - optional, default false, limits the number of returned results
                               on the form:  array( 'limit' => $limit, 'offset' => $offset )
     \param $sortArray       - optional, default false, how to sort the result,
                               on the form: array( 'field', true/false ), true = asc
     \param $asObject        - optional, default true, specifies if results should be returned as objects.

      Fetches a list of information collections.
    */
    static function fetchCollectionsList( $contentObjectID = false, $creatorID = false , $userIdentifier = false, $limitArray  = false, $sortArray = false, $asObject = true )
    {
															   );

so, you can try to change the call to this function in the first file from


$collections = eZInformationCollection::fetchCollectionsList( $objectID, /* object id */
                                                              false, /* creator id */
                                                              false, /* user identifier */
                                                              array( 'limit' => $limit,'offset' => $offset ) /* limit array */,
															
															   );

to something like


$collections = eZInformationCollection::fetchCollectionsList( $objectID, /* object id */
                                                              false, /* creator id */
                                                              false, /* user identifier */
                                                              array( 'limit' => $limit,'offset' => $offset ) /* limit array */,
															  array('modified', false)
															   );
 

... and see what happens.

Abdelkader RHOUATI

Thursday 24 April 2008 3:59:43 pm

hi Aziz,

i think you must not hack kernel. it's to keap a possibilité to update your ez to an other version.
first search for solution , with extension..

tks

Abdelkader RHOUATI

Blog (french) : http://arhouati.com
----
Extension arh_jdebug : EzDebug using jquery

Piotrek Karaś

Thursday 24 April 2008 9:49:41 pm

Exactly, no need to touch the kernel. Extend instead. And the db schema for collections should be quite straightforward once you study it. Here's an example of extension that uses customized approach to collected info:
http://ez.no/developer/contribs/hacks/ez_my_collected_info
Other, direct db operations should also present to problems.

Good luck!

--
Company: mediaSELF Sp. z o.o., http://www.mediaself.pl
eZ references: http://ez.no/partners/worldwide_partners/mediaself
eZ certified developer: http://ez.no/certification/verify/272585
eZ blog: http://ez.ryba.eu