Results 1 to 3 of 3

Thread: Add username to Case module notes?

  1. #1
    adampebt is offline Member
    Join Date
    Jul 2008
    Posts
    9

    Default Add username to Case module notes?

    Hi All, i'm pretty new to sugar/php and am hoping somone can help me. I am trying to show the name of a user that created the note for the case, this is in the subpanel below the case details. I can't see any options in the studio for this subpanel.
    Thanks
    Adam

  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: Add username to Case module notes?

    Hi Adam

    Notes module does not contain the field assigned_user, but this field is displayed into all History modules.
    So if you take a look at the file modules/Notes/metadata/subpanels/ForHistory.php will will see the 'force_exists' attribute for the fields assigned_user_name, assigned_user_owner and assigned_user_mod.
    You need to modify the field assigned_use_name into ForHistory.php.
    Replace it by

    PHP Code:
    'created_by_name' => array(
      
    'alias' => 'assigned_user_name',
    ), 
    Perhaps there are something else you need to do to accomplish that, but this is a good kick off.

    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
    adampebt is offline Member
    Join Date
    Jul 2008
    Posts
    9

    Default Re: Add username to Case module notes?

    Hi André,
    Thanks for the response, i'm having a problem with this code, i've replaced the assigned_user_name parameter, but I get the error below. Is this file related back to the Vardefs.php for the notes module? I've tried to backtrack on the "data_modfied" parameter to see how this works, but i don't understand the relationship between these two files and the database lookup where it references the user id to the actual name.

    Error retrieving Case list: Query Failed: ( SELECT meetings.id , meetings.name , meetings.status , ' ' contact_name , ' ' contact_id , ' ' contact_name_owner , ' ' contact_name_mod , meetings.date_modified , jt1.user_name assigned_user_name , jt1.created_by assigned_user_name_owner , 'Users' assigned_user_name_mod, ' ' filename , meetings.assigned_user_id , 'meetings' panel_name FROM meetings LEFT JOIN users jt1 ON jt1.id= meetings.assigned_user_id AND jt1.deleted=0 AND jt1.deleted=0 where ( meetings.parent_id= '6dc0d5b8-0df3-229a-0af9-4933f9c7f4ee' AND meetings.parent_type='Cases' AND meetings.deleted=0 AND (meetings.status='Held' OR meetings.status='Not Held')) AND meetings.deleted=0 ) UNION ALL ( SELECT tasks.id , tasks.name , tasks.status , CONCAT(IFNULL(contacts.first_name,''),' ',IFNULL(contacts.last_name,'')) contact_name , tasks.contact_id , contacts.assigned_user_id contact_name_owner , 'Contacts' contact_name_mod, tasks.date_modified , jt1.user_name assigned_user_name , jt1.created_by assigned_user_name_owner , 'Users' assigned_user_name_mod, ' ' filename , tasks.assigned_user_id , 'tasks' panel_name FROM tasks LEFT JOIN contacts contacts ON contacts.id= tasks.contact_id AND contacts.deleted=0 AND contacts.deleted=0 LEFT JOIN users jt1 ON jt1.id= tasks.assigned_user_id AND jt1.deleted=0 AND jt1.deleted=0 where ( tasks.parent_id= '6dc0d5b8-0df3-229a-0af9-4933f9c7f4ee' AND tasks.parent_type='Cases' AND tasks.deleted=0 AND (tasks.status='Completed' OR tasks.status='Deferred')) AND tasks.deleted=0 ) UNION ALL ( SELECT calls.id , calls.name , calls.status , ' ' contact_name , ' ' contact_id , ' ' contact_name_owner , ' ' contact_name_mod , calls.date_modified , jt1.user_name assigned_user_name , jt1.created_by assigned_user_name_owner , 'Users' assigned_user_name_mod, ' ' filename , calls.assigned_user_id , 'calls' panel_name FROM calls LEFT JOIN users jt1 ON jt1.id= calls.assigned_user_id AND jt1.deleted=0 AND jt1.deleted=0 where ( calls.parent_id= '6dc0d5b8-0df3-229a-0af9-4933f9c7f4ee' AND calls.parent_type='Cases' AND calls.deleted=0 AND (calls.status='Held' OR calls.status='Not Held')) AND calls.deleted=0 ) UNION ALL ( 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 , jt1.user_name created_by_name , jt1.created_by created_by_name_owner , 'Users' created_by_name_mod, ' ' assigned_user_owner , ' ' assigned_user_mod , notes.filename , notes.created_by , 'notes' panel_name FROM notes LEFT JOIN contacts contacts ON contacts.id= notes.contact_id AND contacts.deleted=0 AND contacts.deleted=0 LEFT JOIN users jt1 ON jt1.id= notes.created_by AND jt1.deleted=0 AND jt1.deleted=0 where ( notes.parent_id= '6dc0d5b8-0df3-229a-0af9-4933f9c7f4ee' AND notes.parent_type='Cases' AND notes.deleted=0) AND notes.deleted=0 ) UNION ALL ( SELECT emails.id , emails.name , emails.status , ' ' contact_name , ' ' contact_id , ' ' contact_name_owner , ' ' contact_name_mod , emails.date_modified , jt0.user_name assigned_user_name , jt0.created_by assigned_user_name_owner , 'Users' assigned_user_name_mod, ' ' filename , emails.assigned_user_id , 'emails' panel_name FROM emails LEFT JOIN users jt0 ON jt0.id= emails.assigned_user_id AND jt0.deleted=0 AND jt0.deleted=0 INNER JOIN emails_beans ON (emails.id=emails_beans.email_id AND emails_beans.bean_id= '6dc0d5b8-0df3-229a-0af9-4933f9c7f4ee' AND bean_module='Cases') where ( emails_beans.deleted=0 AND emails.deleted=0) AND emails.deleted=0 ) ORDER BY date_modified desc LIMIT 0,10::MySQL error 1222: The used SELECT statements have a different number of columns

    Thanks again.
    Adam

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 15
    Last Post: 2010-04-01, 04:04 PM
  2. Replies: 4
    Last Post: 2009-12-08, 08:00 PM
  3. Replies: 5
    Last Post: 2009-07-16, 04:26 AM
  4. Add a field in Case module
    By genius786 in forum Developer Help
    Replies: 1
    Last Post: 2008-11-11, 09:07 AM
  5. Replies: 1
    Last Post: 2006-09-11, 03:38 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
  •