Results 1 to 9 of 9

Thread: Adding Phone Number on Calls - View Details

  1. #1
    tanhaa is offline Sugar Community Member
    Join Date
    Jul 2006
    Posts
    38

    Default Adding Phone Number on Calls - View Details

    Hey guys, I'm not a programmer, but I do understand the code when i look at it... i have been looking at the files and I saw that in call.php, a new function that lets the phone_work be available as well along with the parent_name and parent_id might do the trick, but I'm not sure how to do it.

    This is what I was looking to do:

    when a call is clicked on, the detail view doesn't show the phone number to be called and the need to click on the lead/contact/account name arises to get the phone number. I just wanted to be able to show the parent phone number related to that particular call to show there.

    Can someone help me figure out how and what to do? I am assuming, a function that lets the parent_phone_work variable be available in the array of variables available might do the job and at that point, I could simply use the field layout editor and add the phone_work on the detail view page.

    I'm assuming the files to be edited would be:

    call.php (a new function needed here perhaps?)
    fields_array.php
    detail_view.php
    detail_view.html

    Thanks in advance to all the Sugarcrm gurus out there


    Amit Malhotra
    p.s.
    using sugarcrm v4.2.1a
    MySQL - 4.1.18
    Apache 2.0.55
    php 4.4.3
    windows XP environment
    Last edited by tanhaa; 2006-09-22 at 03:31 PM.

  2. #2
    tanhaa is offline Sugar Community Member
    Join Date
    Jul 2006
    Posts
    38

    Default Re: Adding Phone Number on Calls - View Details

    Any comments on this one folks?

    bumping the post to top so that people can have a look at it

    Amit Malhotra

  3. #3
    ruchida's Avatar
    ruchida is offline A Sugar Hero | Help Forum Moderator
    Join Date
    Feb 2005
    Location
    Japan
    Posts
    1,375

    Default Re: Adding Phone Number on Calls - View Details

    Hi

    Add following codes in somewhere (around 115) in DetailView.php.
    PHP Code:
    $xtpl->assign("CONTACT_PHONE",$focus->contact_phone); 
    then add following html codes to display the contact_phone field in DetailView.html.
    PHP Code:
        <td  class="tabDetailViewDL"><slot>{MOD.LBL_DURATION}</slot></td>
        <
    td  class="tabDetailViewDF" valign="top"><slot>{DURATION_HOURS}{MOD.LBL_HOURS_ABBREV} {DURATION_MINUTES}{MOD.LBL_MINSS_ABBREV}&nbsp;</slot></td>
        <
    td  class="tabDetailViewDL"><slot>{MOD.LBL_PHONE}</slot></td>
        <
    td  class="tabDetailViewDF"><slot>{CONTACT_PHONE}&nbsp;</slot></td
    You may need to remove following lines to make the dialog clean.
    PHP Code:
    <!-- BEGINopen_source -->
        <
    td class="tabDetailViewDL"><slot>&nbsp;</slot></td>
        <
    td class="tabDetailViewDF"><slot>&nbsp;</slot></td>
        <!-- 
    ENDopen_source --> 
    Ryuhei Uchida
    Help Forum Moderator
    Calendar 2.0
    http://blogs.itmedia.co.jp/ruchida/

  4. #4
    tanhaa is offline Sugar Community Member
    Join Date
    Jul 2006
    Posts
    38

    Default Re: Adding Phone Number on Calls - View Details

    Hi Ruchida,

    Thank you so much for your help. This worked great.

    Often, the calls can be scheduled on Accounts or Leads as well, not only contacts, I noticed that the phone number field obviously stays blank when it comes to a call-back scheduled on a lead.

    Thank you though for all your help, it worked like a charm when it came to calls associated with contacts.

    Regards,

    Amit Malhotra

  5. #5
    ruchida's Avatar
    ruchida is offline A Sugar Hero | Help Forum Moderator
    Join Date
    Feb 2005
    Location
    Japan
    Posts
    1,375

    Default Re: Adding Phone Number on Calls - View Details

    Hi,
    To display a phone number for a lead, you need to modify Call.php slightly.
    First, you need to change the query at around #362 in fill_in_additional_parent_fields()
    PHP Code:
            if ($this->parent_type == "Leads" || $this->parent_type == "Contacts") {
    //            $query = "SELECT first_name, last_name, assigned_user_id parent_name_owner from $parent->table_name where id = '$this->parent_id'";
                
    $query "SELECT first_name, last_name, phone_work, assigned_user_id parent_name_owner from $parent->table_name where id = '$this->parent_id'";
            } 
    then insert the following line at around #389 in the same function.
    PHP Code:
            $this->parent_name '';
                if (
    $row['first_name'] != ''$this->parent_name .= stripslashes($row['first_name']). ' ';
                if (
    $row['last_name'] != ''$this->parent_name .= stripslashes($row['last_name']);
    //Add phone_work
                
    if ($row['phone_work'] != ''$this->contact_phone $row['phone_work'];
    //END 
    Ryuhei Uchida
    Help Forum Moderator
    Calendar 2.0
    http://blogs.itmedia.co.jp/ruchida/

  6. #6
    tanhaa is offline Sugar Community Member
    Join Date
    Jul 2006
    Posts
    38

    Default Re: Adding Phone Number on Calls - View Details

    Thank you Ruchida. The code changes worked and now I can see the phone numbers even for the calls scheduled for leads.


    Thanks a lot for all your assistance.


    Regards,


    Amit Malhotra

  7. #7
    enyartd is offline Sugar Community Member
    Join Date
    Sep 2006
    Posts
    14

    Default Re: Adding Phone Number on Calls - View Details

    I also am trying to make the same mods to my Version 4.5.0f (Build 1202) sugar but I do not get any data showing up on the calls tab in the phone section.
    any suggestions?
    thanx

  8. #8
    jimmyremax is offline Junior Member
    Join Date
    Oct 2006
    Posts
    2

    Default Re: Adding Phone Number on Calls - View Details

    Hello,

    I am using 4.5b.

    I've tried the modifications that you have showed above and had no luck.

    Could anything have changed in the new version?

    Thanks in advance.

  9. #9
    jagjit is offline Sugar Community Member
    Join Date
    Nov 2011
    Posts
    51

    Default Re: Adding Phone Number on Calls - View Details

    Hi Ruchida

    Can u pls help me in which folder this file exists . I am using C.E 6.3

    Thanx

Thread Information

Users Browsing this Thread

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

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
  •