From b2a488ef9f3863a12f11013ebebd90d694116f1b Mon Sep 17 00:00:00 2001 From: atm-josselin Date: Mon, 24 Feb 2020 11:00:55 +0100 Subject: [PATCH 01/17] FIX : Bad translation for productlot EatBy and SellBy --- htdocs/product/stock/productlot_card.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/product/stock/productlot_card.php b/htdocs/product/stock/productlot_card.php index 0466f718f80..33281ccf278 100644 --- a/htdocs/product/stock/productlot_card.php +++ b/htdocs/product/stock/productlot_card.php @@ -32,7 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/stock/class/productlot.class.php'; // Load translation files required by the page -$langs->loadLangs(array('stock', 'other', 'productbatch')); +$langs->loadLangs(array('stocks', 'other', 'productbatch')); // Get parameters $id = GETPOST('id', 'int'); @@ -337,17 +337,17 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Eat by print ''; - print $form->editfieldkey($langs->trans('Eatby'), 'eatby', $object->eatby, $object, $user->rights->stock->creer, 'datepicker'); + print $form->editfieldkey($langs->trans('EatByDate'), 'eatby', $object->eatby, $object, $user->rights->stock->creer, 'datepicker'); print ''; - print $form->editfieldval($langs->trans('Eatby'), 'eatby', $object->eatby, $object, $user->rights->stock->creer, 'datepicker'); + print $form->editfieldval($langs->trans('EatByDate'), 'eatby', $object->eatby, $object, $user->rights->stock->creer, 'datepicker'); print ''; print ''; // Sell by print ''; - print $form->editfieldkey($langs->trans('Sellby'), 'sellby', $object->sellby, $object, $user->rights->stock->creer, 'datepicker'); + print $form->editfieldkey($langs->trans('SellByDate'), 'sellby', $object->sellby, $object, $user->rights->stock->creer, 'datepicker'); print ''; - print $form->editfieldval($langs->trans('Sellby'), 'sellby', $object->sellby, $object, $user->rights->stock->creer, 'datepicker'); + print $form->editfieldval($langs->trans('SellByDate'), 'sellby', $object->sellby, $object, $user->rights->stock->creer, 'datepicker'); print ''; print ''; From b565881b31f74553076eb02dacd6b7f2b1a1a818 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Tue, 25 Feb 2020 12:58:27 +0100 Subject: [PATCH 02/17] Create README-DE.md --- doc/user/README-DE.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 doc/user/README-DE.md diff --git a/doc/user/README-DE.md b/doc/user/README-DE.md new file mode 100644 index 00000000000..ea9458f4563 --- /dev/null +++ b/doc/user/README-DE.md @@ -0,0 +1,12 @@ +README (german) +LiesMich (deutsch) + +-------------------------------- +Benutzeranleitung +-------------------------------- + +Alle Dolibarr-Informationen sind online verfuegbar ueber die Webseiten: +https://www.dolibarr.de +oder +https://www.dolibarr.org +https://wiki.dolibarr.org From b7a0de11c680a513a0bce5dbe7688f01e2ddb426 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 25 Feb 2020 14:47:05 +0100 Subject: [PATCH 03/17] FIX API Get list of documents for supplier_invoice --- htdocs/api/class/api_documents.class.php | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/htdocs/api/class/api_documents.class.php b/htdocs/api/class/api_documents.class.php index ebfe3d7b0e0..c8ec14c0c5e 100644 --- a/htdocs/api/class/api_documents.class.php +++ b/htdocs/api/class/api_documents.class.php @@ -230,7 +230,7 @@ class Documents extends DolibarrApi /** * Return the list of documents of a dedicated element (from its ID or Ref) * - * @param string $modulepart Name of module or area concerned ('thirdparty', 'member', 'proposal', 'order', 'invoice', 'shipment', 'project', ...) + * @param string $modulepart Name of module or area concerned ('thirdparty', 'member', 'proposal', 'order', 'invoice', 'supplier_invoice', 'shipment', 'project', ...) * @param int $id ID of element * @param string $ref Ref of element * @param string $sortfield Sort criteria ('','fullname','relativename','name','date','size') @@ -355,6 +355,24 @@ class Documents extends DolibarrApi $upload_dir = $conf->facture->dir_output."/".get_exdir(0, 0, 0, 1, $object, 'invoice'); } + elseif ($modulepart == 'facture_fournisseur' || $modulepart == 'supplier_invoice') + { + $modulepart = 'supplier_invoice'; + + require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; + + if (!DolibarrApiAccess::$user->rights->fournisseur->facture->lire) { + throw new RestException(401); + } + + $object = new FactureFournisseur($this->db); + $result = $object->fetch($id, $ref); + if (!$result) { + throw new RestException(404, 'Invoice not found'); + } + + $upload_dir = $conf->fournisseur->dir_output."/facture/".get_exdir($object->id, 2, 0, 0, $object, 'invoice_supplier').dol_sanitizeFileName($object->ref); + } elseif ($modulepart == 'produit' || $modulepart == 'product') { require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; From ec108162e37f38ddc9ad40caa7c7cb3c86d35582 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 25 Feb 2020 15:14:37 +0100 Subject: [PATCH 04/17] Fix GETPOST --- htdocs/fourn/facture/card.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 6ab40c3924c..f901500cc6f 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -657,7 +657,7 @@ if (empty($reshook)) $_GET['socid'] = $_POST['socid']; $error++; } - if (!($_POST['fac_replacement'] > 0)) { + if (! (GETPOST('fac_replacement', 'int') > 0)) { $error++; setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("ReplaceInvoice")), null, 'errors'); } @@ -870,7 +870,7 @@ if (empty($reshook)) if (!$error && $_POST['origin'] && $_POST['originid']) { // Parse element/subelement (ex: project_task) - $element = $subelement = GETPOST('origin'); + $element = $subelement = GETPOST('origin', 'alpha'); /*if (preg_match('/^([^_]+)_([^_]+)/i',$_POST['origin'],$regs)) { $element = $regs[1]; @@ -894,8 +894,8 @@ if (empty($reshook)) { $element = 'projet'; } - $object->origin = GETPOST('origin'); - $object->origin_id = GETPOST('originid'); + $object->origin = GETPOST('origin', 'alpha'); + $object->origin_id = GETPOST('originid', 'int'); require_once DOL_DOCUMENT_ROOT.'/'.$element.'/class/'.$subelement.'.class.php'; From a18fda6b3d96f4b0cacf39b5c8ff67ad4e40af43 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 25 Feb 2020 19:59:53 +0100 Subject: [PATCH 05/17] Fix data on popup --- htdocs/compta/index.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php index 722a7a3ce82..ca4303326c5 100644 --- a/htdocs/compta/index.php +++ b/htdocs/compta/index.php @@ -449,7 +449,7 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture- $sql = "SELECT ff.rowid, ff.ref, ff.fk_statut, ff.libelle, ff.total_ht, ff.total_tva, ff.total_ttc, ff.tms, ff.paye"; $sql.= ", s.nom as name"; $sql.= ", s.rowid as socid"; - $sql.= ", s.code_fournisseur, s.code_compta_fournisseur"; + $sql.= ", s.code_fournisseur, s.code_compta_fournisseur, s.email"; $sql.= ", SUM(pf.amount) as am"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture_fourn as ff"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiementfourn_facturefourn as pf on ff.rowid=pf.fk_facturefourn"; @@ -497,10 +497,14 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture- $thirdpartystatic->id=$obj->socid; $thirdpartystatic->name=$obj->name; + $thirdpartystatic->email=$obj->email; + $thirdpartystatic->country_id=0; + $thirdpartystatic->country_code=''; + $thirdpartystatic->client=0; $thirdpartystatic->fournisseur=1; - //$thirdpartystatic->code_client = $obj->code_client; + $thirdpartystatic->code_client = ''; $thirdpartystatic->code_fournisseur = $obj->code_fournisseur; - //$thirdpartystatic->code_compta = $obj->code_compta; + $thirdpartystatic->code_compta = ''; $thirdpartystatic->code_compta_fournisseur = $obj->code_compta_fournisseur; print ''; From c38e88ca46e3489dce9a9099e26f0c6ca5686a9c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 26 Feb 2020 06:39:02 +0100 Subject: [PATCH 06/17] FIX Bad sort link in accounting report --- htdocs/compta/resultat/clientfourn.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/htdocs/compta/resultat/clientfourn.php b/htdocs/compta/resultat/clientfourn.php index ee76a29d282..0a60e928db9 100644 --- a/htdocs/compta/resultat/clientfourn.php +++ b/htdocs/compta/resultat/clientfourn.php @@ -67,8 +67,7 @@ if (!$sortorder) $sortorder = 'ASC'; // Date range $year = GETPOST('year', 'int'); -if (empty($year)) -{ +if (empty($year)) { $year_current = strftime("%Y", dol_now()); $month_current = strftime("%m", dol_now()); $year_start = $year_current; @@ -114,7 +113,7 @@ $tmps = dol_getdate($date_start); $year_start = $tmps['year']; $tmpe = dol_getdate($date_end); $year_end = $tmpe['year']; -$nbofyear = ($year_end - $start_year) + 1; +$nbofyear = ($year_end - $year_start) + 1; //var_dump("year_start=".$year_start." year_end=".$year_end." nbofyear=".$nbofyear." date_start=".dol_print_date($date_start, 'dayhour')." date_end=".dol_print_date($date_end, 'dayhour')); // Define modecompta ('CREANCES-DETTES' or 'RECETTES-DEPENSES' or 'BOOKKEEPING') @@ -199,11 +198,15 @@ if ($date_startmonth) $param .= '&date_startmonth='.$date_startmonth; if ($date_startyear) $param .= '&date_startyear='.$date_startyear; if ($date_endday) $param .= '&date_endday='.$date_endday; if ($date_endmonth) $param .= '&date_endmonth='.$date_endmonth; -if ($date_endyear) $param .= '&date_endyear='.$date_startyear; +if ($date_endyear) $param .= '&date_endyear='.$date_endyear; print ''; print ''; -print_liste_field_titre("PredefinedGroups", $_SERVER["PHP_SELF"], 'f.thirdparty_code,f.rowid', '', $param, '', $sortfield, $sortorder, 'width200 '); +if ($modecompta == 'BOOKKEEPING') { + print_liste_field_titre("PredefinedGroups", $_SERVER["PHP_SELF"], 'f.thirdparty_code,f.rowid', '', $param, '', $sortfield, $sortorder, 'width200 '); +} else { + print_liste_field_titre("", $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'width200 '); +} print_liste_field_titre(''); if ($modecompta == 'BOOKKEEPING') { From 114e41108df21ea476cd50f5a9ef827bb65134e7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 26 Feb 2020 06:43:21 +0100 Subject: [PATCH 07/17] FIX sort link --- htdocs/compta/resultat/clientfourn.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/resultat/clientfourn.php b/htdocs/compta/resultat/clientfourn.php index 0a60e928db9..a07aacd127f 100644 --- a/htdocs/compta/resultat/clientfourn.php +++ b/htdocs/compta/resultat/clientfourn.php @@ -192,7 +192,7 @@ if (!empty($conf->accounting->enabled) && $modecompta != 'BOOKKEEPING') } // Show report array -$param = '&modecompta='.$modecompta; +$param = '&modecompta='.urlencode($modecompta).'&showaccountdetail='.urlencode($showaccountdetail); if ($date_startday) $param .= '&date_startday='.$date_startday; if ($date_startmonth) $param .= '&date_startmonth='.$date_startmonth; if ($date_startyear) $param .= '&date_startyear='.$date_startyear; From 373ab3bc01abb2b1ea133cc8bc9337ebc709a004 Mon Sep 17 00:00:00 2001 From: Marc de Lima Lucio Date: Wed, 26 Feb 2020 10:35:43 +0100 Subject: [PATCH 08/17] FIX: excess paid from situation invoices not counted when calculating remain to pay --- htdocs/core/class/discount.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/discount.class.php b/htdocs/core/class/discount.class.php index d464e986c32..5793d4a7d89 100644 --- a/htdocs/core/class/discount.class.php +++ b/htdocs/core/class/discount.class.php @@ -539,14 +539,14 @@ class DiscountAbsolute $sql = 'SELECT sum(rc.amount_ttc) as amount, sum(rc.multicurrency_amount_ttc) as multicurrency_amount'; $sql.= ' FROM '.MAIN_DB_PREFIX.'societe_remise_except as rc, '.MAIN_DB_PREFIX.'facture as f'; $sql.= ' WHERE rc.fk_facture_source=f.rowid AND rc.fk_facture = '.$invoice->id; - $sql.= ' AND (f.type = 2 OR f.type = 0)'; // Find discount coming from credit note or excess received + $sql.= ' AND f.type IN (' . Facture::TYPE_STANDARD . ', ' . Facture::TYPE_CREDIT_NOTE . ', ' . Facture::TYPE_SITUATION . ')'; // Find discount coming from credit note or excess received } else if ($invoice->element == 'invoice_supplier') { $sql = 'SELECT sum(rc.amount_ttc) as amount, sum(rc.multicurrency_amount_ttc) as multicurrency_amount'; $sql.= ' FROM '.MAIN_DB_PREFIX.'societe_remise_except as rc, '.MAIN_DB_PREFIX.'facture_fourn as f'; $sql.= ' WHERE rc.fk_invoice_supplier_source=f.rowid AND rc.fk_invoice_supplier = '.$invoice->id; - $sql.= ' AND (f.type = 2 OR f.type = 0)'; // Find discount coming from credit note or excess paid + $sql.= ' AND f.type IN (' . Facture::TYPE_STANDARD . ', ' . Facture::TYPE_CREDIT_NOTE . ')'; // Find discount coming from credit note or excess paid } else { From 01b9c4267044db0538bde58db8c74243b9110c63 Mon Sep 17 00:00:00 2001 From: gauthier Date: Wed, 26 Feb 2020 15:02:42 +0100 Subject: [PATCH 09/17] FIX : timezone must be tzserver and not tzuser as well as on contract card --- htdocs/contrat/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php index 01cc12dd34a..7859dc5a4f4 100644 --- a/htdocs/contrat/list.php +++ b/htdocs/contrat/list.php @@ -745,7 +745,7 @@ while ($i < min($num, $limit)) // Date if (! empty($arrayfields['c.date_contrat']['checked'])) { - print ''; + print ''; } // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; From b95d74f84318335cfb1e096120989dd03987e99b Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Wed, 26 Feb 2020 15:23:59 +0100 Subject: [PATCH 10/17] FIX token in barcode tools page --- htdocs/barcode/printsheet.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/barcode/printsheet.php b/htdocs/barcode/printsheet.php index 828d2ecff50..5cd988a5bed 100644 --- a/htdocs/barcode/printsheet.php +++ b/htdocs/barcode/printsheet.php @@ -278,6 +278,7 @@ dol_htmloutput_errors($mesg); print '
'; print ''; print ''; +print ''; print '
'; From 91e7ff3c8eebbaf16e67c1d2a742ba9a4866a371 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 26 Feb 2020 15:05:29 +0100 Subject: [PATCH 11/17] FIX No js if javascript off --- htdocs/main.inc.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 438dbcda4ec..fe7ee39f6e8 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1876,7 +1876,7 @@ function top_menu_user()
'; - if (!defined('JS_JQUERY_DISABLE_DROPDOWN')) // This may be set by some pages that use different jquery version to avoid errors + if (!defined('JS_JQUERY_DISABLE_DROPDOWN') && !empty($conf->use_javascript_ajax)) // This may be set by some pages that use different jquery version to avoid errors { $btnUser .= ' @@ -1919,7 +1919,9 @@ function top_menu_bookmark() $html = ''; // Define $bookmarks - if (!empty($conf->bookmark->enabled) && $user->rights->bookmark->lire) + if (empty($conf->bookmark->enabled) || empty($user->rights->bookmark->lire)) return $html; + + if (!defined('JS_JQUERY_DISABLE_DROPDOWN') && !empty($conf->use_javascript_ajax)) // This may be set by some pages that use different jquery version to avoid errors { include_once DOL_DOCUMENT_ROOT.'/bookmarks/bookmarks.lib.php'; $langs->load("bookmarks"); From 4370bf8fdc5e9c2fc7e55b89c104026358fc2ffa Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 26 Feb 2020 15:21:52 +0100 Subject: [PATCH 12/17] FIX Use GETPOST instead of POST Conflicts: htdocs/admin/ihm.php --- htdocs/admin/ihm.php | 49 ++++++++++++++++++++++++++------------------ 1 file changed, 29 insertions(+), 20 deletions(-) diff --git a/htdocs/admin/ihm.php b/htdocs/admin/ihm.php index 44f13173669..1383f6707aa 100644 --- a/htdocs/admin/ihm.php +++ b/htdocs/admin/ihm.php @@ -58,6 +58,13 @@ if (GETPOST('cancel', 'alpha')) $action=''; } +// Convert action set_XXX and del_XXX to set var (this is used when no javascript on for ajax_constantonoff) +$regs = array(); +if (preg_match('/^(set|del)_([A-Z_]+)$/', $action, $regs)) { + if ($regs[1] == 'set') dolibarr_set_const($db, $regs[2], 1, 'chaine', 0, '', $conf->entity); + else dolibarr_del_const($db, $regs[2], $conf->entity); +} + if ($action == 'removebackgroundlogin' && ! empty($conf->global->MAIN_LOGIN_BACKGROUND)) { dolibarr_set_const($db, "MAIN_IHM_PARAMS_REV", (int) $conf->global->MAIN_IHM_PARAMS_REV+1, 'chaine', 0, '', $conf->entity); @@ -81,15 +88,15 @@ if ($action == 'removebackgroundlogin' && ! empty($conf->global->MAIN_LOGIN_BACK if ($action == 'update') { - dolibarr_set_const($db, "MAIN_LANG_DEFAULT", $_POST["MAIN_LANG_DEFAULT"], 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_LANG_DEFAULT", GETPOST("MAIN_LANG_DEFAULT", 'aZ09'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_IHM_PARAMS_REV", (int) $conf->global->MAIN_IHM_PARAMS_REV+1, 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_MULTILANGS", $_POST["MAIN_MULTILANGS"], 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_THEME", $_POST["main_theme"], 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_THEME", GETPOST("main_theme", 'aZ09'), 'chaine', 0, '', $conf->entity); - $val=GETPOST('THEME_TOPMENU_DISABLE_IMAGE'); + /*$val=GETPOST('THEME_TOPMENU_DISABLE_IMAGE'); if (! $val) dolibarr_del_const($db, 'THEME_TOPMENU_DISABLE_IMAGE', $conf->entity); - else dolibarr_set_const($db, 'THEME_TOPMENU_DISABLE_IMAGE', GETPOST('THEME_TOPMENU_DISABLE_IMAGE'), 'chaine', 0, '', $conf->entity); + else dolibarr_set_const($db, 'THEME_TOPMENU_DISABLE_IMAGE', GETPOST('THEME_TOPMENU_DISABLE_IMAGE'), 'chaine', 0, '', $conf->entity);*/ $val=(implode(',', (colorStringToArray(GETPOST('THEME_ELDY_BACKBODY'), array())))); if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_BACKBODY', $conf->entity); @@ -141,25 +148,27 @@ if ($action == 'update') if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_USE_CHECKED', $conf->entity); else dolibarr_set_const($db, "THEME_ELDY_USE_CHECKED", $val, 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_SIZE_LISTE_LIMIT", $_POST["main_size_liste_limit"], 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_SIZE_SHORTLIST_LIMIT", $_POST["main_size_shortliste_limit"], 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_DISABLE_JAVASCRIPT", $_POST["MAIN_DISABLE_JAVASCRIPT"], 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_BUTTON_HIDE_UNAUTHORIZED", $_POST["MAIN_BUTTON_HIDE_UNAUTHORIZED"], 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_START_WEEK", $_POST["MAIN_START_WEEK"], 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_DEFAULT_WORKING_DAYS", $_POST["MAIN_DEFAULT_WORKING_DAYS"], 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_DEFAULT_WORKING_HOURS", $_POST["MAIN_DEFAULT_WORKING_HOURS"], 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_SHOW_LOGO", $_POST["MAIN_SHOW_LOGO"], 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_FIRSTNAME_NAME_POSITION", $_POST["MAIN_FIRSTNAME_NAME_POSITION"], 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_SIZE_LISTE_LIMIT", GETPOST("main_size_liste_limit", 'int'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_SIZE_SHORTLIST_LIMIT", GETPOST("main_size_shortliste_limit", 'int'), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_HELPCENTER_DISABLELINK", $_POST["MAIN_HELPCENTER_DISABLELINK"], 'chaine', 0, '', 0); // Param for all entities - dolibarr_set_const($db, "MAIN_MOTD", dol_htmlcleanlastbr($_POST["main_motd"]), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_HOME", dol_htmlcleanlastbr($_POST["main_home"]), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_HELP_DISABLELINK", $_POST["MAIN_HELP_DISABLELINK"], 'chaine', 0, '', 0); // Param for all entities - dolibarr_set_const($db, "MAIN_BUGTRACK_ENABLELINK", $_POST["MAIN_BUGTRACK_ENABLELINK"], 'chaine', 0, '', $conf->entity); + //dolibarr_set_const($db, "MAIN_DISABLE_JAVASCRIPT", GETPOST("MAIN_DISABLE_JAVASCRIPT", 'aZ09'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_BUTTON_HIDE_UNAUTHORIZED", GETPOST("MAIN_BUTTON_HIDE_UNAUTHORIZED", 'aZ09'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_START_WEEK", GETPOST("MAIN_START_WEEK", 'int'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_DEFAULT_WORKING_DAYS", GETPOST("MAIN_DEFAULT_WORKING_DAYS", 'int'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_DEFAULT_WORKING_HOURS", GETPOST("MAIN_DEFAULT_WORKING_HOURS", 'int'), 'chaine', 0, '', $conf->entity); + //dolibarr_set_const($db, "MAIN_SHOW_LOGO", GETPOST("MAIN_SHOW_LOGO", 'aZ09'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_FIRSTNAME_NAME_POSITION", GETPOST("MAIN_FIRSTNAME_NAME_POSITION", 'aZ09'), 'chaine', 0, '', $conf->entity); + + dolibarr_set_const($db, "MAIN_HELPCENTER_DISABLELINK", GETPOST('MAIN_HELPCENTER_DISABLELINK', 'aZ09'), 'chaine', 0, '', 0); // Param for all entities + dolibarr_set_const($db, "MAIN_MOTD", dol_htmlcleanlastbr(GETPOST("main_motd", 'none')), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_HOME", dol_htmlcleanlastbr(GETPOST("main_home", 'none')), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_HELP_DISABLELINK", GETPOST("MAIN_HELP_DISABLELINK", 'aZ09'), 'chaine', 0, '', 0); // Param for all entities + dolibarr_set_const($db, "MAIN_BUGTRACK_ENABLELINK", GETPOST('MAIN_BUGTRACK_ENABLELINK', 'aZ09'), 'chaine', 0, '', $conf->entity); $varforimage='imagebackground'; $dirforimage=$conf->mycompany->dir_output.'/logos/'; if ($_FILES[$varforimage]["tmp_name"]) { + $reg = array(); if (preg_match('/([^\\/:]+)$/i', $_FILES[$varforimage]["name"], $reg)) { $original_file=$reg[1]; @@ -247,7 +256,7 @@ print '
'; // Multilingual GUI print ''; print ''; print ''; @@ -266,7 +275,7 @@ print ''; // Disable javascript and ajax print ''; print ''; print ''; From b52cfe58d6e9925f8e51705c45bc98e7c187abea Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 26 Feb 2020 15:22:23 +0100 Subject: [PATCH 13/17] FIX Disable js if no javascript --- htdocs/core/class/html.formother.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index a73621faa32..72ac856c31e 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -742,7 +742,7 @@ class FormOther if (!is_array($arrayofcolors) || count($arrayofcolors) < 1) { $langs->load("other"); - if (empty($conf->dol_use_jmobile)) + if (empty($conf->dol_use_jmobile) && !empty($conf->use_javascript_ajax)) { $out .= ''; $out .= ''; @@ -788,7 +788,7 @@ class FormOther } else // In most cases, this is not used. We used instead function with no specific list of colors { - if (empty($conf->dol_use_jmobile)) + if (empty($conf->dol_use_jmobile) && !empty($conf->use_javascript_ajax)) { $out .= ''; $out .= ''; From 9f097b1a0894904ae84f0ee14b4a40d2ed94c120 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 26 Feb 2020 15:41:46 +0100 Subject: [PATCH 14/17] FIX #13146 #13198 --- htdocs/accountancy/admin/account.php | 29 ++++++++++------------------ 1 file changed, 10 insertions(+), 19 deletions(-) diff --git a/htdocs/accountancy/admin/account.php b/htdocs/accountancy/admin/account.php index d75d61e347f..47786e62eb2 100644 --- a/htdocs/accountancy/admin/account.php +++ b/htdocs/accountancy/admin/account.php @@ -46,6 +46,8 @@ $search_accountparent = GETPOST('search_accountparent', 'alpha'); $search_pcgtype = GETPOST('search_pcgtype', 'alpha'); $search_pcgsubtype = GETPOST('search_pcgsubtype', 'alpha'); +$chartofaccounts = GETPOST('chartofaccounts', 'int'); + // Security check if ($user->socid > 0) accessforbidden(); if (! $user->rights->accounting->chartofaccount) accessforbidden(); @@ -101,11 +103,9 @@ if (empty($reshook)) $search_pcgsubtype = ""; $search_array_options = array(); } - - if (GETPOST('change_chart', 'alpha') && (GETPOST('valid_change_chart', 'int') || empty($conf->use_javascript_ajax))) + if ((GETPOST('valid_change_chart', 'alpha') && GETPOST('chartofaccounts', 'int') > 0) // explicit click on button 'Change and load' with js on + || (GETPOST('chartofaccounts', 'int') > 0 && GETPOST('chartofaccounts', 'int') != $conf->global->CHARTOFACCOUNTS)) // a submit of form is done and chartofaccounts combo has been modified { - $chartofaccounts = GETPOST('chartofaccounts', 'int'); - if ($chartofaccounts > 0) { // Get language code for this $chartofaccounts @@ -274,21 +274,13 @@ if ($resql) if (!empty($conf->use_javascript_ajax)) { - print ' + print ' '; @@ -335,8 +327,7 @@ if ($resql) else dol_print_error($db); print ""; print ajax_combobox("chartofaccounts"); - print ''; - print ''; + print ''; print '
'; print '
'; From aba29207a3d70dcd10a6dff3b8d844b4c03f5606 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 26 Feb 2020 16:10:12 +0100 Subject: [PATCH 15/17] Fix param lost --- htdocs/admin/ihm.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/ihm.php b/htdocs/admin/ihm.php index 1383f6707aa..85da8c95844 100644 --- a/htdocs/admin/ihm.php +++ b/htdocs/admin/ihm.php @@ -90,7 +90,7 @@ if ($action == 'update') { dolibarr_set_const($db, "MAIN_LANG_DEFAULT", GETPOST("MAIN_LANG_DEFAULT", 'aZ09'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_IHM_PARAMS_REV", (int) $conf->global->MAIN_IHM_PARAMS_REV+1, 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_MULTILANGS", $_POST["MAIN_MULTILANGS"], 'chaine', 0, '', $conf->entity); + //dolibarr_set_const($db, "MAIN_MULTILANGS", $_POST["MAIN_MULTILANGS"], 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_THEME", GETPOST("main_theme", 'aZ09'), 'chaine', 0, '', $conf->entity); From 9c1c0ee08ff517404c75c1fbb51fa90980309e60 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 26 Feb 2020 16:17:31 +0100 Subject: [PATCH 16/17] Fix for nojs interface --- htdocs/core/boxes/box_task.php | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/htdocs/core/boxes/box_task.php b/htdocs/core/boxes/box_task.php index ed267493e97..94983ef6bff 100644 --- a/htdocs/core/boxes/box_task.php +++ b/htdocs/core/boxes/box_task.php @@ -127,15 +127,17 @@ class box_task extends ModeleBoxes $boxcontent .= ''; $boxcontent .= ''."\n"; $boxcontent .= ''."\n"; - $boxcontent .= ''; - // set cookie by js - $boxcontent .= ''; + '; + // set cookie by js + $boxcontent .= ''; + } $this->info_box_contents[0][] = array( 'tr'=>'class="nohover showiffilter'.$this->boxcode.' hideobject"', 'td' => 'class="nohover"', From 921dacf695a9270cbbc32221bdee73674cf28571 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 26 Feb 2020 16:58:45 +0100 Subject: [PATCH 17/17] Fix remove $_POST --- htdocs/compta/tva/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/tva/card.php b/htdocs/compta/tva/card.php index 759ed75df5e..41e4839b88c 100644 --- a/htdocs/compta/tva/card.php +++ b/htdocs/compta/tva/card.php @@ -277,7 +277,7 @@ if ($action == 'create') if (! empty($conf->banque->enabled)) { print '
'; }
'.dol_print_date($db->jdate($obj->date_contrat), 'day', 'tzuser').''.dol_print_date($db->jdate($obj->date_contrat), 'day', 'tzserver').'
'.$langs->trans("EnableMultilangInterface").''; -print $form->selectyesno('MAIN_MULTILANGS', $conf->global->MAIN_MULTILANGS, 1); +print ajax_constantonoff("MAIN_MULTILANGS"); print ' 
'.$langs->trans("DisableJavascript").''; -print $form->selectyesno('MAIN_DISABLE_JAVASCRIPT', isset($conf->global->MAIN_DISABLE_JAVASCRIPT)?$conf->global->MAIN_DISABLE_JAVASCRIPT:0, 1); +print ajax_constantonoff("MAIN_DISABLE_JAVASCRIPT"); print ' 
'.$langs->trans("BankAccount").''; - $form->select_comptes($_POST["accountid"], "accountid", 0, "courant=1", 1); // Affiche liste des comptes courant + $form->select_comptes(GETPOST("accountid", 'int'), "accountid", 0, "courant=1", 2); // List of bank account available print '