Skip to content

Instantly share code, notes, and snippets.

@bjhaid
Created August 22, 2011 09:36
Show Gist options
  • Save bjhaid/1162022 to your computer and use it in GitHub Desktop.
Save bjhaid/1162022 to your computer and use it in GitHub Desktop.
<?php
if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
class Pushjavascript{
function attach_javascript(&$bean, $event, $arguments){
global $current_user;
global $sugar_config;
if(empty($_REQUEST["to_pdf"]) && $_REQUEST["action"]!= 'modulelistmenu' &&
$_REQUEST['action']!='DynamicAction' && empty($_REQUEST['sugar_body_only']) && $_REQUEST['action'] != 'EditView'){
$url = $sugar_config['vascti_host'];
echo "<script type='text/javascript' src=\"http://$url:9292/faye.js\"></script>";
echo "<script type='text/javascript' src='jquery/test.js'></script>";
echo "<div style='display:none' id='agentExten'>$current_user->ext_number</div>";
}
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment