Results 1 to 3 of 3

Thread: Documents - Assigned to

  1. #1
    roblaus's Avatar
    roblaus is offline Sugar Community Member
    Join Date
    Dec 2006
    Location
    Vienna / Austria
    Posts
    2,850

    Default Documents - Assigned to

    Is there a way of assigning documents (in the module documents) to somebody else except the creator? Apparently there is a function "after save" that changes the usual fields back to the creator no matter what you're doing.
    Asked differently - which field the role function is using in order to identify the owner in this case?

    Problem behind: certain docs (which must be in one place, not connected to other entities) must not be seen by certain users.

    Version is 5.1
    __________________________
    Robert Laussegger
    http://www.iscongroup.net

    Bei Fragen: support@iscon.at
    Die deutschen Sprachdateien für SugarCRM und das deutsche Handbuch gibt es hier: http://goo.gl/kPsAz
    Ab sofort auch mit 6.4.2

  2. #2
    roblaus's Avatar
    roblaus is offline Sugar Community Member
    Join Date
    Dec 2006
    Location
    Vienna / Austria
    Posts
    2,850

    Default Re: Documents - Assigned to

    anyone? Or nobody is using documents?
    __________________________
    Robert Laussegger
    http://www.iscongroup.net

    Bei Fragen: support@iscon.at
    Die deutschen Sprachdateien für SugarCRM und das deutsche Handbuch gibt es hier: http://goo.gl/kPsAz
    Ab sofort auch mit 6.4.2

  3. #3
    yhercouet is offline Sugar Community Member
    Join Date
    Nov 2009
    Location
    Shanghai China
    Posts
    33

    Default Re: Documents - Assigned to

    Hi Roblaus,


    I guess my answer is too late but it might help somebody else.


    It is possible to add the field "Assigned to" to the Documents module doing this modification:


    Just create a php file named "vardefs.ext.php" at this location :

    custom\Extension\modules\Documents\Ext\Vardefs\var defs.ext.php


    And add the following code inside :

    PHP Code:
    <?php

    $dictionary
    ['Document']['fields']['assigned_user_id']['name'] = 'assigned_user_id'
    $dictionary['Document']['fields']['assigned_user_id']['rname'] = 'user_name';
    $dictionary['Document']['fields']['assigned_user_id']['id_name'] = 'assigned_user_id';
    $dictionary['Document']['fields']['assigned_user_id']['type'] = 'assigned_user_name';
    $dictionary['Document']['fields']['assigned_user_id']['vname'] = 'LBL_ASSIGNED_USER_ID';
    $dictionary['Document']['fields']['assigned_user_id']['required'] = false;
    $dictionary['Document']['fields']['assigned_user_id']['dbType'] = 'id';
    $dictionary['Document']['fields']['assigned_user_id']['table'] = 'users';
    $dictionary['Document']['fields']['assigned_user_id']['isnull'] = false;
    $dictionary['Document']['fields']['assigned_user_id']['reportable'] = true;


    $dictionary['Document']['fields']['assigned_user_name']['name'] = 'assigned_user_name'
    $dictionary['Document']['fields']['assigned_user_name']['id_name'] = 'assigned_user_id';
    $dictionary['Document']['fields']['assigned_user_name']['vname'] = 'LBL_ASSIGNED_USER_NAME';
    $dictionary['Document']['fields']['assigned_user_name']['type'] = 'relate';
    $dictionary['Document']['fields']['assigned_user_name']['table'] = 'users';
    $dictionary['Document']['fields']['assigned_user_name']['module'] = 'Users';
    $dictionary['Document']['fields']['assigned_user_name']['source'] = 'non-db';



    $dictionary['Document']['fields']['assigned_user_link']['name'] = 'assigned_user_link'
    $dictionary['Document']['fields']['assigned_user_link']['type'] = 'link';
    $dictionary['Document']['fields']['assigned_user_link']['relationship'] = 'notes_assigned_user';
    $dictionary['Document']['fields']['assigned_user_link']['vname'] = 'LBL_ASSIGNED_TO_USER';
    $dictionary['Document']['fields']['assigned_user_link']['link_type'] = 'one';
    $dictionary['Document']['fields']['assigned_user_link']['module'] = 'Users';
    $dictionary['Document']['fields']['assigned_user_link']['bean_name'] = 'User';
    $dictionary['Document']['fields']['assigned_user_link']['source'] = 'non-db';
    $dictionary['Document']['fields']['assigned_user_link']['rname'] = 'user_name';
    $dictionary['Document']['fields']['assigned_user_link']['id_name'] = 'assigned_user_id';
    $dictionary['Document']['fields']['assigned_user_link']['table'] = 'users';
    $dictionary['Document']['fields']['assigned_user_link']['duplicate_merge'] = 'enabled';



    $dictionary['Document']['relationships']['leads_assigned_user']['lhs_module'] = 'Users';
    $dictionary['Document']['relationships']['leads_assigned_user']['lhs_table'] = 'users';
    $dictionary['Document']['relationships']['leads_assigned_user']['lhs_key'] = 'id';
    $dictionary['Document']['relationships']['leads_assigned_user']['rhs_module'] = 'Documents';
    $dictionary['Document']['relationships']['leads_assigned_user']['rhs_table'] = 'documents';
    $dictionary['Document']['relationships']['leads_assigned_user']['rhs_key'] = 'assigned_user_id';
    $dictionary['Document']['relationships']['leads_assigned_user']['relationship_type'] = 'one-to-many';
      
    ?>


    Then go to the admin panel and do the following:

    Repair --> Rebuild Extensions

    Repair --> Quick Repair and Rebuild

    IMPORTANT: do not forget to execute the SQL request during the Quick Repair and Rebuild




    Then the new field assigned_to should be available in Studio for the module Documents.

    You can then easily change the label and place the field on the different layouts.


    This modification can also be done the same way with the Notes as you can see here:

    http://www.sugarcrm.com/forums/showt...768#post219768


    Hope this helps!

    Yoann

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 4
    Last Post: 2008-08-22, 11:30 PM
  2. Documents to Email, Documents to Fax #
    By jasonmahon in forum Feature Requests
    Replies: 2
    Last Post: 2006-03-08, 02:03 AM
  3. Replies: 0
    Last Post: 2005-12-19, 09:38 PM
  4. Replies: 2
    Last Post: 2005-11-24, 08:42 AM

Tags for this Thread

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
  •