diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php
index 04b994aacfa..83b1c9a6bec 100644
--- a/htdocs/contact/card.php
+++ b/htdocs/contact/card.php
@@ -695,7 +695,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
}
// Address
- if (($objsoc->typent_code == 'TE_PRIVATE' || !empty($conf->global->CONTACT_USE_COMPANY_ADDRESS)) && dol_strlen(trim($object->address)) == 0) {
+ if (((isset($objsoc->typent_code) && $objsoc->typent_code == 'TE_PRIVATE') || !empty($conf->global->CONTACT_USE_COMPANY_ADDRESS)) && dol_strlen(trim($object->address)) == 0) {
$object->address = $objsoc->address; // Predefined with third party
}
print '
'.$langs->trans("Address").' ';
@@ -714,10 +714,10 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
print ' ';
// Zip / Town
- if (($objsoc->typent_code == 'TE_PRIVATE' || !empty($conf->global->CONTACT_USE_COMPANY_ADDRESS)) && dol_strlen(trim($object->zip)) == 0) {
+ if (((isset($objsoc->typent_code) && $objsoc->typent_code == 'TE_PRIVATE') || !empty($conf->global->CONTACT_USE_COMPANY_ADDRESS)) && dol_strlen(trim($object->zip)) == 0) {
$object->zip = $objsoc->zip; // Predefined with third party
}
- if (($objsoc->typent_code == 'TE_PRIVATE' || !empty($conf->global->CONTACT_USE_COMPANY_ADDRESS)) && dol_strlen(trim($object->town)) == 0) {
+ if (((isset($objsoc->typent_code) && $objsoc->typent_code == 'TE_PRIVATE') || !empty($conf->global->CONTACT_USE_COMPANY_ADDRESS)) && dol_strlen(trim($object->town)) == 0) {
$object->town = $objsoc->town; // Predefined with third party
}
print ''.$langs->trans("Zip").' / '.$langs->trans("Town").' ';
@@ -751,10 +751,10 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
print ' ';
}
- if (($objsoc->typent_code == 'TE_PRIVATE' || !empty($conf->global->CONTACT_USE_COMPANY_ADDRESS)) && dol_strlen(trim($object->phone_pro)) == 0) {
+ if (((isset($objsoc->typent_code) && $objsoc->typent_code == 'TE_PRIVATE') || !empty($conf->global->CONTACT_USE_COMPANY_ADDRESS)) && dol_strlen(trim($object->phone_pro)) == 0) {
$object->phone_pro = $objsoc->phone; // Predefined with third party
}
- if (($objsoc->typent_code == 'TE_PRIVATE' || !empty($conf->global->CONTACT_USE_COMPANY_ADDRESS)) && dol_strlen(trim($object->fax)) == 0) {
+ if (((isset($objsoc->typent_code) && $objsoc->typent_code == 'TE_PRIVATE') || !empty($conf->global->CONTACT_USE_COMPANY_ADDRESS)) && dol_strlen(trim($object->fax)) == 0) {
$object->fax = $objsoc->fax; // Predefined with third party
}
@@ -784,7 +784,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
print ' ';
print '';
- if (($objsoc->typent_code == 'TE_PRIVATE' || !empty($conf->global->CONTACT_USE_COMPANY_ADDRESS)) && dol_strlen(trim($object->email)) == 0) {
+ if (((isset($objsoc->typent_code) && $objsoc->typent_code == 'TE_PRIVATE') || !empty($conf->global->CONTACT_USE_COMPANY_ADDRESS)) && dol_strlen(trim($object->email)) == 0) {
$object->email = $objsoc->email; // Predefined with third party
}
@@ -888,7 +888,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
print '';
print ''.$langs->trans("Alert").' : ';
- if ($object->birthday_alert) {
+ if (!empty($object->birthday_alert)) {
print ' ';
} else {
print ' ';
diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php
index be5685615d7..26624b1bf10 100644
--- a/htdocs/contact/list.php
+++ b/htdocs/contact/list.php
@@ -371,7 +371,7 @@ $parameters = array();
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook
$sql .= $hookmanager->resPrint;
$sql .= " FROM ".MAIN_DB_PREFIX."socpeople as p";
-if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) {
+if (isset($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.$object->table_element."_extrafields as ef on (p.rowid = ef.fk_object)";
}
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as co ON co.rowid = p.fk_pays";
diff --git a/htdocs/product/card.php b/htdocs/product/card.php
index a60d256fe21..a8f7c5d4a7a 100644
--- a/htdocs/product/card.php
+++ b/htdocs/product/card.php
@@ -1236,7 +1236,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
// Description (used in invoice, propal...)
print ''.$langs->trans("Description").' ';
- $doleditor = new DolEditor('desc', GETPOST('desc', 'restricthtml'), '', 160, 'dolibarr_details', '', false, true, $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC, ROWS_4, '90%');
+ $doleditor = new DolEditor('desc', GETPOST('desc', 'restricthtml'), '', 160, 'dolibarr_details', '', false, true, getDolGlobalString('FCKEDITOR_ENABLE_PRODUCTDESC'), ROWS_4, '90%');
$doleditor->Create();
print " ";
@@ -1395,13 +1395,13 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
print ''.$langs->trans("NoteNotVisibleOnBill").' ';
// We use dolibarr_details as type of DolEditor here, because we must not accept images as description is included into PDF and not accepted by TCPDF.
- $doleditor = new DolEditor('note_private', GETPOST('note_private', 'restricthtml'), '', 140, 'dolibarr_details', '', false, true, $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC, ROWS_8, '90%');
+ $doleditor = new DolEditor('note_private', GETPOST('note_private', 'restricthtml'), '', 140, 'dolibarr_details', '', false, true, getDolGlobalString('FCKEDITOR_ENABLE_PRODUCTDESC'), ROWS_8, '90%');
$doleditor->Create();
print " ";
//}
- if ($conf->categorie->enabled) {
+ if (!empty($conf->categorie->enabled)) {
// Categories
print ''.$langs->trans("Categories").' ';
$cate_arbo = $form->select_all_categories(Categorie::TYPE_PRODUCT, '', 'parent', 64, 0, 1);
diff --git a/htdocs/product/index.php b/htdocs/product/index.php
index f08ddd217ab..655e80e23e5 100644
--- a/htdocs/product/index.php
+++ b/htdocs/product/index.php
@@ -37,7 +37,7 @@ $type = GETPOST("type", 'int');
if ($type == '' && !$user->rights->produit->lire) {
$type = '1'; // Force global page on service page only
}
-if ($type == '' && !$user->rights->service->lire) {
+if ($type == '' && empty($user->rights->service->lire)) {
$type = '0'; // Force global page on product page only
}
diff --git a/htdocs/product/list.php b/htdocs/product/list.php
index 4d208133759..aaf9903aa85 100644
--- a/htdocs/product/list.php
+++ b/htdocs/product/list.php
@@ -950,7 +950,7 @@ if ($resql) {
}
// Multiprice
- if ($conf->global->PRODUIT_MULTIPRICES) {
+ if (!empty($conf->global->PRODUIT_MULTIPRICES)) {
foreach ($arraypricelevel as $key => $value) {
if (!empty($arrayfields['p.sellprice'.$key]['checked'])) {
print ' ';
@@ -1156,7 +1156,7 @@ if ($resql) {
}
// Multiprices
- if ($conf->global->PRODUIT_MULTIPRICES) {
+ if (!empty($conf->global->PRODUIT_MULTIPRICES)) {
foreach ($arraypricelevel as $key => $value) {
if (!empty($arrayfields['p.sellprice'.$key]['checked'])) {
print_liste_field_titre($arrayfields['p.sellprice'.$key]['label'], $_SERVER["PHP_SELF"], "", "", $param, '', $sortfield, $sortorder, 'right ');
diff --git a/htdocs/product/stock/card.php b/htdocs/product/stock/card.php
index 7defecb7c62..2ffaf43ea90 100644
--- a/htdocs/product/stock/card.php
+++ b/htdocs/product/stock/card.php
@@ -51,6 +51,7 @@ $confirm = GETPOST('confirm');
$projectid = GETPOST('projectid', 'int');
$id = GETPOST('id', 'int');
+$socid = GETPOST('socid', 'int');
$ref = GETPOST('ref', 'alpha');
$sortfield = GETPOST("sortfield", 'alpha');
@@ -288,7 +289,7 @@ if ($action == 'create') {
$langs->load('projects');
print ' '.$langs->trans('Project').' ';
print img_picto('', 'project').$formproject->select_projects(($socid > 0 ? $socid : -1), $projectid, 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 1, 0, 'maxwidth500');
- print ' id.($fac_rec ? '&fac_rec='.$fac_rec : '')).'"> ';
+ print ' ';
print ' ';
}
@@ -296,7 +297,7 @@ if ($action == 'create') {
print ''.$langs->trans("Description").' ';
// Editeur wysiwyg
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
- $doleditor = new DolEditor('desc', (!empty($object->description) ? $object->description : ''), '', 180, 'dolibarr_notes', 'In', false, true, $conf->fckeditor->enabled, ROWS_5, '90%');
+ $doleditor = new DolEditor('desc', (!empty($object->description) ? $object->description : ''), '', 180, 'dolibarr_notes', 'In', false, true, empty($conf->fckeditor->enabled) ? '' : $conf->fckeditor->enabled, ROWS_5, '90%');
$doleditor->Create();
print ' ';
@@ -347,7 +348,7 @@ if ($action == 'create') {
// Other attributes
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php';
- if ($conf->categorie->enabled) {
+ if (!empty($conf->categorie->enabled)) {
// Categories
print ''.$langs->trans("Categories").' ';
$cate_arbo = $form->select_all_categories(Categorie::TYPE_WAREHOUSE, '', 'parent', 64, 0, 1);
diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php
index 1307b9bf4a7..6eec5cb956d 100644
--- a/htdocs/projet/card.php
+++ b/htdocs/projet/card.php
@@ -451,9 +451,9 @@ $formfile = new FormFile($db);
$formproject = new FormProjets($db);
$userstatic = new User($db);
-$title = $langs->trans("Project").' - '.$object->ref.($object->thirdparty->name ? ' - '.$object->thirdparty->name : '').($object->title ? ' - '.$object->title : '');
+$title = $langs->trans("Project").' - '.$object->ref.(!empty($object->thirdparty->name) ? ' - '.$object->thirdparty->name : '').(!empty($object->title) ? ' - '.$object->title : '');
if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/projectnameonly/', $conf->global->MAIN_HTML_TITLE)) {
- $title = $object->ref.($object->thirdparty->name ? ' - '.$object->thirdparty->name : '').($object->title ? ' - '.$object->title : '');
+ $title = $object->ref.(!empty($object->thirdparty->name) ? ' - '.$object->thirdparty->name : '').(!empty($object->title) ? ' - '.$object->title : '');
}
$help_url = "EN:Module_Projects|FR:Module_Projets|ES:Módulo_Proyectos|DE:Modul_Projekte";
@@ -665,11 +665,11 @@ if ($action == 'create' && $user->rights->projet->creer) {
// Description
print ' '.$langs->trans("Description").' ';
print '';
- $doleditor = new DolEditor('description', GETPOST("description", 'restricthtml'), '', 90, 'dolibarr_notes', '', false, true, $conf->global->FCKEDITOR_ENABLE_SOCIETE, ROWS_3, '90%');
+ $doleditor = new DolEditor('description', GETPOST("description", 'restricthtml'), '', 90, 'dolibarr_notes', '', false, true, getDolGlobalString('FCKEDITOR_ENABLE_SOCIETE'), ROWS_3, '90%');
$doleditor->Create();
print ' ';
- if ($conf->categorie->enabled) {
+ if (!empty($conf->categorie->enabled)) {
// Categories
print ''.$langs->trans("Categories").' ';
$cate_arbo = $form->select_all_categories(Categorie::TYPE_PROJECT, '', 'parent', 64, 0, 1);
diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php
index 9e44479dfb0..a5f14431eda 100644
--- a/htdocs/projet/list.php
+++ b/htdocs/projet/list.php
@@ -553,7 +553,7 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
if (is_numeric($nbtotalofrecords) && ($limit > $nbtotalofrecords || empty($limit))) {
$num = $nbtotalofrecords;
} else {
- if ($limit) {
+ if (!empty($limit)) {
$sql .= $db->plimit($limit + 1, $offset);
}
diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php
index aec790b9240..0b47b164c5a 100644
--- a/htdocs/projet/tasks.php
+++ b/htdocs/projet/tasks.php
@@ -31,7 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
-if ($conf->categorie->enabled) {
+if (!empty($conf->categorie->enabled)) {
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
}
@@ -718,7 +718,7 @@ if ($action == 'create' && $user->rights->projet->creer && (empty($object->third
// Project
print ' '.$langs->trans("ChildOfProjectTask").' ';
print img_picto('', 'project');
- $formother->selectProjectTasks(GETPOST('task_parent'), $projectid ? $projectid : $object->id, 'task_parent', 0, 0, 1, 1, 0, '0,1', 'maxwidth500');
+ $formother->selectProjectTasks(GETPOST('task_parent'), !empty($projectid) ? $projectid : $object->id, 'task_parent', 0, 0, 1, 1, 0, '0,1', 'maxwidth500');
print ' ';
// Assigned to
@@ -733,17 +733,17 @@ if ($action == 'create' && $user->rights->projet->creer && (empty($object->third
// Date start
print ''.$langs->trans("DateStart").' ';
- print $form->selectDate(($date_start ? $date_start : ''), 'dateo', 1, 1, 0, '', 1, 1);
+ print $form->selectDate((!empty($date_start) ? $date_start : ''), 'dateo', 1, 1, 0, '', 1, 1);
print ' ';
// Date end
print ''.$langs->trans("DateEnd").' ';
- print $form->selectDate(($date_end ? $date_end : -1), 'datee', -1, 1, 0, '', 1, 1);
+ print $form->selectDate((!empty($date_end) ? $date_end : -1), 'datee', -1, 1, 0, '', 1, 1);
print ' ';
// Planned workload
print ''.$langs->trans("PlannedWorkload").' ';
- print $form->select_duration('planned_workload', $planned_workload ? $planned_workload : 0, 0, 'text');
+ print $form->select_duration('planned_workload', !empty($planned_workload) ? $planned_workload : 0, 0, 'text');
print ' ';
// Progress
diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php
index 328d7e3741d..ad1e0cfbf54 100644
--- a/htdocs/societe/list.php
+++ b/htdocs/societe/list.php
@@ -1396,7 +1396,7 @@ while ($i < min($num, $limit)) {
print '';
print $obj->rowid;
print " \n";
- if (!$i) {
+ if (empty($i)) {
$totalarray['nbfield']++;
}
}
@@ -1413,7 +1413,7 @@ while ($i < min($num, $limit)) {
}
print "\n";
$companystatic->name_alias = $savalias;
- if (!$i) {
+ if (empty($i)) {
$totalarray['nbfield']++;
}
}
@@ -1508,12 +1508,12 @@ while ($i < min($num, $limit)) {
// Type ent
if (!empty($arrayfields['typent.code']['checked'])) {
print '';
- if (!is_array($typenArray) || count($typenArray) == 0) {
+ if (!isset($typenArray) || !is_array($typenArray) || count($typenArray) == 0) {
$typenArray = $formcompany->typent_array(1);
}
- print $typenArray[$obj->typent_code];
+ print empty($typenArray[$obj->typent_code]) ? '' : $typenArray[$obj->typent_code];
print ' ';
- if (!$i) {
+ if (empty($i)) {
$totalarray['nbfield']++;
}
}
@@ -1532,19 +1532,19 @@ while ($i < min($num, $limit)) {
}
print $staffArray[$obj->staff_code];
print '';
- if (!$i) {
+ if (empty($i)) {
$totalarray['nbfield']++;
}
}
if (!empty($arrayfields['s.email']['checked'])) {
print ''.dol_print_email($obj->email, $obj->rowid, $obj->socid, 'AC_EMAIL', 0, 0, 1)." \n";
- if (!$i) {
+ if (empty($i)) {
$totalarray['nbfield']++;
}
}
if (!empty($arrayfields['s.phone']['checked'])) {
print ''.dol_print_phone($obj->phone, $obj->country_code, 0, $obj->rowid, 'AC_TEL', ' ', 'phone')." \n";
- if (!$i) {
+ if (empty($i)) {
$totalarray['nbfield']++;
}
}