Merge pull request #18462 from grandoc/new_branch_22_08_2021

fix : Undefined property: stdClass:: in C:\wamp64\www\dolibarr-140\ht…
This commit is contained in:
Laurent Destailleur 2021-08-28 18:35:40 +02:00 committed by GitHub
commit 8b996627eb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 25 additions and 15 deletions

View File

@ -6,7 +6,7 @@
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
* Copyright (C) 2010-2016 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2010-2018 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2010-2021 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2012-2013 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2012 Cedric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
@ -121,7 +121,7 @@ $usercansend = (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->
$usercancreateorder = $user->rights->commande->creer;
$usercancreateinvoice = $user->rights->facture->creer;
$usercancreatecontract = $user->rights->contrat->creer;
$usercancreateintervention = $user->rights->ficheinter->creer;
$usercancreateintervention = $user->hasRight('ficheinter', 'creer');
$usercancreatepurchaseorder = ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer);
$permissionnote = $usercancreate; // Used by the include of actions_setnotes.inc.php
@ -260,10 +260,10 @@ if (empty($reshook)) {
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
$outputlangs = $langs;
$newlang = '';
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09');
}
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) {
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang)) {
$newlang = $object->thirdparty->default_lang;
}
if (!empty($newlang)) {

View File

@ -66,13 +66,13 @@ if ($action == 'builddoc' && $permissiontoadd) {
$outputlangs = $langs;
$newlang = '';
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
$newlang = GETPOST('lang_id', 'aZ09');
}
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && isset($object->thirdparty->default_lang)) {
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && isset($object->thirdparty->default_lang)) {
$newlang = $object->thirdparty->default_lang; // for proposal, order, invoice, ...
}
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && isset($object->default_lang)) {
if (!empty($conf->global->MAIN_MULTILANGS) && empty($newlang) && isset($object->default_lang)) {
$newlang = $object->default_lang; // for thirdparty
}
if (!empty($newlang)) {

View File

@ -1701,7 +1701,7 @@ abstract class CommonObject
$idtype = $this->barcode_type;
if (empty($idtype) && $idtype != '0') { // If type of barcode no set, we try to guess. If set to '0' it means we forced to have type remain not defined
if ($this->element == 'product') {
if ($this->element == 'product' && !empty($conf->global->PRODUIT_DEFAULT_BARCODE_TYPE)) {
$idtype = $conf->global->PRODUIT_DEFAULT_BARCODE_TYPE;
} elseif ($this->element == 'societe') {
$idtype = $conf->global->GENBARCODE_BARCODETYPE_THIRDPARTY;

View File

@ -1718,7 +1718,7 @@ class ExtraFields
$sql = 'SELECT '.$keyList;
$sql .= ' FROM '.MAIN_DB_PREFIX.$InfoFieldList[0];
if (strpos($InfoFieldList[4], 'extra') !== false) {
if (!empty($InfoFieldList[4]) && strpos($InfoFieldList[4], 'extra') !== false) {
$sql .= ' as main';
}
if ($selectkey == 'rowid' && empty($value)) {

View File

@ -10,7 +10,7 @@
* Copyright (C) 2007 Franky Van Liedekerke <franky.van.liedekerker@telenet.be>
* Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
* Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2010-2019 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2010-2021 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2011 Herve Prot <herve.prot@symeos.com>
* Copyright (C) 2012-2016 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2012 Cedric Salvador <csalvador@gpcsolutions.fr>
@ -7855,6 +7855,11 @@ class Form
if (empty($conf->expedition->enabled)) {
continue; // Do not show if module disabled
}
} elseif ($objecttype == 'ficheinter') {
$tplpath = 'fichinter';
if (empty($conf->ficheinter->enabled)) {
continue; // Do not show if module disabled
}
} elseif ($objecttype == 'invoice_supplier') {
$tplpath = 'fourn/facture';
} elseif ($objecttype == 'order_supplier') {

View File

@ -170,9 +170,9 @@ class modBlockedLog extends DolibarrModules
$sql = array();
// If already used, we add an entry to show we enable module
require_once DOL_DOCUMENT_ROOT.'/blockedlog/class/blockedlog.class.php';
require_once DOL_DOCUMENT_ROOT . '/blockedlog/class/blockedlog.class.php';
$object = new stdClass();
$object = new stdClass();
$object->id = 1;
$object->element = 'module';
$object->ref = 'systemevent';

View File

@ -77,6 +77,11 @@ class modFicheinter extends DolibarrModules
$this->const = array();
$r = 0;
if (!isset($conf->ficheinter) || !isset($conf->ficheinter->enabled)) {
$conf->ficheinter = new stdClass();
$conf->ficheinter->enabled = 0;
}
$this->const[$r][0] = "FICHEINTER_ADDON_PDF";
$this->const[$r][1] = "chaine";
$this->const[$r][2] = "soleil";

View File

@ -233,7 +233,7 @@ class Propalmergepdfproduct extends CommonObject
$sql .= " FROM ".MAIN_DB_PREFIX."propal_merge_pdf_product as t";
$sql .= " WHERE t.fk_product = ".((int) $product_id);
if ($conf->global->MAIN_MULTILANGS && !empty($lang)) {
if (!empty($conf->global->MAIN_MULTILANGS) && !empty($lang)) {
$sql .= " AND t.lang = '".$this->db->escape($lang)."'";
}
@ -248,7 +248,7 @@ class Propalmergepdfproduct extends CommonObject
$line->fk_product = $obj->fk_product;
$line->file_name = $obj->file_name;
if ($conf->global->MAIN_MULTILANGS) {
if (!empty($conf->global->MAIN_MULTILANGS)) {
$line->lang = $obj->lang;
}
$line->fk_user_author = $obj->fk_user_author;
@ -258,7 +258,7 @@ class Propalmergepdfproduct extends CommonObject
$line->import_key = $obj->import_key;
if ($conf->global->MAIN_MULTILANGS) {
if (!empty($conf->global->MAIN_MULTILANGS)) {
$this->lines[$obj->file_name.'_'.$obj->lang] = $line;
} else {
$this->lines[$obj->file_name] = $line;