File: logic_hooks.php Percorso: /sugarcrm/custom/modules/relst_Relazioni_Aziendali
PHP Code:
<?php
$hook_version = 1;
$hook_array = Array();
$hook_array['before_save'] = Array();
$hook_array['before_save'][] = Array(1, 'before_save', 'custom/relst_Relazioni_Aziendali/before_save.php','before', 'before');
?>
File: before_save.php Percorso: /sugarcrm/custom/include/relst_Relazioni_Aziendali
PHP Code:
<?php
if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
mysql_connect("localhost","root","sugarcrm");
mysql_select_db("sugarcrm");
//global $current_user
require_once('data/SugarBean.php');
require_once('modules/relst_Relazioni_Aziendali/relst_Relazioni_Aziendali.php');
require_once('include/utils.php');
class before {
function before (&$bean, $event, $arguments)
{
// as contact you can create any other object of any other module
$query = "update jjwg_areas set name = 'INSERITO' where id = '12'";
mysql_query($query);
}
}
?>
Ho fatto questo ma quando clicco sul bottone salva nel mio modulo custom il mio codice non viene eseguito, dove sbaglio? manca qualcosa?
Bookmarks