[Vtigercrm-developers] Correctly sort ListView

Jonathan Sardo sardoj at gmail.com
Wed Sep 17 20:01:46 GMT 2014


Hi !

This is a way to correctly sort a ListView according with the field
*$default_order_by
 *defined in the module class:

Edit "/modules/Vtiger/models/ListView.php" and add the following code at
the line 188, after $sortOrder = $this->getForSql('sortorder') :






*if(empty($orderBy) && empty($sortOrder) && $moduleName != "Users"){
 if(!empty($moduleFocus->default_order_by))   {      $orderBy =
$moduleFocus->default_order_by;   }*





*   if(!empty($moduleFocus->default_sort_order))   {      $sortOrder =
$moduleFocus->default_sort_order;   }}*

Regards,

Jonathan SARDO
[image: Images intégrées 5]
Tél. 06 99 45 50 47
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20140917/553e7177/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 4223 bytes
Desc: not available
URL: <http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20140917/553e7177/attachment.png>


More information about the vtigercrm-developers mailing list