Results 1 to 2 of 2

Thread: Limit Users under Assigned to Field (Advanced Search)

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

    Default Limit Users under Assigned to Field (Advanced Search)

    Good evening all,

    I need to limit the users in the ASSIGNED TO multi-select field in the advanced search by removing those users that are not under the current user as defined by the TEAMS module. Example if Sales1 and Sales2 report to Branch1, when Branch1 logs in, only _Branch1,_Sales1 and _Sales2 are in the ASSIGNED TO multi-select field. If there is a user called Branch2, his team shouldn't be included in the selection since Branch1 is not allowed to see him..

    I know this might require some coding, all I need is a tip maybe on where to start.

    Thanks!

  2. #2
    kuske's Avatar
    kuske is offline Sugar Community Member
    Join Date
    Oct 2007
    Location
    Germany
    Posts
    2,597

    Default Re: Limit Users under Assigned to Field (Advanced Search)

    In modules/users/ListView.php you can extend the while criteria of the user search.

    Find the following lines:

    if(isset($address_country) && $address_country != "") array_push($where_clauses, "address_country like '".PearDatabase::quote($address_country)."%'");

    $where = "";

    Between these two lines you can calculate and add new where criteria by simple "array_push"-calls to the $where_clauses.

    Good luck
    hk

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 1
    Last Post: 2006-06-16, 03:35 AM
  2. BUG In Search/Edit Layout???
    By tj@estreet.com in forum Help
    Replies: 13
    Last Post: 2006-06-10, 05:43 AM
  3. Replies: 1
    Last Post: 2006-05-01, 01:44 AM
  4. Replies: 10
    Last Post: 2005-03-29, 04:36 PM
  5. Advanced Search - Search by User
    By JStinson in forum Help
    Replies: 0
    Last Post: 2005-01-26, 09:06 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
  •