diff --git a/ChangeLog b/ChangeLog
index 46779a760c5..9e0b301edde 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,23 +5,23 @@ English Dolibarr ChangeLog
***** ChangeLog for 13.0.0 compared to 12.0.0 *****
For users:
-NEW: Add module Credit transfer SEPA to manage payment of supplier using bank credit transfer SEPA files
-NEW: Module Reception (for a more accurate management of your receptions) moved from experimental to stable
+NEW: Add module "Credit transfer SEPA" to manage payment of vendors using bank credit transfer SEPA files.
+NEW: Module Reception (for a more accurate management of your receptions) moved from experimental to stable.
WARNING:
Following changes may create regressions for some external modules, but were necessary to make Dolibarr better:
* Properties ->contactid has been renamed into ->contact_id
-* Rename property $paiementid in API api_supplier_invoices into $payment_mode_id
-* The deprecated subsitution key __SIGNATURE__ has been removed. Replace with __USER_SIGNATURE__ if you still use old syntax in
+* Property $paiementid in API api_supplier_invoices has been renamed into into $payment_mode_id (english)
+* The deprecated subsitution key __SIGNATURE__ has been removed. Replace with __USER_SIGNATURE__ if you used the old syntax in
your email templates.
* The hidden option HOLIDAY_MORE_PUBLIC_HOLIDAYS has been removed. Use instead the dictionary table if you need to define custom
days of holiday.
* Property num_paiement has been renamed num_payment everywhere for better code consistency.
* If you build a class that implement CommonObject to use the incoterm properties or method (->fk_incoterm, ->label_incoterm, ->location_incoterm),
you must now also include declaration of the Trait CommonIncoterm in your class. All incoterm functions were moved into this Trait.
-* The GETPOST(..., 'alpha') has now the same behaviour than GETPOST(..., 'alpahnohtml');
+* The GETPOST(..., 'alpha') has now the same behaviour than GETPOST(..., 'alphanohtml');
***** ChangeLog for 12.0.3 compared to 12.0.2 *****
diff --git a/htdocs/accountancy/expensereport/list.php b/htdocs/accountancy/expensereport/list.php
index 265e9488055..77b8c6e57b9 100644
--- a/htdocs/accountancy/expensereport/list.php
+++ b/htdocs/accountancy/expensereport/list.php
@@ -43,7 +43,7 @@ $massaction = GETPOST('massaction', 'alpha');
$show_files = GETPOST('show_files', 'int');
$confirm = GETPOST('confirm', 'alpha');
$toselect = GETPOST('toselect', 'array');
-$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'myobjectlist'; // To manage different context of search
+$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'expensereportlist'; // To manage different context of search
$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
diff --git a/htdocs/adherents/subscription/list.php b/htdocs/adherents/subscription/list.php
index b06ee5f227e..364a7854fb7 100644
--- a/htdocs/adherents/subscription/list.php
+++ b/htdocs/adherents/subscription/list.php
@@ -33,10 +33,9 @@ $langs->loadLangs(array("members", "companies"));
$action = GETPOST('action', 'aZ09');
$massaction = GETPOST('massaction', 'alpha');
-$contextpage = GETPOST('contextpage', 'aZ09');
$confirm = GETPOST('confirm', 'alpha');
$toselect = GETPOST('toselect', 'array');
-$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'myobjectlist'; // To manage different context of search
+$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'subscriptionlist'; // To manage different context of search
$statut = (GETPOSTISSET("statut") ?GETPOST("statut", "alpha") : 1);
$search_ref = GETPOST('search_ref', 'alpha');
diff --git a/htdocs/admin/boxes.php b/htdocs/admin/boxes.php
index 4f6dfff33a5..2dbcfe00015 100644
--- a/htdocs/admin/boxes.php
+++ b/htdocs/admin/boxes.php
@@ -175,10 +175,10 @@ if ($action == 'switch')
$db->begin();
$objfrom = new ModeleBoxes($db);
- $objfrom->fetch($_GET["switchfrom"]);
+ $objfrom->fetch(GETPOST("switchfrom", 'int'));
$objto = new ModeleBoxes($db);
- $objto->fetch($_GET["switchto"]);
+ $objto->fetch(GETPOST('switchto', 'int'));
$resultupdatefrom = 0;
$resultupdateto = 0;
@@ -192,12 +192,12 @@ if ($action == 'switch')
$newsecondnum = preg_replace('/[a-zA-Z]+/', '', $newsecond);
$newsecond = sprintf("%s%02d", $newsecondchar ? $newsecondchar : 'A', $newsecondnum + 1);
}
- $sql = "UPDATE ".MAIN_DB_PREFIX."boxes SET box_order='".$db->escape($newfirst)."' WHERE rowid=".$objfrom->rowid;
+ $sql = "UPDATE ".MAIN_DB_PREFIX."boxes SET box_order='".$db->escape($newfirst)."' WHERE rowid=".((int) $objfrom->rowid);
dol_syslog($sql);
$resultupdatefrom = $db->query($sql);
if (!$resultupdatefrom) { dol_print_error($db); }
- $sql = "UPDATE ".MAIN_DB_PREFIX."boxes SET box_order='".$db->escape($newsecond)."' WHERE rowid=".$objto->rowid;
+ $sql = "UPDATE ".MAIN_DB_PREFIX."boxes SET box_order='".$db->escape($newsecond)."' WHERE rowid=".((int) $objto->rowid);
dol_syslog($sql);
$resultupdateto = $db->query($sql);
if (!$resultupdateto) { dol_print_error($db); }
diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php
index 8211fd1cadf..724a978996b 100644
--- a/htdocs/admin/company.php
+++ b/htdocs/admin/company.php
@@ -558,7 +558,7 @@ $langs->load("companies");
// Managing Director(s)
print '
'.$langs->trans("ManagingDirectors").' ';
-print ' ';
+print ' ';
// GDPR contact
print '';
@@ -568,7 +568,7 @@ print ' '.$langs->trans("Capital").' ';
-print ' ';
+print ' ';
// Juridical Status
print ''.$langs->trans("JuridicalStatus").' ';
diff --git a/htdocs/admin/emailcollector_card.php b/htdocs/admin/emailcollector_card.php
index cb48336e72c..9d5dcbc32e3 100644
--- a/htdocs/admin/emailcollector_card.php
+++ b/htdocs/admin/emailcollector_card.php
@@ -45,7 +45,7 @@ $ref = GETPOST('ref', 'alpha');
$action = GETPOST('action', 'aZ09');
$confirm = GETPOST('confirm', 'alpha');
$cancel = GETPOST('cancel', 'aZ09');
-$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'myobjectcard'; // To manage different context of search
+$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'emailcollectorcard'; // To manage different context of search
$backtopage = GETPOST('backtopage', 'alpha');
$operationid = GETPOST('operationid', 'int');
diff --git a/htdocs/admin/events.php b/htdocs/admin/events.php
index 931cefb2992..37d1a795428 100644
--- a/htdocs/admin/events.php
+++ b/htdocs/admin/events.php
@@ -36,7 +36,7 @@ if (!$user->admin) {
$langs->loadLangs(array("users", "admin", "other"));
$action = GETPOST('action', 'aZ09');
-$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'myobjectlist'; // To manage different context of search
+$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'auditeventslist'; // To manage different context of search
$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
// Load variable for pagination
diff --git a/htdocs/admin/geoipmaxmind.php b/htdocs/admin/geoipmaxmind.php
index 0a118dfe065..6b8fe0ab3b7 100644
--- a/htdocs/admin/geoipmaxmind.php
+++ b/htdocs/admin/geoipmaxmind.php
@@ -47,7 +47,12 @@ if ($action == 'set')
$gimcdf = GETPOST("GEOIPMAXMIND_COUNTRY_DATAFILE");
- if (!$gimcdf && !file_exists($gimcdf))
+ if (!$error && $gimcdf && ! preg_match('/\.(dat|mmdb)$/', $gimcdf)) {
+ setEventMessages($langs->trans("ErrorFileMustHaveFormat", '.dat|.mmdb'), null, 'errors');
+ $error++;
+ }
+
+ if (!$error && $gimcdf && !file_exists($gimcdf))
{
setEventMessages($langs->trans("ErrorFileNotFound", $gimcdf), null, 'errors');
$error++;
@@ -126,7 +131,7 @@ if ($conf->global->GEOIP_VERSION == 'php')
{
print 'Using geoip PHP internal functions. Value must be '.geoip_db_filename(GEOIP_COUNTRY_EDITION).' or '.geoip_db_filename(GEOIP_CITY_EDITION_REV1).' or /pathtodatafile/GeoLite2-Country.mmdb ';
}
-print ' ';
+print ' ';
print ' ';
print '';
@@ -148,7 +153,7 @@ print $langs->trans("YouCanDownloadAdvancedDatFileTo", ' ';
- print ' '.$langs->trans("TestGeoIPResult", $ip).':';
+ print ''.$langs->trans("TestGeoIPResult", $ip).': ';
$ip = '24.24.24.24';
print ' '.$ip.' -> ';
diff --git a/htdocs/asset/card.php b/htdocs/asset/card.php
index 6c017d6e765..3434b03da99 100644
--- a/htdocs/asset/card.php
+++ b/htdocs/asset/card.php
@@ -37,7 +37,7 @@ $ref = GETPOST('ref', 'alpha');
$action = GETPOST('action', 'aZ09');
$confirm = GETPOST('confirm', 'alpha');
$cancel = GETPOST('cancel', 'aZ09');
-$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'myobjectcard'; // To manage different context of search
+$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'assetcard'; // To manage different context of search
$backtopage = GETPOST('backtopage', 'alpha');
$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha');
diff --git a/htdocs/asset/list.php b/htdocs/asset/list.php
index 936b070ec5a..d9bfea71510 100644
--- a/htdocs/asset/list.php
+++ b/htdocs/asset/list.php
@@ -39,7 +39,7 @@ $show_files = GETPOST('show_files', 'int'); // Show files area generated by bulk
$confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation
$cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button
$toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list
-$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'assetslist'; // To manage different context of search
+$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'assetlist'; // To manage different context of search
$backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page
$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
diff --git a/htdocs/bookmarks/list.php b/htdocs/bookmarks/list.php
index ca8e1d5c16a..3b01efdeea8 100644
--- a/htdocs/bookmarks/list.php
+++ b/htdocs/bookmarks/list.php
@@ -32,7 +32,7 @@ $massaction = GETPOST('massaction', 'alpha');
$show_files = GETPOST('show_files', 'int');
$confirm = GETPOST('confirm', 'alpha');
$toselect = GETPOST('toselect', 'array');
-$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'myobjectlist'; // To manage different context of search
+$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'bookmarklist'; // To manage different context of search
// Security check
if (!$user->rights->bookmark->lire) {
diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php
index 202a5770f06..32ed91becbe 100644
--- a/htdocs/categories/viewcat.php
+++ b/htdocs/categories/viewcat.php
@@ -47,7 +47,7 @@ $show_files = GETPOST('show_files', 'int'); // Show files area generated by bulk
$confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation
$cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button
$toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list
-$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'myobjectlist'; // To manage different context of search
+$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'categorylist'; // To manage different context of search
$backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page
$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
diff --git a/htdocs/comm/action/peruser.php b/htdocs/comm/action/peruser.php
index 94105c55303..f99cc3cbd16 100644
--- a/htdocs/comm/action/peruser.php
+++ b/htdocs/comm/action/peruser.php
@@ -110,8 +110,8 @@ if ($dateselect > 0)
$tmp = empty($conf->global->MAIN_DEFAULT_WORKING_HOURS) ? '9-18' : $conf->global->MAIN_DEFAULT_WORKING_HOURS;
$tmp = str_replace(' ', '', $tmp); // FIX 7533
$tmparray = explode('-', $tmp);
-$begin_h = GETPOST('begin_h', 'int') != '' ?GETPOST('begin_h', 'int') : ($tmparray[0] != '' ? $tmparray[0] : 9);
-$end_h = GETPOST('end_h', 'int') ?GETPOST('end_h', 'int') : ($tmparray[1] != '' ? $tmparray[1] : 18);
+$begin_h = GETPOST('begin_h', 'int') != '' ? GETPOST('begin_h', 'int') : ($tmparray[0] != '' ? $tmparray[0] : 9);
+$end_h = GETPOST('end_h', 'int') ? GETPOST('end_h', 'int') : ($tmparray[1] != '' ? $tmparray[1] : 18);
if ($begin_h < 0 || $begin_h > 23) $begin_h = 9;
if ($end_h < 1 || $end_h > 24) $end_h = 18;
if ($end_h <= $begin_h) $end_h = $begin_h + 1;
diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php
index c144b388093..bbcdd2ab895 100644
--- a/htdocs/compta/facture/list.php
+++ b/htdocs/compta/facture/list.php
@@ -837,8 +837,7 @@ if ($resql)
print '';
print '';
print $langs->trans('to').' ';*/
- print $langs->trans("Before").' ';
- print $form->selectDate($search_datelimit_end ? $search_datelimit_end : -1, 'search_datelimit_end', 0, 0, 1);
+ print $form->selectDate($search_datelimit_end ? $search_datelimit_end : -1, 'search_datelimit_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("Before"));
print ' '.$langs->trans("Alert");
print '
';
print '';
diff --git a/htdocs/compta/prelevement/card.php b/htdocs/compta/prelevement/card.php
index 1370155cb1d..ad105c5e364 100644
--- a/htdocs/compta/prelevement/card.php
+++ b/htdocs/compta/prelevement/card.php
@@ -179,7 +179,7 @@ if ($id > 0 || $ref)
}*/
- $linkback = ''.$langs->trans("BackToList").' ';
+ $linkback = ''.$langs->trans("BackToList").' ';
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref');
diff --git a/htdocs/compta/prelevement/demandes.php b/htdocs/compta/prelevement/demandes.php
index c6c0f24497a..94c8c0639e1 100644
--- a/htdocs/compta/prelevement/demandes.php
+++ b/htdocs/compta/prelevement/demandes.php
@@ -40,7 +40,7 @@ $status = GETPOST('status', 'int');
if ($user->socid) $socid = $user->socid;
$result = restrictedArea($user, 'prelevement', '', '', 'bons');
-$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'myobjectlist'; // To manage different context of search
+$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'directdebitcredittransferlist'; // To manage different context of search
$backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page
$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
diff --git a/htdocs/compta/prelevement/factures.php b/htdocs/compta/prelevement/factures.php
index 0b0c0eef6d4..4e3d191fdfa 100644
--- a/htdocs/compta/prelevement/factures.php
+++ b/htdocs/compta/prelevement/factures.php
@@ -86,7 +86,7 @@ if ($id > 0 || $ref)
$head = prelevement_prepare_head($object);
dol_fiche_head($head, 'invoices', $langs->trans("WithdrawalsReceipts"), -1, 'payment');
- $linkback = ''.$langs->trans("BackToList").' ';
+ $linkback = ''.$langs->trans("BackToList").' ';
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref');
diff --git a/htdocs/compta/prelevement/fiche-rejet.php b/htdocs/compta/prelevement/fiche-rejet.php
index 6e601d82ecd..7783edd4673 100644
--- a/htdocs/compta/prelevement/fiche-rejet.php
+++ b/htdocs/compta/prelevement/fiche-rejet.php
@@ -80,7 +80,7 @@ if ($prev_id > 0 || $ref)
$head = prelevement_prepare_head($object);
dol_fiche_head($head, 'rejects', $langs->trans("WithdrawalsReceipts"), -1, 'payment');
- $linkback = ''.$langs->trans("BackToList").' ';
+ $linkback = ''.$langs->trans("BackToList").' ';
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref');
diff --git a/htdocs/compta/prelevement/fiche-stat.php b/htdocs/compta/prelevement/fiche-stat.php
index 4ff81467d7c..df5118df0cf 100644
--- a/htdocs/compta/prelevement/fiche-stat.php
+++ b/htdocs/compta/prelevement/fiche-stat.php
@@ -79,7 +79,7 @@ if ($prev_id > 0 || $ref)
$head = prelevement_prepare_head($object);
dol_fiche_head($head, 'statistics', $langs->trans("WithdrawalsReceipts"), -1, 'payment');
- $linkback = ''.$langs->trans("BackToList").' ';
+ $linkback = ''.$langs->trans("BackToList").' ';
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref');
diff --git a/htdocs/compta/prelevement/list.php b/htdocs/compta/prelevement/list.php
index 6f9685ece18..36aa4bb8e5c 100644
--- a/htdocs/compta/prelevement/list.php
+++ b/htdocs/compta/prelevement/list.php
@@ -38,7 +38,7 @@ $show_files = GETPOST('show_files', 'int'); // Show files area generated by bulk
$confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation
$cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button
$toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list
-$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'myobjectlist'; // To manage different context of search
+$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'directdebitcredittransferlinelist'; // To manage different context of search
$backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page
$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
diff --git a/htdocs/compta/prelevement/bons.php b/htdocs/compta/prelevement/orders_list.php
similarity index 97%
rename from htdocs/compta/prelevement/bons.php
rename to htdocs/compta/prelevement/orders_list.php
index 69d6412b235..d4f16eab7f6 100644
--- a/htdocs/compta/prelevement/bons.php
+++ b/htdocs/compta/prelevement/orders_list.php
@@ -19,9 +19,9 @@
*/
/**
- * \file htdocs/compta/prelevement/bons.php
+ * \file htdocs/compta/prelevement/orders_list.php
* \ingroup prelevement
- * \brief Page liste des bons de prelevements
+ * \brief Page to list direct debit orders or credit transfer orders
*/
require '../../main.inc.php';
@@ -31,7 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
// Load translation files required by the page
$langs->loadLangs(array('banks', 'categories', 'widthdrawals'));
-$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'myobjectlist'; // To manage different context of search
+$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'directdebitcredittransferlist'; // To manage different context of search
// Security check
$socid = GETPOST('socid', 'int');
diff --git a/htdocs/core/boxes/modules_boxes.php b/htdocs/core/boxes/modules_boxes.php
index 51719ec6c15..80589e4c4f3 100644
--- a/htdocs/core/boxes/modules_boxes.php
+++ b/htdocs/core/boxes/modules_boxes.php
@@ -143,10 +143,10 @@ class ModeleBoxes // Can't be abtract as it is instantiated to build "empty" box
global $conf;
// Recupere liste des boites d'un user si ce dernier a sa propre liste
- $sql = "SELECT b.rowid, b.box_id, b.position, b.box_order, b.fk_user";
+ $sql = "SELECT b.rowid as id, b.box_id, b.position, b.box_order, b.fk_user";
$sql .= " FROM ".MAIN_DB_PREFIX."boxes as b";
$sql .= " WHERE b.entity = ".$conf->entity;
- $sql .= " AND b.rowid = ".$rowid;
+ $sql .= " AND b.rowid = ".((int) $rowid);
dol_syslog(get_class($this)."::fetch rowid=".$rowid);
$resql = $this->db->query($sql);
@@ -155,7 +155,8 @@ class ModeleBoxes // Can't be abtract as it is instantiated to build "empty" box
$obj = $this->db->fetch_object($resql);
if ($obj)
{
- $this->rowid = $obj->rowid;
+ $this->id = $obj->id;
+ $this->rowid = $obj->id; // For backward compatibility
$this->box_id = $obj->box_id;
$this->position = $obj->position;
$this->box_order = $obj->box_order;
diff --git a/htdocs/core/class/menu.class.php b/htdocs/core/class/menu.class.php
index 60bf6474031..06bc79804bf 100644
--- a/htdocs/core/class/menu.class.php
+++ b/htdocs/core/class/menu.class.php
@@ -120,7 +120,8 @@ class Menu
$nb = 0;
foreach ($this->liste as $val)
{
- if (!empty($val['enabled'])) $nb++;
+ //if (dol_eval($val['enabled'], 1)) $nb++;
+ if (!empty($val['enabled'])) $nb++; // $val['enabled'] is already evaluated to 0 or 1, no need for dol_eval()
}
return $nb;
}
diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index e9375f91e30..f6a5c172c0a 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -3896,20 +3896,21 @@ function dol_print_error($db = '', $error = '', $errors = null)
$out = '';
$syslog = '';
- // Si erreur intervenue avant chargement langue
+ // If error occurs before the $lang object was loaded
if (!$langs)
{
require_once DOL_DOCUMENT_ROOT.'/core/class/translate.class.php';
$langs = new Translate('', $conf);
$langs->load("main");
}
- // Load translation files required by the page
+
+ // Load translation files required by the error messages
$langs->loadLangs(array('main', 'errors'));
if ($_SERVER['DOCUMENT_ROOT']) // Mode web
{
$out .= $langs->trans("DolibarrHasDetectedError").". \n";
- if (!empty($conf->global->MAIN_FEATURES_LEVEL)) $out .= "You use an experimental or develop level of features, so please do NOT report any bugs, except if problem is confirmed moving option MAIN_FEATURES_LEVEL back to 0. \n";
+ if (!empty($conf->global->MAIN_FEATURES_LEVEL)) $out .= "You use an experimental or develop level of features, so please do NOT report any bugs or vulnerability, except if problem is confirmed after moving option MAIN_FEATURES_LEVEL back to 0. \n";
$out .= $langs->trans("InformationToHelpDiagnose").": \n";
$out .= "".$langs->trans("Date").": ".dol_print_date(time(), 'dayhourlog')." \n";
@@ -3919,7 +3920,7 @@ function dol_print_error($db = '', $error = '', $errors = null)
{
$out .= "".$langs->trans("PHP").": ".phpversion()." \n";
}
- $out .= "".$langs->trans("Server").": ".$_SERVER["SERVER_SOFTWARE"]." \n";
+ $out .= "".$langs->trans("Server").": ".dol_htmlentities($_SERVER["SERVER_SOFTWARE"])." \n";
if (function_exists("php_uname"))
{
$out .= "".$langs->trans("OS").": ".php_uname()." \n";
@@ -3927,8 +3928,8 @@ function dol_print_error($db = '', $error = '', $errors = null)
$out .= "".$langs->trans("UserAgent").": ".dol_htmlentities($_SERVER["HTTP_USER_AGENT"], ENT_COMPAT, 'UTF-8')." \n";
$out .= " \n";
$out .= "".$langs->trans("RequestedUrl").": ".dol_htmlentities($_SERVER["REQUEST_URI"], ENT_COMPAT, 'UTF-8')." \n";
- $out .= "".$langs->trans("Referer").": ".(isset($_SERVER["HTTP_REFERER"]) ?dol_htmlentities($_SERVER["HTTP_REFERER"], ENT_COMPAT, 'UTF-8') : '')." \n";
- $out .= "".$langs->trans("MenuManager").": ".(isset($conf->standard_menu) ? $conf->standard_menu : '')." \n";
+ $out .= "".$langs->trans("Referer").": ".(isset($_SERVER["HTTP_REFERER"]) ? dol_htmlentities($_SERVER["HTTP_REFERER"], ENT_COMPAT, 'UTF-8') : '')." \n";
+ $out .= "".$langs->trans("MenuManager").": ".(isset($conf->standard_menu) ? dol_htmlentities($conf->standard_menu) : '')." \n";
$out .= " \n";
$syslog .= "url=".dol_escape_htmltag($_SERVER["REQUEST_URI"]);
$syslog .= ", query_string=".dol_escape_htmltag($_SERVER["QUERY_STRING"]);
@@ -3948,9 +3949,9 @@ function dol_print_error($db = '', $error = '', $errors = null)
if ($_SERVER['DOCUMENT_ROOT']) // Mode web
{
$out .= "".$langs->trans("DatabaseTypeManager").": ".$db->type." \n";
- $out .= "".$langs->trans("RequestLastAccessInError").": ".($db->lastqueryerror() ?dol_escape_htmltag($db->lastqueryerror()) : $langs->trans("ErrorNoRequestInError"))." \n";
- $out .= "".$langs->trans("ReturnCodeLastAccessInError").": ".($db->lasterrno() ?dol_escape_htmltag($db->lasterrno()) : $langs->trans("ErrorNoRequestInError"))." \n";
- $out .= "".$langs->trans("InformationLastAccessInError").": ".($db->lasterror() ?dol_escape_htmltag($db->lasterror()) : $langs->trans("ErrorNoRequestInError"))." \n";
+ $out .= "".$langs->trans("RequestLastAccessInError").": ".($db->lastqueryerror() ? dol_escape_htmltag($db->lastqueryerror()) : $langs->trans("ErrorNoRequestInError"))." \n";
+ $out .= "".$langs->trans("ReturnCodeLastAccessInError").": ".($db->lasterrno() ? dol_escape_htmltag($db->lasterrno()) : $langs->trans("ErrorNoRequestInError"))." \n";
+ $out .= "".$langs->trans("InformationLastAccessInError").": ".($db->lasterror() ? dol_escape_htmltag($db->lasterror()) : $langs->trans("ErrorNoRequestInError"))." \n";
$out .= " \n";
} else // Mode CLI
{
@@ -3997,8 +3998,14 @@ function dol_print_error($db = '', $error = '', $errors = null)
$out .= " \n";
}
- if (empty($dolibarr_main_prod)) print $out;
- else {
+ // Return a http error code if possible
+ if (! headers_sent()) {
+ http_response_code(500);
+ }
+
+ if (empty($dolibarr_main_prod)) {
+ print $out;
+ } else {
// This should not happen, except if there is a bug somewhere. Enabled and check log in such case.
print 'This website or feature is currently temporarly not available or failed after a technical error. This may be due to a maintenance operation. Current status of operation are on next line... '."\n";
$langs->load("errors");
@@ -4006,7 +4013,7 @@ function dol_print_error($db = '', $error = '', $errors = null)
print $langs->trans("YouCanSetOptionDolibarrMainProdToZero");
define("MAIN_CORE_ERROR", 1);
}
- //else print 'Sorry, an error occured but the parameter $dolibarr_main_prod is defined in conf file so no message is reported to your browser. Please read the log file for error message.';
+
dol_syslog("Error ".$syslog, LOG_ERR);
}
diff --git a/htdocs/core/menus/init_menu_auguria.sql b/htdocs/core/menus/init_menu_auguria.sql
index b5f96655ed7..bcfe3d42582 100644
--- a/htdocs/core/menus/init_menu_auguria.sql
+++ b/htdocs/core/menus/init_menu_auguria.sql
@@ -322,13 +322,20 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'empty($conf->global->BANK_DISABLE_CHECK_DEPOSIT) && ! empty($conf->banque->enabled) && (! empty($conf->facture->enabled) || ! empty($conf->global->MAIN_MENU_CHEQUE_DEPOSIT_ON))', __HANDLER__, 'left', 1711__+MAX_llx_menu__, 'accountancy', 'checks', 14__+MAX_llx_menu__, '/compta/paiement/cheque/index.php?mainmenu=bank&leftmenu=checks', 'MenuChequeDeposits', 0, 'bills', '$user->rights->banque->lire', '', 2, 9, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'empty($conf->global->BANK_DISABLE_CHECK_DEPOSIT) && ! empty($conf->banque->enabled) && (! empty($conf->facture->enabled) || ! empty($conf->global->MAIN_MENU_CHEQUE_DEPOSIT_ON))', __HANDLER__, 'left', 1712__+MAX_llx_menu__, 'accountancy', '', 1711__+MAX_llx_menu__, '/compta/paiement/cheque/card.php?mainmenu=bank&leftmenu=checks&action=new', 'NewCheckDeposit', 1, 'compta', '$user->rights->banque->lire', '', 2, 0, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'empty($conf->global->BANK_DISABLE_CHECK_DEPOSIT) && ! empty($conf->banque->enabled) && (! empty($conf->facture->enabled) || ! empty($conf->global->MAIN_MENU_CHEQUE_DEPOSIT_ON))', __HANDLER__, 'left', 1713__+MAX_llx_menu__, 'accountancy', '', 1711__+MAX_llx_menu__, '/compta/paiement/cheque/list.php?mainmenu=bank&leftmenu=checks', 'List', 1, 'bills', '$user->rights->banque->lire', '', 2, 1, __ENTITY__);
--- Withdrawal
-insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->prelevement->enabled', __HANDLER__, 'left', 2500__+MAX_llx_menu__, 'accountancy', 'withdraw', 14__+MAX_llx_menu__, '/compta/prelevement/index.php?mainmenu=bank&leftmenu=withdraw', 'StandingOrders', 0, 'withdrawals', '$user->rights->prelevement->bons->lire', '', 2, 9, __ENTITY__);
+-- PaymentByDirectDebit
+insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->prelevement->enabled', __HANDLER__, 'left', 2500__+MAX_llx_menu__, 'accountancy', 'withdraw', 14__+MAX_llx_menu__, '/compta/prelevement/index.php?mainmenu=bank&leftmenu=withdraw', 'PaymentByDirectDebit', 0, 'withdrawals', '$user->rights->prelevement->bons->lire', '', 2, 9, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->prelevement->enabled && $leftmenu=="withdraw"', __HANDLER__, 'left', 2502__+MAX_llx_menu__, 'accountancy', '', 2500__+MAX_llx_menu__, '/compta/prelevement/create.php?mainmenu=bank&leftmenu=withdraw', 'NewStandingOrder', 1, 'withdrawals', '$user->rights->prelevement->bons->lire', '', 2, 0, __ENTITY__);
-insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->prelevement->enabled && $leftmenu=="withdraw"', __HANDLER__, 'left', 2503__+MAX_llx_menu__, 'accountancy', '', 2500__+MAX_llx_menu__, '/compta/prelevement/bons.php?mainmenu=bank&leftmenu=withdraw', 'WithdrawalsReceipts', 1, 'withdrawals', '$user->rights->prelevement->bons->lire', '', 2, 2, __ENTITY__);
+insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->prelevement->enabled && $leftmenu=="withdraw"', __HANDLER__, 'left', 2503__+MAX_llx_menu__, 'accountancy', '', 2500__+MAX_llx_menu__, '/compta/prelevement/orders_list.php?mainmenu=bank&leftmenu=withdraw', 'WithdrawalsReceipts', 1, 'withdrawals', '$user->rights->prelevement->bons->lire', '', 2, 2, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->prelevement->enabled && $leftmenu=="withdraw"', __HANDLER__, 'left', 2504__+MAX_llx_menu__, 'accountancy', '', 2500__+MAX_llx_menu__, '/compta/prelevement/list.php?mainmenu=bank&leftmenu=withdraw', 'WithdrawalsLines', 1, 'withdrawals', '$user->rights->prelevement->bons->lire', '', 2, 3, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->prelevement->enabled && $leftmenu=="withdraw"', __HANDLER__, 'left', 2506__+MAX_llx_menu__, 'accountancy', '', 2500__+MAX_llx_menu__, '/compta/prelevement/rejets.php?mainmenu=bank&leftmenu=withdraw', 'Rejects', 1, 'withdrawals', '$user->rights->prelevement->bons->lire', '', 2, 5, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->prelevement->enabled && $leftmenu=="withdraw"', __HANDLER__, 'left', 2507__+MAX_llx_menu__, 'accountancy', '', 2500__+MAX_llx_menu__, '/compta/prelevement/stats.php?mainmenu=bank&leftmenu=withdraw', 'Statistics', 1, 'withdrawals', '$user->rights->prelevement->bons->lire', '', 2, 6, __ENTITY__);
+-- PaymentByCreditTransfer
+insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->prelevement->enabled', __HANDLER__, 'left', 2510__+MAX_llx_menu__, 'accountancy', 'banktransfer', 14__+MAX_llx_menu__, '/compta/prelevement/index.php?mainmenu=bank&leftmenu=banktransfer&type=bank-transfer', 'PaymentByBankTransfer', 0, 'withdrawals', '$user->rights->prelevement->bons->lire', '', 2, 9, __ENTITY__);
+insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->prelevement->enabled && $leftmenu=="banktransfer"', __HANDLER__, 'left', 2512__+MAX_llx_menu__, 'accountancy', '', 2510__+MAX_llx_menu__, '/compta/prelevement/create.php?mainmenu=bank&leftmenu=banktransfer&type=bank-transfer', 'NewStandingOrder', 1, 'withdrawals', '$user->rights->prelevement->bons->lire', '', 2, 0, __ENTITY__);
+insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->prelevement->enabled && $leftmenu=="banktransfer"', __HANDLER__, 'left', 2513__+MAX_llx_menu__, 'accountancy', '', 2510__+MAX_llx_menu__, '/compta/prelevement/orders_list.php?mainmenu=bank&leftmenu=banktransfer&type=bank-transfer', 'WithdrawalsReceipts', 1, 'withdrawals', '$user->rights->prelevement->bons->lire', '', 2, 2, __ENTITY__);
+insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->prelevement->enabled && $leftmenu=="banktransfer"', __HANDLER__, 'left', 2514__+MAX_llx_menu__, 'accountancy', '', 2510__+MAX_llx_menu__, '/compta/prelevement/list.php?mainmenu=bank&leftmenu=banktransfer&type=bank-transfer', 'WithdrawalsLines', 1, 'withdrawals', '$user->rights->prelevement->bons->lire', '', 2, 3, __ENTITY__);
+insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->prelevement->enabled && $leftmenu=="banktransfer"', __HANDLER__, 'left', 2516__+MAX_llx_menu__, 'accountancy', '', 2510__+MAX_llx_menu__, '/compta/prelevement/rejets.php?mainmenu=bank&leftmenu=banktransfer&type=bank-transfer', 'Rejects', 1, 'withdrawals', '$user->rights->prelevement->bons->lire', '', 2, 5, __ENTITY__);
+insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->prelevement->enabled && $leftmenu=="banktransfer"', __HANDLER__, 'left', 2517__+MAX_llx_menu__, 'accountancy', '', 2510__+MAX_llx_menu__, '/compta/prelevement/stats.php?mainmenu=bank&leftmenu=banktransfer&type=bank-transfer', 'Statistics', 1, 'withdrawals', '$user->rights->prelevement->bons->lire', '', 2, 6, __ENTITY__);
-- Bank
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->banque->enabled', __HANDLER__, 'left', 2600__+MAX_llx_menu__, 'accountancy', 'bank', 14__+MAX_llx_menu__, '/compta/bank/list.php?mainmenu=bank&leftmenu=bank', 'MenuBankCash', 0, 'banks', '$user->rights->banque->lire', '', 0, 1, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->banque->enabled && ($leftmenu=="bank" || $leftmenu=="checks" || $leftmenu=="withdraw")', __HANDLER__, 'left', 2601__+MAX_llx_menu__, 'accountancy', '', 2600__+MAX_llx_menu__, '/compta/bank/card.php?mainmenu=bank&action=create&leftmenu=bank', 'MenuNewFinancialAccount', 1, 'banks', '$user->rights->banque->configurer', '', 0, 0, __ENTITY__);
diff --git a/htdocs/core/menus/standard/auguria_menu.php b/htdocs/core/menus/standard/auguria_menu.php
index a9d05fe4b5c..5b7aa913350 100644
--- a/htdocs/core/menus/standard/auguria_menu.php
+++ b/htdocs/core/menus/standard/auguria_menu.php
@@ -68,14 +68,14 @@ class MenuManager
global $conf, $user, $langs;
// On sauve en session le menu principal choisi
- if (isset($_GET["mainmenu"])) $_SESSION["mainmenu"] = $_GET["mainmenu"];
- if (isset($_GET["idmenu"])) $_SESSION["idmenu"] = $_GET["idmenu"];
+ if (GETPOSTISSET("mainmenu")) $_SESSION["mainmenu"] = GETPOST("mainmenu", 'aZ09');
+ if (GETPOSTISSET("idmenu")) $_SESSION["idmenu"] = GETPOST("idmenu", 'int');
// Read mainmenu and leftmenu that define which menu to show
- if (isset($_GET["mainmenu"]))
+ if (GETPOSTISSET("mainmenu"))
{
// On sauve en session le menu principal choisi
- $mainmenu = $_GET["mainmenu"];
+ $mainmenu = GETPOST("mainmenu", 'aZ09');
$_SESSION["mainmenu"] = $mainmenu;
$_SESSION["leftmenuopened"] = "";
} else {
@@ -84,10 +84,10 @@ class MenuManager
}
if (!empty($forcemainmenu)) $mainmenu = $forcemainmenu;
- if (isset($_GET["leftmenu"]))
+ if (GETPOSTISSET("leftmenu"))
{
// On sauve en session le menu principal choisi
- $leftmenu = $_GET["leftmenu"];
+ $leftmenu = GETPOST("leftmenu", 'aZ09');
$_SESSION["leftmenu"] = $leftmenu;
if ($_SESSION["leftmenuopened"] == $leftmenu) // To collapse
diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php
index 2c3549cdea9..52a28b6d232 100644
--- a/htdocs/core/menus/standard/eldy.lib.php
+++ b/htdocs/core/menus/standard/eldy.lib.php
@@ -447,6 +447,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout =
// Show personalized menus
$menuArbo = new Menubase($db, 'eldy');
+
$newTabMenu = $menuArbo->menuTopCharger('', '', $type_user, 'eldy', $tabMenu); // Return tabMenu with only top entries
$num = count($newTabMenu);
@@ -455,34 +456,39 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout =
//var_dump($type_user.' '.$newTabMenu[$i]['url'].' '.$showmode.' '.$newTabMenu[$i]['perms']);
$idsel = (empty($newTabMenu[$i]['mainmenu']) ? 'none' : $newTabMenu[$i]['mainmenu']);
+ $newTabMenu[$i]['url'] = make_substitutions($newTabMenu[$i]['url'], $substitarray);
+
+ // url = url from host, shorturl = relative path into dolibarr sources
+ $url = $shorturl = $newTabMenu[$i]['url'];
+ if (!preg_match("/^(http:\/\/|https:\/\/)/i", $newTabMenu[$i]['url'])) // Do not change url content for external links
+ {
+ $tmp = explode('?', $newTabMenu[$i]['url'], 2);
+ $url = $shorturl = $tmp[0];
+ $param = (isset($tmp[1]) ? $tmp[1] : '');
+
+ if (!preg_match('/mainmenu/i', $param) || !preg_match('/leftmenu/i', $param)) $param .= ($param ? '&' : '').'mainmenu='.$newTabMenu[$i]['mainmenu'].'&leftmenu=';
+ //$url.="idmenu=".$newTabMenu[$i]['rowid']; // Already done by menuLoad
+ $url = dol_buildpath($url, 1).($param ? '?'.$param : '');
+ //$shorturl = $shorturl.($param?'?'.$param:'');
+ $shorturl = $url;
+ if (DOL_URL_ROOT) $shorturl = preg_replace('/^'.preg_quote(DOL_URL_ROOT, '/').'/', '', $shorturl);
+ }
+
$showmode = isVisibleToUserType($type_user, $newTabMenu[$i], $listofmodulesforexternal);
if ($showmode == 1)
{
- $newTabMenu[$i]['url'] = make_substitutions($newTabMenu[$i]['url'], $substitarray);
-
- // url = url from host, shorturl = relative path into dolibarr sources
- $url = $shorturl = $newTabMenu[$i]['url'];
- if (!preg_match("/^(http:\/\/|https:\/\/)/i", $newTabMenu[$i]['url'])) // Do not change url content for external links
- {
- $tmp = explode('?', $newTabMenu[$i]['url'], 2);
- $url = $shorturl = $tmp[0];
- $param = (isset($tmp[1]) ? $tmp[1] : '');
-
- if (!preg_match('/mainmenu/i', $param) || !preg_match('/leftmenu/i', $param)) $param .= ($param ? '&' : '').'mainmenu='.$newTabMenu[$i]['mainmenu'].'&leftmenu=';
- //$url.="idmenu=".$newTabMenu[$i]['rowid']; // Already done by menuLoad
- $url = dol_buildpath($url, 1).($param ? '?'.$param : '');
- //$shorturl = $shorturl.($param?'?'.$param:'');
- $shorturl = $url;
- if (DOL_URL_ROOT) $shorturl = preg_replace('/^'.preg_quote(DOL_URL_ROOT, '/').'/', '', $shorturl);
- }
-
// Define the class (top menu selected or not)
if (!empty($_SESSION['idmenu']) && $newTabMenu[$i]['rowid'] == $_SESSION['idmenu']) $classname = 'class="tmenusel"';
elseif (!empty($_SESSION["mainmenu"]) && $newTabMenu[$i]['mainmenu'] == $_SESSION["mainmenu"]) $classname = 'class="tmenusel"';
else $classname = 'class="tmenu"';
- } elseif ($showmode == 2) $classname = 'class="tmenu"';
+ } elseif ($showmode == 2) {
+ $classname = 'class="tmenu"';
+ }
- $menu->add($shorturl, $newTabMenu[$i]['titre'], 0, $showmode, ($newTabMenu[$i]['target'] ? $newTabMenu[$i]['target'] : $atarget), ($newTabMenu[$i]['mainmenu'] ? $newTabMenu[$i]['mainmenu'] : $newTabMenu[$i]['rowid']), ($newTabMenu[$i]['leftmenu'] ? $newTabMenu[$i]['leftmenu'] : ''), $newTabMenu[$i]['position'], $id, $idsel, $classname);
+ $menu->add($shorturl, $newTabMenu[$i]['titre'], 0, $showmode, ($newTabMenu[$i]['target'] ? $newTabMenu[$i]['target'] : $atarget),
+ ($newTabMenu[$i]['mainmenu'] ? $newTabMenu[$i]['mainmenu'] : $newTabMenu[$i]['rowid']),
+ ($newTabMenu[$i]['leftmenu'] ? $newTabMenu[$i]['leftmenu'] : ''),
+ $newTabMenu[$i]['position'], $id, $idsel, $classname);
}
// Sort on position
@@ -517,7 +523,6 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout =
print "\n".''."\n";
print_start_menu_entry('companylogo', 'class="tmenu tmenucompanylogo nohover"', 1);
-
print ''."\n";
print_end_menu_entry(4);
@@ -1482,7 +1487,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
if ($usemenuhider || empty($leftmenu) || $leftmenu == "withdraw") {
$newmenu->add("/compta/prelevement/create.php?mainmenu=bank", $langs->trans("NewStandingOrder"), 1, $user->rights->prelevement->bons->creer);
- $newmenu->add("/compta/prelevement/bons.php?mainmenu=bank", $langs->trans("WithdrawalsReceipts"), 1, $user->rights->prelevement->bons->lire);
+ $newmenu->add("/compta/prelevement/orders_list.php?mainmenu=bank", $langs->trans("WithdrawalsReceipts"), 1, $user->rights->prelevement->bons->lire);
$newmenu->add("/compta/prelevement/list.php?mainmenu=bank", $langs->trans("WithdrawalsLines"), 1, $user->rights->prelevement->bons->lire);
$newmenu->add("/compta/prelevement/rejets.php?mainmenu=bank", $langs->trans("Rejects"), 1, $user->rights->prelevement->bons->lire);
$newmenu->add("/compta/prelevement/stats.php?mainmenu=bank", $langs->trans("Statistics"), 1, $user->rights->prelevement->bons->lire);
@@ -1497,7 +1502,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
if ($usemenuhider || empty($leftmenu) || $leftmenu == "banktransfer") {
$newmenu->add("/compta/prelevement/create.php?type=bank-transfer&mainmenu=bank", $langs->trans("NewPaymentByBankTransfer"), 1, $user->rights->paymentbybanktransfer->create);
- $newmenu->add("/compta/prelevement/bons.php?type=bank-transfer&mainmenu=bank", $langs->trans("PaymentByBankTransferReceipts"), 1, $user->rights->paymentbybanktransfer->read);
+ $newmenu->add("/compta/prelevement/orders_list.php?type=bank-transfer&mainmenu=bank", $langs->trans("PaymentByBankTransferReceipts"), 1, $user->rights->paymentbybanktransfer->read);
$newmenu->add("/compta/prelevement/list.php?type=bank-transfer&mainmenu=bank", $langs->trans("PaymentByBankTransferLines"), 1, $user->rights->paymentbybanktransfer->read);
$newmenu->add("/compta/prelevement/rejets.php?type=bank-transfer&mainmenu=bank", $langs->trans("Rejects"), 1, $user->rights->paymentbybanktransfer->read);
$newmenu->add("/compta/prelevement/stats.php?type=bank-transfer&mainmenu=bank", $langs->trans("Statistics"), 1, $user->rights->paymentbybanktransfer->read);
diff --git a/htdocs/core/menus/standard/eldy_menu.php b/htdocs/core/menus/standard/eldy_menu.php
index 5a33d0b323b..c3e6a0bce05 100644
--- a/htdocs/core/menus/standard/eldy_menu.php
+++ b/htdocs/core/menus/standard/eldy_menu.php
@@ -66,15 +66,15 @@ class MenuManager
{
global $conf, $user, $langs;
- // On sauve en session le menu principal choisi
- if (isset($_GET["mainmenu"])) $_SESSION["mainmenu"] = $_GET["mainmenu"];
- if (isset($_GET["idmenu"])) $_SESSION["idmenu"] = $_GET["idmenu"];
+ // We save into session the main menu selected
+ if (GETPOSTISSET("mainmenu")) $_SESSION["mainmenu"] = GETPOST("mainmenu", 'aZ09');
+ if (GETPOSTISSET("idmenu")) $_SESSION["idmenu"] = GETPOST("idmenu", 'int');
- // Read mainmenu and leftmenu that define which menu to show
- if (isset($_GET["mainmenu"]))
+ // Read now mainmenu and leftmenu that define which menu to show
+ if (GETPOSTISSET("mainmenu"))
{
// On sauve en session le menu principal choisi
- $mainmenu = $_GET["mainmenu"];
+ $mainmenu = GETPOST("mainmenu", 'aZ09');
$_SESSION["mainmenu"] = $mainmenu;
$_SESSION["leftmenuopened"] = "";
} else {
@@ -83,10 +83,10 @@ class MenuManager
}
if (!empty($forcemainmenu)) $mainmenu = $forcemainmenu;
- if (isset($_GET["leftmenu"]))
+ if (GETPOSTISSET("leftmenu"))
{
// On sauve en session le menu principal choisi
- $leftmenu = $_GET["leftmenu"];
+ $leftmenu = GETPOST("leftmenu", 'aZ09');
$_SESSION["leftmenu"] = $leftmenu;
if ($_SESSION["leftmenuopened"] == $leftmenu) // To collapse
@@ -147,7 +147,6 @@ class MenuManager
if ($mode == 'top') print_left_eldy_menu($this->db, $this->menu_array, $this->menu_array_after, $this->tabMenu, $this->menu, 0);
if ($mode == 'left') print_eldy_menu($this->db, $this->atarget, $this->type_user, $this->tabMenu, $this->menu, 0, $mode);
}
-
if ($mode == 'topnb')
{
print_eldy_menu($this->db, $this->atarget, $this->type_user, $this->tabMenu, $this->menu, 1, $mode); // no output
diff --git a/htdocs/core/tpl/onlinepaymentlinks.tpl.php b/htdocs/core/tpl/onlinepaymentlinks.tpl.php
index d34b2da6b29..dcf8e712709 100644
--- a/htdocs/core/tpl/onlinepaymentlinks.tpl.php
+++ b/htdocs/core/tpl/onlinepaymentlinks.tpl.php
@@ -39,6 +39,8 @@ if (!empty($conf->commande->enabled))
{
$langs->load("orders");
print '