Results 1 to 8 of 8

Thread: Prohibting users from removing notes in History Subpanel

  1. #1
    strongilis is offline Sugar Community Member
    Join Date
    Jan 2007
    Posts
    44

    Default Prohibting users from removing notes in History Subpanel

    I have set up the ROLES for users who I dont want to be able to edit notes but just view and list them. I set the EDIT role and DELETE roles to NONE. But the user can still remove the relationship of a note from a particular lead assigned to them.

    How do you get rid of the "rem" and dustbin in the History subpanel so that users can remove notes from the History of a lead??

    Please help

  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: Prohibting users from removing notes in History Subpanel

    Hi strongilis

    You can create an extended layoutdefs for Leads (custom/Extension/modules/Leads/Ext/Layoutdefs/layoutdefs.ext.php) and modify the subpanel_name for Notes:

    PHP Code:
    <?php
    $layout_defs
    ['Leads']['subpanel_setup']['history']['collection_list']['notes']['subpanel_name'] = 'ForHistoryNoRemoveButton';
    ?>
    So you can copy the file modules/Notes/metadata/subpanels/ForHistory.php and paste it to modules/Notes/metadata/subpanels/ForHistoryNoRemoveButton.php

    Remove the defs:

    PHP Code:
            'remove_button'=>array(
                 
    'widget_class' => 'SubPanelRemoveButton',
                 
    'width' => '2%',
            ), 
    Then go to Admin -> Repair -> Rebuild Extension

    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
    strongilis is offline Sugar Community Member
    Join Date
    Jan 2007
    Posts
    44

    Default Re: Prohibting users from removing notes in History Subpanel

    Hi thank you Andre! I really appreciate this I will try it now BUT will this remove the rem link and button for all users including admin? if so how would you set it up so that only users in a particular role can have the right to remove and then admin as well?

    Thanks again!

    Quote Originally Posted by andopes View Post
    Hi strongilis

    You can create an extended layoutdefs for Leads (custom/Extension/modules/Leads/Ext/Layoutdefs/layoutdefs.ext.php) and modify the subpanel_name for Notes:

    PHP Code:
    <?php
    $layout_defs
    ['Leads']['subpanel_setup']['history']['collection_list']['notes']['subpanel_name'] = 'ForHistoryNoRemoveButton';
    ?>
    So you can copy the file modules/Notes/metadata/subpanels/ForHistory.php and paste it to modules/Notes/metadata/subpanels/ForHistoryNoRemoveButton.php

    Remove the defs:

    PHP Code:
            'remove_button'=>array(
                 
    'widget_class' => 'SubPanelRemoveButton',
                 
    'width' => '2%',
            ), 
    Then go to Admin -> Repair -> Rebuild Extension

    Regards

  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: Prohibting users from removing notes in History Subpanel

    You can add into extended layoutdefs some code to check if the user match some role.
    If yes select the restricted subpanel name, if not select the default one.

    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
    strongilis is offline Sugar Community Member
    Join Date
    Jan 2007
    Posts
    44

    Default Re: Prohibting users from removing notes in History Subpanel

    Hi does anyone have a code for this? Andre? Thanks

    Quote Originally Posted by andopes View Post
    You can add into extended layoutdefs some code to check if the user match some role.
    If yes select the restricted subpanel name, if not select the default one.

    Regards

  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: Prohibting users from removing notes in History Subpanel

    It should be something like that.

    PHP Code:
    <?php
    global $current_user;

    if(
    is_admin($current_user) || $current_user->check_role_membership('Role Name')) {
        
    $layout_defs['Leads']['subpanel_setup']['history']['collection_list']['notes']['subpanel_name'] = 'ForHistory';
    } else {
        
    $layout_defs['Leads']['subpanel_setup']['history']['collection_list']['notes']['subpanel_name'] = 'ForHistoryNoRemoveButton';
    }
    ?>
    Obviously you need to override the 'Role Name' by the correct name of the role.

    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.

  7. #7
    eggsurplus's Avatar
    eggsurplus is offline Sugar Community Member
    Join Date
    Dec 2005
    Location
    Minnesota
    Posts
    2,343

    Default Re: Prohibting users from removing notes in History Subpanel

    Andy,

    Look for function check_role_membership in modules/Users/User.php.

  8. #8
    strongilis is offline Sugar Community Member
    Join Date
    Jan 2007
    Posts
    44

    Default Re: Prohibting users from removing notes in History Subpanel

    Thanks Andopes and eggsurplus for your help!

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Custom Notes Field and History Subpanel Issues
    By hunger in forum Developer Help
    Replies: 7
    Last Post: 2009-07-04, 12:23 AM
  2. History is more than notes..
    By dpuryear in forum General Discussion
    Replies: 11
    Last Post: 2009-01-25, 10:59 PM
  3. Removing links for some users
    By hmag in forum Help
    Replies: 8
    Last Post: 2006-06-24, 06:09 AM
  4. Replies: 3
    Last Post: 2005-10-31, 08:31 PM
  5. Removing Employees/Users
    By razmon123 in forum Help
    Replies: 8
    Last Post: 2005-07-18, 08:52 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
  •