Results 1 to 3 of 3

Thread: footer tpl for ListView

  1. #1
    ElGato is offline Member
    Join Date
    Nov 2009
    Posts
    10

    Default footer tpl for ListView

    Hi!

    I have standard Opportunities module. And I need to add 'total' line after "Opportunity List" table.
    This total line should show sum of all 'Amounts'.

    The question is: how to add custom html(php) below "Opportunity List" table (see attachment)?

    Thanks for any help.
    Attached Images Attached Images  

  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: footer tpl for ListView

    You need to do the following:

    Create the script custom/modules/Opportunities/CustomListViewSmarty.php containing the class CustomListViewSmarty which extends the default ListViewSmarty at include/ListView/ListViewSmarty.php
    Create a custom view list on Opportunities module (custom/modules/Opportunities/views/view.list.php);
    Implement the method "preDisplay", where you will set $this->lv as an instance of CustomListViewSmarty;
    Implement inside custom/modules/Opportunities/CustomListViewSmarty.php just one function "display" containing something like that:

    PHP Code:
        function display($end true) {
            
            if(!
    $this->should_process) return $GLOBALS['app_strings']['LBL_SEARCH_POPULATE_ONLY'];
            global 
    $app_strings;
            
            
    $this->ss->assign('data'$this->data['data']);
            
    $this->data['pageData']['offsets']['lastOffsetOnPage'] = $this->data['pageData']['offsets']['current'] + count($this->data['data']);
            
    $this->ss->assign('pageData'$this->data['pageData']);
            
            
    $navStrings = array('next' => $app_strings['LNK_LIST_NEXT'],
                                
    'previous' => $app_strings['LNK_LIST_PREVIOUS'],
                                
    'end' => $app_strings['LNK_LIST_END'],
                                
    'start' => $app_strings['LNK_LIST_START'],
                                
    'of' => $app_strings['LBL_LIST_OF']);
            
    $this->ss->assign('navStrings'$navStrings);
            
            
    $str parent::display();

            
    // CUSTOM FOOTER TPL
            
    $str.= $this->displayFooter();
            
            
    $strend $this->displayEnd();
            
            return 
    $str $this->ss->fetch($this->tpl) . (($end) ? '<br><br>' $strend '');
        } 
    Implement the function displayFooter() on this same script. This will definitely render the footer as you wish.

    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
    vbondoux is offline Sugar Community Member
    Join Date
    Feb 2007
    Posts
    50

    Default Re: footer tpl for ListView

    Hi andopes

    I would be very interesting if you can detail all the lines of insctructions.

    thank you

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. SugarCRM Footer
    By mittapallikiran in forum Developer Help
    Replies: 3
    Last Post: 2010-06-22, 09:13 AM
  2. Customizing Footer
    By nk2009 in forum Developer Help
    Replies: 1
    Last Post: 2010-01-10, 06:33 PM
  3. How to remove footer
    By ksk in forum Help
    Replies: 6
    Last Post: 2009-04-30, 12:07 PM
  4. Adding the text in footer
    By daviddavid in forum Help
    Replies: 3
    Last Post: 2008-02-05, 03:59 PM
  5. SugarCRM Listview Footer Layout
    By natster in forum General Discussion
    Replies: 1
    Last Post: 2006-01-04, 10:00 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
  •