Results 1 to 6 of 6

Thread: Problems with the Employee list view

  1. #1
    ltnp is offline Sugar Community Member
    Join Date
    Dec 2005
    Posts
    20

    Post Problems with the Employee list view

    Hello, when I'm login in as an user (not admin rights) I'm not able to view the Employee list. But when login in as an Admin user, all employees is shown on the Employee list.

    I'm using the latest SugarSuite 3.5.1 e (updated with all pacthes).

    Regards
    LTNP

  2. #2
    matthew's Avatar
    matthew is offline Sugar Team Member
    Join Date
    Jul 2005
    Posts
    533

    Default Re: Problems with the Employee list view

    A good way to debug this is to echo out the query in the create_list_query method in the <modules/Employees/Employee.php> file.

    I added "echo $query;" the line before the "return $query;" which will print the query to the screen before the list view. Then you can anaylize the query to see what's going on and why you're not getting anything.

    Start there, if that doesn't help, turn debugging on in log4php.properties and refresh the listview to see what's going on while the page is loading.

    Let us know.

  3. #3
    ltnp is offline Sugar Community Member
    Join Date
    Dec 2005
    Posts
    20

    Exclamation Re: Problems with the Employee list view

    Dear Matthew,

    when inserting "echo $query;" I recieve the following message:

    SELECT users.*, reports.first_name as reports_first_name, reports.last_name as reports_last_name FROM users LEFT JOIN users reports ON reports.id=users.reports_to_id WHERE users.deleted = 0 and users.employee_status<>'Terminated' ORDER BY users.last_name, users.first_name asc

    How can I solve this problem? I'm not so familiar with SugarCRM nor SQL, so I hope that you could help me...

    Thank you for all the help so far!

    Regards
    Phuong

  4. #4
    rana is offline Sugar Community Member
    Join Date
    Jul 2005
    Posts
    196

    Default Re: Problems with the Employee list view

    Hi Phuong

    Are your employee in status "Terminated"???

    If this is true, the system verify if you are admin user or not

    1. admin user: can see all employee in all status

    2. not admin user: can see only employee in staus <> 'terminated'

    so if your employee are all in status Terminated only admin user can see them.

    this is the query in employee.php file....

    $where_auto = '1=1';

    if($show_deleted == 0){

    $where_auto = " users.deleted = 0";
    if(!is_admin($current_user))
    {
    $where_auto .= " and users.employee_status<>'Terminated'";
    }
    }
    else if($show_deleted == 1){
    $where_auto = " users.deleted = 1";
    }



    verify your query!

  5. #5
    ltnp is offline Sugar Community Member
    Join Date
    Dec 2005
    Posts
    20

    Thumbs up Re: Problems with the Employee list view

    Hello,

    this problem is no longer a problem after upgrading to SuagarSuite 4.0.

    Thanks you for helping!

    Regards
    Phuong

  6. #6
    matthew's Avatar
    matthew is offline Sugar Team Member
    Join Date
    Jul 2005
    Posts
    533

    Default Re: Problems with the Employee list view

    Great news!

Thread Information

Users Browsing this Thread

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

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
  •