add visibility

This commit is contained in:
Frédéric FRANCE 2019-02-26 23:15:28 +01:00
parent 8b4e920d5e
commit d608921f1e
No known key found for this signature in database
GPG Key ID: 06809324E4B2ABC1
10 changed files with 378 additions and 379 deletions

View File

@ -82,7 +82,7 @@ class Fiscalyear extends CommonObject
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
*/ */
function __construct(DoliDB $db) public function __construct(DoliDB $db)
{ {
global $langs; global $langs;
@ -98,7 +98,7 @@ class Fiscalyear extends CommonObject
* @param User $user User making creation * @param User $user User making creation
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function create($user) public function create($user)
{ {
global $conf; global $conf;
@ -159,7 +159,7 @@ class Fiscalyear extends CommonObject
* @param User $user User making update * @param User $user User making update
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function update($user) public function update($user)
{ {
global $langs; global $langs;
@ -203,7 +203,7 @@ class Fiscalyear extends CommonObject
* @param int $id Id of record to load * @param int $id Id of record to load
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function fetch($id) public function fetch($id)
{ {
$sql = "SELECT rowid, label, date_start, date_end, statut"; $sql = "SELECT rowid, label, date_start, date_end, statut";
$sql.= " FROM ".MAIN_DB_PREFIX."accounting_fiscalyear"; $sql.= " FROM ".MAIN_DB_PREFIX."accounting_fiscalyear";
@ -237,7 +237,7 @@ class Fiscalyear extends CommonObject
* @param int $id Id of record to delete * @param int $id Id of record to delete
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function delete($id) public function delete($id)
{ {
$this->db->begin(); $this->db->begin();
@ -264,12 +264,12 @@ class Fiscalyear extends CommonObject
* @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto
* @return string Label * @return string Label
*/ */
function getLibStatut($mode = 0) public function getLibStatut($mode = 0)
{ {
return $this->LibStatut($this->statut, $mode); return $this->LibStatut($this->statut, $mode);
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Give a label from a status * Give a label from a status
* *
@ -277,7 +277,7 @@ class Fiscalyear extends CommonObject
* @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto
* @return string Label * @return string Label
*/ */
function LibStatut($statut, $mode = 0) public function LibStatut($statut, $mode = 0)
{ {
// phpcs:enable // phpcs:enable
global $langs; global $langs;
@ -318,7 +318,7 @@ class Fiscalyear extends CommonObject
* @param int $id Id of record * @param int $id Id of record
* @return void * @return void
*/ */
function info($id) public function info($id)
{ {
$sql = 'SELECT fy.rowid, fy.datec, fy.fk_user_author, fy.fk_user_modif,'; $sql = 'SELECT fy.rowid, fy.datec, fy.fk_user_author, fy.fk_user_modif,';
$sql.= ' fy.tms'; $sql.= ' fy.tms';
@ -364,7 +364,7 @@ class Fiscalyear extends CommonObject
* @param int $dateend Date end to scan * @param int $dateend Date end to scan
* @return string Number of entries * @return string Number of entries
*/ */
function getAccountancyEntriesByFiscalYear($datestart, $dateend) public function getAccountancyEntriesByFiscalYear($datestart, $dateend)
{ {
global $conf; global $conf;
@ -390,7 +390,7 @@ class Fiscalyear extends CommonObject
* @param int $dateend Date end to scan * @param int $dateend Date end to scan
* @return string Number of movements * @return string Number of movements
*/ */
function getAccountancyMovementsByFiscalYear($datestart, $dateend) public function getAccountancyMovementsByFiscalYear($datestart, $dateend)
{ {
global $conf; global $conf;

View File

@ -26,63 +26,63 @@
*/ */
class GoogleAPI class GoogleAPI
{ {
/** /**
* @var DoliDB Database handler. * @var DoliDB Database handler.
*/ */
public $db; public $db;
/** /**
* @var string Error code (or message) * @var string Error code (or message)
*/ */
public $error=''; public $error='';
public $key; public $key;
/** /**
* Constructor * Constructor
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
* @param string $key Google key * @param string $key Google key
*/ */
function __construct($db, $key) public function __construct($db, $key)
{ {
$this->db=$db; $this->db=$db;
$this->key=$key; $this->key=$key;
} }
/** /**
* Return geo coordinates of an address * Return geo coordinates of an address
* *
* @param string $address Address * @param string $address Address
* Example: 68 Grande rue Charles de Gaulle,+94130,+Nogent sur Marne,+France * Example: 68 Grande rue Charles de Gaulle,+94130,+Nogent sur Marne,+France
* Example: 188, rue de Fontenay,+94300,+Vincennes,+France * Example: 188, rue de Fontenay,+94300,+Vincennes,+France
* @return string Coordinates * @return string Coordinates
*/ */
function getGeoCoordinatesOfAddress($address) public function getGeoCoordinatesOfAddress($address)
{ {
global $conf; global $conf;
$i=0; $i=0;
// Desired address // Desired address
$urladdress = "https://maps.google.com/maps/geo?q=".urlencode($address)."&output=xml&key=".$this->key; $urladdress = "https://maps.google.com/maps/geo?q=".urlencode($address)."&output=xml&key=".$this->key;
// Retrieve the URL contents // Retrieve the URL contents
$page = file_get_contents($urladdress); $page = file_get_contents($urladdress);
$code = strstr($page, '<coordinates>'); $code = strstr($page, '<coordinates>');
$code = strstr($code, '>'); $code = strstr($code, '>');
$val=strpos($code, "<"); $val=strpos($code, "<");
$code = substr($code, 1, $val-1); $code = substr($code, 1, $val-1);
//print $code; //print $code;
//print "<br>"; //print "<br>";
$latitude = substr($code, 0, strpos($code, ",")); $latitude = substr($code, 0, strpos($code, ","));
$longitude = substr($code, strpos($code, ",")+1, dol_strlen(strpos($code, ","))-3); $longitude = substr($code, strpos($code, ",")+1, dol_strlen(strpos($code, ","))-3);
// Output the coordinates // Output the coordinates
//echo "Longitude: $longitude ',' Latitude: $latitude"; //echo "Longitude: $longitude ',' Latitude: $latitude";
$i++; $i++;
} }
} }

View File

@ -45,24 +45,24 @@ class HookManager
public $errors = array(); public $errors = array();
// Context hookmanager was created for ('thirdpartycard', 'thirdpartydao', ...) // Context hookmanager was created for ('thirdpartycard', 'thirdpartydao', ...)
var $contextarray=array(); public $contextarray=array();
// Array with instantiated classes // Array with instantiated classes
var $hooks=array(); public $hooks=array();
// Array result // Array result
var $resArray=array(); public $resArray=array();
// Printable result // Printable result
var $resPrint=''; public $resPrint='';
// Nb of qualified hook ran // Nb of qualified hook ran
var $resNbOfHooks=0; public $resNbOfHooks=0;
/** /**
* Constructor * Constructor
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
*/ */
function __construct($db) public function __construct($db)
{ {
$this->db = $db; $this->db = $db;
} }
@ -79,7 +79,7 @@ class HookManager
* @param string[] $arraycontext Array list of searched hooks tab/features. For example: 'thirdpartycard' (for hook methods into page card thirdparty), 'thirdpartydao' (for hook methods into Societe), ... * @param string[] $arraycontext Array list of searched hooks tab/features. For example: 'thirdpartycard' (for hook methods into page card thirdparty), 'thirdpartydao' (for hook methods into Societe), ...
* @return int Always 1 * @return int Always 1
*/ */
function initHooks($arraycontext) public function initHooks($arraycontext)
{ {
global $conf; global $conf;
@ -125,18 +125,18 @@ class HookManager
} }
/** /**
* Execute hooks (if they were initialized) for the given method * Execute hooks (if they were initialized) for the given method
* *
* @param string $method Name of method hooked ('doActions', 'printSearchForm', 'showInputField', ...) * @param string $method Name of method hooked ('doActions', 'printSearchForm', 'showInputField', ...)
* @param array $parameters Array of parameters * @param array $parameters Array of parameters
* @param Object $object Object to use hooks on * @param Object $object Object to use hooks on
* @param string $action Action code on calling page ('create', 'edit', 'view', 'add', 'update', 'delete'...) * @param string $action Action code on calling page ('create', 'edit', 'view', 'add', 'update', 'delete'...)
* @return mixed For 'addreplace' hooks (doActions,formObjectOptions,pdf_xxx,...): Return 0 if we want to keep standard actions, >0 if we want to stop/replace standard actions, <0 if KO. Things to print are returned into ->resprints and set into ->resPrint. Things to return are returned into ->results by hook and set into ->resArray for caller. * @return mixed For 'addreplace' hooks (doActions,formObjectOptions,pdf_xxx,...): Return 0 if we want to keep standard actions, >0 if we want to stop/replace standard actions, <0 if KO. Things to print are returned into ->resprints and set into ->resPrint. Things to return are returned into ->results by hook and set into ->resArray for caller.
* For 'output' hooks (printLeftBlock, formAddObjectLine, formBuilddocOptions, ...): Return 0, <0 if KO. Things to print are returned into ->resprints and set into ->resPrint. Things to return are returned into ->results by hook and set into ->resArray for caller. * For 'output' hooks (printLeftBlock, formAddObjectLine, formBuilddocOptions, ...): Return 0, <0 if KO. Things to print are returned into ->resprints and set into ->resPrint. Things to return are returned into ->results by hook and set into ->resArray for caller.
* All types can also return some values into an array ->results that will be finaly merged into this->resArray for caller. * All types can also return some values into an array ->results that will be finaly merged into this->resArray for caller.
* $this->error or this->errors are also defined by class called by this function if error. * $this->error or this->errors are also defined by class called by this function if error.
*/ */
function executeHooks($method, $parameters = array(), &$object = '', &$action = '') public function executeHooks($method, $parameters = array(), &$object = '', &$action = '')
{ {
if (! is_array($this->hooks) || empty($this->hooks)) return ''; if (! is_array($this->hooks) || empty($this->hooks)) return '';
@ -145,7 +145,7 @@ class HookManager
// Define type of hook ('output' or 'addreplace'. 'returnvalue' is deprecated because a 'addreplace' hook can also return resPrint and resArray). // Define type of hook ('output' or 'addreplace'. 'returnvalue' is deprecated because a 'addreplace' hook can also return resPrint and resArray).
$hooktype='output'; $hooktype='output';
if (in_array( if (in_array(
$method, $method,
array( array(
'addCalendarChoice', 'addCalendarChoice',
@ -204,10 +204,9 @@ if (in_array(
) )
)) $hooktype='addreplace'; )) $hooktype='addreplace';
if ($method == 'insertExtraFields') if ($method == 'insertExtraFields') {
{ $hooktype='returnvalue'; // @deprecated. TODO Remove all code with "executeHooks('insertExtraFields'" as soon as there is a trigger available.
$hooktype='returnvalue'; // @deprecated. TODO Remove all code with "executeHooks('insertExtraFields'" as soon as there is a trigger available. dol_syslog("Warning: The hook 'insertExtraFields' is deprecated and must not be used. Use instead trigger on CRUD event (ask it to dev team if not implemented)", LOG_WARNING);
dol_syslog("Warning: The hook 'insertExtraFields' is deprecated and must not be used. Use instead trigger on CRUD event (ask it to dev team if not implemented)", LOG_WARNING);
} }
// Init return properties // Init return properties

File diff suppressed because it is too large Load Diff

View File

@ -76,7 +76,7 @@ class FormSms
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
*/ */
function __construct($db) public function __construct($db)
{ {
$this->db = $db; $this->db = $db;
@ -92,7 +92,7 @@ class FormSms
$this->withbodyreadonly=0; $this->withbodyreadonly=0;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Show the form to input an sms. * Show the form to input an sms.
* *
@ -100,7 +100,7 @@ class FormSms
* @param int $showform Show form tags and submit button (recommanded is to use with value 0) * @param int $showform Show form tags and submit button (recommanded is to use with value 0)
* @return void * @return void
*/ */
function show_form($morecss = 'titlefield', $showform = 1) public function show_form($morecss = 'titlefield', $showform = 1)
{ {
// phpcs:enable // phpcs:enable
global $conf, $langs, $user, $form; global $conf, $langs, $user, $form;

View File

@ -27,15 +27,15 @@
*/ */
class InfoBox class InfoBox
{ {
/** /**
* Name of positions 0=Home, 1=... * Name of positions 0=Home, 1=...
* *
* @return string[] Array with list of zones * @return string[] Array with list of zones
*/ */
static function getListOfPagesForBoxes() public static function getListOfPagesForBoxes()
{ {
return array(0=>'Home'); return array(0=>'Home');
} }
/** /**
* Return array of boxes qualified for area and user * Return array of boxes qualified for area and user
@ -48,7 +48,7 @@ class InfoBox
* @param int $includehidden Include also hidden boxes * @param int $includehidden Include also hidden boxes
* @return array Array of boxes * @return array Array of boxes
*/ */
static function listBoxes($db, $mode, $zone, $user = null, $excludelist = array(), $includehidden = 1) public static function listBoxes($db, $mode, $zone, $user = null, $excludelist = array(), $includehidden = 1)
{ {
global $conf; global $conf;
@ -68,10 +68,10 @@ class InfoBox
$sql.= " ORDER BY b.box_order"; $sql.= " ORDER BY b.box_order";
} }
else // available else // available
{ {
$sql = "SELECT d.rowid as box_id, d.file, d.note, d.tms"; $sql = "SELECT d.rowid as box_id, d.file, d.note, d.tms";
$sql.= " FROM ".MAIN_DB_PREFIX."boxes_def as d"; $sql.= " FROM ".MAIN_DB_PREFIX."boxes_def as d";
$sql.= " WHERE d.entity IN (0,".$conf->entity.")"; $sql.= " WHERE d.entity IN (0,".$conf->entity.")";
} }
dol_syslog(get_class()."::listBoxes get default box list for mode=".$mode." userid=".(is_object($user)?$user->id:'')."", LOG_DEBUG); dol_syslog(get_class()."::listBoxes get default box list for mode=".$mode." userid=".(is_object($user)?$user->id:'')."", LOG_DEBUG);
@ -97,17 +97,17 @@ class InfoBox
{ {
$boxname=preg_replace('/\.php$/i', '', $obj->file); $boxname=preg_replace('/\.php$/i', '', $obj->file);
$relsourcefile = "/core/boxes/".$boxname.".php"; $relsourcefile = "/core/boxes/".$boxname.".php";
} }
//print $obj->box_id.'-'.$boxname.'-'.$relsourcefile.'<br>'; //print $obj->box_id.'-'.$boxname.'-'.$relsourcefile.'<br>';
// TODO PERF Do not make "dol_include_once" here, nor "new" later. This means, we must store a 'depends' field to store modules list, then // TODO PERF Do not make "dol_include_once" here, nor "new" later. This means, we must store a 'depends' field to store modules list, then
// the "enabled" condition for modules forbidden for external users and the depends condition can be done. // the "enabled" condition for modules forbidden for external users and the depends condition can be done.
// Goal is to avoid making a "new" done for each boxes returned by select. // Goal is to avoid making a "new" done for each boxes returned by select.
dol_include_once($relsourcefile); dol_include_once($relsourcefile);
if (class_exists($boxname)) if (class_exists($boxname))
{ {
$box=new $boxname($db, $obj->note); // Constructor may set properties like box->enabled. obj->note is note into box def, not user params. $box=new $boxname($db, $obj->note); // Constructor may set properties like box->enabled. obj->note is note into box def, not user params.
//$box=new stdClass(); //$box=new stdClass();
// box properties // box properties
@ -117,9 +117,9 @@ class InfoBox
$box->box_order = (empty($obj->box_order) ? '' : $obj->box_order); $box->box_order = (empty($obj->box_order) ? '' : $obj->box_order);
$box->fk_user = (empty($obj->fk_user) ? 0 : $obj->fk_user); $box->fk_user = (empty($obj->fk_user) ? 0 : $obj->fk_user);
$box->sourcefile= $relsourcefile; $box->sourcefile= $relsourcefile;
$box->class = $boxname; $box->class = $boxname;
if ($mode == 'activated' && ! is_object($user)) // List of activated box was not yet personalized into database if ($mode == 'activated' && ! is_object($user)) // List of activated box was not yet personalized into database
{ {
if (is_numeric($box->box_order)) if (is_numeric($box->box_order))
{ {
@ -138,19 +138,19 @@ class InfoBox
{ {
foreach($box->depends as $moduleelem) foreach($box->depends as $moduleelem)
{ {
$arrayelem=explode('|', $moduleelem); $arrayelem=explode('|', $moduleelem);
$tmpenabled=0; // $tmpenabled is used for the '|' test (OR) $tmpenabled=0; // $tmpenabled is used for the '|' test (OR)
foreach($arrayelem as $module) foreach($arrayelem as $module)
{ {
$tmpmodule=preg_replace('/@[^@]+/', '', $module); $tmpmodule=preg_replace('/@[^@]+/', '', $module);
if (! empty($conf->$tmpmodule->enabled)) $tmpenabled=1; if (! empty($conf->$tmpmodule->enabled)) $tmpenabled=1;
//print $boxname.'-'.$module.'-module enabled='.(empty($conf->$tmpmodule->enabled)?0:1).'<br>'; //print $boxname.'-'.$module.'-module enabled='.(empty($conf->$tmpmodule->enabled)?0:1).'<br>';
} }
if (empty($tmpenabled)) // We found at least one module required that is disabled if (empty($tmpenabled)) // We found at least one module required that is disabled
{ {
$enabled=0; $enabled=0;
break; break;
} }
} }
} }
//print '=>'.$boxname.'-enabled='.$enabled.'<br>'; //print '=>'.$boxname.'-enabled='.$enabled.'<br>';
@ -160,16 +160,16 @@ class InfoBox
else unset($box); else unset($box);
} }
else else
{ {
dol_syslog("Failed to load box '".$boxname."' into file '".$relsourcefile."'", LOG_WARNING); dol_syslog("Failed to load box '".$boxname."' into file '".$relsourcefile."'", LOG_WARNING);
} }
} }
$j++; $j++;
} }
} }
else else
{ {
dol_syslog($db->lasterror(), LOG_ERR); dol_syslog($db->lasterror(), LOG_ERR);
return array('error'=>$db->lasterror()); return array('error'=>$db->lasterror());
} }
@ -186,7 +186,7 @@ class InfoBox
* @param int $userid Id of user * @param int $userid Id of user
* @return int <0 if KO, 0=Nothing done, > 0 if OK * @return int <0 if KO, 0=Nothing done, > 0 if OK
*/ */
static function saveboxorder($db, $zone, $boxorder, $userid = 0) public static function saveboxorder($db, $zone, $boxorder, $userid = 0)
{ {
global $conf; global $conf;

View File

@ -36,24 +36,24 @@ class Interfaces
*/ */
public $db; public $db;
var $dir; // Directory with all core and external triggers files public $dir; // Directory with all core and external triggers files
/** /**
* @var string[] Error codes (or messages) * @var string[] Error codes (or messages)
*/ */
public $errors = array(); public $errors = array();
/** /**
* Constructor * Constructor
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
*/ */
function __construct($db) public function __construct($db)
{ {
$this->db = $db; $this->db = $db;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Function called when a Dolibarr business event occurs * Function called when a Dolibarr business event occurs
* This function call all qualified triggers. * This function call all qualified triggers.
@ -65,15 +65,15 @@ class Interfaces
* @param Conf $conf Objet conf * @param Conf $conf Objet conf
* @return int Nb of triggers ran if no error, -Nb of triggers with errors otherwise. * @return int Nb of triggers ran if no error, -Nb of triggers with errors otherwise.
*/ */
function run_triggers($action, $object, $user, $langs, $conf) public function run_triggers($action, $object, $user, $langs, $conf)
{ {
// phpcs:enable // phpcs:enable
// Check parameters // Check parameters
if (! is_object($object) || ! is_object($conf)) // Error if (! is_object($object) || ! is_object($conf)) // Error
{ {
$this->error='function run_triggers called with wrong parameters action='.$action.' object='.is_object($object).' user='.is_object($user).' langs='.is_object($langs).' conf='.is_object($conf); $this->error='function run_triggers called with wrong parameters action='.$action.' object='.is_object($object).' user='.is_object($user).' langs='.is_object($langs).' conf='.is_object($conf);
dol_syslog(get_class($this).'::run_triggers '.$this->error, LOG_ERR); dol_syslog(get_class($this).'::run_triggers '.$this->error, LOG_ERR);
$this->errors[]=$this->error; $this->errors[]=$this->error;
return -1; return -1;
} }
if (! is_object($langs)) // Warning if (! is_object($langs)) // Warning
@ -93,10 +93,10 @@ class Interfaces
$files = array(); $files = array();
$modules = array(); $modules = array();
$orders = array(); $orders = array();
$i=0; $i=0;
$dirtriggers=array_merge(array('/core/triggers'), $conf->modules_parts['triggers']); $dirtriggers=array_merge(array('/core/triggers'), $conf->modules_parts['triggers']);
foreach($dirtriggers as $reldir) foreach($dirtriggers as $reldir)
{ {
$dir=dol_buildpath($reldir, 0); $dir=dol_buildpath($reldir, 0);
@ -113,9 +113,9 @@ class Interfaces
{ {
if (is_readable($newdir."/".$file) && preg_match('/^interface_([0-9]+)_([^_]+)_(.+)\.class\.php$/i', $file, $reg)) if (is_readable($newdir."/".$file) && preg_match('/^interface_([0-9]+)_([^_]+)_(.+)\.class\.php$/i', $file, $reg))
{ {
$part1=$reg[1]; $part1=$reg[1];
$part2=$reg[2]; $part2=$reg[2];
$part3=$reg[3]; $part3=$reg[3];
$nbfile++; $nbfile++;
@ -177,22 +177,22 @@ class Interfaces
$objMod = new $modName($this->db); $objMod = new $modName($this->db);
if ($objMod) if ($objMod)
{ {
$result=0; $result=0;
if (method_exists($objMod, 'runTrigger')) // New method to implement if (method_exists($objMod, 'runTrigger')) // New method to implement
{ {
//dol_syslog(get_class($this)."::run_triggers action=".$action." Launch runTrigger for file '".$files[$key]."'", LOG_DEBUG); //dol_syslog(get_class($this)."::run_triggers action=".$action." Launch runTrigger for file '".$files[$key]."'", LOG_DEBUG);
$result=$objMod->runTrigger($action, $object, $user, $langs, $conf); $result=$objMod->runTrigger($action, $object, $user, $langs, $conf);
} }
elseif (method_exists($objMod, 'run_trigger')) // Deprecated method elseif (method_exists($objMod, 'run_trigger')) // Deprecated method
{ {
dol_syslog(get_class($this)."::run_triggers action=".$action." Launch old method run_trigger (rename your trigger into runTrigger) for file '".$files[$key]."'", LOG_WARNING); dol_syslog(get_class($this)."::run_triggers action=".$action." Launch old method run_trigger (rename your trigger into runTrigger) for file '".$files[$key]."'", LOG_WARNING);
$result=$objMod->run_trigger($action, $object, $user, $langs, $conf); $result=$objMod->run_trigger($action, $object, $user, $langs, $conf);
} }
else else
{ {
dol_syslog(get_class($this)."::run_triggers action=".$action." A trigger was declared for class ".get_class($objMod)." but method runTrigger was not found", LOG_ERR); dol_syslog(get_class($this)."::run_triggers action=".$action." A trigger was declared for class ".get_class($objMod)." but method runTrigger was not found", LOG_ERR);
} }
if ($result > 0) if ($result > 0)
{ {
@ -217,7 +217,7 @@ class Interfaces
} }
} }
else else
{ {
dol_syslog(get_class($this)."::run_triggers action=".$action." Failed to instantiate trigger for file '".$files[$key]."'", LOG_ERR); dol_syslog(get_class($this)."::run_triggers action=".$action." Failed to instantiate trigger for file '".$files[$key]."'", LOG_ERR);
} }
} }
@ -238,10 +238,10 @@ class Interfaces
* Return list of triggers. Function used by admin page htdoc/admin/triggers. * Return list of triggers. Function used by admin page htdoc/admin/triggers.
* List is sorted by trigger filename so by priority to run. * List is sorted by trigger filename so by priority to run.
* *
* @param array $forcedirtriggers null=All default directories. This parameter is used by modulebuilder module only. * @param array $forcedirtriggers null=All default directories. This parameter is used by modulebuilder module only.
* @return array Array list of triggers * @return array Array list of triggers
*/ */
function getTriggersList($forcedirtriggers = null) public function getTriggersList($forcedirtriggers = null)
{ {
global $conf, $langs, $db; global $conf, $langs, $db;
@ -256,7 +256,7 @@ class Interfaces
$dirtriggers=array_merge(array('/core/triggers/'), $conf->modules_parts['triggers']); $dirtriggers=array_merge(array('/core/triggers/'), $conf->modules_parts['triggers']);
if (is_array($forcedirtriggers)) if (is_array($forcedirtriggers))
{ {
$dirtriggers=$forcedirtriggers; $dirtriggers=$forcedirtriggers;
} }
foreach($dirtriggers as $reldir) foreach($dirtriggers as $reldir)
@ -276,9 +276,9 @@ class Interfaces
{ {
if (preg_match('/\.back$/', $file)) continue; if (preg_match('/\.back$/', $file)) continue;
$part1=$reg[1]; $part1=$reg[1];
$part2=$reg[2]; $part2=$reg[2];
$part3=$reg[3]; $part3=$reg[3];
$modName = 'Interface'.ucfirst($reg[3]); $modName = 'Interface'.ucfirst($reg[3]);
//print "file=$file"; print "modName=$modName"; exit; //print "file=$file"; print "modName=$modName"; exit;
@ -319,8 +319,8 @@ class Interfaces
if (! class_exists($modName)) if (! class_exists($modName))
{ {
print 'Error: A trigger file was found but its class "'.$modName.'" was not found.'."<br>\n"; print 'Error: A trigger file was found but its class "'.$modName.'" was not found.'."<br>\n";
continue; continue;
} }
$objMod = new $modName($db); $objMod = new $modName($db);
@ -342,7 +342,7 @@ class Interfaces
$triggers[$j]['module']=strtolower($module); $triggers[$j]['module']=strtolower($module);
} }
// We set info of modules // We set info of modules
$triggers[$j]['picto'] = $objMod->picto?img_object('', $objMod->picto):img_object('', 'generic'); $triggers[$j]['picto'] = $objMod->picto?img_object('', $objMod->picto):img_object('', 'generic');
$triggers[$j]['file'] = $files[$key]; $triggers[$j]['file'] = $files[$key];
$triggers[$j]['fullpath'] = $fullpath[$key]; $triggers[$j]['fullpath'] = $fullpath[$key];

View File

@ -42,78 +42,78 @@ class Ldap
/** /**
* Tableau des serveurs (IP addresses ou nom d'hotes) * Tableau des serveurs (IP addresses ou nom d'hotes)
*/ */
var $server=array(); public $server=array();
/** /**
* Base DN (e.g. "dc=foo,dc=com") * Base DN (e.g. "dc=foo,dc=com")
*/ */
var $dn; public $dn;
/** /**
* type de serveur, actuellement OpenLdap et Active Directory * type de serveur, actuellement OpenLdap et Active Directory
*/ */
var $serverType; public $serverType;
/** /**
* Version du protocole ldap * Version du protocole ldap
*/ */
var $domain; public $domain;
/** /**
* User administrateur Ldap * User administrateur Ldap
* Active Directory ne supporte pas les connexions anonymes * Active Directory ne supporte pas les connexions anonymes
*/ */
var $searchUser; public $searchUser;
/** /**
* Mot de passe de l'administrateur * Mot de passe de l'administrateur
* Active Directory ne supporte pas les connexions anonymes * Active Directory ne supporte pas les connexions anonymes
*/ */
var $searchPassword; public $searchPassword;
/** /**
* DN des utilisateurs * DN des utilisateurs
*/ */
var $people; public $people;
/** /**
* DN des groupes * DN des groupes
*/ */
var $groups; public $groups;
/** /**
* Code erreur retourne par le serveur Ldap * Code erreur retourne par le serveur Ldap
*/ */
var $ldapErrorCode; public $ldapErrorCode;
/** /**
* Message texte de l'erreur * Message texte de l'erreur
*/ */
var $ldapErrorText; public $ldapErrorText;
//Fetch user //Fetch user
var $name; public $name;
var $firstname; public $firstname;
var $login; public $login;
var $phone; public $phone;
var $skype; public $skype;
var $fax; public $fax;
var $mail; public $mail;
var $mobile; public $mobile;
var $uacf; public $uacf;
var $pwdlastset; public $pwdlastset;
var $ldapcharset='UTF-8'; // LDAP should be UTF-8 encoded public $ldapcharset='UTF-8'; // LDAP should be UTF-8 encoded
/** /**
* The internal LDAP connection handle * The internal LDAP connection handle
*/ */
var $connection; public $connection;
/** /**
* Result of any connections etc. * Result of any connections etc.
*/ */
var $result; public $result;
/** /**
* Constructor * Constructor
*/ */
function __construct() public function __construct()
{ {
global $conf; global $conf;
@ -149,7 +149,7 @@ class Ldap
// Connection handling methods ------------------------------------------- // Connection handling methods -------------------------------------------
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Connect and bind * Connect and bind
* Use this->server, this->serverPort, this->ldapProtocolVersion, this->serverType, this->searchUser, this->searchPassword * Use this->server, this->serverPort, this->ldapProtocolVersion, this->serverType, this->searchUser, this->searchPassword
@ -157,7 +157,7 @@ class Ldap
* *
* @return int <0 if KO, 1 if bind anonymous, 2 if bind auth * @return int <0 if KO, 1 if bind anonymous, 2 if bind auth
*/ */
function connect_bind() public function connect_bind()
{ {
// phpcs:enable // phpcs:enable
global $langs, $conf; global $langs, $conf;
@ -290,7 +290,7 @@ class Ldap
* *
* @return boolean true or false * @return boolean true or false
*/ */
function close() public function close()
{ {
if ($this->connection && ! @ldap_close($this->connection)) if ($this->connection && ! @ldap_close($this->connection))
{ {
@ -308,7 +308,7 @@ class Ldap
* *
* @return boolean true or false * @return boolean true or false
*/ */
function bind() public function bind()
{ {
if (! $this->result=@ldap_bind($this->connection)) if (! $this->result=@ldap_bind($this->connection))
{ {
@ -333,7 +333,7 @@ class Ldap
* @param string $pass Password * @param string $pass Password
* @return boolean true or false * @return boolean true or false
*/ */
function bindauth($bindDn, $pass) public function bindauth($bindDn, $pass)
{ {
if (! $this->result = @ldap_bind($this->connection, $bindDn, $pass)) if (! $this->result = @ldap_bind($this->connection, $bindDn, $pass))
{ {
@ -353,7 +353,7 @@ class Ldap
* *
* @return boolean true or false * @return boolean true or false
*/ */
function unbind() public function unbind()
{ {
if (!$this->result=@ldap_unbind($this->connection)) if (!$this->result=@ldap_unbind($this->connection))
{ {
@ -369,7 +369,7 @@ class Ldap
* *
* @return string version * @return string version
*/ */
function getVersion() public function getVersion()
{ {
$version = 0; $version = 0;
$version = @ldap_get_option($this->connection, LDAP_OPT_PROTOCOL_VERSION, $version); $version = @ldap_get_option($this->connection, LDAP_OPT_PROTOCOL_VERSION, $version);
@ -410,7 +410,7 @@ class Ldap
* @param User $user Objet user that create * @param User $user Objet user that create
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function add($dn, $info, $user) public function add($dn, $info, $user)
{ {
global $conf; global $conf;
@ -464,7 +464,7 @@ class Ldap
* @param User $user Objet user that modify * @param User $user Objet user that modify
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function modify($dn, $info, $user) public function modify($dn, $info, $user)
{ {
global $conf; global $conf;
@ -518,7 +518,7 @@ class Ldap
* @param bool $deleteoldrdn If true the old RDN value(s) is removed, else the old RDN value(s) is retained as non-distinguished values of the entry. * @param bool $deleteoldrdn If true the old RDN value(s) is removed, else the old RDN value(s) is retained as non-distinguished values of the entry.
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function rename($dn, $newrdn, $newparent, $user, $deleteoldrdn = true) public function rename($dn, $newrdn, $newparent, $user, $deleteoldrdn = true)
{ {
global $conf; global $conf;
@ -569,7 +569,7 @@ class Ldap
* @param string $newparent New parent (ou=xxx,dc=aaa,dc=bbb) (for ldap_rename) * @param string $newparent New parent (ou=xxx,dc=aaa,dc=bbb) (for ldap_rename)
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function update($dn, $info, $user, $olddn, $newrdn = false, $newparent = false) public function update($dn, $info, $user, $olddn, $newrdn = false, $newparent = false)
{ {
global $conf; global $conf;
@ -629,7 +629,7 @@ class Ldap
* @param string $dn DN entry key * @param string $dn DN entry key
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function delete($dn) public function delete($dn)
{ {
global $conf; global $conf;
@ -656,7 +656,7 @@ class Ldap
return -1; return -1;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Build a LDAP message * Build a LDAP message
* *
@ -664,7 +664,7 @@ class Ldap
* @param array $info Attributes array * @param array $info Attributes array
* @return string Content of file * @return string Content of file
*/ */
function dump_content($dn, $info) public function dump_content($dn, $info)
{ {
// phpcs:enable // phpcs:enable
$content=''; $content='';
@ -707,7 +707,7 @@ class Ldap
* @param array $info Attributes array * @param array $info Attributes array
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function dump($dn, $info) public function dump($dn, $info)
{ {
global $conf; global $conf;
@ -741,7 +741,7 @@ class Ldap
* @param int $timeout Timeout in second (default 1s) * @param int $timeout Timeout in second (default 1s)
* @return boolean true or false * @return boolean true or false
*/ */
function serverPing($host, $port = 389, $timeout = 1) public function serverPing($host, $port = 389, $timeout = 1)
{ {
// Replace ldaps:// by ssl:// // Replace ldaps:// by ssl://
if (preg_match('/^ldaps:\/\/([^\/]+)\/?$/', $host, $regs)) { if (preg_match('/^ldaps:\/\/([^\/]+)\/?$/', $host, $regs)) {
@ -771,7 +771,7 @@ class Ldap
* @param User $user Objet user that create * @param User $user Objet user that create
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function addAttribute($dn, $info, $user) public function addAttribute($dn, $info, $user)
{ {
global $conf; global $conf;
@ -823,7 +823,7 @@ class Ldap
* @param User $user Objet user that create * @param User $user Objet user that create
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function updateAttribute($dn, $info, $user) public function updateAttribute($dn, $info, $user)
{ {
global $conf; global $conf;
@ -875,7 +875,7 @@ class Ldap
* @param User $user Objet user that create * @param User $user Objet user that create
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
function deleteAttribute($dn, $info, $user) public function deleteAttribute($dn, $info, $user)
{ {
global $conf; global $conf;
@ -925,7 +925,7 @@ class Ldap
* @param string $filter Filter * @param string $filter Filter
* @return int|array <0 or false if KO, array if OK * @return int|array <0 or false if KO, array if OK
*/ */
function getAttribute($dn, $filter) public function getAttribute($dn, $filter)
{ {
// Check parameters // Check parameters
if (! $this->connection) if (! $this->connection)
@ -970,7 +970,7 @@ class Ldap
* @param string $attribute Attributes * @param string $attribute Attributes
* @return void * @return void
*/ */
function getAttributeValues($filterrecord, $attribute) public function getAttributeValues($filterrecord, $attribute)
{ {
$attributes=array(); $attributes=array();
$attributes[0] = $attribute; $attributes[0] = $attribute;
@ -1015,7 +1015,7 @@ class Ldap
* @param array $attributeAsArray Array of fields wanted as an array not a string * @param array $attributeAsArray Array of fields wanted as an array not a string
* @return array Array of [id_record][ldap_field]=value * @return array Array of [id_record][ldap_field]=value
*/ */
function getRecords($search, $userDn, $useridentifier, $attributeArray, $activefilter = 0, $attributeAsArray = array()) public function getRecords($search, $userDn, $useridentifier, $attributeArray, $activefilter = 0, $attributeAsArray = array())
{ {
$fulllist=array(); $fulllist=array();
@ -1123,7 +1123,7 @@ class Ldap
* @param string $hex Hex value * @param string $hex Hex value
* @return string Little endian * @return string Little endian
*/ */
function littleEndian($hex) public function littleEndian($hex)
{ {
for ($x=dol_strlen($hex)-2; $x >= 0; $x=$x-2) { for ($x=dol_strlen($hex)-2; $x >= 0; $x=$x-2) {
$result .= substr($hex, $x, 2); $result .= substr($hex, $x, 2);
@ -1139,7 +1139,7 @@ class Ldap
* @param string $ldapUser Login de l'utilisateur * @param string $ldapUser Login de l'utilisateur
* @return string Sid * @return string Sid
*/ */
function getObjectSid($ldapUser) public function getObjectSid($ldapUser)
{ {
$criteria = '('.$this->getUserIdentifier().'='.$ldapUser.')'; $criteria = '('.$this->getUserIdentifier().'='.$ldapUser.')';
$justthese = array("objectsid"); $justthese = array("objectsid");
@ -1198,7 +1198,7 @@ class Ldap
* @param string $binsid Binary SID * @param string $binsid Binary SID
* @return string Textual SID * @return string Textual SID
*/ */
function binSIDtoText($binsid) public function binSIDtoText($binsid)
{ {
$hex_sid=bin2hex($binsid); $hex_sid=bin2hex($binsid);
$rev = hexdec(substr($hex_sid, 0, 2)); // Get revision-part of SID $rev = hexdec(substr($hex_sid, 0, 2)); // Get revision-part of SID
@ -1224,7 +1224,7 @@ class Ldap
* @param string $filter Search filter (ex: (sn=nom_personne) ) * @param string $filter Search filter (ex: (sn=nom_personne) )
* @return array|int Array with answers (key lowercased - value) * @return array|int Array with answers (key lowercased - value)
*/ */
function search($checkDn, $filter) public function search($checkDn, $filter)
{ {
dol_syslog(get_class($this)."::search checkDn=".$checkDn." filter=".$filter); dol_syslog(get_class($this)."::search checkDn=".$checkDn." filter=".$filter);
@ -1260,7 +1260,7 @@ class Ldap
* Examples: &(objectClass=inetOrgPerson) &(objectClass=user)(objectCategory=person) &(isMemberOf=cn=Sales,ou=Groups,dc=opencsi,dc=com) * Examples: &(objectClass=inetOrgPerson) &(objectClass=user)(objectCategory=person) &(isMemberOf=cn=Sales,ou=Groups,dc=opencsi,dc=com)
* @return int >0 if OK, <0 if KO * @return int >0 if OK, <0 if KO
*/ */
function fetch($user, $filter) public function fetch($user, $filter)
{ {
// Perform the search and get the entry handles // Perform the search and get the entry handles
@ -1353,7 +1353,7 @@ class Ldap
* *
* @return string Login * @return string Login
*/ */
function getUserIdentifier() public function getUserIdentifier()
{ {
if ($this->serverType == "activedirectory") { if ($this->serverType == "activedirectory") {
return $this->attr_sambalogin; return $this->attr_sambalogin;
@ -1368,7 +1368,7 @@ class Ldap
* @param string $uacf UACF * @param string $uacf UACF
* @return void * @return void
*/ */
function parseUACF($uacf) public function parseUACF($uacf)
{ {
//All flags array //All flags array
$flags = array( $flags = array(
@ -1414,7 +1414,7 @@ class Ldap
* @param string $samtype SamType * @param string $samtype SamType
* @return string Sam string * @return string Sam string
*/ */
function parseSAT($samtype) public function parseSAT($samtype)
{ {
$stypes = array( $stypes = array(
805306368 => "NORMAL_ACCOUNT", 805306368 => "NORMAL_ACCOUNT",
@ -1438,14 +1438,14 @@ class Ldap
return($retval); return($retval);
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Convertit le temps ActiveDirectory en Unix timestamp * Convertit le temps ActiveDirectory en Unix timestamp
* *
* @param string $value AD time to convert * @param string $value AD time to convert
* @return integer Unix timestamp * @return integer Unix timestamp
*/ */
function convert_time($value) public function convert_time($value)
{ {
// phpcs:enable // phpcs:enable
$dateLargeInt=$value; // nano secondes depuis 1601 !!!! $dateLargeInt=$value; // nano secondes depuis 1601 !!!!
@ -1478,7 +1478,7 @@ class Ldap
* @param string $pagecodeto Page code for result string * @param string $pagecodeto Page code for result string
* @return string Converted string * @return string Converted string
*/ */
function convFromOutputCharset($str, $pagecodeto = 'UTF-8') public function convFromOutputCharset($str, $pagecodeto = 'UTF-8')
{ {
global $conf; global $conf;
if ($pagecodeto == 'ISO-8859-1' && $conf->file->character_set_client == 'UTF-8') $str=utf8_decode($str); if ($pagecodeto == 'ISO-8859-1' && $conf->file->character_set_client == 'UTF-8') $str=utf8_decode($str);
@ -1493,7 +1493,7 @@ class Ldap
* @param string $keygroup Key of group * @param string $keygroup Key of group
* @return int gid number * @return int gid number
*/ */
function getNextGroupGid($keygroup = 'LDAP_KEY_GROUPS') public function getNextGroupGid($keygroup = 'LDAP_KEY_GROUPS')
{ {
global $conf; global $conf;

View File

@ -150,11 +150,11 @@ class Link extends CommonObject
} }
/** /**
* Update parameters of third party * Update parameters of third party
* *
* @param User $user User executing update * @param User $user User executing update
* @param int $call_trigger 0=no, 1=yes * @param int $call_trigger 0=no, 1=yes
* @return int <0 if KO, >=0 if OK * @return int <0 if KO, >=0 if OK
*/ */
public function update($user = '', $call_trigger = 1) public function update($user = '', $call_trigger = 1)
{ {

View File

@ -28,14 +28,14 @@
*/ */
class Menu class Menu
{ {
var $liste; public $liste;
/** /**
* Constructor * Constructor
*/ */
function __construct() public function __construct()
{ {
$this->liste = array(); $this->liste = array();
} }
/** /**
@ -43,7 +43,7 @@ class Menu
* *
* @return void * @return void
*/ */
function clear() public function clear()
{ {
$this->liste = array(); $this->liste = array();
} }
@ -65,15 +65,15 @@ class Menu
* @param string $prefix Prefix to title (image or picto) * @param string $prefix Prefix to title (image or picto)
* @return void * @return void
*/ */
function add($url, $titre, $level = 0, $enabled = 1, $target = '', $mainmenu = '', $leftmenu = '', $position = 0, $id = '', $idsel = '', $classname = '', $prefix = '') public function add($url, $titre, $level = 0, $enabled = 1, $target = '', $mainmenu = '', $leftmenu = '', $position = 0, $id = '', $idsel = '', $classname = '', $prefix = '')
{ {
$this->liste[]=array('url'=>$url,'titre'=>$titre,'level'=>$level,'enabled'=>$enabled,'target'=>$target,'mainmenu'=>$mainmenu,'leftmenu'=>$leftmenu, 'position'=>$position, 'id'=>$id, 'idsel'=>$idsel, 'classname'=>$classname, 'prefix'=>$prefix); $this->liste[]=array('url'=>$url,'titre'=>$titre,'level'=>$level,'enabled'=>$enabled,'target'=>$target,'mainmenu'=>$mainmenu,'leftmenu'=>$leftmenu, 'position'=>$position, 'id'=>$id, 'idsel'=>$idsel, 'classname'=>$classname, 'prefix'=>$prefix);
} }
/** /**
* Insert a menu entry into this->liste * Insert a menu entry into this->liste
* *
* @param int $idafter Array key after which inserting new entry * @param int $idafter Array key after which inserting new entry
* @param string $url Url to follow on click * @param string $url Url to follow on click
* @param string $titre Label of menu to add * @param string $titre Label of menu to add
* @param integer $level Level of menu to add * @param integer $level Level of menu to add
@ -88,7 +88,7 @@ class Menu
* @param string $prefix Prefix to title (image or picto) * @param string $prefix Prefix to title (image or picto)
* @return void * @return void
*/ */
function insert($idafter, $url, $titre, $level = 0, $enabled = 1, $target = '', $mainmenu = '', $leftmenu = '', $position = 0, $id = '', $idsel = '', $classname = '', $prefix = '') public function insert($idafter, $url, $titre, $level = 0, $enabled = 1, $target = '', $mainmenu = '', $leftmenu = '', $position = 0, $id = '', $idsel = '', $classname = '', $prefix = '')
{ {
$array_start = array_slice($this->liste, 0, ($idafter+1)); $array_start = array_slice($this->liste, 0, ($idafter+1));
$array_new = array(0=>array('url'=>$url,'titre'=>$titre,'level'=>$level,'enabled'=>$enabled,'target'=>$target,'mainmenu'=>$mainmenu,'leftmenu'=>$leftmenu,'position'=>$position, 'id'=>$id, 'idsel'=>$idsel, 'classname'=>$classname, 'prefix'=>$prefix)); $array_new = array(0=>array('url'=>$url,'titre'=>$titre,'level'=>$level,'enabled'=>$enabled,'target'=>$target,'mainmenu'=>$mainmenu,'leftmenu'=>$leftmenu,'position'=>$position, 'id'=>$id, 'idsel'=>$idsel, 'classname'=>$classname, 'prefix'=>$prefix));
@ -96,13 +96,13 @@ class Menu
$this->liste=array_merge($array_start, $array_new, $array_end); $this->liste=array_merge($array_start, $array_new, $array_end);
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Remove a menu entry from this->liste * Remove a menu entry from this->liste
* *
* @return void * @return void
*/ */
function remove_last() public function remove_last()
{ {
// phpcs:enable // phpcs:enable
if (count($this->liste) > 1) { if (count($this->liste) > 1) {
@ -115,7 +115,7 @@ class Menu
* *
* @return int Number of visible (gray or not) menu entries * @return int Number of visible (gray or not) menu entries
*/ */
function getNbOfVisibleMenuEntries() public function getNbOfVisibleMenuEntries()
{ {
$nb=0; $nb=0;
foreach($this->liste as $val) foreach($this->liste as $val)