diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php
index 61b9f2ce04e..9e9895444b8 100644
--- a/htdocs/contact/card.php
+++ b/htdocs/contact/card.php
@@ -545,8 +545,8 @@ $formcompany = new FormCompany($db);
$countrynotdefined = $langs->trans("ErrorSetACountryFirst").' ('.$langs->trans("SeeAbove").')';
+$objsoc = new Societe($db);
if ($socid > 0) {
- $objsoc = new Societe($db);
$objsoc->fetch($socid);
}
diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index 3c544357ad7..68bba0e04b5 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -1005,6 +1005,7 @@ class Form
$langs->load("dict");
$out = '';
+ $moreattrib = '';
$incotermArray = array();
$sql = "SELECT rowid, code";
@@ -1444,7 +1445,7 @@ class Form
$label .= ' ('.$obj->name_alias.')';
}
- if ($conf->global->SOCIETE_SHOW_VAT_IN_LIST && !empty($obj->tva_intra)) {
+ if (!empty($conf->global->SOCIETE_SHOW_VAT_IN_LIST) && !empty($obj->tva_intra)) {
$label .= ' - '.$obj->tva_intra.'';
}
@@ -8088,7 +8089,7 @@ class Form
}
} else { // There is no list of fields already customized for user
foreach ($array as $key => $val) {
- if ($array[$key]['checked'] < 0) {
+ if (!empty($array[$key]['checked']) && $array[$key]['checked'] < 0) {
$array[$key]['checked'] = 0;
}
}
@@ -8116,7 +8117,7 @@ class Form
}
// Note: $val['checked'] <> 0 means we must show the field into the combo list
- $listoffieldsforselection .= '
'.dol_escape_htmltag($langs->trans($val['label'])).' ';
+ $listoffieldsforselection .= ''.dol_escape_htmltag($langs->trans($val['label'])).' ';
$listcheckedstring .= (empty($val['checked']) ? '' : $key.',');
}
}
diff --git a/htdocs/product/card.php b/htdocs/product/card.php
index 28c7b0d1d5d..6bc98f273dc 100644
--- a/htdocs/product/card.php
+++ b/htdocs/product/card.php
@@ -1172,8 +1172,8 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
$tooltip .= ' '.$langs->trans("GenericMaskCodes3");
$tooltip .= ' '.$langs->trans("GenericMaskCodes4a", $langs->transnoentities("Batch"), $langs->transnoentities("Batch"));
$tooltip .= ' '.$langs->trans("GenericMaskCodes5");
- if (($conf->global->PRODUCTBATCH_LOT_USE_PRODUCT_MASKS && $conf->global->PRODUCTBATCH_LOT_ADDON == 'mod_lot_advanced')
- || ($conf->global->PRODUCTBATCH_SN_USE_PRODUCT_MASKS && $conf->global->PRODUCTBATCH_SN_ADDON == 'mod_sn_advanced')) {
+ if ((!empty($conf->global->PRODUCTBATCH_LOT_USE_PRODUCT_MASKS) && $conf->global->PRODUCTBATCH_LOT_ADDON == 'mod_lot_advanced')
+ || (!empty($conf->global->PRODUCTBATCH_SN_USE_PRODUCT_MASKS) && $conf->global->PRODUCTBATCH_SN_ADDON == 'mod_sn_advanced')) {
print ''.$langs->trans("ManageLotMask").' ';
$inherited_mask_lot = $conf->global->LOT_ADVANCED_MASK;
$inherited_mask_sn = $conf->global->SN_ADVANCED_MASK;
@@ -1221,10 +1221,12 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
if ($showbarcode) {
print ''.$langs->trans('BarcodeType').' ';
if (GETPOSTISSET('fk_barcode_type')) {
- $fk_barcode_type = GETPOST('fk_barcode_type');
+ $fk_barcode_type = GETPOST('fk_barcode_type')?:0;
} else {
if (empty($fk_barcode_type) && !empty($conf->global->PRODUIT_DEFAULT_BARCODE_TYPE)) {
- $fk_barcode_type = $conf->global->PRODUIT_DEFAULT_BARCODE_TYPE;
+ $fk_barcode_type = getDolGlobalInt("PRODUIT_DEFAULT_BARCODE_TYPE");
+ } else {
+ $fk_barcode_type=0;
}
}
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formbarcode.class.php';
diff --git a/htdocs/product/list.php b/htdocs/product/list.php
index aaf9903aa85..8ec03d408f3 100644
--- a/htdocs/product/list.php
+++ b/htdocs/product/list.php
@@ -256,7 +256,7 @@ $arrayfields = array(
// MultiPrices
-if ($conf->global->PRODUIT_MULTIPRICES) {
+if (!empty($conf->global->PRODUIT_MULTIPRICES)) {
for ($i = 1; $i <= $conf->global->PRODUIT_MULTIPRICES_LIMIT; $i++) {
$keyforlabel = 'PRODUIT_MULTIPRICES_LABEL'.$i;
if (!empty($conf->global->$keyforlabel)) {
@@ -405,7 +405,7 @@ $sql .= ' FROM '.MAIN_DB_PREFIX.'product as p';
if (!empty($conf->global->MAIN_PRODUCT_PERENTITY_SHARED)) {
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "product_perentity as ppe ON ppe.fk_product = p.rowid AND ppe.entity = " . ((int) $conf->entity);
}
-if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) {
+if (!empty($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) {
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_extrafields as ef on (p.rowid = ef.fk_object)";
}
if (!empty($searchCategoryProductList) || !empty($catid)) {
diff --git a/htdocs/product/reassort.php b/htdocs/product/reassort.php
index c327b24e8f0..b0a1ce87ddd 100644
--- a/htdocs/product/reassort.php
+++ b/htdocs/product/reassort.php
@@ -46,6 +46,7 @@ $toolowstock = GETPOST('toolowstock');
$tosell = GETPOST("tosell");
$tobuy = GETPOST("tobuy");
$fourn_id = GETPOST("fourn_id", 'int');
+$sbarcode = GETPOST("sbarcode", 'int');
$sortfield = GETPOST("sortfield", 'alpha');
$sortorder = GETPOST("sortorder", 'alpha');
diff --git a/htdocs/product/reassortlot.php b/htdocs/product/reassortlot.php
index c8eae99d7cf..e75d1504267 100644
--- a/htdocs/product/reassortlot.php
+++ b/htdocs/product/reassortlot.php
@@ -50,6 +50,7 @@ $toolowstock = GETPOST('toolowstock');
$tosell = GETPOST("tosell");
$tobuy = GETPOST("tobuy");
$fourn_id = GETPOST("fourn_id", 'int');
+$sbarcode = GETPOST("sbarcode", 'int');
$sortfield = GETPOST("sortfield", 'alpha');
$sortorder = GETPOST("sortorder", 'alpha');
diff --git a/htdocs/product/stats/card.php b/htdocs/product/stats/card.php
index 6c56d3c307c..46799773276 100644
--- a/htdocs/product/stats/card.php
+++ b/htdocs/product/stats/card.php
@@ -67,6 +67,7 @@ $currentyear = $tmp['year'];
if (empty($search_year)) {
$search_year = $currentyear;
}
+$moreforfilter = "";
$result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype);
diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php
index 7013acdae56..5f6238554d8 100644
--- a/htdocs/societe/list.php
+++ b/htdocs/societe/list.php
@@ -1363,6 +1363,7 @@ print " \n";
$i = 0;
$totalarray = array();
+$totalarray['nbfield'] = 0;
while ($i < min($num, $limit)) {
$obj = $db->fetch_object($resql);