| '."\n";
@@ -873,6 +878,7 @@ class FormOther
$ii=0;
foreach ($boxactivated as $key => $box)
{
+ if ((! empty($user->conf->$confuserzone) && $box->fk_user == 0) || (empty($user->conf->$confuserzone) && $box->fk_user != 0)) continue;
if (empty($box->box_order) && $ii < ($nbboxactivated / 2)) $box->box_order='A'.sprintf("%02d",($ii+1)); // When box_order was not yet set to Axx or Bxx and is still 0
if (preg_match('/^A/i',$box->box_order)) // column A
{
@@ -885,7 +891,6 @@ class FormOther
}
}
- $emptybox=new ModeleBoxes($db);
$emptybox->box_id='A';
$emptybox->info_box_head=array();
$emptybox->info_box_contents=array();
@@ -902,7 +907,8 @@ class FormOther
$ii=0;
foreach ($boxactivated as $key => $box)
{
- if (empty($box->box_order) && $ii < ($nbboxactivated / 2)) $box->box_order='B'.sprintf("%02d",($ii+1)); // When box_order was not yet set to Axx or Bxx and is still 0
+ if ((! empty($user->conf->$confuserzone) && $box->fk_user == 0) || (empty($user->conf->$confuserzone) && $box->fk_user != 0)) continue;
+ if (empty($box->box_order) && $ii < ($nbboxactivated / 2)) $box->box_order='B'.sprintf("%02d",($ii+1)); // When box_order was not yet set to Axx or Bxx and is still 0
if (preg_match('/^B/i',$box->box_order)) // colonne B
{
$ii++;
@@ -914,7 +920,6 @@ class FormOther
}
}
- $emptybox=new ModeleBoxes($db);
$emptybox->box_id='B';
$emptybox->info_box_head=array();
$emptybox->info_box_contents=array();
diff --git a/htdocs/core/class/infobox.class.php b/htdocs/core/class/infobox.class.php
index 4c089b2ef88..e24a893baf4 100644
--- a/htdocs/core/class/infobox.class.php
+++ b/htdocs/core/class/infobox.class.php
@@ -33,7 +33,7 @@ class InfoBox
* @param DoliDB $db Database handler
* @param string $mode 'available' or 'activated'
* @param string $zone Name or area (-1 for all, 0 for Homepage, 1 for xxx, ...)
- * @param User $user Objet user to filter (used only if $zone >= 0)
+ * @param User $user Objet user to filter
* @param array $excludelist Array of box id (box.box_id = boxes_def.rowid) to exclude
* @return array Array of boxes
*/
@@ -52,7 +52,7 @@ class InfoBox
$sql.= " WHERE b.box_id = d.rowid";
$sql.= " AND b.entity IN (0,".(! empty($conf->multicompany->enabled) && ! empty($conf->multicompany->transverse_mode)?"1,":"").$conf->entity.")";
if ($zone >= 0) $sql.= " AND b.position = ".$zone;
- if ($user->id && ! empty($user->conf->$confuserzone)) $sql.= " AND b.fk_user = ".$user->id;
+ if (is_object($user)) $sql.= " AND b.fk_user IN (0,".$user->id.")";
else $sql.= " AND b.fk_user = 0";
$sql.= " ORDER BY b.box_order";
}
@@ -71,7 +71,7 @@ class InfoBox
}
}
- dol_syslog(get_class()."::listBoxes get default box list sql=".$sql, LOG_DEBUG);
+ dol_syslog(get_class()."::listBoxes get default box list for mode=".$mode." userid=".(is_object($user)?$user->id:'')." sql=".$sql, LOG_DEBUG);
$resql = $db->query($sql);
if ($resql)
{
@@ -101,13 +101,13 @@ class InfoBox
$box=new $boxname($db,$obj->note);
// box properties
- $box->rowid = (! empty($obj->rowid) ? $obj->rowid : '');
- $box->id = (! empty($obj->box_id) ? $obj->box_id : '');
- $box->position = (! empty($obj->position) ? $obj->position : '');
- $box->box_order = (! empty($obj->box_order) ? $obj->box_order : '');
- $box->fk_user = (! empty($obj->fk_user) ? $obj->fk_user : '');
+ $box->rowid = (empty($obj->rowid) ? '' : $obj->rowid);
+ $box->id = (empty($obj->box_id) ? '' : $obj->box_id);
+ $box->position = (empty($obj->position) ? '' : $obj->position);
+ $box->box_order = (empty($obj->box_order) ? '' : $obj->box_order);
+ $box->fk_user = (empty($obj->fk_user) ? 0 : $obj->fk_user);
$box->sourcefile=$relsourcefile;
- if ($mode == 'activated' && (! $user->id || empty($user->conf->$confuserzone))) // 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))
{
@@ -116,18 +116,20 @@ class InfoBox
}
}
// box_def properties
- $box->box_id = (! empty($obj->box_id) ? $obj->box_id : '');
- $box->note = (! empty($obj->note) ? $obj->note : '');
+ $box->box_id = (empty($obj->box_id) ? '' : $obj->box_id);
+ $box->note = (empty($obj->note) ? '' : $obj->note);
- $enabled=true;
+ $enabled=$box->enabled;
if (isset($box->depends) && count($box->depends) > 0)
{
foreach($box->depends as $module)
{
//print $boxname.'-'.$module.' '; - if (empty($conf->$module->enabled)) $enabled=false; + if (empty($conf->$module->enabled)) $enabled=0; } } + + //print 'xx module='.$module.' enabled='.$enabled; if ($enabled) $boxes[]=$box; } } @@ -137,9 +139,8 @@ class InfoBox else { //dol_print_error($db); - $error=$db->error(); + $error=$db->lasterror(); dol_syslog(get_class()."::listBoxes Error ".$error, LOG_ERR); - return array(); } return $boxes; diff --git a/htdocs/core/class/menubase.class.php b/htdocs/core/class/menubase.class.php index ada707fe11f..24427f6b3c2 100644 --- a/htdocs/core/class/menubase.class.php +++ b/htdocs/core/class/menubase.class.php @@ -434,7 +434,7 @@ class Menubase $this->newmenu = $newmenu; // Load datas from database into $tabMenu, later we will complete this->newmenu with values into $tabMenu - if (count($tabMenu) == 0) + if (count($tabMenu) == 0) // To avoid to read into database a second time { $this->menuLoad($mainmenu, $leftmenu, $type_user, $menu_handler, $tabMenu); } @@ -535,7 +535,7 @@ class Menubase // If type_user == 2, no test required $sql.= " ORDER BY m.position, m.rowid"; - dol_syslog(get_class($this)."::menuLeftCharger sql=".$sql); + dol_syslog(get_class($this)."::menuLoad mymainmenu=".$mymainmenu." myleftmenu=".$myleftmenu." type_user=".$type_user." menu_handler=".$menu_handler." tabMenu size=".count($tabMenu)." sql=".$sql); $resql = $this->db->query($sql); if ($resql) { diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 576d9845776..53126eb70a1 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -473,8 +473,8 @@ function dol_strtoupper($utf8_string) /** * Write log message into outputs. Possible outputs can be: - * A file if SYSLOG_FILE_ON defined: file name is then defined by SYSLOG_FILE - * Syslog if SYSLOG_SYSLOG_ON defined: facility is then defined by SYSLOG_FACILITY + * SYSLOG_HANDLERS = ["mod_syslog_file"] file name is then defined by SYSLOG_FILE + * SYSLOG_HANDLERS = ["mod_syslog_syslog"] facility is then defined by SYSLOG_FACILITY * Warning, syslog functions are bugged on Windows, generating memory protection faults. To solve * this, use logging to files instead of syslog (see setup of module). * Note: If SYSLOG_FILE_NO_ERROR defined, we never output any error message when writing to log fails. diff --git a/htdocs/core/menus/standard/auguria_frontoffice.php b/htdocs/core/menus/standard/auguria_frontoffice.php index 7d095d8e6d4..8432a29e9af 100644 --- a/htdocs/core/menus/standard/auguria_frontoffice.php +++ b/htdocs/core/menus/standard/auguria_frontoffice.php @@ -98,6 +98,8 @@ class MenuLeft */ function showmenu() { + global $conf; + require_once DOL_DOCUMENT_ROOT.'/core/menus/standard/auguria.lib.php'; $res=print_left_auguria_menu($this->db,$this->menu_array,$this->menu_array_after); diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 51e61dfb6c9..5ad1389819b 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -444,7 +444,7 @@ function print_eldy_menu($db,$atarget,$type_user) $tabMenu=array(); $menuArbo = new Menubase($db,'eldy','top'); - $newTabMenu = $menuArbo->menuTopCharger('','',$type_user,'eldy',$tabMenu); + $newTabMenu = $menuArbo->menuTopCharger('','',$type_user,'eldy',$tabMenu); // Return tabMenu with only top entries $num = count($newTabMenu); for($i = 0; $i < $num; $i++) diff --git a/htdocs/core/menus/standard/eldy_frontoffice.php b/htdocs/core/menus/standard/eldy_frontoffice.php index 355619e6832..9aec7ac62a4 100644 --- a/htdocs/core/menus/standard/eldy_frontoffice.php +++ b/htdocs/core/menus/standard/eldy_frontoffice.php @@ -96,6 +96,8 @@ class MenuLeft */ function showmenu() { + global $conf; + require_once DOL_DOCUMENT_ROOT.'/core/menus/standard/eldy.lib.php'; $res=print_left_eldy_menu($this->db,$this->menu_array,$this->menu_array_after); diff --git a/htdocs/install/inc.php b/htdocs/install/inc.php index 799ce4e2e98..e65c6a35b40 100644 --- a/htdocs/install/inc.php +++ b/htdocs/install/inc.php @@ -303,7 +303,7 @@ function conf($dolibarr_main_document_root) // Force usage of log file for install and upgrades $conf->syslog->enabled=1; $conf->global->SYSLOG_LEVEL=constant('LOG_DEBUG'); - if (! defined('SYSLOG_FILE_ON')) define('SYSLOG_FILE_ON',1); + if (! defined('SYSLOG_HANDLERS')) define('SYSLOG_HANDLERS','["mod_syslog_file"]'); if (! defined('SYSLOG_FILE')) // To avoid warning on systems with constant already defined { if (@is_writable('/tmp')) define('SYSLOG_FILE','/tmp/dolibarr_install.log'); diff --git a/htdocs/install/mysql/data/llx_c_currencies.sql b/htdocs/install/mysql/data/llx_c_currencies.sql index fa84275d24f..293c1ea8796 100644 --- a/htdocs/install/mysql/data/llx_c_currencies.sql +++ b/htdocs/install/mysql/data/llx_c_currencies.sql @@ -85,6 +85,7 @@ INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'ILS' INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'JMD', '[74,36]', 1, 'Jamaica Dollar'); INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'JPY', '[165]', 1, 'Japan Yen'); INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'JEP', '[163]', 1, 'Jersey Pound'); +INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'KES', NULL, 1, 'Kenya Shilling'); INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'KZT', '[1083,1074]', 1, 'Kazakhstan Tenge'); INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'KPW', '[8361]', 1, 'Korea (North) Won'); INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'KRW', '[8361]', 1, 'Korea (South) Won'); diff --git a/htdocs/install/mysql/data/llx_const.sql b/htdocs/install/mysql/data/llx_const.sql index 973152f119c..d9fdc2ba8da 100644 --- a/htdocs/install/mysql/data/llx_const.sql +++ b/htdocs/install/mysql/data/llx_const.sql @@ -35,7 +35,7 @@ insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_N insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_FEATURES_LEVEL','0','chaine','Level of features to show (0=stable only, 1=stable+experimental, 2=stable+experimental+development',1,0); -- Hidden and common to all entities -insert into llx_const (name, value, type, note, visible, entity) values ('SYSLOG_FILE_ON','1','chaine','Log to file Directory where to write log file',0,0); +insert into llx_const (name, value, type, note, visible, entity) values ('SYSLOG_HANDLERS','["mod_syslog_file"]','chaine','Which logger to use',0,0); insert into llx_const (name, value, type, note, visible, entity) values ('SYSLOG_FILE','DOL_DATA_ROOT/dolibarr.log','chaine','Directory where to write log file',0,0); insert into llx_const (name, value, type, note, visible, entity) values ('SYSLOG_LEVEL','7','chaine','Level of debug info to show',0,0); |