Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Hiding some documents from sales reps eyes

  1. #1
    tmamayek is offline Sugar Community Member
    Join Date
    Apr 2008
    Location
    Hartford, WI
    Posts
    52

    Default Hiding some documents from sales reps eyes

    I use Sugar 5.1 CE. I wanted to know if there is a way that I can hide some documents from my sales reps for candidate information? If so, how?

  2. #2
    andopes's Avatar
    andopes is offline A Sugar Hero | Help Forum Moderator
    Join Date
    Jul 2006
    Location
    São Paulo - Brazil
    Posts
    8,335

    Default Re: Hiding some documents from sales reps eyes

    Hi tmamayek

    It is pretty possible, but the implementation will depend on some details regarding the scene:

    1. What is the rule for hiding some specific document (Documents module?) to a specific sales reps (User)?
    2. Do you want to define any custom field which will specify the visibility of document?

    A detailed work flow would enable us guide you.

    Best regards
    André Lopes
    DevToolKit / Project of the Month - June 2009
    Lampada Global Services- Open Source Solutions
    Avenida Ipiranga, 318
    Bloco B - CJ 1602
    São Paulo, SP 01046-010
    Brazil
    Office: +55 11 3237-3110
    Mobile: +55 11 7636-5859
    e-mail: andre@lampadaglobal.com

    Lampada Global delivers offshore software development and support services to customers around the world.
    Lampada is proud to be a SugarCRM Gold Partner, revolutionizing Customer Relationship Management.

    I DO NOT answer questions through PM and Email. If you need some help post your question into SugarForum.

  3. #3
    tmamayek is offline Sugar Community Member
    Join Date
    Apr 2008
    Location
    Hartford, WI
    Posts
    52

    Default Re: Hiding some documents from sales reps eyes

    In all honesty, I only want the 2 custom modules to only be able to be accessed by myself, as well as the attachments and notes and everything that is related to a specific module.
    So I would only want user's with Admin rights to be able to access it unless I add on more people that would need that information, but that would be at least a year or so down the road. So it would just be admin rights now.

    Adding a custom field to specify the visibility of the document wold be EXACTLY what I am looking for in general though. I want to be able to keep all of my documents in Sugar so that when I email people, everything is tracked. However, I don't want my reps to have access to some of these documents, so adding a custom field would be great.

    Since I've got your attention, I don't know why when I go to accounts or leads advanced search, and try selecting a user to see just their records isn't working. What's weird is the version of Sugar I use in my part time job works perfectly as a multi-select box, but the one in mine is a look up function. Even when you select someone from the look up, it doesn't show anything....

    Thanks a lot in advance.

  4. #4
    andopes's Avatar
    andopes is offline A Sugar Hero | Help Forum Moderator
    Join Date
    Jul 2006
    Location
    São Paulo - Brazil
    Posts
    8,335

    Default Re: Hiding some documents from sales reps eyes

    Quote Originally Posted by tmamayek
    In all honesty, I only want the 2 custom modules to only be able to be accessed by myself, as well as the attachments and notes and everything that is related to a specific module.
    So I would only want user's with Admin rights to be able to access it unless I add on more people that would need that information, but that would be at least a year or so down the road. So it would just be admin rights now.

    Adding a custom field to specify the visibility of the document wold be EXACTLY what I am looking for in general though. I want to be able to keep all of my documents in Sugar so that when I email people, everything is tracked. However, I don't want my reps to have access to some of these documents, so adding a custom field would be great.

    Since I've got your attention, I don't know why when I go to accounts or leads advanced search, and try selecting a user to see just their records isn't working. What's weird is the version of Sugar I use in my part time job works perfectly as a multi-select box, but the one in mine is a look up function. Even when you select someone from the look up, it doesn't show anything....

    Thanks a lot in advance.
    Hi tmamayek

    Regarding your last question, how does the assigned user field looks like? A multi select, a dropdown or a select button?
    If the ListView is empty then probably it looks like a select button, I suppose. Let me know it.

    Edit the file include/ListView/ListViewData.php and add the code:

    PHP Code:
    echo "<LI>$main_query"
    Just after the line

    PHP Code:
    $main_query $ret_array['select'] . $params['custom_select'] . $ret_array['from'] . $params['custom_from'] . $ret_array['where'] . $params['custom_where'] . $ret_array['order_by'] . $params['custom_order_by']; 
    Around the line 287.

    Regarding the main question, I can imagine how to implement your needs. Do you have PHP and Sugar skills?
    It is necessary to create some extended code, not only a custom field.
    Let me know if you want to discuss it.

    Best regards
    André Lopes
    DevToolKit / Project of the Month - June 2009
    Lampada Global Services- Open Source Solutions
    Avenida Ipiranga, 318
    Bloco B - CJ 1602
    São Paulo, SP 01046-010
    Brazil
    Office: +55 11 3237-3110
    Mobile: +55 11 7636-5859
    e-mail: andre@lampadaglobal.com

    Lampada Global delivers offshore software development and support services to customers around the world.
    Lampada is proud to be a SugarCRM Gold Partner, revolutionizing Customer Relationship Management.

    I DO NOT answer questions through PM and Email. If you need some help post your question into SugarForum.

  5. #5
    tmamayek is offline Sugar Community Member
    Join Date
    Apr 2008
    Location
    Hartford, WI
    Posts
    52

    Default Re: Hiding some documents from sales reps eyes

    It's a select button, so should I do that edit you mentioned? In the list view, it does show the users, you just can't select one user to search the Account/leads.

  6. #6
    andopes's Avatar
    andopes is offline A Sugar Hero | Help Forum Moderator
    Join Date
    Jul 2006
    Location
    São Paulo - Brazil
    Posts
    8,335

    Default Re: Hiding some documents from sales reps eyes

    Hi tmamayek


    Edit the file custom/modules/<ModuleName>/metadata/searchdefs.php and modify the assigned_user_name field to looks like that one:
    PHP Code:
                                array('name' => 'assigned_user_id''type' => 'enum''label' => 'LBL_ASSIGNED_TO''function' => array('name' => 'get_user_array''params' => array(false))), 
    This is the default assigned_user_name defs for be displayed into Search Form.

    Cheers
    André Lopes
    DevToolKit / Project of the Month - June 2009
    Lampada Global Services- Open Source Solutions
    Avenida Ipiranga, 318
    Bloco B - CJ 1602
    São Paulo, SP 01046-010
    Brazil
    Office: +55 11 3237-3110
    Mobile: +55 11 7636-5859
    e-mail: andre@lampadaglobal.com

    Lampada Global delivers offshore software development and support services to customers around the world.
    Lampada is proud to be a SugarCRM Gold Partner, revolutionizing Customer Relationship Management.

    I DO NOT answer questions through PM and Email. If you need some help post your question into SugarForum.

  7. #7
    tmamayek is offline Sugar Community Member
    Join Date
    Apr 2008
    Location
    Hartford, WI
    Posts
    52

    Default Re: Hiding some documents from sales reps eyes

    what about the hiding of the documents though? Still haven't received an answer on that from anyone...

  8. #8
    andopes's Avatar
    andopes is offline A Sugar Hero | Help Forum Moderator
    Join Date
    Jul 2006
    Location
    São Paulo - Brazil
    Posts
    8,335

    Default Re: Hiding some documents from sales reps eyes

    Hi tmamayek

    It is pretty possible.
    You can create a logic_hook after_retrieve in the Users module which could add a filter in the ListView of Documents if some condition is filled.

    Create the file custom/modules/Users/logic_hooks.php with this content:

    PHP Code:
    <?php
    $hook_version 
    1
    $hook_array = Array(); 
    $hook_array['after_retrieve'] = Array(); 
    $hook_array['after_retrieve'][] = Array(1'filterDocuments''custom/modules/Users/UserHook.php','UserHook''filterDocuments'); 
    ?>
    Create the file custom/modules/Users/UserHook.php with this content:

    PHP Code:
    <?php
    if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');

    class 
    UserHook {
        function 
    filterDocuments(&$focus$event$arguments) {
            global 
    $current_user;
            
            if(
    $focus->id == $current_user->id && ! $current_user->is_admin) {
                if((isset(
    $_REQUEST['action']) && ($_REQUEST['action'] == 'index' || $_REQUEST['action'] == 'ListView')) &&  $_REQUEST['module'] == 'Documents') {
                    if(! isset(
    $_REQUEST['searchFormTab']) || $_REQUEST['searchFormTab'] == 'basic_search') {
                        
    $_REQUEST['searchFormTab']        = 'basic_search';
                        
    $_REQUEST['assigned_user_id_basic'] = $current_user->id;
                    } else if(
    $_REQUEST['searchFormTab'] == 'advanced_search') {
                        
    $_REQUEST['searchFormTab']           = 'advanced_search';
                        
    $_REQUEST['assigned_user_id_advanced'] = $current_user->id;
                    }

                    
    $_REQUEST['query'] = 'true';
                }
            }
        }
    }
    ?>
    Cheers
    André Lopes
    DevToolKit / Project of the Month - June 2009
    Lampada Global Services- Open Source Solutions
    Avenida Ipiranga, 318
    Bloco B - CJ 1602
    São Paulo, SP 01046-010
    Brazil
    Office: +55 11 3237-3110
    Mobile: +55 11 7636-5859
    e-mail: andre@lampadaglobal.com

    Lampada Global delivers offshore software development and support services to customers around the world.
    Lampada is proud to be a SugarCRM Gold Partner, revolutionizing Customer Relationship Management.

    I DO NOT answer questions through PM and Email. If you need some help post your question into SugarForum.

  9. #9
    sbankhead is offline Sugar Community Member
    Join Date
    Mar 2012
    Posts
    15

    Default Re: Hiding some documents from sales reps eyes

    Hoping to revive this thread to get a little more explanation. I was able to implement what andopes suggested (Using Sugar 6.4.1) and I can filter so only documents which are assigned to a specific user show up when that user is in the documents module. I wanted to extend this logic a little further to set it up so that certain roles are unable to view all documents and other roles are unable to view documents which have an assigned category of Administrative. I understand that this line: $_REQUEST['assigned_user_id_advanced'] = $current_user->id; and the one for basic search seems to be what is filtering the results but I don't understand how it is doing it. Can anyone provide an information bridge as to either what this line is doing to filter the results or how I can implement what I stated above.

  10. #10
    andopes's Avatar
    andopes is offline A Sugar Hero | Help Forum Moderator
    Join Date
    Jul 2006
    Location
    São Paulo - Brazil
    Posts
    8,335

    Default Re: Hiding some documents from sales reps eyes

    Quote Originally Posted by sbankhead View Post
    Hoping to revive this thread to get a little more explanation. I was able to implement what andopes suggested (Using Sugar 6.4.1) and I can filter so only documents which are assigned to a specific user show up when that user is in the documents module. I wanted to extend this logic a little further to set it up so that certain roles are unable to view all documents and other roles are unable to view documents which have an assigned category of Administrative. I understand that this line: $_REQUEST['assigned_user_id_advanced'] = $current_user->id; and the one for basic search seems to be what is filtering the results but I don't understand how it is doing it. Can anyone provide an information bridge as to either what this line is doing to filter the results or how I can implement what I stated above.
    As far I understand you want to use Teams. Consider upgrading to PRO or install Security Suite.
    Some goods on PRO flavors are:
    • Teams;
    • Workflows;
    • Reports;
    • ACL Fields;



    Cheers
    André Lopes
    DevToolKit / Project of the Month - June 2009
    Lampada Global Services- Open Source Solutions
    Avenida Ipiranga, 318
    Bloco B - CJ 1602
    São Paulo, SP 01046-010
    Brazil
    Office: +55 11 3237-3110
    Mobile: +55 11 7636-5859
    e-mail: andre@lampadaglobal.com

    Lampada Global delivers offshore software development and support services to customers around the world.
    Lampada is proud to be a SugarCRM Gold Partner, revolutionizing Customer Relationship Management.

    I DO NOT answer questions through PM and Email. If you need some help post your question into SugarForum.

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Commission-based sales reps and affiliates
    By tigerincanada in forum Classifieds
    Replies: 10
    Last Post: 2011-10-25, 04:54 AM
  2. Simple Sugar for my Sales Reps
    By fisher318 in forum General Discussion
    Replies: 3
    Last Post: 2008-05-20, 11:15 AM
  3. Today's "Comments" from our sales group.
    By jjwdesign in forum Help
    Replies: 7
    Last Post: 2008-02-01, 09:02 AM
  4. Daily Sales Reports
    By MidNiteRaver in forum Feature Requests
    Replies: 1
    Last Post: 2006-09-08, 11:17 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
  •