Remove useless call

This commit is contained in:
Laurent Destailleur 2019-11-10 17:48:50 +01:00
parent 197bf61cfd
commit 0a824db6d3
4 changed files with 14 additions and 12 deletions

View File

@ -853,7 +853,8 @@ class ExtraFields
// if (empty($forceload) && ! empty($this->attributes[$tab->elementtype]['loaded'])) return $array_name_label;
// Set array of label of entity
// TODO Remove completely loading of label. This should be done by presentation.
// Remove completely loading of label. This should be done by presentation.
/*
$labelmulticompany=array();
if (!empty($conf->multicompany->enabled))
{
@ -866,11 +867,9 @@ class ExtraFields
$labelmulticompany[$obj->rowid]=$obj->label;
}
}
}
// We should not have several time this log. If we have, there is some optimization to do by calling a simple $object->fetch_optionals() that include cache management.
dol_syslog("fetch_name_optionals_label elementtype=".$elementtype);
}*/
// We should not have several time this request. If we have, there is some optimization to do by calling a simple $extrafields->fetch_optionals() in top of code and not into subcode
$sql = "SELECT rowid,name,label,type,size,elementtype,fieldunique,fieldrequired,param,pos,alwayseditable,perms,langs,list,totalizable,fielddefault,fieldcomputed,entity,enabled,help";
$sql.= " FROM ".MAIN_DB_PREFIX."extrafields";
//$sql.= " WHERE entity IN (0,".$conf->entity.")"; // Filter is done later

View File

@ -91,6 +91,7 @@ class HookManager
$this->contextarray=array_unique(array_merge($arraycontext, $this->contextarray)); // All contexts are concatenated
$arraytolog = array();
foreach($conf->modules_parts['hooks'] as $module => $hooks) // Loop on each module that brings hooks
{
if (empty($conf->$module->enabled)) continue;
@ -109,7 +110,7 @@ class HookManager
$path = '/'.$module.'/class/';
$actionfile = 'actions_'.$module.'.class.php';
dol_syslog(get_class($this).'::initHooks Loading hook class for context '.$context.": ".$actionfile, LOG_INFO);
$arraytolog[] = 'context='.$context.'-path='.$path.$actionfile;
$resaction=dol_include_once($path.$actionfile);
if ($resaction)
{
@ -121,6 +122,11 @@ class HookManager
}
}
}
if (count($arraytolog) > 0)
{
dol_syslog(get_class($this)."::initHooks Loading hooks: ".join(', ', $arraytolog), LOG_DEBUG);
}
return 1;
}

View File

@ -93,7 +93,7 @@ class Menu
$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_end = array_slice($this->liste, ($idafter+1));
$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.ScopeNotCamelCaps
@ -105,7 +105,7 @@ class Menu
public function remove_last()
{
// phpcs:enable
if (count($this->liste) > 1) {
if (count($this->liste) > 1) {
array_pop($this->liste);
}
}

View File

@ -566,7 +566,6 @@ class Menubase
global $langs, $user, $conf; // To export to dol_eval function
global $mainmenu, $leftmenu; // To export to dol_eval function
$menutopid=0;
$mainmenu=$mymainmenu; // To export to dol_eval function
$leftmenu=$myleftmenu; // To export to dol_eval function
@ -579,9 +578,7 @@ class Menubase
$sql.= " ORDER BY m.position, m.rowid";
//print $sql;
//$tmp1=microtime(true);
//print '>>> 1 0<br>';
dol_syslog(get_class($this)."::menuLoad mymainmenu=".$mymainmenu." myleftmenu=".$myleftmenu." type_user=".$type_user." menu_handler=".$menu_handler." tabMenu size=".count($tabMenu)."", LOG_DEBUG);
//dol_syslog(get_class($this)."::menuLoad mymainmenu=".$mymainmenu." myleftmenu=".$myleftmenu." type_user=".$type_user." menu_handler=".$menu_handler." tabMenu size=".count($tabMenu)."", LOG_DEBUG);
$resql = $this->db->query($sql);
if ($resql)
{