diff --git a/htdocs/admin/limits.php b/htdocs/admin/limits.php index 43c4cc84776..34da6f7d34e 100644 --- a/htdocs/admin/limits.php +++ b/htdocs/admin/limits.php @@ -100,9 +100,12 @@ if ($action == 'update') $form = new Form($db); -llxHeader(); +$title = $langs->trans("LimitsSetup"); +$help_url = ''; -print load_fiche_titre($langs->trans("LimitsSetup"), '', 'title_setup'); +llxHeader('', $title, $help_url); + +print load_fiche_titre($title, '', 'title_setup'); $aCurrencies = array($conf->currency); // Default currency always first position @@ -125,7 +128,8 @@ if (!empty($conf->multicurrency->enabled) && !empty($conf->global->MULTICURRENCY if (!empty($aCurrencies) && count($aCurrencies) > 1) { $head = multicurrencyLimitPrepareHead($aCurrencies); - print dol_get_fiche_head($head, $currencycode, '', -1, "multicurrency"); + + print dol_get_fiche_head($head, $currencycode, '', -1, ''); } } @@ -172,6 +176,7 @@ if ($action == 'edit') print ''; print '
'; } else { + print '
'; print ''; print ''; @@ -191,6 +196,7 @@ if ($action == 'edit') print ''; print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.(isset($conf->global->$mainroundingruletot) ? $conf->global->$mainroundingruletot : $conf->global->MAIN_ROUNDING_RULE_TOT).'
'; + print '
'; print '
'; print ''.$langs->trans("Modify").''; diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index b8cdf8cd085..704a4496d03 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -924,30 +924,33 @@ function purgeSessions($mysessionid) dol_syslog('admin.lib:purgeSessions mysessionid='.$mysessionid.' sessPath='.$sessPath); $error = 0; - $dh = @opendir(dol_osencode($sessPath)); - while (($file = @readdir($dh)) !== false) { - if ($file != "." && $file != "..") { - $fullpath = $sessPath.$file; - if (!@is_dir($fullpath)) { - $sessValues = file_get_contents($fullpath); // get raw session data - if (preg_match('/dol_login/i', $sessValues) && // limit to dolibarr session - preg_match('/dol_entity\|s:([0-9]+):"('.$conf->entity.')"/i', $sessValues) && // limit to current entity - preg_match('/dol_company\|s:([0-9]+):"('.$conf->global->MAIN_INFO_SOCIETE_NOM.')"/i', $sessValues)) { // limit to company name - $tmp = explode('_', $file); - $idsess = $tmp[1]; - // We remove session if it's not ourself - if ($idsess != $mysessionid) { - $res = @unlink($fullpath); - if (!$res) { - $error++; + $dh = @opendir(dol_osencode($sessPath)); + if ($dh) { + while (($file = @readdir($dh)) !== false) { + if ($file != "." && $file != "..") { + $fullpath = $sessPath.$file; + if (!@is_dir($fullpath)) { + $sessValues = file_get_contents($fullpath); // get raw session data + + if (preg_match('/dol_login/i', $sessValues) && // limit to dolibarr session + preg_match('/dol_entity\|s:([0-9]+):"('.$conf->entity.')"/i', $sessValues) && // limit to current entity + preg_match('/dol_company\|s:([0-9]+):"('.$conf->global->MAIN_INFO_SOCIETE_NOM.')"/i', $sessValues)) { // limit to company name + $tmp = explode('_', $file); + $idsess = $tmp[1]; + // We remove session if it's not ourself + if ($idsess != $mysessionid) { + $res = @unlink($fullpath); + if (!$res) { + $error++; + } } } } } } + @closedir($dh); } - @closedir($dh); if (!$error) { return 1; diff --git a/htdocs/core/menus/standard/empty.php b/htdocs/core/menus/standard/empty.php index b3151e15748..213cd14e9b0 100644 --- a/htdocs/core/menus/standard/empty.php +++ b/htdocs/core/menus/standard/empty.php @@ -348,14 +348,29 @@ class MenuManager // ***** END ***** + $menu_array_before = array(); + $menu_array_after = array(); + // do not change code after this + $menu_array = $this->menu->liste; + if (is_array($menu_array_before)) { + $menu_array = array_merge($menu_array_before, $menu_array); + } + if (is_array($menu_array_after)) { + $menu_array = array_merge($menu_array, $menu_array_after); + } + //var_dump($menu_array);exit; + if (!is_array($menu_array)) { + return 0; + } + if (empty($noout)) { $alt = 0; $altok = 0; $blockvmenuopened = false; - $num = count($this->menu->liste); + $num = count($menu_array); for ($i = 0; $i < $num; $i++) { $alt++; - if (empty($this->menu->liste[$i]['level'])) { + if (empty($menu_array[$i]['level'])) { $altok++; $blockvmenuopened = true; $lastopened = true; @@ -375,55 +390,55 @@ class MenuManager // Add tabulation $tabstring = ''; - $tabul = ($this->menu->liste[$i]['level'] - 1); + $tabul = ($menu_array[$i]['level'] - 1); if ($tabul > 0) { for ($j = 0; $j < $tabul; $j++) { $tabstring .= '   '; } } - if ($this->menu->liste[$i]['level'] == 0) { - if ($this->menu->liste[$i]['enabled']) { - print ''."\n"; + if ($menu_array[$i]['level'] == 0) { + if ($menu_array[$i]['enabled']) { + print ''."\n"; } else { - print ''."\n"; + print ''."\n"; } print ''."\n"; } - if ($this->menu->liste[$i]['level'] > 0) { + if ($menu_array[$i]['level'] > 0) { $cssmenu = ''; - if ($this->menu->liste[$i]['url']) { - $cssmenu = ' menu_contenu'.dol_string_nospecial(preg_replace('/\.php.*$/', '', $this->menu->liste[$i]['url'])); + if ($menu_array[$i]['url']) { + $cssmenu = ' menu_contenu'.dol_string_nospecial(preg_replace('/\.php.*$/', '', $menu_array[$i]['url'])); } print ''."\n"; } // If next is a new block or end - if (empty($this->menu->liste[$i + 1]['level'])) { + if (empty($menu_array[$i + 1]['level'])) { print ''."\n"; print "
\n"; } @@ -436,66 +451,9 @@ class MenuManager if ($mode == 'jmobile') { $this->leftmenu = clone $this->menu; - unset($this->menu->liste); + unset($menu_array); } } - /* - if ($mode == 'jmobile') - { - $substitarray = getCommonSubstitutionArray($langs, 0, null, null); - - foreach($this->menu->liste as $key => $val) // $val['url','titre','level','enabled'=0|1|2,'target','mainmenu','leftmenu' - { - print ''."\n"; - - break; // Only first menu entry (so home) - } - } - */ unset($this->menu); return $res;