Results 1 to 5 of 5

Thread: Private messages

  1. #1
    toncho11 is offline Member
    Join Date
    Jun 2009
    Posts
    8

    Question Private messages

    Can a SugarCRM user add notes in "History" to an account that are only visible to him?

    Sometimes you just do not need to know everything the other users of SugarCRM are thinking.

    Cheers,
    Toncho

  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: Private messages

    It is possible and upgrade safe, but you will face a lots of work to accomplish that because an user can create a note directly through links at activities modules.
    The easier strategy is to remove the "Create Note" link from all activities modules and allow users creating Notes only through subpanel under the Account.
    Configure a role where user will be able to access only accounts assigned to him and add into this role the users.

    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.

  3. #3
    letrium is offline Sugar Community Member
    Join Date
    Dec 2008
    Posts
    614

    Default Re: Private messages

    It's possible to develop. I tried to do it 'upgrade-safe' but faced with problems.
    I suggest next solution:

    In file modules/Accounts/metadata/subpaneldefs.php find this part:
    PHP Code:
                    'notes' => array(
                        
    'module' => 'Notes',
                        
    'subpanel_name' => 'ForHistory',
                        
    'get_subpanel_data' => 'notes',
                    ), 
    and change to

    PHP Code:
                    'notes' => array(
                        
    'module' => 'Notes',
                        
    'subpanel_name' => 'ForHistory',
                        
    'get_subpanel_data' => 'function:notes'
                        
    'generate_select'=>true,                    
                    ), 
    In the file modules/Accounts/Account.php add function named "notes", this function should return array of parts of query that selects notes for subpanel in Account module.
    E.g. your function will looks like this:
    PHP Code:
        function notes(){
            global 
    $current_user;  
            
    $return_array['select'] = "SELECT notes.id , notes.name , ' ' status , CONCAT(IFNULL(contacts.first_name,''),' ',IFNULL(contacts.last_name,'')) contact_name , notes.contact_id , contacts.assigned_user_id contact_name_owner , 'Contacts' contact_name_mod, notes.date_modified , ' ' assigned_user_name , ' ' assigned_user_owner , ' ' assigned_user_mod , notes.filename , notes.created_by ";;
            
    $return_array['from']= " FROM notes LEFT JOIN contacts contacts ON contacts.id= notes.contact_id AND contacts.deleted=0 ";
            
    $return_array['where'] = " WHERE notes.parent_id = '$this->id' AND notes.parent_type = 'Accounts' ";
            
    $return_array['join'] = "";
            
    $return_array['join_tables'][0] = '';

         if(!
    $current_user->is_admin){
                
    $return_array['join'] .=     "....."// your condition
           
    }
            return 
    $return_array;   
        } 

    Feel free to contact us if you need any help.
    Last edited by letrium; 2009-07-01 at 09:11 AM.

  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: Private messages

    According to Letrium suggestion you can create a custom controller for Accounts (custom/modules/Accounts/controller.php), implement the method action_detailview and override the $this->bean inside this method.
    The new value should be an object of a new class which extends Account and implement the method notes.

    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.

  5. #5
    letrium is offline Sugar Community Member
    Join Date
    Dec 2008
    Posts
    614

    Default Re: Private messages

    Quote Originally Posted by andopes View Post
    According to Letrium suggestion you can create a custom controller for Accounts (custom/modules/Accounts/controller.php), implement the method action_detailview and override the $this->bean inside this method.
    The new value should be an object of a new class which extends Account and implement the method notes.

    Cheers
    I tried this. but it doesn't work correct. (problems was with ajax actions)

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 2
    Last Post: 2009-03-03, 09:33 PM
  2. Replies: 0
    Last Post: 2009-01-27, 07:48 AM
  3. Private Accounts
    By juliebee in forum Help
    Replies: 1
    Last Post: 2008-05-07, 04:12 PM
  4. Private emails
    By bjchudson in forum Help
    Replies: 0
    Last Post: 2007-05-04, 01:41 PM
  5. Private Elements
    By telenieko in forum Help
    Replies: 3
    Last Post: 2005-12-21, 01:32 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
  •