Results 1 to 7 of 7

Thread: orderBy problem

  1. #1
    dekleinemedia is offline A Prolific Poster
    Join Date
    May 2009
    Location
    Netherlands
    Posts
    241

    Question orderBy problem

    Hi, i have the following issue of which i hope someone can help me with;

    I want to use the functions orderBy for the ListView of my module "ProjectTask".
    Now i want the field 'Project Task Id' to be ordered Ascending.

    I have created a file view.list.php in this folder custom\modules\ProjectTask\views but this doesn't seems to work...

    This file containts the following code;

    PHP Code:
    <?php

    // Order by function

    require_once('include/MVC/View/views/view.list.php');

    class 
    ProjectTaskViewList extends ViewList {

      function 
    ProjectTaskViewList() 
      { 
        
    parent::ViewList(); 
      } 
        
      function 
    listViewPrepare() 
      { 
        if(empty(
    $_REQUEST['orderBy'])) 
        { 
          
    $_REQUEST['orderBy'] = 'project_task_id';  
          
    $_REQUEST['sortOrder'] = 'asc'
        }  
        
    parent::listViewPrepare();  
      }
      
    // Remove the Advanced Search tab from form

      
    function processSearchForm() 
      {
        
    $args func_get_args();
        
        unset(
    $this->searchForm->tabs[1]);
        
    $this->searchForm->nbTabs sizeof($this->searchForm->tabs);
        
    call_user_func_array
        
    (
        array
        (
    'parent'__FUNCTION__), $args);
      }
    }
    ?>
    See screenshot for more info.

    Hope someone can help me with this one. Thanks in advance!
    Attached Images Attached Images  
    Kind regards,

    De Kleine Media


    SugarCRM CE v.5.2.0h
    Windows platform
    MySQL v.5.1
    phpMyAdmin - 2.11.2.2
    Apache Server v.2.0

  2. #2
    eescribano's Avatar
    eescribano is offline Senior Member
    Join Date
    Mar 2009
    Location
    Netherlands
    Posts
    85

    Default Re: orderBy problem

    This is weird, I took your code and I tried in my instance... and it is working and I didn't change anything.
    Do you have enabled the developer mode?
    I tried also with desc sortOrder to know if it was working... I attach the two cases in screenshot
    Attached Images Attached Images   
    Elisabeth Escribano
    Webdeveloper

    MADCAP verademing in ict

    e.escribano@madcap.nl

    Schapedrift 89
    3371 JJ Hardinxveld-Giessendam
    Netherlands
    Tel 088 99 088 99
    Fax 088 99 088 98

    www.madcap.nl

  3. #3
    dekleinemedia is offline A Prolific Poster
    Join Date
    May 2009
    Location
    Netherlands
    Posts
    241

    Default Re: orderBy problem

    Hi Elisabeth,

    Thanks for your reply and suggestions.
    I had enabled Developer Mode so that couldn't be the issue. But now when i remove the view.list.php from the custom ProjectTask folder and Repair and Rebuild this, I still see that it is sort by Project Name. How is that possible when I removed the view.list.php file? Again, thanks for your help!
    Kind regards,

    De Kleine Media


    SugarCRM CE v.5.2.0h
    Windows platform
    MySQL v.5.1
    phpMyAdmin - 2.11.2.2
    Apache Server v.2.0

  4. #4
    eescribano's Avatar
    eescribano is offline Senior Member
    Join Date
    Mar 2009
    Location
    Netherlands
    Posts
    85

    Default Re: orderBy problem

    did you removed or modified the view.list.php that is in modules/ProjectTask/views ?
    Elisabeth Escribano
    Webdeveloper

    MADCAP verademing in ict

    e.escribano@madcap.nl

    Schapedrift 89
    3371 JJ Hardinxveld-Giessendam
    Netherlands
    Tel 088 99 088 99
    Fax 088 99 088 98

    www.madcap.nl

  5. #5
    dekleinemedia is offline A Prolific Poster
    Join Date
    May 2009
    Location
    Netherlands
    Posts
    241

    Default Re: orderBy problem

    Quote Originally Posted by eescribano View Post
    did you removed or modified the view.list.php that is in modules/ProjectTask/views ?
    No, I removed the custom view.list.php from custom\modules\ProjectTask\views and have Repaired and Rebuild several times, but it still sorts by Project Name. Strange isn't it?
    Kind regards,

    De Kleine Media


    SugarCRM CE v.5.2.0h
    Windows platform
    MySQL v.5.1
    phpMyAdmin - 2.11.2.2
    Apache Server v.2.0

  6. #6
    eescribano's Avatar
    eescribano is offline Senior Member
    Join Date
    Mar 2009
    Location
    Netherlands
    Posts
    85

    Default Re: orderBy problem

    to this actions you really don't need to repair...
    I think you pressed in one moment to order by name and it is still selected... to clear that selection just press clear in the search panel.

    Hope this helps... your code was good, this is the only thing I can think it is causing the ordering
    Elisabeth Escribano
    Webdeveloper

    MADCAP verademing in ict

    e.escribano@madcap.nl

    Schapedrift 89
    3371 JJ Hardinxveld-Giessendam
    Netherlands
    Tel 088 99 088 99
    Fax 088 99 088 98

    www.madcap.nl

  7. #7
    dekleinemedia is offline A Prolific Poster
    Join Date
    May 2009
    Location
    Netherlands
    Posts
    241

    Default Re: orderBy problem

    ]to this actions you really don't need to repair...
    I think you pressed in one moment to order by name and it is still selected... to clear that selection just press clear in the search panel.
    Hope this helps... your code was good, this is the only thing I can think it is causing the ordering

    that was the issue. Now its sorting fine by project_task_id
    Great thanks!
    Kind regards,

    De Kleine Media


    SugarCRM CE v.5.2.0h
    Windows platform
    MySQL v.5.1
    phpMyAdmin - 2.11.2.2
    Apache Server v.2.0

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 0
    Last Post: 2005-06-07, 01:42 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •