Hi
I want to include a .php file and a .js file into the whole suiteCRM. What is the best practice? Where to copy the source and in which file to include them?
Hi
I want to include a .php file and a .js file into the whole suiteCRM. What is the best practice? Where to copy the source and in which file to include them?
It would depend on what you want those files to do? You could look into adding a custom Entry point but you really need to give more information.
I need to use Hijri date. Actually I want to use this: https://github.com/sallar/jDateTime
jDateTime is a PHP class to convert dates from Gregorian calendar system to Jalali calendar system and vice versa. Supports dates beyond 2038.
Jalali, also known as Shamsi or Hijri Shamsi is the Iranian calendar system.
Hi,
Like so
custom/modules/logic_hook.php
<?php
$hook_version = 1;
$hook_array = Array();
$hook_array['after_ui_frame'] = Array();
$hook_array['after_ui_frame'][] = array(
1, //Hook version
'Adds cisco javascript to page to enable Click To Dial/Logging.', //Label
'custom/include/click2calls/ciscoJS.php', //Include file
'ciscoJS', //Class
'echoCiscoJS' //Method
);
?>
And the files ciscoJS.php :
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
class ciscoJS{
function echoCiscoJS($event,$arguments){
global $sugar_config;
if( (!isset($_REQUEST['sugar_body_only']) || $_REQUEST['sugar_body_only']!=true) && $_REQUEST['action']!='modulelistmenu' && $_REQUEST['action']!='Popup' && empty($_REQUEST['to_pdf']) && ( !empty($_REQUEST['module']) && $_REQUEST['module']!='ModuleBuilder') && empty($_REQUEST['to_csv'])){
echo '<link rel="stylesheet" type="text/css" media="all" href="custom/include/click2calls/cisco.css">';
echo '<script> userExt = ' . $userExt . ';</script>';
echo '<script type="text/javascript" src="custom/include/click2calls/dialout.js"></script>';
}
}
}
?>
I didnât understand. You just gave me a file name and bunch of codes. Would you please elaborate?
Is this for every date in the entire system or only certain dates in some modules?
He just showed you how to create an after_ui_frame logic hook for a custom module. Although I am not 100% sure what Item is trying to tell you.
More information here:
Module logichooks:
It is for every date in the entire system. In order to use it in Persian language, along with translation and RTL direction in CSS we need Hijri date. So the entire system.
Unless you are willing to do it on the fly,such as implement logic hooks that convert dates on page load etc which would probably slow the system down then I think to do it properly would be a big job involving a lot of changes to core files and you would likely run into many many bugs and issues. In fact i wouldnât even want to contemplate doing that sorry :unsure: That is a job for a professional coding outfit.
Hi,
The question is : âHow to include a .php and a .js file to whole project?â
Then i give code for this.
This is not for custom module, look the path of the first file : custom/modules/logic_hook.php => global logic_hook
The code in this file (see above) execute on all module this file : âcustom/include/click2calls/ciscoJS.phpâ, //Include file
The content of this file is (see above)
Then, i respond at the question âHow to include a .php and a .js file to whole project?â âJS; PHP;CSSâ
My code do a click2call, all Phone field (mobile, office; alternate, etc) on all module and custom module become clickable and do a SIP request to a PBX.
Regards
Do you know anyone who is willing to?
Désolé, je ne comprends pas.
Mais si vous avez un conseil pour aider la communauté, je suis preneur.
Comment ajouter un bouton close dans les tickets ?
Would you please reply in English?
Yes i can do :
i am sorry, i dont understand.
But if you have a advice to the community, i will take it,
How add a close buton for case.