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 ''; -print ''; +print ''; // GDPR contact print ''; @@ -568,7 +568,7 @@ print ''; -print ''; +print ''; // Juridical Status print ''; 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 '
'; + print ''; + print $langs->trans("EnterRefToBuildUrl", $langs->transnoentitiesnoconv("Order")).': '; print ''; print ''; @@ -62,6 +64,8 @@ if (!empty($conf->facture->enabled)) { $langs->load("bills"); print ''; + print ''; + print $langs->trans("EnterRefToBuildUrl", $langs->transnoentitiesnoconv("Invoice")).': '; print ''; print ''; @@ -85,6 +89,8 @@ if (!empty($conf->contrat->enabled)) { $langs->load("contracts"); print ''; + print ''; + print $langs->trans("EnterRefToBuildUrl", $langs->transnoentitiesnoconv("ContractLine")).': '; print ''; print ''; @@ -108,6 +114,8 @@ if (!empty($conf->adherent->enabled)) { $langs->load("members"); print ''; + print ''; + print $langs->trans("EnterRefToBuildUrl", $langs->transnoentitiesnoconv("Member")).': '; print ''; print ''; @@ -131,6 +139,8 @@ if (!empty($conf->don->enabled)) { $langs->load("members"); print ''; + print ''; + print $langs->trans("EnterRefToBuildUrl", $langs->transnoentitiesnoconv("Don")).': '; print ''; print ''; diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index f893b0e2e72..f0703d6b83f 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -318,6 +318,7 @@ if (is_array($extrafields->attributes[$object->table_element]['label']) && count if (!$search_all) $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'paiementfourn_facturefourn as pf ON pf.fk_facturefourn = f.rowid'; if ($search_all || $search_product_category > 0) $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'facture_fourn_det as pd ON f.rowid=pd.fk_facture_fourn'; if ($search_product_category > 0) $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie_product as cp ON cp.fk_product=pd.fk_product'; +$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'user AS u ON f.fk_user_author = u.rowid'; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."projet as p ON p.rowid = f.fk_projet"; // We'll need this table joined to the select in order to filter by sale if ($search_sale > 0 || (!$user->rights->societe->client->voir && !$socid)) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; @@ -326,7 +327,6 @@ if ($search_user > 0) $sql .= ", ".MAIN_DB_PREFIX."element_contact as ec"; $sql .= ", ".MAIN_DB_PREFIX."c_type_contact as tc"; } -$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'user AS u ON f.fk_user_author = u.rowid'; $sql .= ' WHERE f.fk_soc = s.rowid'; $sql .= ' AND f.entity IN ('.getEntity('facture_fourn').')'; if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id; diff --git a/htdocs/install/doctemplates/websites/website_template-corporate.zip b/htdocs/install/doctemplates/websites/website_template-corporate.zip index 80f16714c78..9186b95fdb6 100644 Binary files a/htdocs/install/doctemplates/websites/website_template-corporate.zip and b/htdocs/install/doctemplates/websites/website_template-corporate.zip differ diff --git a/htdocs/install/doctemplates/websites/website_template-stellar.zip b/htdocs/install/doctemplates/websites/website_template-stellar.zip index 5cf573d21d2..399a32e579d 100644 Binary files a/htdocs/install/doctemplates/websites/website_template-stellar.zip and b/htdocs/install/doctemplates/websites/website_template-stellar.zip differ diff --git a/htdocs/install/mysql/migration/12.0.0-13.0.0.sql b/htdocs/install/mysql/migration/12.0.0-13.0.0.sql index c80b1d4ebda..710dcedab65 100644 --- a/htdocs/install/mysql/migration/12.0.0-13.0.0.sql +++ b/htdocs/install/mysql/migration/12.0.0-13.0.0.sql @@ -328,3 +328,5 @@ ALTER TABLE llx_paiement ADD COLUMN ref_ext varchar(255) AFTER ref; ALTER TABLE llx_bank ADD COLUMN origin_id integer; ALTER TABLE llx_bank ADD COLUMN origin_type varchar(64) NULL; ALTER TABLE llx_bank ADD COLUMN import_key varchar(14); + +ALTER TABLE llx_menu MODIFY COLUMN enabled text; diff --git a/htdocs/install/mysql/tables/llx_menu.sql b/htdocs/install/mysql/tables/llx_menu.sql index cb279cb5c56..4408cb69627 100644 --- a/htdocs/install/mysql/tables/llx_menu.sql +++ b/htdocs/install/mysql/tables/llx_menu.sql @@ -39,7 +39,7 @@ CREATE TABLE llx_menu langs varchar(100), -- Lang file to load for translation level smallint, -- Deprecated. Not used. perms text, -- Condition to show enabled or disabled - enabled varchar(255) NULL default '1', -- Condition to show or hide + enabled text NULL default '1', -- Condition to show or hide usertype integer NOT NULL DEFAULT 0, -- 0 if menu for all users, 1 for external only, 2 for internal only tms timestamp diff --git a/htdocs/loan/list.php b/htdocs/loan/list.php index 82ef8ed9407..79e38dbdeb1 100644 --- a/htdocs/loan/list.php +++ b/htdocs/loan/list.php @@ -55,7 +55,7 @@ $search_ref = GETPOST('search_ref', 'int'); $search_label = GETPOST('search_label', 'alpha'); $search_amount = GETPOST('search_amount', 'alpha'); -$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'myobjectlist'; // To manage different context of search +$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'loanlist'; // To manage different context of search $optioncss = GETPOST('optioncss', 'alpha'); diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index ce0af2bfd67..33b94e7730c 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -365,8 +365,8 @@ if (!defined('NOTOKENRENEWAL')) if ((!defined('NOCSRFCHECK') && empty($dolibarr_nocsrfcheck) && !empty($conf->global->MAIN_SECURITY_CSRF_WITH_TOKEN)) || defined('CSRFCHECK_WITH_TOKEN')) // Check validity of token, only if option MAIN_SECURITY_CSRF_WITH_TOKEN enabled or if constant CSRFCHECK_WITH_TOKEN is set { - // Check all cases that need a token (all POST and some GET) - if ($_SERVER['REQUEST_METHOD'] == 'POST' || (GETPOSTISSET('action') && defined('CSRFCHECK_WITH_TOKEN')) || in_array(GETPOST('action', 'aZ09'), array('add', 'update', 'install'))) + // Check all cases that need a token (all POST actions, all actions and mass actions on pages with CSRFCHECK_WITH_TOKEN set, all sensitive GET actions) + if ($_SERVER['REQUEST_METHOD'] == 'POST' || ((GETPOSTISSET('action') || GETPOSTISSET('massaction')) && defined('CSRFCHECK_WITH_TOKEN')) || in_array(GETPOST('action', 'aZ09'), array('add', 'update', 'install', 'delete'))) { if (!GETPOSTISSET('token')) { dol_syslog("--- Access to ".$_SERVER["PHP_SELF"]." refused by CSRFCHECK_WITH_TOKEN protection. Token not provided."); @@ -384,10 +384,12 @@ if ((!defined('NOCSRFCHECK') && empty($dolibarr_nocsrfcheck) && !empty($conf->gl //if ($conf->global->MAIN_FEATURES_LEVEL >= 1) setEventMessages('Unset POST and GET params by CSRF protection in main.inc.php (Token provided was not generated by the previous page).'."
\n".'$_SERVER[REQUEST_URI] = '.$_SERVER['REQUEST_URI'].' $_SERVER[REQUEST_METHOD] = '.$_SERVER['REQUEST_METHOD'].' GETPOST(token) = '.GETPOST('token', 'alpha').' $_SESSION[token] = '.$_SESSION['token'], null, 'warnings'); $savid = ((int) $_POST['id']); unset($_POST); - //unset($_POST['action']); - //unset($_POST['confirm']); + //unset($_POST['action']); unset($_POST['massaction']); + //unset($_POST['confirm']); unset($_POST['confirmmassaction']); unset($_GET['confirm']); unset($_GET['action']); + unset($_GET['confirmmassaction']); + unset($_GET['massaction']); $_POST['id'] = ((int) $savid); } } diff --git a/htdocs/opensurvey/list.php b/htdocs/opensurvey/list.php index f17a4615eef..77e7feed460 100644 --- a/htdocs/opensurvey/list.php +++ b/htdocs/opensurvey/list.php @@ -36,7 +36,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') : 'opensurveylist'; // 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/paybox/admin/paybox.php b/htdocs/paybox/admin/paybox.php index 68d55558c9f..a1ceb3e4810 100644 --- a/htdocs/paybox/admin/paybox.php +++ b/htdocs/paybox/admin/paybox.php @@ -110,7 +110,7 @@ $head[$h][1] = $langs->trans("PayBox"); $head[$h][2] = 'payboxaccount'; $h++; -print ''; +print ''; print ''; print ''; diff --git a/htdocs/product/inventory/card.php b/htdocs/product/inventory/card.php index 357251fe512..3053cc45d71 100644 --- a/htdocs/product/inventory/card.php +++ b/htdocs/product/inventory/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') : 'inventorycard'; // To manage different context of search $backtopage = GETPOST('backtopage', 'alpha'); if (empty($conf->global->MAIN_USE_ADVANCED_PERMS)) diff --git a/htdocs/product/inventory/inventory.php b/htdocs/product/inventory/inventory.php index 9b871da7a8b..504f8419685 100644 --- a/htdocs/product/inventory/inventory.php +++ b/htdocs/product/inventory/inventory.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') : 'inventorycard'; // To manage different context of search $backtopage = GETPOST('backtopage', 'alpha'); $fk_warehouse = GETPOST('fk_warehouse', 'int'); diff --git a/htdocs/product/stock/productlot_list.php b/htdocs/product/stock/productlot_list.php index 33d49c0c5e5..8a02f3a2b41 100644 --- a/htdocs/product/stock/productlot_list.php +++ b/htdocs/product/stock/productlot_list.php @@ -39,7 +39,7 @@ $id = GETPOST('id', 'int'); $action = GETPOST('action', 'aZ09'); $backtopage = GETPOST('backtopage', 'alpha'); $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') : 'productlotlist'; // To manage different context of search $optioncss = GETPOST('optioncss', 'alpha'); $search_entity = GETPOST('search_entity', 'int'); diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index 515c3163b50..4ded7e9d197 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -44,7 +44,7 @@ $massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choi $confirm = GETPOST('confirm', 'alpha'); $cancel = GETPOST('cancel', 'alpha'); $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') : 'timespentlist'; // To manage different context of search $backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page $optioncss = GETPOST('optioncss', 'alpha'); diff --git a/htdocs/societe/website.php b/htdocs/societe/website.php index 5347cbe32e3..883908e8d5d 100644 --- a/htdocs/societe/website.php +++ b/htdocs/societe/website.php @@ -39,7 +39,7 @@ $langs->loadLangs(array("companies", "website")); $action = GETPOST('action', 'aZ09') ?GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ... $show_files = GETPOST('show_files', 'int'); -$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'myobjectlist'; // To manage different context of search +$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'websitelist'; // 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/stripe/admin/stripe.php b/htdocs/stripe/admin/stripe.php index 46f59039c36..efcef759da4 100644 --- a/htdocs/stripe/admin/stripe.php +++ b/htdocs/stripe/admin/stripe.php @@ -157,7 +157,7 @@ print load_fiche_titre($langs->trans("ModuleSetup").' Stripe', $linkback); $head = stripeadmin_prepare_head(); -print ''; +print ''; print ''; print ''; diff --git a/htdocs/stripe/charge.php b/htdocs/stripe/charge.php index 5672176168a..8544417b2e4 100644 --- a/htdocs/stripe/charge.php +++ b/htdocs/stripe/charge.php @@ -79,195 +79,207 @@ $stripeacc = $stripe->getStripeAccount($service); if (!$rowid) { $option = array('limit' => $limit + 1); + $num = 0; + if (GETPOSTISSET('starting_after_'.$page)) $option['starting_after'] = GETPOST('starting_after_'.$page, 'alphanohtml'); - if ($stripeacc) - { - $list = \Stripe\Charge::all($option, array("stripe_account" => $stripeacc)); - } else { - $list = \Stripe\Charge::all($option); - } - $num = count($list->data); - $totalnboflines = ''; - - $param = ''; - //if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.urlencode($contextpage); - if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.urlencode($limit); - $param .= '&starting_after_'.($page + 1).'='.$list->data[($limit - 1)]->id; - //$param.='&ending_before_'.($page+1).'='.$list->data[($limit-1)]->id; - - $moreforfilter = ''; - - print ''; - if ($optioncss != '') print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - - $title = $langs->trans("StripeChargeList"); - $title .= ($stripeacc ? ' (Stripe connection with Stripe OAuth Connect account '.$stripeacc.')' : ' (Stripe connection with keys from Stripe module setup)'); - - print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $totalnboflines, 'title_accountancy.png', 0, '', 'hidepaginationprevious', $limit); - - print '
'; - print ''."\n"; - - print ''; - print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "", "", "", "", $sortfield, $sortorder); - print_liste_field_titre("StripeCustomerId", $_SERVER["PHP_SELF"], "", "", "", "", $sortfield, $sortorder); - print_liste_field_titre("Customer", $_SERVER["PHP_SELF"], "", "", "", "", $sortfield, $sortorder); - print_liste_field_titre("Origin", $_SERVER["PHP_SELF"], "", "", "", "", $sortfield, $sortorder); - print_liste_field_titre("DatePayment", $_SERVER["PHP_SELF"], "", "", "", '', $sortfield, $sortorder, 'center '); - print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "", "", "", '', $sortfield, $sortorder, 'left '); - print_liste_field_titre("Paid", $_SERVER["PHP_SELF"], "", "", "", '', $sortfield, $sortorder, 'right '); - print_liste_field_titre("Status", $_SERVER["PHP_SELF"], "", "", "", '', '', '', 'right '); - print "\n"; - - //print $list; - $i = 0; - foreach ($list->data as $charge) - { - if ($i >= $limit) { - break; - } - - if ($charge->refunded == '1') { - $status = img_picto($langs->trans("refunded"), 'statut6'); - } elseif ($charge->paid == '1') { - $status = img_picto($langs->trans((string) $charge->status), 'statut4'); - } else { - $label = $langs->trans("Message").": ".$charge->failure_message."
"; - $label .= $langs->trans("Network").": ".$charge->outcome->network_status."
"; - $label .= $langs->trans("Status").": ".$langs->trans((string) $charge->outcome->seller_message); - $status = $form->textwithpicto(img_picto($langs->trans((string) $charge->status), 'statut8'), $label, -1); - } - - if ($charge->payment_method_details->type == 'card') { - $type = $langs->trans("card"); - } elseif ($charge->source->type == 'card') { - $type = $langs->trans("card"); - } elseif ($charge->payment_method_details->type == 'three_d_secure') { - $type = $langs->trans("card3DS"); - } elseif ($charge->payment_method_details->type == 'sepa_debit') { - $type = $langs->trans("sepadebit"); - } elseif ($charge->payment_method_details->type == 'ideal') { - $type = $langs->trans("iDEAL"); - } - - // Why this ? - /*if (! empty($charge->payment_intent)) { - if (empty($stripeacc)) { // If the Stripe connect account not set, we use common API usage - $charge = \Stripe\PaymentIntent::retrieve($charge->payment_intent); - } else { - $charge = \Stripe\PaymentIntent::retrieve($charge->payment_intent, array("stripe_account" => $stripeacc)); - } - }*/ - - // The metadata FULLTAG is defined by the online payment page - $FULLTAG = $charge->metadata->FULLTAG; - - // Save into $tmparray all metadata - $tmparray = dolExplodeIntoArray($FULLTAG, '.', '='); - // Load origin object according to metadata - if (!empty($tmparray['CUS']) && $tmparray['CUS'] > 0) + try { + if ($stripeacc) { - $societestatic->fetch($tmparray['CUS']); - } elseif (!empty($charge->metadata->dol_thirdparty_id) && $charge->metadata->dol_thirdparty_id > 0) - { - $societestatic->fetch($charge->metadata->dol_thirdparty_id); + $list = \Stripe\Charge::all($option, array("stripe_account" => $stripeacc)); } else { - $societestatic->id = 0; - } - if (!empty($tmparray['MEM']) && $tmparray['MEM'] > 0) - { - $memberstatic->fetch($tmparray['MEM']); - } else { - $memberstatic->id = 0; + $list = \Stripe\Charge::all($option); } - print ''; + $num = count($list->data); - if (!empty($stripeacc)) $connect = $stripeacc.'/'; + $totalnboflines = ''; - // Ref - $url = 'https://dashboard.stripe.com/'.$connect.'test/payments/'.$charge->id; - if ($servicestatus) - { - $url = 'https://dashboard.stripe.com/'.$connect.'payments/'.$charge->id; - } - print "\n"; + $param = ''; + //if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.urlencode($contextpage); + if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.urlencode($limit); + $param .= '&starting_after_'.($page + 1).'='.$list->data[($limit - 1)]->id; + //$param.='&ending_before_'.($page+1).'='.$list->data[($limit-1)]->id; - // Stripe customer - print "\n"; + $moreforfilter = ''; - // Link - print "\n"; + print ''; + if ($optioncss != '') print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; - // Origin - print "\n"; + $title = $langs->trans("StripeChargeList"); + $title .= ($stripeacc ? ' (Stripe connection with Stripe OAuth Connect account '.$stripeacc.')' : ' (Stripe connection with keys from Stripe module setup)'); - // Date payment - print '\n"; - // Type - print ''; - // Amount - print '"; - // Status - print '\n"; + print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $totalnboflines, 'title_accountancy.png', 0, '', 'hidepaginationprevious', $limit); + print '
'; + print '
"; - print "".img_picto($langs->trans('ShowInStripe'), 'globe')." ".$charge->id.""; - if ($charge->payment_intent) print '
'.$charge->payment_intent.''; - print "
"; - if (!empty($conf->stripe->enabled) && !empty($stripeacc)) $connect = $stripeacc.'/'; - $url = 'https://dashboard.stripe.com/'.$connect.'test/customers/'.$charge->customer; - if ($servicestatus) - { - $url = 'https://dashboard.stripe.com/'.$connect.'customers/'.$charge->customer; - } - if (!empty($charge->customer)) - { - print ''.img_picto($langs->trans('ShowInStripe'), 'globe').' '.$charge->customer.''; - } - print ""; - if ($societestatic->id > 0) - { - print $societestatic->getNomUrl(1); - } elseif ($memberstatic->id > 0) - { - print $memberstatic->getNomUrl(1); - } - print ""; - if ($charge->metadata->dol_type == "order" || $charge->metadata->dol_type == "commande") { - $object = new Commande($db); - $object->fetch($charge->metadata->dol_id); - if ($object->id > 0) { - print "".img_picto('', 'object_order')." ".$object->ref.""; - } else { - print $FULLTAG; - } - } elseif ($charge->metadata->dol_type == "invoice" || $charge->metadata->dol_type == "facture") { - print $charge->metadata->dol_type.' '.$charge->metadata->dol_id.' - '; - $object = new Facture($db); - $object->fetch($charge->metadata->dol_id); - if ($object->id > 0) { - print "".img_picto('', 'object_invoice')." ".$object->ref.""; - } else { - print $FULLTAG; - } - } else { - print $FULLTAG; - } - print "'.dol_print_date($charge->created, '%d/%m/%Y %H:%M')."'; - print $type; - print ''.price(($charge->amount - $charge->amount_refunded) / 100, 0, '', 1, - 1, - 1, strtoupper($charge->currency))."'; - print $status; - print "
'."\n"; + + print ''; + print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "", "", "", "", $sortfield, $sortorder); + print_liste_field_titre("StripeCustomerId", $_SERVER["PHP_SELF"], "", "", "", "", $sortfield, $sortorder); + print_liste_field_titre("Customer", $_SERVER["PHP_SELF"], "", "", "", "", $sortfield, $sortorder); + print_liste_field_titre("Origin", $_SERVER["PHP_SELF"], "", "", "", "", $sortfield, $sortorder); + print_liste_field_titre("DatePayment", $_SERVER["PHP_SELF"], "", "", "", '', $sortfield, $sortorder, 'center '); + print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "", "", "", '', $sortfield, $sortorder, 'left '); + print_liste_field_titre("Paid", $_SERVER["PHP_SELF"], "", "", "", '', $sortfield, $sortorder, 'right '); + print_liste_field_titre("Status", $_SERVER["PHP_SELF"], "", "", "", '', '', '', 'right '); print "\n"; - $i++; + //print $list; + $i = 0; + foreach ($list->data as $charge) + { + if ($i >= $limit) { + break; + } + + if ($charge->refunded == '1') { + $status = img_picto($langs->trans("refunded"), 'statut6'); + } elseif ($charge->paid == '1') { + $status = img_picto($langs->trans((string) $charge->status), 'statut4'); + } else { + $label = $langs->trans("Message").": ".$charge->failure_message."
"; + $label .= $langs->trans("Network").": ".$charge->outcome->network_status."
"; + $label .= $langs->trans("Status").": ".$langs->trans((string) $charge->outcome->seller_message); + $status = $form->textwithpicto(img_picto($langs->trans((string) $charge->status), 'statut8'), $label, -1); + } + + if ($charge->payment_method_details->type == 'card') { + $type = $langs->trans("card"); + } elseif ($charge->source->type == 'card') { + $type = $langs->trans("card"); + } elseif ($charge->payment_method_details->type == 'three_d_secure') { + $type = $langs->trans("card3DS"); + } elseif ($charge->payment_method_details->type == 'sepa_debit') { + $type = $langs->trans("sepadebit"); + } elseif ($charge->payment_method_details->type == 'ideal') { + $type = $langs->trans("iDEAL"); + } + + // Why this ? + /*if (! empty($charge->payment_intent)) { + if (empty($stripeacc)) { // If the Stripe connect account not set, we use common API usage + $charge = \Stripe\PaymentIntent::retrieve($charge->payment_intent); + } else { + $charge = \Stripe\PaymentIntent::retrieve($charge->payment_intent, array("stripe_account" => $stripeacc)); + } + }*/ + + // The metadata FULLTAG is defined by the online payment page + $FULLTAG = $charge->metadata->FULLTAG; + + // Save into $tmparray all metadata + $tmparray = dolExplodeIntoArray($FULLTAG, '.', '='); + // Load origin object according to metadata + if (!empty($tmparray['CUS']) && $tmparray['CUS'] > 0) + { + $societestatic->fetch($tmparray['CUS']); + } elseif (!empty($charge->metadata->dol_thirdparty_id) && $charge->metadata->dol_thirdparty_id > 0) + { + $societestatic->fetch($charge->metadata->dol_thirdparty_id); + } else { + $societestatic->id = 0; + } + if (!empty($tmparray['MEM']) && $tmparray['MEM'] > 0) + { + $memberstatic->fetch($tmparray['MEM']); + } else { + $memberstatic->id = 0; + } + + print ''; + + if (!empty($stripeacc)) $connect = $stripeacc.'/'; + + // Ref + $url = 'https://dashboard.stripe.com/'.$connect.'test/payments/'.$charge->id; + if ($servicestatus) + { + $url = 'https://dashboard.stripe.com/'.$connect.'payments/'.$charge->id; + } + print "\n"; + + // Stripe customer + print "\n"; + + // Link + print "\n"; + + // Origin + print "\n"; + + // Date payment + print '\n"; + // Type + print ''; + // Amount + print '"; + // Status + print '\n"; + + print "\n"; + + $i++; + } + + print '
"; + print "".img_picto($langs->trans('ShowInStripe'), 'globe')." ".$charge->id.""; + if ($charge->payment_intent) print '
'.$charge->payment_intent.''; + print "
"; + if (!empty($conf->stripe->enabled) && !empty($stripeacc)) $connect = $stripeacc.'/'; + $url = 'https://dashboard.stripe.com/'.$connect.'test/customers/'.$charge->customer; + if ($servicestatus) + { + $url = 'https://dashboard.stripe.com/'.$connect.'customers/'.$charge->customer; + } + if (!empty($charge->customer)) + { + print ''.img_picto($langs->trans('ShowInStripe'), 'globe').' '.$charge->customer.''; + } + print ""; + if ($societestatic->id > 0) + { + print $societestatic->getNomUrl(1); + } elseif ($memberstatic->id > 0) + { + print $memberstatic->getNomUrl(1); + } + print ""; + if ($charge->metadata->dol_type == "order" || $charge->metadata->dol_type == "commande") { + $object = new Commande($db); + $object->fetch($charge->metadata->dol_id); + if ($object->id > 0) { + print "".img_picto('', 'object_order')." ".$object->ref.""; + } else { + print $FULLTAG; + } + } elseif ($charge->metadata->dol_type == "invoice" || $charge->metadata->dol_type == "facture") { + print $charge->metadata->dol_type.' '.$charge->metadata->dol_id.' - '; + $object = new Facture($db); + $object->fetch($charge->metadata->dol_id); + if ($object->id > 0) { + print "".img_picto('', 'object_invoice')." ".$object->ref.""; + } else { + print $FULLTAG; + } + } else { + print $FULLTAG; + } + print "'.dol_print_date($charge->created, '%d/%m/%Y %H:%M')."'; + print $type; + print ''.price(($charge->amount - $charge->amount_refunded) / 100, 0, '', 1, - 1, - 1, strtoupper($charge->currency))."'; + print $status; + print "
'; + print '
'; + print '
'; + } catch (Exception $e) { + print $e->getMessage(); } } diff --git a/htdocs/stripe/payout.php b/htdocs/stripe/payout.php index 6823c32c0b7..6cc093417ad 100644 --- a/htdocs/stripe/payout.php +++ b/htdocs/stripe/payout.php @@ -109,111 +109,115 @@ if (!$rowid) { print "\n"; - if ($stripeacc) - { - $payout = \Stripe\Payout::all(array("limit" => $limit), array("stripe_account" => $stripeacc)); - } else { - $payout = \Stripe\Payout::all(array("limit" => $limit)); - } - - foreach ($payout->data as $payout) - { - //$charge = $payout; - //var_dump($payout); - - // The metadata FULLTAG is defined by the online payment page - /*$FULLTAG=$charge->metadata->FULLTAG; - - // Save into $tmparray all metadata - $tmparray = dolExplodeIntoArray($FULLTAG,'.','='); - // Load origin object according to metadata - if (! empty($tmparray['CUS'])) + try { + if ($stripeacc) { - $societestatic->fetch($tmparray['CUS']); - } - else - { - $societestatic->id = 0; - } - if (! empty($tmparray['MEM'])) - { - $memberstatic->fetch($tmparray['MEM']); - } - else - { - $memberstatic->id = 0; - }*/ - - $societestatic->fetch($charge->metadata->idcustomer); - $societestatic->id = $charge->metadata->idcustomer; - $societestatic->lastname = $obj->lastname; - $societestatic->firstname = $obj->firstname; - $societestatic->admin = $obj->admin; - $societestatic->login = $obj->login; - $societestatic->email = $obj->email; - $societestatic->socid = $obj->fk_soc; - - print ''; - - // Ref - if (!empty($stripeacc)) $connect = $stripeacc.'/'; - - $url = 'https://dashboard.stripe.com/'.$connect.'test/payouts/'.$payout->id; - if ($servicestatus) { - $url = 'https://dashboard.stripe.com/'.$connect.'payouts/'.$payout->id; + $payout = \Stripe\Payout::all(array("limit" => $limit), array("stripe_account" => $stripeacc)); + } else { + $payout = \Stripe\Payout::all(array("limit" => $limit)); } - print "".img_picto($langs->trans('ShowInStripe'), 'globe')." ".$payout->id."\n"; + foreach ($payout->data as $payout) + { + //$charge = $payout; + //var_dump($payout); + + // The metadata FULLTAG is defined by the online payment page + /*$FULLTAG=$charge->metadata->FULLTAG; + + // Save into $tmparray all metadata + $tmparray = dolExplodeIntoArray($FULLTAG,'.','='); + // Load origin object according to metadata + if (! empty($tmparray['CUS'])) + { + $societestatic->fetch($tmparray['CUS']); + } + else + { + $societestatic->id = 0; + } + if (! empty($tmparray['MEM'])) + { + $memberstatic->fetch($tmparray['MEM']); + } + else + { + $memberstatic->id = 0; + }*/ + + $societestatic->fetch($charge->metadata->idcustomer); + $societestatic->id = $charge->metadata->idcustomer; + $societestatic->lastname = $obj->lastname; + $societestatic->firstname = $obj->firstname; + $societestatic->admin = $obj->admin; + $societestatic->login = $obj->login; + $societestatic->email = $obj->email; + $societestatic->socid = $obj->fk_soc; + + print ''; + + // Ref + if (!empty($stripeacc)) $connect = $stripeacc.'/'; + + $url = 'https://dashboard.stripe.com/'.$connect.'test/payouts/'.$payout->id; + if ($servicestatus) { + $url = 'https://dashboard.stripe.com/'.$connect.'payouts/'.$payout->id; + } + + print "".img_picto($langs->trans('ShowInStripe'), 'globe')." ".$payout->id."\n"; - // Stripe customer - //print "".$charge->customer."\n"; - // Link - /*print ""; - if ($societestatic->id > 0) - { - print $societestatic->getNomUrl(1); + // Stripe customer + //print "".$charge->customer."\n"; + // Link + /*print ""; + if ($societestatic->id > 0) + { + print $societestatic->getNomUrl(1); + } + if ($memberstatic->id > 0) + { + print $memberstatic->getNomUrl(1); + } + print "\n";*/ + // Origine + //print ""; + ////if ($charge->metadata->dol_type=="order"){ + // $object = new Commande($db); + // $object->fetch($charge->metadata->dol_id); + // print "".img_picto('', 'object_order')." ".$object->ref.""; + //} elseif ($charge->metadata->dol_type=="invoice"){ + // $object = new Facture($db); + // $object->fetch($charge->metadata->dol_id); + // print "".img_picto('', 'object_invoice')." ".$object->ref.""; + //} + //print "\n"; + // Date payment + print ''.dol_print_date($payout->created, '%d/%m/%Y %H:%M')."\n"; + // Date payment + print ''.dol_print_date($payout->arrival_date, '%d/%m/%Y %H:%M')."\n"; + // Type + print ''.$payout->description.''; + // Amount + print ''.price(($payout->amount) / 100, 0, '', 1, -1, -1, strtoupper($payout->currency)).""; + // Status + print ""; + if ($payout->status == 'paid') { + print img_picto($langs->trans("".$payout->status.""), 'statut4'); + } elseif ($payout->status == 'pending') { + print img_picto($langs->trans("".$payout->status.""), 'statut7'); + } elseif ($payout->status == 'in_transit') { + print img_picto($langs->trans("".$payout->status.""), 'statut7'); + } elseif ($payout->status == 'failed') { + print img_picto($langs->trans("".$payout->status.""), 'statut7'); + } elseif ($payout->status == 'canceled') { + print img_picto($langs->trans("".$payout->status.""), 'statut8'); + } + print ''; + print "\n"; } - if ($memberstatic->id > 0) - { - print $memberstatic->getNomUrl(1); - } - print "\n";*/ - // Origine - //print ""; - ////if ($charge->metadata->dol_type=="order"){ - // $object = new Commande($db); - // $object->fetch($charge->metadata->dol_id); - // print "".img_picto('', 'object_order')." ".$object->ref.""; - //} elseif ($charge->metadata->dol_type=="invoice"){ - // $object = new Facture($db); - // $object->fetch($charge->metadata->dol_id); - // print "".img_picto('', 'object_invoice')." ".$object->ref.""; - //} - //print "\n"; - // Date payment - print ''.dol_print_date($payout->created, '%d/%m/%Y %H:%M')."\n"; - // Date payment - print ''.dol_print_date($payout->arrival_date, '%d/%m/%Y %H:%M')."\n"; - // Type - print ''.$payout->description.''; - // Amount - print ''.price(($payout->amount) / 100, 0, '', 1, -1, -1, strtoupper($payout->currency)).""; - // Status - print ""; - if ($payout->status == 'paid') { - print img_picto($langs->trans("".$payout->status.""), 'statut4'); - } elseif ($payout->status == 'pending') { - print img_picto($langs->trans("".$payout->status.""), 'statut7'); - } elseif ($payout->status == 'in_transit') { - print img_picto($langs->trans("".$payout->status.""), 'statut7'); - } elseif ($payout->status == 'failed') { - print img_picto($langs->trans("".$payout->status.""), 'statut7'); - } elseif ($payout->status == 'canceled') { - print img_picto($langs->trans("".$payout->status.""), 'statut8'); - } - print ''; - print "\n"; + } catch (Exception $e) { + print ''.$e->getMessage().''; } print ""; print ''; diff --git a/htdocs/stripe/transaction.php b/htdocs/stripe/transaction.php index 6f74d1a48c0..cd75fec476c 100644 --- a/htdocs/stripe/transaction.php +++ b/htdocs/stripe/transaction.php @@ -108,117 +108,121 @@ if (!$rowid) { print "\n"; - if ($stripeacc) - { - $txn = \Stripe\BalanceTransaction::all(array("limit" => $limit), array("stripe_account" => $stripeacc)); - } else { - $txn = \Stripe\BalanceTransaction::all(array("limit" => $limit)); - } - - foreach ($txn->data as $txn) - { - //$charge = $txn; - //var_dump($txn); - - // The metadata FULLTAG is defined by the online payment page - /*$FULLTAG=$charge->metadata->FULLTAG; - - // Save into $tmparray all metadata - $tmparray = dolExplodeIntoArray($FULLTAG,'.','='); - // Load origin object according to metadata - if (! empty($tmparray['CUS'])) + try { + if ($stripeacc) { - $societestatic->fetch($tmparray['CUS']); + $txn = \Stripe\BalanceTransaction::all(array("limit" => $limit), array("stripe_account" => $stripeacc)); + } else { + $txn = \Stripe\BalanceTransaction::all(array("limit" => $limit)); } - else + + foreach ($txn->data as $txn) { - $societestatic->id = 0; + //$charge = $txn; + //var_dump($txn); + + // The metadata FULLTAG is defined by the online payment page + /*$FULLTAG=$charge->metadata->FULLTAG; + + // Save into $tmparray all metadata + $tmparray = dolExplodeIntoArray($FULLTAG,'.','='); + // Load origin object according to metadata + if (! empty($tmparray['CUS'])) + { + $societestatic->fetch($tmparray['CUS']); + } + else + { + $societestatic->id = 0; + } + if (! empty($tmparray['MEM'])) + { + $memberstatic->fetch($tmparray['MEM']); + } + else + { + $memberstatic->id = 0; + }*/ + + $societestatic->fetch($charge->metadata->idcustomer); + $societestatic->id = $charge->metadata->idcustomer; + $societestatic->lastname = $obj->lastname; + $societestatic->firstname = $obj->firstname; + $societestatic->admin = $obj->admin; + $societestatic->login = $obj->login; + $societestatic->email = $obj->email; + $societestatic->societe_id = $obj->fk_soc; + + print ''; + + // Ref + if (!empty($stripeacc)) $connect = $stripeacc.'/'; + + // Ref + if (preg_match('/po_/i', $txn->source)) { + $origin = "payouts"; + } elseif (preg_match('/fee_/i', $txn->source)) { + $origin = "connect/application_fees"; + } else { + $origin = "payments"; + } + + $url = 'https://dashboard.stripe.com/'.$connect.'test/'.$origin.'/'.$txn->source; + if ($servicestatus) { + $url = 'https://dashboard.stripe.com/'.$connect.$origin.'/'.$txn->source; + } + if ($txn->type == 'stripe_fee' || $txn->type == 'reserve_transaction') { + print "".$txn->type.""; + } else { + print "".img_picto($langs->trans('ShowInStripe'), 'globe')." ".$txn->source."\n"; + } + + // Stripe customer + //print "".$charge->customer."\n"; + // Link + /*print ""; + if ($societestatic->id > 0) + { + print $societestatic->getNomUrl(1); + } + if ($memberstatic->id > 0) + { + print $memberstatic->getNomUrl(1); + } + print "\n";*/ + // Origine + //print ""; + ////if ($charge->metadata->dol_type=="order"){ + // $object = new Commande($db); + // $object->fetch($charge->metadata->dol_id); + // print "".img_picto('', 'object_order')." ".$object->ref.""; + //} elseif ($charge->metadata->dol_type=="invoice"){ + // $object = new Facture($db); + // $object->fetch($charge->metadata->dol_id); + // print "".img_picto('', 'object_invoice')." ".$object->ref.""; + //} + //print "\n"; + // Date payment + print ''.dol_print_date($txn->created, '%d/%m/%Y %H:%M')."\n"; + // Type + print ''.$txn->type.''; + // Amount + print ''.price(($txn->amount) / 100, 0, '', 1, - 1, - 1, strtoupper($txn->currency)).""; + print ''.price(($txn->fee) / 100, 0, '', 1, - 1, - 1, strtoupper($txn->currency)).""; + // Status + print ""; + if ($txn->status == 'available') { + print img_picto($langs->trans("".$txn->status.""), 'statut4'); + } elseif ($txn->status == 'pending') { + print img_picto($langs->trans("".$txn->status.""), 'statut7'); + } elseif ($txn->status == 'failed') { + print img_picto($langs->trans("".$txn->status.""), 'statut8'); + } + print ''; + print "\n"; } - if (! empty($tmparray['MEM'])) - { - $memberstatic->fetch($tmparray['MEM']); - } - else - { - $memberstatic->id = 0; - }*/ - - $societestatic->fetch($charge->metadata->idcustomer); - $societestatic->id = $charge->metadata->idcustomer; - $societestatic->lastname = $obj->lastname; - $societestatic->firstname = $obj->firstname; - $societestatic->admin = $obj->admin; - $societestatic->login = $obj->login; - $societestatic->email = $obj->email; - $societestatic->societe_id = $obj->fk_soc; - - print ''; - - // Ref - if (!empty($stripeacc)) $connect = $stripeacc.'/'; - - // Ref - if (preg_match('/po_/i', $txn->source)) { - $origin = "payouts"; - } elseif (preg_match('/fee_/i', $txn->source)) { - $origin = "connect/application_fees"; - } else { - $origin = "payments"; - } - - $url = 'https://dashboard.stripe.com/'.$connect.'test/'.$origin.'/'.$txn->source; - if ($servicestatus) { - $url = 'https://dashboard.stripe.com/'.$connect.$origin.'/'.$txn->source; - } - if ($txn->type == 'stripe_fee' || $txn->type == 'reserve_transaction') { - print "".$txn->type.""; - } else { - print "".img_picto($langs->trans('ShowInStripe'), 'globe')." ".$txn->source."\n"; - } - - // Stripe customer - //print "".$charge->customer."\n"; - // Link - /*print ""; - if ($societestatic->id > 0) - { - print $societestatic->getNomUrl(1); - } - if ($memberstatic->id > 0) - { - print $memberstatic->getNomUrl(1); - } - print "\n";*/ - // Origine - //print ""; - ////if ($charge->metadata->dol_type=="order"){ - // $object = new Commande($db); - // $object->fetch($charge->metadata->dol_id); - // print "".img_picto('', 'object_order')." ".$object->ref.""; - //} elseif ($charge->metadata->dol_type=="invoice"){ - // $object = new Facture($db); - // $object->fetch($charge->metadata->dol_id); - // print "".img_picto('', 'object_invoice')." ".$object->ref.""; - //} - //print "\n"; - // Date payment - print ''.dol_print_date($txn->created, '%d/%m/%Y %H:%M')."\n"; - // Type - print ''.$txn->type.''; - // Amount - print ''.price(($txn->amount) / 100, 0, '', 1, - 1, - 1, strtoupper($txn->currency)).""; - print ''.price(($txn->fee) / 100, 0, '', 1, - 1, - 1, strtoupper($txn->currency)).""; - // Status - print ""; - if ($txn->status == 'available') { - print img_picto($langs->trans("".$txn->status.""), 'statut4'); - } elseif ($txn->status == 'pending') { - print img_picto($langs->trans("".$txn->status.""), 'statut7'); - } elseif ($txn->status == 'failed') { - print img_picto($langs->trans("".$txn->status.""), 'statut8'); - } - print ''; - print "\n"; + } catch (Exception $e) { + print ''.$e->getMessage().''; } print ""; print ''; diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index b9f630872ae..59aaf0ecc2c 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -31,8 +31,8 @@ if (!defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); //if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); // Not disabled because need to do translations if (!defined('NOCSRFCHECK')) define('NOCSRFCHECK', 1); if (!defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', 1); -if (!defined('NOLOGIN')) define('NOLOGIN', 1); // File must be accessed by logon page so without login -//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU',1); // We need top menu content +if (!defined('NOLOGIN')) define('NOLOGIN', 1); // File must be accessed by logon page so without login. +//if (!defined('NOREQUIREMENU')) define('NOREQUIREMENU',1); // We load menu manager class (note that object loaded may have wrong content because NOLOGIN is set and some values depends on login) if (!defined('NOREQUIREHTML')) define('NOREQUIREHTML', 1); if (!defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); @@ -55,6 +55,10 @@ if (empty($user->id) && !empty($_SESSION['dol_login'])) { $user->fetch('', $_SESSION['dol_login'], '', 1); $user->getrights(); + + // Reload menu now we have the good user (and we need the good menu to have ->showmenu('topnb') correct. + $menumanager = new MenuManager($db, empty($user->socid) ? 0 : 1); + $menumanager->loadMenu(); } @@ -190,6 +194,7 @@ $colortext = join(',', colorStringToArray($colortext)); $colortextlink = join(',', colorStringToArray($colortextlink)); $nbtopmenuentries = $menumanager->showmenu('topnb'); + if ($conf->browser->layout == 'phone') $nbtopmenuentries = max($nbtopmenuentries, 10); diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index d468eccf87d..dcfbc402927 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -56,6 +56,10 @@ if (empty($user->id) && !empty($_SESSION['dol_login'])) { $user->fetch('', $_SESSION['dol_login'], '', 1); $user->getrights(); + + // Reload menu now we have the good user (and we need the good menu to have ->showmenu('topnb') correct. + $menumanager = new MenuManager($db, empty($user->socid) ? 0 : 1); + $menumanager->loadMenu(); } diff --git a/htdocs/ticket/list.php b/htdocs/ticket/list.php index 12dd4c37058..91d84270a30 100644 --- a/htdocs/ticket/list.php +++ b/htdocs/ticket/list.php @@ -659,11 +659,15 @@ foreach ($object->fields as $key => $val) if ($search[$key]) $selectedarray = array_values($search[$key]); print Form::multiselectarray('search_fk_statut', $arrayofstatus, $selectedarray, 0, 0, 'minwidth150', 1, 0, '', '', ''); print ''; - } elseif ($key == "fk_soc") - { + } elseif ($key == "fk_soc") { print ''; } else { - print ''; + print ''; + if (is_array($val['arrayofkeyval'])) print $form->selectarray('search_'.$key, $val['arrayofkeyval'], $search[$key], $val['notnull'], 0, 0, '', 1, 0, 0, '', 'maxwidth75'); + elseif (strpos($val['type'], 'integer:') === 0) { + print $object->showInputField($val, $key, $search[$key], '', '', 'search_', 'maxwidth150', 1); + } elseif (!preg_match('/^(date|timestamp)/', $val['type'])) print ''; + print ''; } } } diff --git a/htdocs/variants/admin/admin.php b/htdocs/variants/admin/admin.php index 86342664c35..d97211d46bf 100644 --- a/htdocs/variants/admin/admin.php +++ b/htdocs/variants/admin/admin.php @@ -50,7 +50,9 @@ print load_fiche_titre($title, $linkback, 'title_setup'); dol_fiche_head(array(), 'general', $tab, 0, 'product'); -print '
'; +print ''; +print ''; + print ''; print ''; print '
'.$langs->trans("Parameters").''."\n"; diff --git a/htdocs/website/index.php b/htdocs/website/index.php index a36f33ee682..7614f6cc876 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -59,7 +59,7 @@ $massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choi $confirm = GETPOST('confirm', 'alpha'); $cancel = GETPOST('cancel', 'alpha'); $toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list -$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'bomlist'; // To manage different context of search +$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'websitelist'; // 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/zapier/hook_card.php b/htdocs/zapier/hook_card.php index 9d33a9801b0..efb02395e7b 100644 --- a/htdocs/zapier/hook_card.php +++ b/htdocs/zapier/hook_card.php @@ -38,7 +38,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') : 'zapiercard'; // To manage different context of search $backtopage = GETPOST('backtopage', 'alpha'); // Initialize technical objects diff --git a/htdocs/zapier/hook_list.php b/htdocs/zapier/hook_list.php index ac90713f13c..d36d909b399 100644 --- a/htdocs/zapier/hook_list.php +++ b/htdocs/zapier/hook_list.php @@ -41,7 +41,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') : 'hooklist'; // To manage different context of search +$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'zapierlist'; // 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')