Results 1 to 3 of 3

Thread: Reports in Connection with Teams

  1. #1
    enrikm is offline Sugar Community Member
    Join Date
    Dec 2006
    Posts
    61

    Default Reports in Connection with Teams

    Good afternoon all,

    I currently have the Teams module up and running. However when using ZuckerReports, this overrules the Teams module, returning all records that the current user isn't suppose to see.

    My question therefore is, is there any way we can link the reports to the Teams module so when we run a report, only records viewable by the user will be returned.

    Thanks!

  2. #2
    ftreml's Avatar
    ftreml is offline Sugar Community Member
    Join Date
    May 2005
    Location
    Vienna, Austria
    Posts
    399

    Default Re: Reports in Connection with Teams

    i think you have to join the "teams" and "teams_users" tables to your queries, restricting resultset to viewable records. The report parameter "SUGAR_USER_ID" always contains the id of the currently logged on user

  3. #3
    enrikm is offline Sugar Community Member
    Join Date
    Dec 2006
    Posts
    61

    Default Re: Reports in Connection with Teams

    Hi, I can't find the teams_users tables however I tried this query.

    SELECT accounts.name
    FROM accounts
    JOIN accounts_cstm
    ON accounts.id = accounts_cstm.id_c
    JOIN teams
    ON accounts_cstm.assigned_team_id_c = teams.id
    JOIN users
    ON accounts.assigned_user_id = users.id
    JOIN users_cstm
    ON users.id = users_cstm.id_c
    WHERE accounts.deleted = 0
    AND users.user_name = 'sugar_user_id'

    It seems 'sugar_user_id' is not recognized that's why I tried to substitute a real user name however instead of getting all accounts viewable by that user, I am getting all the accounts assigned to that user. Any thing I am doing wrong?

    Thanks

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Why Teams OS 2.0 Could Be So Important to So Many
    By SohodojoJim in forum General Discussion
    Replies: 6
    Last Post: 2006-10-05, 02:15 PM
  2. Outputting to reports
    By matthewseymour in forum Help
    Replies: 1
    Last Post: 2006-08-20, 08:26 PM
  3. help - Reports have gone missing
    By crmireland in forum Help
    Replies: 0
    Last Post: 2006-07-18, 10:40 PM

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
  •