[TYPO3-project-formidable] TODO requests

Manuel Rego Casasnovas mrego at igalia.com
Thu Jun 7 15:40:33 CEST 2007


Allow to order by two or more fields in the LISTER datahandlers.

Sometimes I need to order by for more than one field, I've redefined the
method _buildSql of the class tx_dhlister to allow this. I've changed
the lines 843-844 by the next ones:
        if($sortfield != "") {
            $sortFields = explode(',', $sortfield);
            $sortDirections = explode(',', $sortdirection);
            for ($i=0; $i < count($sortFields); $i++) {
                $orderBySentence[] = $sortFields[$i] . " " .
$sortDirections[$i];
            }
            $aQuery['ORDERBY'] = implode(', ', $orderBySentence);
        }

And in the XML configuration I can use this new option:
<pager>
...
   <sort>
      <field>my_field, uid</field>
      <dir>ASC, DESC</dir>
   </sort>
</pager>


This is a first and quick solution but I think that there is a better
option for the XML configuration:
<pager>
...
   <sort>
      <fields>
         <field>
            <name>my_field</name>
            <dir>ASC</dir>
         </field>
         <field>
            <name>uid</name>
            <dir>DESC</dir>
         </field>
      </fields>
   </sort>
</pager>


Best regards,
   Rego

--
http://www.igalia.com


"Jerome Schneider" <j.schneider at ameos.com> a �crit dans le message de news: 
mailman.1.1176894947.6408.typo3-project-formidable at lists.netfielders.de...

> Hello !
>
> Please post in this thread if you have requests for TODO in formidable, it 
> will be easier to track for everyone.
>
> Best regards,
> Jerome 


More information about the TYPO3-project-formidable mailing list