diff --git a/htdocs/core/class/doleditor.class.php b/htdocs/core/class/doleditor.class.php index a0879160727..fc148b94611 100644 --- a/htdocs/core/class/doleditor.class.php +++ b/htdocs/core/class/doleditor.class.php @@ -174,7 +174,7 @@ class DolEditor //$out.= ''; if ($this->tool == 'ckeditor' && ! empty($conf->use_javascript_ajax) && ! empty($conf->fckeditor->enabled)) diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index dbdba9db085..e5b3f8fbb6e 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -754,7 +754,7 @@ class FormOther } ); }); '; } - $out .= ''; + $out .= ''; } else // In most cases, this is not used. We used instead function with no specific list of colors { diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 4e187f5988b..00ca3f3d45f 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -5212,16 +5212,18 @@ function get_default_npr(Societe $thirdparty_seller, Societe $thirdparty_buyer, if ($idprodfournprice > 0) { - if (!class_exists('ProductFournisseur')) + if (!class_exists('ProductFournisseur')) { require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php'; + } $prodprice = new ProductFournisseur($db); $prodprice->fetch_product_fournisseur_price($idprodfournprice); return $prodprice->fourn_tva_npr; } elseif ($idprod > 0) { - if (!class_exists('Product')) + if (!class_exists('Product')) { require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; + } $prod = new Product($db); $prod->fetch($idprod); return $prod->tva_npr; diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index 5d69840644e..994b71a416d 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -1258,9 +1258,15 @@ class pdf_einstein extends ModelePDFCommandes // Logo if (empty($conf->global->PDF_DISABLE_MYCOMPANY_LOGO)) { - $logo=$conf->mycompany->multidir_output[$object->entity].'/logos/'.$this->emetteur->logo; if ($this->emetteur->logo) { + if (empty($conf->global->MAIN_PDF_USE_LARGE_LOGO)) + { + $logo=$conf->mycompany->multidir_output[$object->entity].'/logos/thumbs/'.$this->emetteur->logo_small; + } + else { + $logo=$conf->mycompany->multidir_output[$object->entity].'/logos/'.$this->emetteur->logo; + } if (is_readable($logo)) { $height=pdf_getHeightForLogo($logo); diff --git a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php index 648b99f36bd..68fa5f179e7 100644 --- a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php @@ -1391,9 +1391,15 @@ class pdf_eratosthene extends ModelePDFCommandes // Logo if (empty($conf->global->PDF_DISABLE_MYCOMPANY_LOGO)) { - $logo=$conf->mycompany->multidir_output[$object->entity].'/logos/'.$this->emetteur->logo; if ($this->emetteur->logo) { + if (empty($conf->global->MAIN_PDF_USE_LARGE_LOGO)) + { + $logo=$conf->mycompany->multidir_output[$object->entity].'/logos/thumbs/'.$this->emetteur->logo_small; + } + else { + $logo=$conf->mycompany->multidir_output[$object->entity].'/logos/'.$this->emetteur->logo; + } if (is_readable($logo)) { $height=pdf_getHeightForLogo($logo); diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index 34467203ae8..ae34fd3f8e1 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -1616,9 +1616,15 @@ class pdf_crabe extends ModelePDFFactures // Logo if (empty($conf->global->PDF_DISABLE_MYCOMPANY_LOGO)) { - $logo = $conf->mycompany->multidir_output[$object->entity].'/logos/'.$this->emetteur->logo; if ($this->emetteur->logo) { + if (empty($conf->global->MAIN_PDF_USE_LARGE_LOGO)) + { + $logo=$conf->mycompany->multidir_output[$object->entity].'/logos/thumbs/'.$this->emetteur->logo_small; + } + else { + $logo=$conf->mycompany->multidir_output[$object->entity].'/logos/'.$this->emetteur->logo; + } if (is_readable($logo)) { $height = pdf_getHeightForLogo($logo); diff --git a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php index b6a5c0297d0..ecaa4ba14a0 100644 --- a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php @@ -1832,9 +1832,15 @@ class pdf_sponge extends ModelePDFFactures // Logo if (empty($conf->global->PDF_DISABLE_MYCOMPANY_LOGO)) { - $logo=$conf->mycompany->multidir_output[$object->entity].'/logos/'.$this->emetteur->logo; if ($this->emetteur->logo) { + if (empty($conf->global->MAIN_PDF_USE_LARGE_LOGO)) + { + $logo=$conf->mycompany->multidir_output[$object->entity].'/logos/thumbs/'.$this->emetteur->logo_small; + } + else { + $logo=$conf->mycompany->multidir_output[$object->entity].'/logos/'.$this->emetteur->logo; + } if (is_readable($logo)) { $height=pdf_getHeightForLogo($logo); diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index a398fbf23a4..3a53e9294df 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -1460,9 +1460,15 @@ class pdf_azur extends ModelePDFPropales // Logo if (empty($conf->global->PDF_DISABLE_MYCOMPANY_LOGO)) { - $logo = $conf->mycompany->multidir_output[$object->entity].'/logos/'.$this->emetteur->logo; if ($this->emetteur->logo) { + if (empty($conf->global->MAIN_PDF_USE_LARGE_LOGO)) + { + $logo=$conf->mycompany->multidir_output[$object->entity].'/logos/thumbs/'.$this->emetteur->logo_small; + } + else { + $logo=$conf->mycompany->multidir_output[$object->entity].'/logos/'.$this->emetteur->logo; + } if (is_readable($logo)) { $height = pdf_getHeightForLogo($logo); diff --git a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php index d35bedb6c9e..b26b8831f32 100644 --- a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php @@ -1501,9 +1501,15 @@ class pdf_cyan extends ModelePDFPropales // Logo if (empty($conf->global->PDF_DISABLE_MYCOMPANY_LOGO)) { - $logo=$conf->mycompany->multidir_output[$object->entity].'/logos/'.$this->emetteur->logo; if ($this->emetteur->logo) { + if (empty($conf->global->MAIN_PDF_USE_LARGE_LOGO)) + { + $logo=$conf->mycompany->multidir_output[$object->entity].'/logos/thumbs/'.$this->emetteur->logo_small; + } + else { + $logo=$conf->mycompany->multidir_output[$object->entity].'/logos/'.$this->emetteur->logo; + } if (is_readable($logo)) { $height=pdf_getHeightForLogo($logo); diff --git a/htdocs/fourn/class/fournisseur.product.class.php b/htdocs/fourn/class/fournisseur.product.class.php index c56c2a2cb64..069380249db 100644 --- a/htdocs/fourn/class/fournisseur.product.class.php +++ b/htdocs/fourn/class/fournisseur.product.class.php @@ -503,7 +503,7 @@ class ProductFournisseur extends Product $sql .= " pfp.multicurrency_price, pfp.multicurrency_unitprice, pfp.multicurrency_tx, pfp.fk_multicurrency, pfp.multicurrency_code,"; $sql .= " pfp.barcode, pfp.fk_barcode_type"; $sql .= " FROM ".MAIN_DB_PREFIX."product_fournisseur_price as pfp"; - $sql .= " WHERE pfp.rowid = ".$rowid; + $sql .= " WHERE pfp.rowid = ".(int) $rowid; dol_syslog(get_class($this)."::fetch_product_fournisseur_price", LOG_DEBUG); $resql = $this->db->query($sql); diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php index b10f409e9a1..b419185d84e 100644 --- a/htdocs/product/fournisseurs.php +++ b/htdocs/product/fournisseurs.php @@ -259,8 +259,9 @@ if (empty($reshook)) { $supplier = new Fournisseur($db); $result = $supplier->fetch($id_fourn); - if (isset($_POST['ref_fourn_price_id'])) - $object->fetch_product_fournisseur_price($_POST['ref_fourn_price_id']); + if (GETPOSTISSET('ref_fourn_price_id')) { + $object->fetch_product_fournisseur_price(GETPOST('ref_fourn_price_id', 'int')); + } $extralabels = $extrafields->fetch_name_optionals_label("product_fournisseur_price"); $extrafield_values = $extrafields->getOptionalsFromPost("product_fournisseur_price"); diff --git a/htdocs/user/card.php b/htdocs/user/card.php index 7886c0ef728..e522f542621 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -803,12 +803,12 @@ if ($action == 'create' || $action == 'adduserldap') print ''; if (!empty($ldap_lastname)) { - print ''; + print ''; print $ldap_lastname; } else { - print ''; + print ''; } print ''; @@ -817,12 +817,12 @@ if ($action == 'create' || $action == 'adduserldap') print ''; if (!empty($ldap_firstname)) { - print ''; + print ''; print $ldap_firstname; } else { - print ''; + print ''; } print ''; @@ -831,17 +831,17 @@ if ($action == 'create' || $action == 'adduserldap') print ''; if (!empty($ldap_login)) { - print ''; + print ''; print $ldap_login; } elseif (!empty($ldap_loginsmb)) { - print ''; + print ''; print $ldap_loginsmb; } else { - print ''; + print ''; } print ''; @@ -851,7 +851,7 @@ if ($action == 'create' || $action == 'adduserldap') require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php'; $generated_password = getRandomPassword(false); } - $password = $generated_password; + $password=(GETPOSTISSET('password')?GETPOST('password'):$generated_password); // Password print ''.$langs->trans("Password").''; @@ -1045,12 +1045,12 @@ if ($action == 'create' || $action == 'adduserldap') print ''; if (!empty($ldap_phone)) { - print ''; + print ''; print $ldap_phone; } else { - print ''; + print ''; } print ''; @@ -1059,12 +1059,12 @@ if ($action == 'create' || $action == 'adduserldap') print ''; if (!empty($ldap_mobile)) { - print ''; + print ''; print $ldap_mobile; } else { - print ''; + print ''; } print ''; @@ -1073,12 +1073,12 @@ if ($action == 'create' || $action == 'adduserldap') print ''; if (!empty($ldap_fax)) { - print ''; + print ''; print $ldap_fax; } else { - print ''; + print ''; } print ''; @@ -1087,12 +1087,12 @@ if ($action == 'create' || $action == 'adduserldap') print ''; if (!empty($ldap_mail)) { - print ''; + print ''; print $ldap_mail; } else { - print ''; + print ''; } print ''; @@ -1191,7 +1191,7 @@ if ($action == 'create' || $action == 'adduserldap') { print ''.$langs->trans("AccountancyCode").''; print ''; - print ''; + print ''; print ''; } @@ -1200,7 +1200,7 @@ if ($action == 'create' || $action == 'adduserldap') { print ''.$langs->trans("ColorUser").''; print ''; - print $formother->selectColor(GETPOST('color') ?GETPOST('color') : $object->color, 'color', null, 1, '', 'hideifnotset'); + print $formother->selectColor(GETPOSTISSET('color')?GETPOST('color', 'alphanohtml'):$object->color, 'color', null, 1, '', 'hideifnotset'); print ''; } @@ -1246,7 +1246,7 @@ if ($action == 'create' || $action == 'adduserldap') print $langs->trans("Note"); print ''; require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor = new DolEditor('note', '', '', 120, 'dolibarr_notes', '', false, true, $conf->global->FCKEDITOR_ENABLE_SOCIETE, ROWS_3, '90%'); + $doleditor = new DolEditor('note', GETPOSTISSET('note')?GETPOST('note', 'none'):'', '', 120, 'dolibarr_notes', '', false, true, $conf->global->FCKEDITOR_ENABLE_SOCIETE, ROWS_3, '90%'); $doleditor->Create(); print "\n"; @@ -1275,7 +1275,7 @@ if ($action == 'create' || $action == 'adduserldap') // Position/Job print ''.$langs->trans("PostOrFunction").''; print ''; - print ''; + print ''; print ''; if ((!empty($conf->salaries->enabled) && !empty($user->rights->salaries->read)) @@ -1289,7 +1289,7 @@ if ($action == 'create' || $action == 'adduserldap') print $form->textwithpicto($text, $langs->trans("THMDescription"), 1, 'help', 'classthm'); print ''; print ''; - print ''; + print ''; print ''; print "\n"; @@ -1299,14 +1299,14 @@ if ($action == 'create' || $action == 'adduserldap') print $form->textwithpicto($text, $langs->trans("TJMDescription"), 1, 'help', 'classtjm'); print ''; print ''; - print ''; + print ''; print ''; print "\n"; // Salary print ''.$langs->trans("Salary").''; print ''; - print ''; + print ''; print ''; print "\n"; } @@ -1314,7 +1314,7 @@ if ($action == 'create' || $action == 'adduserldap') // Weeklyhours print ''.$langs->trans("WeeklyHours").''; print ''; - print ''; + print ''; print ''; print "\n"; @@ -2596,7 +2596,7 @@ else print ''; if ($caneditfield) { - print $formother->selectColor(GETPOST('color') ?GETPOST('color') : $object->color, 'color', null, 1, '', 'hideifnotset'); + print $formother->selectColor(GETPOSTISSET('color')?GETPOST('color', 'alphanohtml'):$object->color, 'color', null, 1, '', 'hideifnotset'); } else { print $formother->showColor($object->color, ''); }