CRM Open Source Business & Social CRM Software

Results 1 to 3 of 3

Thread: How to: AJAX-driven menu

  1. #1
    Superman's Avatar
    Superman is offline Sugar Community Member
    Join Date
    Oct 2005
    Location
    Kazakhstan
    Posts
    829

    Cool How to: AJAX-driven menu

    Hello!

    First, this is almost commercial of SuperTimesheet but still it is "howto"

    Paid version of SuperTimesheet module now contain AJAX-driven menu.
    It means that when after a module has been loaded and then you click on any item from Shortcuts, the ajax call is being initiated and returned HTML-result will be shown in main region without reloading current page.

    You need to create Menu.php under module dir (modules/{module}/) with such contents:
    PHP Code:
    <?php
    if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
    global 
    $mod_strings$app_strings$current_user;

    if(
    ACLController::checkAccess('Timesheet''list'true)) 
      
    $module_menu[] = array("index.php?module=Timesheet&action=ListView&return_module=Timesheet&return_action=DetailView\" onclick=\"var ajax=new SUGAR.ajaxStatusClass; ajax.showStatus('".$app_strings['LBL_LOADING_PAGE']."');var obj=YAHOO.util.Connect.asyncRequest('GET', 'index.php?module=Timesheet&action=ListView&return_module=Timesheet&return_action=DetailView&sugar_body_only=true&to_pdf=true', {success:function(o){if(o.status > 0){document.getElementById('main').innerHTML=o.responseText; ajax.hideStatus();}}, failure: function(o){}}, null); return false\""$mod_strings['LNK_TIMESHEET_LIST'],"TimesheetList");
    ...
    Free SuperTimesheet module v.2.0 has this feature (download http://www.sugarforge.org/frs/downlo...sheet.v2.0.zip)
    Last edited by Superman; 2008-11-29 at 11:12 AM.
    Farkhad Rakhimzhanov
    E-mail: farkhad@gmail.com
    Skype: rakikama

    SuperTimesheet and Invoicing — timesheet tool with invoicing for SugarCRM.
    Book time against Cases, Project Tasks and Projects.
    Create invoice regarding booked time, print it in PDF or HTML,
    customize template as you like.

  2. #2
    Superman's Avatar
    Superman is offline Sugar Community Member
    Join Date
    Oct 2005
    Location
    Kazakhstan
    Posts
    829

    Default Re: How to: AJAX-driven menu

    Also, it seems like the speed of screen loading is increased...
    Farkhad Rakhimzhanov
    E-mail: farkhad@gmail.com
    Skype: rakikama

    SuperTimesheet and Invoicing — timesheet tool with invoicing for SugarCRM.
    Book time against Cases, Project Tasks and Projects.
    Create invoice regarding booked time, print it in PDF or HTML,
    customize template as you like.

  3. #3
    Superman's Avatar
    Superman is offline Sugar Community Member
    Join Date
    Oct 2005
    Location
    Kazakhstan
    Posts
    829

    Default Re: How to: AJAX-driven menu

    Well, the solution seems to be like a prototype and not realistic, because if loaded page has javascript, it would not work.
    Farkhad Rakhimzhanov
    E-mail: farkhad@gmail.com
    Skype: rakikama

    SuperTimesheet and Invoicing — timesheet tool with invoicing for SugarCRM.
    Book time against Cases, Project Tasks and Projects.
    Create invoice regarding booked time, print it in PDF or HTML,
    customize template as you like.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 8
    Last Post: 2009-11-27, 09:06 PM
  2. HOWTO - Enhance modulebuilder - Create AJAX enables modules/subpanels
    By kenneth.thorman in forum Developer Tutorials
    Replies: 1
    Last Post: 2008-06-09, 08:13 PM
  3. Help Implementing AJAX
    By simbawoomba in forum Help
    Replies: 0
    Last Post: 2007-01-22, 11:18 AM
  4. Removing Shortcut Panels under Shortcuts menu
    By Echoreef in forum Developer Help
    Replies: 1
    Last Post: 2006-08-21, 06:26 AM

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
  •