From 3a6be2b8967036ad8fb939045d61f508dd5953b3 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 14 Sep 2012 11:34:30 +0200 Subject: [PATCH 1/6] Fix: uniformize code fix: add current user for commercial by default --- htdocs/societe/class/societe.class.php | 24 ++++++++++++------------ htdocs/societe/soc.php | 16 ++++++++-------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 6e14a1ec6e6..f51390d90b4 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -388,22 +388,22 @@ class Societe extends CommonObject // Clean parameters $this->id = $id; - $this->name=$this->name?trim($this->name):trim($this->nom); - $this->nom=trim($this->nom); // TODO obsolete - $this->ref_ext=trim($this->ref_ext); - $this->address=$this->address?trim($this->address):trim($this->adresse); - $this->adresse=$this->address; // TODO obsolete - $this->zip=$this->zip?trim($this->zip):trim($this->cp); - $this->cp=$this->zip; // TODO obsolete - $this->town=$this->town?trim($this->town):trim($this->ville); - $this->ville=$this->town; // TODO obsolete - $this->state_id=trim($this->state_id); + $this->name = $this->name?trim($this->name):trim($this->nom); + $this->nom = trim($this->nom); // TODO obsolete + $this->ref_ext = trim($this->ref_ext); + $this->address = $this->address?trim($this->address):trim($this->adresse); + $this->adresse = $this->address; // TODO obsolete + $this->zip = $this->zip?trim($this->zip):trim($this->cp); + $this->cp = $this->zip; // TODO obsolete + $this->town = $this->town?trim($this->town):trim($this->ville); + $this->ville = $this->town; // TODO obsolete + $this->state_id = trim($this->state_id); $this->country_id = ($this->country_id > 0)?$this->country_id:$this->pays_id; - $this->pays_id = $this->country_id; + $this->pays_id = $this->country_id; // TODO obsolete $this->phone = trim($this->phone?$this->phone:$this->tel); $this->phone = preg_replace("/\s/","",$this->phone); $this->phone = preg_replace("/\./","",$this->phone); - $this->tel = $this->phone; + $this->tel = $this->phone; // TODO obsolete $this->fax = trim($this->fax); $this->fax = preg_replace("/\s/","",$this->fax); $this->fax = preg_replace("/\./","",$this->fax); diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index a81426f1739..0a5888eb77c 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -129,7 +129,7 @@ if (empty($reshook)) $object->town = GETPOST('town'); $object->country_id = GETPOST('country_id'); $object->state_id = GETPOST('departement_id'); - $object->tel = GETPOST('tel'); + $object->phone = GETPOST('phone'); $object->fax = GETPOST('fax'); $object->email = GETPOST('email'); $object->url = GETPOST('url'); @@ -248,7 +248,7 @@ if (empty($reshook)) $contact->socid = $object->id; // fk_soc $contact->status = 1; $contact->email = $object->email; - $contact->phone_pro = $object->tel; + $contact->phone_pro = $object->phone; $contact->fax = $object->fax; $contact->priv = 0; @@ -559,7 +559,7 @@ else $object->zip = GETPOST('zipcode'); $object->town = GETPOST('town'); $object->state_id = GETPOST('departement_id'); - $object->tel = GETPOST('tel'); + $object->phone = GETPOST('phone'); $object->fax = GETPOST('fax'); $object->email = GETPOST('email'); $object->url = GETPOST('url'); @@ -818,7 +818,7 @@ else } // Phone / Fax - print ''.$langs->trans('Phone').''; + print ''.$langs->trans('Phone').''; print ''.$langs->trans('Fax').''; print ''.$langs->trans('EMail').(! empty($conf->global->SOCIETE_MAIL_REQUIRED)?'*':'').''; @@ -945,7 +945,7 @@ else print ''; print ''.$langs->trans("AllocateCommercial").''; print ''; - $form->select_users($object->commercial_id,'commercial_id',1); + $form->select_users((! empty($object->commercial_id)?$object->commercial_id:$user->id),'commercial_id',1); // Add current user by default print ''; } @@ -1052,7 +1052,7 @@ else $object->town = GETPOST('town'); $object->country_id = GETPOST('country_id')?GETPOST('country_id'):$mysoc->country_id; $object->state_id = GETPOST('departement_id'); - $object->tel = GETPOST('tel'); + $object->phone = GETPOST('phone'); $object->fax = GETPOST('fax'); $object->email = GETPOST('email'); $object->url = GETPOST('url'); @@ -1256,7 +1256,7 @@ else } // Phone / Fax - print ''.$langs->trans('Phone').''; + print ''.$langs->trans('Phone').''; print ''.$langs->trans('Fax').''; // EMail / Web @@ -1552,7 +1552,7 @@ else // State if (empty($conf->global->SOCIETE_DISABLE_STATE)) print ''.$langs->trans('State').''.$object->state.''; - print ''.$langs->trans('Phone').''.dol_print_phone($object->tel,$object->country_code,0,$object->id,'AC_TEL').''; + print ''.$langs->trans('Phone').''.dol_print_phone($object->phone,$object->country_code,0,$object->id,'AC_TEL').''; print ''.$langs->trans('Fax').''.dol_print_phone($object->fax,$object->country_code,0,$object->id,'AC_FAX').''; // EMail From 42202295737d619f288ee42bf9b3fb029f48b990 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 14 Sep 2012 15:56:50 +0200 Subject: [PATCH 2/6] Fix: minor change --- .../modules/propale/doc/pdf_azur.modules.php | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index 436d0b2c72a..7cd7d972796 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -40,10 +40,10 @@ class pdf_azur extends ModelePDFPropales var $name; var $description; var $type; - + var $phpmin = array(4,3,0); // Minimum version of PHP required by module var $version = 'dolibarr'; - + var $page_largeur; var $page_hauteur; var $format; @@ -51,7 +51,7 @@ class pdf_azur extends ModelePDFPropales var $marge_droite; var $marge_haute; var $marge_basse; - + var $emetteur; // Objet societe qui emet @@ -142,7 +142,7 @@ class pdf_azur extends ModelePDFPropales $outputlangs->load("products"); $default_font_size = pdf_getPDFFontSize($outputlangs); - + if ($conf->propal->dir_output) { $object->fetch_thirdparty(); @@ -276,11 +276,11 @@ class pdf_azur extends ModelePDFPropales $pdf->setPage($pageposbefore); $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. -// We suppose that a too long description is moved completely on next page -if ($pageposafter > $pageposbefore) { - $pdf->setPage($pageposafter); $curY = $tab_top_newpage; -} - + // We suppose that a too long description is moved completely on next page + if ($pageposafter > $pageposbefore) { + $pdf->setPage($pageposafter); $curY = $tab_top_newpage; + } + $pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par defaut // VAT Rate @@ -640,7 +640,7 @@ if ($pageposafter > $pageposbefore) { $col1x = 120; $col2x = 170; $largcol2 = ($this->page_largeur - $this->marge_droite - $col2x); $index = 0; - + // Total HT $pdf->SetFillColor(255,255,255); $pdf->SetXY($col1x, $tab2_top + 0); @@ -790,7 +790,7 @@ if ($pageposafter > $pageposbefore) { } $pdf->SetTextColor(0,0,0); - + $resteapayer = $object->total_ttc - $deja_regle; if ($object->paye) $resteapayer=0; @@ -863,10 +863,10 @@ if ($pageposafter > $pageposbefore) { $pdf->SetXY($this->page_largeur - $this->marge_droite - ($pdf->GetStringWidth($titre) + 3), $tab_top-4); $pdf->MultiCell(($pdf->GetStringWidth($titre) + 3), 2, $titre); } - + $pdf->SetDrawColor(128,128,128); $pdf->SetFont('','',$default_font_size - 1); - + // Output Rect $this->printRect($pdf,$this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect prend une longueur en 3eme param et 4eme param @@ -877,7 +877,7 @@ if ($pageposafter > $pageposbefore) { $pdf->SetXY($this->posxdesc-1, $tab_top+1); $pdf->MultiCell(108,2, $outputlangs->transnoentities("Designation"),'','L'); } - + if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) { $pdf->line($this->posxtva-1, $tab_top, $this->posxtva-1, $tab_top + $tab_height); @@ -894,14 +894,14 @@ if ($pageposafter > $pageposbefore) { $pdf->SetXY($this->posxup-1, $tab_top+1); $pdf->MultiCell($this->posxqty-$this->posxup-1,2, $outputlangs->transnoentities("PriceUHT"),'','C'); } - + $pdf->line($this->posxqty-1, $tab_top, $this->posxqty-1, $tab_top + $tab_height); if (empty($hidetop)) { $pdf->SetXY($this->posxqty-1, $tab_top+1); $pdf->MultiCell($this->posxdiscount-$this->posxqty-1,2, $outputlangs->transnoentities("Qty"),'','C'); } - + $pdf->line($this->posxdiscount-1, $tab_top, $this->posxdiscount-1, $tab_top + $tab_height); if (empty($hidetop)) { @@ -942,7 +942,7 @@ if ($pageposafter > $pageposbefore) { $outputlangs->load("companies"); $default_font_size = pdf_getPDFFontSize($outputlangs); - + pdf_pagehead($pdf,$outputlangs,$this->page_hauteur); // Show Draft Watermark @@ -1058,7 +1058,7 @@ if ($pageposafter > $pageposbefore) { $pdf->SetFillColor(230,230,230); $pdf->MultiCell(82, $hautcadre, "", 0, 'R', 1); $pdf->SetTextColor(0,0,60); - + // Show sender name $pdf->SetXY($posx+2,$posy+3); $pdf->SetFont('','B', $default_font_size); From f19321eaf630bca75b595c21e3db2a42286c3d94 Mon Sep 17 00:00:00 2001 From: Grand Philippe Date: Fri, 14 Sep 2012 17:37:14 +0200 Subject: [PATCH 3/6] dyslexie --- htdocs/adherents/fiche_subscription.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/adherents/fiche_subscription.php b/htdocs/adherents/fiche_subscription.php index 02c9539d262..e0fd826cbc8 100644 --- a/htdocs/adherents/fiche_subscription.php +++ b/htdocs/adherents/fiche_subscription.php @@ -66,7 +66,7 @@ if ($user->rights->adherent->cotisation->creer && $_REQUEST["action"] == 'update // If transaction consolidated if ($accountline->rappro) { - $errmsg=$langs->trans("SubscriptionLinkedToConciliatedTrnasaction"); + $errmsg=$langs->trans("SubscriptionLinkedToConciliatedTransaction"); } else { From be13602c7176ef13fdb54c2aa947b35f7988fc28 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sat, 15 Sep 2012 09:02:20 +0200 Subject: [PATCH 4/6] Fix: use getDocumentsLink method --- htdocs/admin/modules.php | 20 +++--- htdocs/comm/index.php | 2 +- htdocs/comm/propal/index.php | 8 +-- htdocs/comm/propal/list.php | 3 +- htdocs/commande/class/commande.class.php | 2 +- htdocs/commande/index.php | 6 +- htdocs/commande/liste.php | 2 +- htdocs/commande/orderstoinvoice.php | 56 ++++++++-------- htdocs/compta/facture/class/facture.class.php | 2 +- htdocs/compta/facture/fiche-rec.php | 8 +-- htdocs/compta/facture/impayees.php | 8 ++- htdocs/compta/facture/list.php | 2 +- htdocs/compta/index.php | 13 ++-- htdocs/core/admin_extrafields.inc.php | 14 ++-- htdocs/core/class/html.form.class.php | 4 +- htdocs/core/class/html.formfile.class.php | 66 ++++++++++--------- htdocs/core/lib/functions.lib.php | 12 ++-- htdocs/core/lib/price.lib.php | 28 ++++---- .../doc/pdf_expedition_merou.modules.php | 40 +++++------ .../doc/pdf_expedition_rouget.modules.php | 8 +-- .../fichinter/doc/pdf_soleil.modules.php | 18 ++--- .../livraison/pdf/pdf_typhon.modules.php | 6 +- .../modules/propale/doc/pdf_azur.modules.php | 34 +++++----- .../pdf/pdf_canelle.modules.php | 8 +-- htdocs/fourn/commande/index.php | 4 +- htdocs/holiday/admin/holiday.php | 4 +- htdocs/margin/admin/margin.php | 2 +- htdocs/product/admin/product_extrafields.php | 4 +- 28 files changed, 194 insertions(+), 190 deletions(-) diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index bc3c0d53760..e072807a6ca 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -251,19 +251,19 @@ if (! empty($categ[$categidx])) if ($conf->global->MAIN_FEATURES_LEVEL >= 1) { $form = new Form($db); - $categidx='expdev'; + $categidx='expdev'; $head[$h][0] = DOL_URL_ROOT."/admin/modules.php?mode=".$categidx; - $head[$h][1] = $form->textwithpicto($langs->trans("ModuleFamilyExperimental"), $langs->trans('DoNotUseInProduction'), 1, 'warning', '', 0, 3); - $head[$h][2] = 'expdev'; - $h++; + $head[$h][1] = $form->textwithpicto($langs->trans("ModuleFamilyExperimental"), $langs->trans('DoNotUseInProduction'), 1, 'warning', '', 0, 3); + $head[$h][2] = 'expdev'; + $h++; } -$categidx='marketplace'; -$head[$h][0] = DOL_URL_ROOT."/admin/modules.php?mode=".$categidx; -$head[$h][1] = $langs->trans("ModulesMarketPlaces"); -$head[$h][2] = 'marketplace'; -$h++; - +$categidx='marketplace'; +$head[$h][0] = DOL_URL_ROOT."/admin/modules.php?mode=".$categidx; +$head[$h][1] = $langs->trans("ModulesMarketPlaces"); +$head[$h][2] = 'marketplace'; +$h++; + dol_fiche_head($head, $mode, $langs->trans("Modules")); diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php index b46d47c57da..7ba7a2412fb 100644 --- a/htdocs/comm/index.php +++ b/htdocs/comm/index.php @@ -516,7 +516,7 @@ if ($conf->propal->enabled && $user->rights->propal->lire) $filename=dol_sanitizeFileName($obj->ref); $filedir=$conf->propal->dir_output . '/' . dol_sanitizeFileName($obj->ref); $urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->propalid; - $formfile->show_documents('propal',$filename,$filedir,$urlsource,'','','',1,'',1); + print $formfile->getDocumentsLink($propalstatic->element, $filename, $filedir); print ''; print ""; diff --git a/htdocs/comm/propal/index.php b/htdocs/comm/propal/index.php index 831970d2e14..b341e8a9c11 100644 --- a/htdocs/comm/propal/index.php +++ b/htdocs/comm/propal/index.php @@ -257,7 +257,7 @@ if ($resql) $filename=dol_sanitizeFileName($obj->ref); $filedir=$conf->propal->dir_output . '/' . dol_sanitizeFileName($obj->ref); $urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid; - $formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','',1,'',1); + print $formfile->getDocumentsLink($propalstatic->element, $filename, $filedir); print ''; print ''; @@ -334,7 +334,7 @@ if (! empty($conf->propal->enabled) && $user->rights->propale->lire) $filename=dol_sanitizeFileName($obj->ref); $filedir=$conf->propal->dir_output . '/' . dol_sanitizeFileName($obj->ref); $urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->propalid; - $formfile->show_documents('propal',$filename,$filedir,$urlsource,'','','',1,'',1); + print $formfile->getDocumentsLink($propalstatic->element, $filename, $filedir); print ''; print ""; @@ -418,7 +418,7 @@ if ($conf->propal->enabled) $filename=dol_sanitizeFileName($obj->ref); $filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref); $urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid; - $formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','',1,'',1); + print $formfile->getDocumentsLink($propalstatic->element, $filename, $filedir); print ''; print ''; @@ -490,7 +490,7 @@ if ($conf->propal->enabled) $filename=dol_sanitizeFileName($obj->ref); $filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref); $urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid; - $formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','',1,'',1); + print $formfile->getDocumentsLink($propalstatic->element, $filename, $filedir); print ''; print ''; diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 7092e8dc180..8603f0a7394 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -320,8 +320,7 @@ if ($result) $filename=dol_sanitizeFileName($objp->ref); $filedir=$conf->propal->dir_output . '/' . dol_sanitizeFileName($objp->ref); $urlsource=$_SERVER['PHP_SELF'].'?id='.$objp->propalid; - //$formfile->show_documents('propal',$filename,$filedir,$urlsource,'','','',1,'',1); - print $formfile->getDocumentsLink('propal', $filename, $filedir); + print $formfile->getDocumentsLink($objectstatic->element, $filename, $filedir); print ''; if ($objp->client == 1) diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 71a863b6e07..091701aeeac 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -3140,7 +3140,7 @@ class OrderLine $sql.= " , total_ht=".price2num($this->total_ht).""; $sql.= " , total_tva=".price2num($this->total_tva).""; $sql.= " , total_ttc=".price2num($this->total_ttc).""; - $sql.= " , total_localtax1=".price2num($this->total_localtax1); + $sql.= " , total_localtax1=".price2num($this->total_localtax1); $sql.= " , total_localtax2=".price2num($this->total_localtax2); } $sql.= " , fk_product_fournisseur_price=".(! empty($this->fk_fournprice)?$this->fk_fournprice:"null"); diff --git a/htdocs/commande/index.php b/htdocs/commande/index.php index 0c7a40d2ac8..7b5e3391330 100644 --- a/htdocs/commande/index.php +++ b/htdocs/commande/index.php @@ -262,7 +262,7 @@ if ($resql) $filename=dol_sanitizeFileName($obj->ref); $filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref); $urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid; - $formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','',1,'',1); + print $formfile->getDocumentsLink($commandestatic->element, $filename, $filedir); print ''; print ''; @@ -331,7 +331,7 @@ if ($conf->commande->enabled) $filename=dol_sanitizeFileName($obj->ref); $filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref); $urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid; - $formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','',1,'',1); + print $formfile->getDocumentsLink($commandestatic->element, $filename, $filedir); print ''; print ''; @@ -402,7 +402,7 @@ if ($conf->commande->enabled) $filename=dol_sanitizeFileName($obj->ref); $filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref); $urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid; - $formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','',1,'',1); + print $formfile->getDocumentsLink($commandestatic->element, $filename, $filedir); print ''; print ''; diff --git a/htdocs/commande/liste.php b/htdocs/commande/liste.php index 08c68939903..641d13f8643 100644 --- a/htdocs/commande/liste.php +++ b/htdocs/commande/liste.php @@ -308,7 +308,7 @@ if ($resql) $filename=dol_sanitizeFileName($objp->ref); $filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($objp->ref); $urlsource=$_SERVER['PHP_SELF'].'?id='.$objp->rowid; - $formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','',1,'',1); + print $formfile->getDocumentsLink($generic_commande->element, $filename, $filedir); print ''; print ''; diff --git a/htdocs/commande/orderstoinvoice.php b/htdocs/commande/orderstoinvoice.php index c0ef16db6fb..ec94022d853 100755 --- a/htdocs/commande/orderstoinvoice.php +++ b/htdocs/commande/orderstoinvoice.php @@ -469,10 +469,10 @@ if ($action == 'create') while ($i < $n) { print ''; - + $i++; } - + print "\n"; // Button "Create Draft" print '
'; @@ -496,7 +496,7 @@ if (($action != 'create' && $action != 'add') || ! empty($mesgs)) }); escape($sall)."%' OR c.note LIKE '%".$db->escape($sall)."%')"; } - + //Date filter if ($date_start && $date_end) $sql.= " AND c.date_commande >= '".$db->idate($date_start)."' AND c.date_commande <= '".$db->idate($date_end)."'"; if ($date_starty && $date_endy) $sql.= " AND c.date_livraison >= '".$db->idate($date_starty)."' AND c.date_livraison <= '".$db->idate($date_endy)."'"; - + if (!empty($sref_client)) { $sql.= ' AND c.ref_client LIKE \'%'.$db->escape($sref_client).'%\''; } $sql.= ' ORDER BY '.$sortfield.' '.$sortorder; $resql = $db->query($sql); - + if ($resql) { if ($socid) @@ -569,7 +569,7 @@ if (($action != 'create' && $action != 'add') || ! empty($mesgs)) print '

'; $companystatic->id=$socid; $companystatic->nom=$soc->nom; - + print $companystatic->getNomUrl(1,'customer'); print '

'; print ''; @@ -581,7 +581,7 @@ if (($action != 'create' && $action != 'add') || ! empty($mesgs)) print_liste_field_titre($langs->trans('Status'),'','','','','align="right"'); print_liste_field_titre($langs->trans('GenerateBill'),'','','','','align="center"'); print ''; - + // Lignes des champs de filtre print ''; print ''; @@ -593,88 +593,88 @@ if (($action != 'create' && $action != 'add') || ! empty($mesgs)) //print ''; - + //DATE DELIVERY print ''; - + //SEARCH BUTTON print ''; - + print ''; print ''; - + print ''; $var=True; $generic_commande = new Commande($db); - + while ($i < $num) { $objp = $db->fetch_object($resql); $var=!$var; print ''; print ''; - + print ''; - + // Order date print ''; - + //Delivery date print ''; - + // Statut print ''; - + // Checkbox print '' ; - + print ''; - + $total = $total + $objp->price; $subtotal = $subtotal + $objp->price; $i++; } print '
'; print ''; print ''; - + //DATE ORDER print ''; print $period; print ''; print $periodely; print ''; print ''; - + //ALL/NONE print ''; if ($conf->use_javascript_ajax) print ''.$langs->trans("All").' / '.$langs->trans("None").''; print '
'; - + $generic_commande->id=$objp->rowid; $generic_commande->ref=$objp->ref; - + print ''; print ''; - + print ''; - + print '
'; print $generic_commande->getNomUrl(1,$objp->fk_statut); print ''; if (($objp->fk_statut > 0) && ($objp->fk_statut < 3) && $db->jdate($objp->date_valid) < ($now - $conf->commande->client->warning_delay)) print img_picto($langs->trans("Late"),"warning"); print ''; $filename=dol_sanitizeFileName($objp->ref); $filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($objp->ref); $urlsource=$_SERVER['PHP_SELF'].'?id='.$objp->rowid; - $formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','',1,'',1); + print $formfile->getDocumentsLink($generic_commande->element, $filename, $filedir); print '
'; print '
'.$objp->ref_client.''; print dol_print_date($db->jdate($objp->date_commande),'day'); print ''; print dol_print_date($db->jdate($objp->date_livraison),'day'); print ''.$generic_commande->LibStatut($objp->fk_statut,$objp->facturee,5).''; print ''; print '
'; - + /* * Boutons actions */ diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 3ec0b1576e7..054b2a13760 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -3446,7 +3446,7 @@ class FactureLigne $sql.= ",total_ht=".price2num($this->total_ht).""; $sql.= ",total_tva=".price2num($this->total_tva).""; $sql.= ",total_ttc=".price2num($this->total_ttc).""; - $sql.= ",total_localtax1=".price2num($this->total_localtax1).""; + $sql.= ",total_localtax1=".price2num($this->total_localtax1).""; $sql.= ",total_localtax2=".price2num($this->total_localtax2).""; } $sql.= " , fk_product_fournisseur_price='".$this->fk_fournprice."'"; diff --git a/htdocs/compta/facture/fiche-rec.php b/htdocs/compta/facture/fiche-rec.php index 1f014a65aaf..a0173e74fa4 100644 --- a/htdocs/compta/facture/fiche-rec.php +++ b/htdocs/compta/facture/fiche-rec.php @@ -301,10 +301,10 @@ if ($action == 'create') $prodprice=$product_static->price; // price HT print ''.price($prodprice)."\n"; } - else - { - print ' '; - } + else + { + print ' '; + } } print ""; diff --git a/htdocs/compta/facture/impayees.php b/htdocs/compta/facture/impayees.php index 6cd4850ddd8..f81252e39e6 100644 --- a/htdocs/compta/facture/impayees.php +++ b/htdocs/compta/facture/impayees.php @@ -340,7 +340,7 @@ if ($resql) print ''; $filename=dol_sanitizeFileName($objp->facnumber); $filedir=$conf->facture->dir_output . '/' . dol_sanitizeFileName($objp->facnumber); - $foundpdf=$formfile->show_documents('facture',$filename,$filedir,$urlsource,'','','',1,'',1,$param); + print $formfile->getDocumentsLink($facturestatic->element, $filename, $filedir); print ''; print ''; @@ -365,8 +365,10 @@ if ($resql) // Checkbox print ''; - if ($foundpdf) print ''; - else print ' '; + if (! empty($formfile->numoffiles)) + print ''; + else + print ' '; print '' ; print "\n"; diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 8a19de20180..9d668723f34 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -341,7 +341,7 @@ if ($resql) $filename=dol_sanitizeFileName($objp->facnumber); $filedir=$conf->facture->dir_output . '/' . dol_sanitizeFileName($objp->facnumber); $urlsource=$_SERVER['PHP_SELF'].'?id='.$objp->facid; - $formfile->show_documents('facture',$filename,$filedir,$urlsource,'','','',1,'',1); + print $formfile->getDocumentsLink($facturestatic->element, $filename, $filedir); print ''; print ''; print ''; diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php index bf2c773265b..a0ffe2b9035 100644 --- a/htdocs/compta/index.php +++ b/htdocs/compta/index.php @@ -320,7 +320,7 @@ print ''; print ''; // Last modified customer invoices -if ($conf->facture->enabled && $user->rights->facture->lire) +if (! empty($conf->facture->enabled) && $user->rights->facture->lire) { $langs->load("boxes"); $facstatic=new Facture($db); @@ -378,7 +378,7 @@ if ($conf->facture->enabled && $user->rights->facture->lire) $filename=dol_sanitizeFileName($obj->facnumber); $filedir=$conf->facture->dir_output . '/' . dol_sanitizeFileName($obj->facnumber); $urlsource=$_SERVER['PHP_SELF'].'?facid='.$obj->rowid; - $formfile->show_documents('facture',$filename,$filedir,$urlsource,'','','',1,'',1); + print $formfile->getDocumentsLink($facturestatic->element, $filename, $filedir); print ''; print ''; @@ -709,7 +709,7 @@ if ($conf->tax->enabled && $user->rights->tax->charges->lire) /* * Customers orders to be billed */ -if ($conf->facture->enabled && $conf->commande->enabled && $user->rights->commande->lire) +if (! empty($conf->facture->enabled) && ! empty($conf->commande->enabled) && $user->rights->commande->lire) { $commandestatic=new Commande($db); $langs->load("orders"); @@ -770,7 +770,7 @@ if ($conf->facture->enabled && $conf->commande->enabled && $user->rights->comman $filename=dol_sanitizeFileName($obj->ref); $filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref); $urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid; - $formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','',1,'',1); + print $formfile->getDocumentsLink($commandestatic->element, $filename, $filedir); print ''; print ''; @@ -813,7 +813,7 @@ if ($conf->facture->enabled && $conf->commande->enabled && $user->rights->comman /* * Unpaid customers invoices */ -if ($conf->facture->enabled && $user->rights->facture->lire) +if (! empty($conf->facture->enabled) && $user->rights->facture->lire) { $facstatic=new Facture($db); @@ -853,7 +853,6 @@ if ($conf->facture->enabled && $user->rights->facture->lire) { $obj = $db->fetch_object($resql); - print ''; print ''; @@ -871,7 +870,7 @@ if ($conf->facture->enabled && $user->rights->facture->lire) $filename=dol_sanitizeFileName($obj->facnumber); $filedir=$conf->facture->dir_output . '/' . dol_sanitizeFileName($obj->facnumber); $urlsource=$_SERVER['PHP_SELF'].'?facid='.$obj->rowid; - $formfile->show_documents('facture',$filename,$filedir,$urlsource,'','','',1,'',1); + print $formfile->getDocumentsLink($facturestatic->element, $filename, $filedir); print ''; print ''; diff --git a/htdocs/core/admin_extrafields.inc.php b/htdocs/core/admin_extrafields.inc.php index 5384c3c4490..35492db4fdc 100644 --- a/htdocs/core/admin_extrafields.inc.php +++ b/htdocs/core/admin_extrafields.inc.php @@ -25,9 +25,9 @@ $maxsizestring=255; $maxsizeint=10; $extrasize=GETPOST('size'); -if (GETPOST('type')=='double' && strpos($extrasize,',')===false) $extrasize='24,8'; -if (GETPOST('type')=='date') $extrasize=''; -if (GETPOST('type')=='datetime') $extrasize=''; +if (GETPOST('type')=='double' && strpos($extrasize,',')===false) $extrasize='24,8'; +if (GETPOST('type')=='date') $extrasize=''; +if (GETPOST('type')=='datetime') $extrasize=''; // Add attribute @@ -38,10 +38,10 @@ if ($action == 'add') // Check values if (! GETPOST('type')) { - $error++; - $langs->load("errors"); - $mesg=$langs->trans("ErrorFieldRequired",$langs->trans("Type")); - $action = 'create'; + $error++; + $langs->load("errors"); + $mesg=$langs->trans("ErrorFieldRequired",$langs->trans("Type")); + $action = 'create'; } if (GETPOST('type')=='varchar' && $extrasize > $maxsizestring) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index d2eb3c0f4af..299df8afdf1 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -369,8 +369,8 @@ class Form else $paramfortooltiptd =($extracss?' class="'.$extracss.'"':''); // Attribut to put on td text tag $s=""; if (empty($notabs)) $s.=''; - if ($direction < 0) $s.='<'.$tag.$paramfortooltipimg.' valign="top" width="14">'.$img.''; - if ($text != '') $s.='<'.$tag.$paramfortooltiptd.'>'.(($direction < 0)?' ':'').$text.(($direction > 0)?' ':'').''; + if ($direction < 0) $s.='<'.$tag.$paramfortooltipimg.' valign="top" width="14">'.$img.''; + if ($text != '') $s.='<'.$tag.$paramfortooltiptd.'>'.(($direction < 0)?' ':'').$text.(($direction > 0)?' ':'').''; if ($direction > 0) $s.='<'.$tag.$paramfortooltipimg.' valign="top" width="14">'.$img.''; if (empty($notabs)) $s.='
'; diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index edef760ec00..b7f3bb0e6b4 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -199,9 +199,9 @@ class FormFile global $langs,$bc,$conf; - // For backward compatibility - if (! empty($iconPDF)) { - return $this->getDocumentsLink($modulepart, $filename, $filedir); + // For backward compatibility + if (! empty($iconPDF)) { + return $this->getDocumentsLink($modulepart, $filename, $filedir); } $forname='builddoc'; @@ -470,15 +470,15 @@ class FormFile if (preg_match('/text/',$mime)) $out.= ' target="_blank"'; $out.= '>'; $out.= img_mime($file["name"],$langs->trans("File").': '.$file["name"]).' '.dol_trunc($file["name"],$maxfilenamelength); - $out.= ''."\n"; + $out.= ''."\n"; $out.= ''; - + // Show file size - $size=(! empty($file['size'])?$file['size']:dol_filesize($filedir."/".$file["name"])); + $size=(! empty($file['size'])?$file['size']:dol_filesize($filedir."/".$file["name"])); $out.= ''.dol_print_size($size).''; - + // Show file date - $date=(! empty($file['date'])?$file['date']:dol_filemtime($filedir."/".$file["name"])); + $date=(! empty($file['date'])?$file['date']:dol_filemtime($filedir."/".$file["name"])); $out.= ''.dol_print_date($date, 'dayhour').''; if ($delallowed) @@ -526,35 +526,39 @@ class FormFile } $out=''; - + + $this->numoffiles=0; + $file_list=dol_dir_list($filedir, 'files', 0, $filename.'.pdf', '\.meta$|\.png$'); - // For ajax treatment + // For ajax treatment $out.= '
'.img_picto('', 'refresh').'
'."\n"; if (! empty($file_list)) { - // Loop on each file found - foreach($file_list as $file) - { - // Define relative path for download link (depends on module) - $relativepath=$file["name"]; // Cas general - if ($filename) $relativepath=$filename."/".$file["name"]; // Cas propal, facture... - // Autre cas - if ($modulepart == 'donation') { - $relativepath = get_exdir($filename,2).$file["name"]; - } - if ($modulepart == 'export') { - $relativepath = $file["name"]; - } - - // Show file name with link to download - $out.= 'numoffiles++; } } diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 160970b3aae..73b8541ac2a 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -739,12 +739,12 @@ function dol_format_address($object) } else if (in_array($object->country_code,array('GB'))) // UK: title firstname name \n address lines \n town state \n zip \n country { - $ret .= ($ret ? "\n" : '' ).$object->town; - if ($object->state && in_array($object->country_code,$countriesusingstate)) - { - $ret.=", ".$object->departement; - } - if ($object->zip) $ret .= ($ret ? "\n" : '' ).$object->zip; + $ret .= ($ret ? "\n" : '' ).$object->town; + if ($object->state && in_array($object->country_code,$countriesusingstate)) + { + $ret.=", ".$object->departement; + } + if ($object->zip) $ret .= ($ret ? "\n" : '' ).$object->zip; } else // Other: title firstname name \n address lines \n zip town \n country { diff --git a/htdocs/core/lib/price.lib.php b/htdocs/core/lib/price.lib.php index 189e02b2cd0..78a357cd71b 100644 --- a/htdocs/core/lib/price.lib.php +++ b/htdocs/core/lib/price.lib.php @@ -56,16 +56,16 @@ function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $localtax1 $result=array(); // TODO Remove this code. Added for backward compatibility. To remove once localtaxX_type is provided by caller. - if ($localtax1_type == '?') - { - if ($mysoc->country_code=='ES') $localtax1_type='1'; - else $localtax1_type='0'; - } - if ($localtax2_type == '?') - { - if ($mysoc->country_code=='ES') $localtax2_type='1'; - else $localtax2_type='0'; - } + if ($localtax1_type == '?') + { + if ($mysoc->country_code=='ES') $localtax1_type='1'; + else $localtax1_type='0'; + } + if ($localtax2_type == '?') + { + if ($mysoc->country_code=='ES') $localtax2_type='1'; + else $localtax2_type='0'; + } // initialize total (may be HT or TTC depending on price_base_type) $tot_sans_remise = $pu * $qty; @@ -166,10 +166,10 @@ function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $localtax1 $apply_tax = false; //If price is 'TTC' we need to have the totals without VAT for a correct calculation - if ($price_base_type=='TTC') - { - $tot_sans_remise= price2num($tot_sans_remise / (1 + ($txtva / 100)),'MU'); - $tot_avec_remise= price2num($tot_avec_remise / (1 + ($txtva / 100)),'MU'); + if ($price_base_type=='TTC') + { + $tot_sans_remise= price2num($tot_sans_remise / (1 + ($txtva / 100)),'MU'); + $tot_avec_remise= price2num($tot_avec_remise / (1 + ($txtva / 100)),'MU'); } switch($localtax1_type) { diff --git a/htdocs/core/modules/expedition/doc/pdf_expedition_merou.modules.php b/htdocs/core/modules/expedition/doc/pdf_expedition_merou.modules.php index bd09ce8cd17..906a1a74e37 100644 --- a/htdocs/core/modules/expedition/doc/pdf_expedition_merou.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_expedition_merou.modules.php @@ -162,7 +162,7 @@ class pdf_expedition_merou extends ModelePdfExpedition $pagenb=0; $pdf->SetDrawColor(128,128,128); - $pdf->AliasNbPages(); + $pdf->AliasNbPages(); $pdf->SetTitle($outputlangs->convToOutputCharset($object->ref)); $pdf->SetSubject($outputlangs->transnoentities("Sending")); @@ -182,9 +182,9 @@ class pdf_expedition_merou extends ModelePdfExpedition $pdf->SetTextColor(0,0,0); $tab_top = 52; - $tab_top_newpage = 10; + $tab_top_newpage = 10; $tab_height = $this->page_hauteur - $tab_top - $heightforfooter; - $tab_height_newpage = $this->page_hauteur - $tab_top_newpage - $heightforfooter; + $tab_height_newpage = $this->page_hauteur - $tab_top_newpage - $heightforfooter; $pdf->SetFillColor(240,240,240); $pdf->SetTextColor(0,0,0); @@ -219,13 +219,13 @@ class pdf_expedition_merou extends ModelePdfExpedition $pdf->SetFont('','', $default_font_size - 3); - //Creation des cases a cocher - $pdf->Rect(10+3, $curY, 3, 3); - $pdf->Rect(20+3, $curY, 3, 3); - //Insertion de la reference du produit - $pdf->SetXY(30, $curY); - $pdf->SetFont('','B', $default_font_size - 3); - $pdf->MultiCell(24, 3, $outputlangs->convToOutputCharset($object->lines[$i]->ref), 0, 'L', 0); + //Creation des cases a cocher + $pdf->Rect(10+3, $curY, 3, 3); + $pdf->Rect(20+3, $curY, 3, 3); + //Insertion de la reference du produit + $pdf->SetXY(30, $curY); + $pdf->SetFont('','B', $default_font_size - 3); + $pdf->MultiCell(24, 3, $outputlangs->convToOutputCharset($object->lines[$i]->ref), 0, 'L', 0); $pdf->SetXY(140, $curY); $pdf->MultiCell(30, 3, $object->lines[$i]->qty_asked, 0, 'C', 0); @@ -269,16 +269,16 @@ class pdf_expedition_merou extends ModelePdfExpedition } } - // Show square - if ($pagenb == 1) - { - $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 0); - $bottomlasttab=$this->page_hauteur - $heightforinfotot + 1; - } - else - { - $this->_tableau($pdf, $tab_top_newpage - 1, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 0); - $bottomlasttab=$this->page_hauteur - $heightforinfotot + 1; + // Show square + if ($pagenb == 1) + { + $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 0); + $bottomlasttab=$this->page_hauteur - $heightforinfotot + 1; + } + else + { + $this->_tableau($pdf, $tab_top_newpage - 1, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 0); + $bottomlasttab=$this->page_hauteur - $heightforinfotot + 1; } // Pied de page diff --git a/htdocs/core/modules/expedition/doc/pdf_expedition_rouget.modules.php b/htdocs/core/modules/expedition/doc/pdf_expedition_rouget.modules.php index cd4af15d121..f30b676cfc0 100644 --- a/htdocs/core/modules/expedition/doc/pdf_expedition_rouget.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_expedition_rouget.modules.php @@ -240,10 +240,10 @@ class pdf_expedition_rouget extends ModelePdfExpedition $pdf->setPage($pageposbefore); $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. - // We suppose that a too long description is moved completely on next page - if ($pageposafter > $pageposbefore) { - $pdf->setPage($pageposafter); $curY = $tab_top_newpage; - } + // We suppose that a too long description is moved completely on next page + if ($pageposafter > $pageposbefore) { + $pdf->setPage($pageposafter); $curY = $tab_top_newpage; + } $pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par defaut diff --git a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php index e71db402c7a..653ec0d4344 100644 --- a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php +++ b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php @@ -243,8 +243,8 @@ class pdf_soleil extends ModelePDFFicheinter { $curY = $nexY; - $pdf->setPageOrientation('', 1, $this->marge_basse+$heightforfooter+$heightforinfotot); // The only function to edit the bottom margin of current page to set it. - $pageposbefore=$pdf->getPage(); + $pdf->setPageOrientation('', 1, $this->marge_basse+$heightforfooter+$heightforinfotot); // The only function to edit the bottom margin of current page to set it. + $pageposbefore=$pdf->getPage(); $pdf->SetFont('','B', $default_font_size - 1); $pdf->SetXY($this->marge_gauche, $curY); @@ -273,16 +273,16 @@ class pdf_soleil extends ModelePDFFicheinter $nexY+=2; // Passe espace entre les lignes - $pageposafter=$pdf->getPage(); - $pdf->setPage($pageposbefore); - $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. + $pageposafter=$pdf->getPage(); + $pdf->setPage($pageposbefore); + $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. - // We suppose that a too long description is moved completely on next page - if ($pageposafter > $pageposbefore) { - $pdf->setPage($pageposafter); $curY = $tab_top_newpage; + // We suppose that a too long description is moved completely on next page + if ($pageposafter > $pageposbefore) { + $pdf->setPage($pageposafter); $curY = $tab_top_newpage; } - $pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par defaut + $pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par defaut // Detect if some page were added automatically and output _tableau for past pages while ($pagenb < $pageposafter) diff --git a/htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php b/htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php index 7f5a25550a4..eebe473fd1e 100644 --- a/htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php +++ b/htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php @@ -254,9 +254,9 @@ class pdf_typhon extends ModelePDFDeliveryOrder $pdf->setPage($pageposbefore); $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. - // We suppose that a too long description is moved completely on next page - if ($pageposafter > $pageposbefore) { - $pdf->setPage($pageposafter); $curY = $tab_top_newpage; + // We suppose that a too long description is moved completely on next page + if ($pageposafter > $pageposbefore) { + $pdf->setPage($pageposafter); $curY = $tab_top_newpage; } $pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par defaut diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index 7cd7d972796..6213ed5fd3a 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -36,21 +36,21 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php'; */ class pdf_azur extends ModelePDFPropales { - var $db; - var $name; - var $description; - var $type; - - var $phpmin = array(4,3,0); // Minimum version of PHP required by module - var $version = 'dolibarr'; - - var $page_largeur; - var $page_hauteur; - var $format; - var $marge_gauche; - var $marge_droite; - var $marge_haute; - var $marge_basse; + var $db; + var $name; + var $description; + var $type; + + var $phpmin = array(4,3,0); // Minimum version of PHP required by module + var $version = 'dolibarr'; + + var $page_largeur; + var $page_hauteur; + var $format; + var $marge_gauche; + var $marge_droite; + var $marge_haute; + var $marge_basse; var $emetteur; // Objet societe qui emet @@ -279,7 +279,7 @@ class pdf_azur extends ModelePDFPropales // We suppose that a too long description is moved completely on next page if ($pageposafter > $pageposbefore) { $pdf->setPage($pageposafter); $curY = $tab_top_newpage; - } + } $pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par defaut @@ -1057,7 +1057,7 @@ class pdf_azur extends ModelePDFPropales $pdf->SetXY($posx,$posy); $pdf->SetFillColor(230,230,230); $pdf->MultiCell(82, $hautcadre, "", 0, 'R', 1); - $pdf->SetTextColor(0,0,60); + $pdf->SetTextColor(0,0,60); // Show sender name $pdf->SetXY($posx+2,$posy+3); diff --git a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php index 756d94726e5..652082cc57a 100755 --- a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php +++ b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php @@ -273,10 +273,10 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $pdf->setPage($pageposbefore); $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. -// We suppose that a too long description is moved completely on next page -if ($pageposafter > $pageposbefore) { - $pdf->setPage($pageposafter); $curY = $tab_top_newpage; -} +// We suppose that a too long description is moved completely on next page +if ($pageposafter > $pageposbefore) { + $pdf->setPage($pageposafter); $curY = $tab_top_newpage; +} $pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par defaut diff --git a/htdocs/fourn/commande/index.php b/htdocs/fourn/commande/index.php index 5d31d8317d7..a8281927c2b 100755 --- a/htdocs/fourn/commande/index.php +++ b/htdocs/fourn/commande/index.php @@ -348,7 +348,7 @@ if ($resql) $filename=dol_sanitizeFileName($obj->ref); $filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref); $urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid; - $formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','',1,'',1); + print $formfile->getDocumentsLink($commandestatic->element, $filename, $filedir); print ''; print ''; @@ -416,7 +416,7 @@ print ''; $filename=dol_sanitizeFileName($obj->ref); $filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref); $urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid; -$formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','',1,'',1); +print $formfile->getDocumentsLink($commandestatic->element, $filename, $filedir); print ''; print ''; diff --git a/htdocs/holiday/admin/holiday.php b/htdocs/holiday/admin/holiday.php index df5fdd52384..b73694e187e 100644 --- a/htdocs/holiday/admin/holiday.php +++ b/htdocs/holiday/admin/holiday.php @@ -33,8 +33,8 @@ require_once DOL_DOCUMENT_ROOT. '/user/class/usergroup.class.php'; $action=GETPOST('action'); -$langs->load("admin"); -$langs->load("holiday"); +$langs->load("admin"); +$langs->load("holiday"); // Si pas administrateur if (! $user->admin) accessforbidden(); diff --git a/htdocs/margin/admin/margin.php b/htdocs/margin/admin/margin.php index 69d3c574dd0..f04cda7f072 100644 --- a/htdocs/margin/admin/margin.php +++ b/htdocs/margin/admin/margin.php @@ -248,7 +248,7 @@ print ''; print ''; -dol_fiche_end(); +dol_fiche_end(); print '
'; diff --git a/htdocs/product/admin/product_extrafields.php b/htdocs/product/admin/product_extrafields.php index 4d979c9e493..67dea9bb7a9 100755 --- a/htdocs/product/admin/product_extrafields.php +++ b/htdocs/product/admin/product_extrafields.php @@ -37,8 +37,8 @@ $extrafields = new ExtraFields($db); $form = new Form($db); // List of supported format -$tmptype2label=getStaticMember(get_class($extrafields),'type2label'); -$type2label=array(''); +$tmptype2label=getStaticMember(get_class($extrafields),'type2label'); +$type2label=array(''); foreach ($tmptype2label as $key => $val) $type2label[$key]=$langs->trans($val); $action=GETPOST('action', 'alpha'); From e19f8c54f13f6118ee1c82d1a4a00e78068789be Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sat, 15 Sep 2012 10:01:35 +0200 Subject: [PATCH 5/6] Fix: strict mode hurricane --- htdocs/adherents/admin/adherent.php | 2 +- htdocs/adherents/admin/mailman.php | 4 +- htdocs/adherents/admin/public.php | 4 +- htdocs/adherents/admin/spip.php | 2 +- htdocs/adherents/agenda.php | 4 +- htdocs/adherents/card_subscriptions.php | 12 +++--- htdocs/adherents/class/adherent.class.php | 2 +- htdocs/adherents/cotisations.php | 6 +-- htdocs/adherents/fiche.php | 20 ++++----- htdocs/adherents/fiche_subscription.php | 4 +- htdocs/adherents/ldap.php | 4 +- htdocs/adherents/liste.php | 2 +- htdocs/admin/barcode.php | 4 +- htdocs/admin/company.php | 2 +- htdocs/admin/compta.php | 2 +- htdocs/admin/confexped.php | 4 +- htdocs/admin/expedition.php | 2 +- htdocs/admin/facture.php | 2 +- htdocs/admin/ldap.php | 10 ++--- htdocs/admin/ldap_members.php | 2 +- htdocs/admin/livraison.php | 2 +- htdocs/admin/mails.php | 2 +- htdocs/admin/prelevement.php | 2 +- htdocs/admin/security.php | 4 +- htdocs/admin/stock.php | 12 +++--- htdocs/admin/tools/purge.php | 4 +- htdocs/cashdesk/admin/cashdesk.php | 6 +-- htdocs/cashdesk/class/Facturation.class.php | 2 +- htdocs/cashdesk/facturation.php | 2 +- htdocs/cashdesk/facturation_verif.php | 2 +- htdocs/cashdesk/index.php | 2 +- htdocs/cashdesk/validation_verif.php | 2 +- htdocs/categories/categorie.php | 4 +- htdocs/categories/class/categorie.class.php | 6 +-- htdocs/comm/action/document.php | 4 +- htdocs/comm/action/fiche.php | 4 +- htdocs/comm/action/index.php | 2 +- htdocs/comm/addpropal.php | 4 +- htdocs/comm/fiche.php | 32 +++++++------- htdocs/comm/index.php | 6 +-- htdocs/comm/list.php | 2 +- htdocs/comm/propal.php | 2 +- htdocs/comm/propal/apercu.php | 2 +- htdocs/comm/propal/index.php | 6 +-- htdocs/comm/prospect/fiche.php | 8 ++-- htdocs/comm/prospect/index.php | 4 +- htdocs/comm/prospect/list.php | 2 +- htdocs/comm/prospect/recap-prospect.php | 2 +- htdocs/comm/recap-client.php | 2 +- htdocs/commande/apercu.php | 4 +- htdocs/commande/contact.php | 2 +- htdocs/commande/fiche.php | 8 ++-- htdocs/commande/index.php | 6 +-- htdocs/commande/orderstoinvoice.php | 4 +- htdocs/compta/bank/fiche.php | 4 +- htdocs/compta/bank/ligne.php | 2 +- htdocs/compta/deplacement/fiche.php | 4 +- htdocs/compta/dons/fiche.php | 12 +++--- htdocs/compta/dons/liste.php | 4 +- htdocs/compta/facture.php | 20 ++++----- htdocs/compta/facture/apercu.php | 6 +-- htdocs/compta/facture/impayees.php | 2 +- htdocs/compta/index.php | 42 +++++++++---------- .../compta/localtax/class/localtax.class.php | 2 +- htdocs/compta/localtax/clients.php | 4 +- htdocs/compta/localtax/fiche.php | 4 +- htdocs/compta/paiement.php | 8 ++-- .../compta/paiement/class/paiement.class.php | 4 +- htdocs/compta/paiement/fiche.php | 6 +-- htdocs/compta/paiement/liste.php | 6 +-- htdocs/compta/payment_sc/fiche.php | 6 +-- .../class/bonprelevement.class.php | 2 +- htdocs/compta/recap-compta.php | 2 +- .../class/paymentsocialcontribution.class.php | 2 +- htdocs/compta/tva/class/tva.class.php | 2 +- htdocs/compta/tva/clients.php | 4 +- htdocs/compta/tva/fiche.php | 4 +- htdocs/compta/tva/quadri_detail.php | 4 +- .../actions_contactcard_common.class.php | 10 ++--- htdocs/contact/fiche.php | 20 ++++----- htdocs/contrat/fiche.php | 8 ++-- htdocs/core/ajax/ziptown.php | 2 +- htdocs/core/boxes/box_produits.php | 2 +- htdocs/core/boxes/box_services_contracts.php | 2 +- htdocs/core/class/CMailFile.class.php | 2 +- htdocs/core/class/commonobject.class.php | 16 +++---- htdocs/core/class/html.formfile.class.php | 2 +- htdocs/core/class/ldap.class.php | 4 +- htdocs/core/lib/agenda.lib.php | 2 +- htdocs/core/lib/company.lib.php | 6 +-- htdocs/core/lib/invoice.lib.php | 2 +- htdocs/core/lib/ldap.lib.php | 4 +- htdocs/core/lib/order.lib.php | 2 +- htdocs/core/lib/pdf.lib.php | 2 +- htdocs/core/lib/product.lib.php | 4 +- htdocs/core/lib/security2.lib.php | 2 +- htdocs/core/lib/stock.lib.php | 2 +- htdocs/core/lib/tax.lib.php | 24 +++++------ htdocs/core/menus/standard/eldy.lib.php | 22 +++++----- .../cheque/pdf/modules_chequereceipts.php | 2 +- .../modules/cheque/pdf/pdf_blochet.class.php | 2 +- .../doc/doc_generic_order_odt.modules.php | 2 +- .../commande/doc/pdf_einstein.modules.php | 4 +- htdocs/core/modules/dons/modules_don.php | 2 +- .../doc/pdf_expedition_merou.modules.php | 4 +- .../doc/pdf_expedition_rouget.modules.php | 10 ++--- .../doc/doc_generic_invoice_odt.modules.php | 2 +- .../modules/facture/doc/pdf_crabe.modules.php | 4 +- .../fichinter/doc/pdf_soleil.modules.php | 4 +- .../modules/fichinter/modules_fichinter.php | 2 +- .../modules/livraison/modules_livraison.php | 2 +- .../livraison/pdf/pdf_sirocco.modules.php | 6 +-- .../livraison/pdf/pdf_typhon.modules.php | 4 +- .../modules/member/doc/pdf_standard.class.php | 2 +- .../doc/pdf_standardlabel.class.php | 2 +- .../project/pdf/pdf_baleine.modules.php | 2 +- .../doc/doc_generic_proposal_odt.modules.php | 2 +- .../modules/propale/doc/pdf_azur.modules.php | 4 +- .../modules/rapport/pdf_paiement.class.php | 2 +- .../modules/societe/modules_societe.class.php | 2 +- .../pdf/pdf_canelle.modules.php | 4 +- .../pdf/pdf_muscadet.modules.php | 6 +-- .../core/tpl/freeproductline_create.tpl.php | 12 +++--- htdocs/core/tpl/objectline_add.tpl.php | 8 ++-- htdocs/core/tpl/objectline_view.tpl.php | 4 +- .../tpl/predefinedproductline_create.tpl.php | 14 +++---- ...interface_50_modLdap_Ldapsynchro.class.php | 4 +- htdocs/document.php | 4 +- htdocs/ecm/index.php | 16 +++---- htdocs/ecm/search.php | 14 +++---- htdocs/expedition/class/expedition.class.php | 4 +- htdocs/expedition/contact.php | 2 +- htdocs/expedition/fiche.php | 18 ++++---- htdocs/expedition/shipment.php | 10 ++--- htdocs/fichinter/apercu.php | 2 +- htdocs/fichinter/fiche.php | 6 +-- htdocs/fourn/commande/dispatch.php | 4 +- htdocs/fourn/commande/fiche.php | 8 ++-- htdocs/fourn/facture/fiche.php | 18 ++++---- htdocs/fourn/facture/paiement.php | 4 +- htdocs/fourn/fiche.php | 4 +- htdocs/fourn/index.php | 2 +- htdocs/fourn/liste.php | 2 +- htdocs/fourn/paiement/fiche.php | 6 +-- htdocs/fourn/product/categorie.php | 6 +-- htdocs/fourn/product/index.php | 4 +- htdocs/fourn/product/photos.php | 4 +- htdocs/livraison/class/livraison.class.php | 6 +-- htdocs/livraison/fiche.php | 4 +- htdocs/paybox/admin/paybox.php | 8 ++-- htdocs/paybox/lib/paybox.lib.php | 8 ++-- htdocs/paypal/admin/paypal.php | 8 ++-- htdocs/paypal/lib/paypal.lib.php | 12 +++--- htdocs/paypal/lib/paypalfunctions.lib.php | 10 ++--- .../canvas/product/tpl/card_create.tpl.php | 2 +- .../canvas/product/tpl/card_edit.tpl.php | 2 +- htdocs/product/class/product.class.php | 2 +- htdocs/product/composition/fiche.php | 18 ++++---- htdocs/product/document.php | 4 +- htdocs/product/fiche.php | 2 +- htdocs/product/index.php | 6 +-- htdocs/product/price.php | 6 +-- htdocs/product/stock/fiche.php | 2 +- htdocs/product/stock/product.php | 10 ++--- htdocs/projet/element.php | 28 ++++++------- htdocs/public/members/new.php | 2 +- htdocs/public/paybox/newpayment.php | 2 +- htdocs/public/paypal/newpayment.php | 2 +- htdocs/public/paypal/paymentok.php | 8 ++-- htdocs/societe/agenda.php | 4 +- htdocs/societe/ajaxcompanies.php | 2 +- .../canvas/actions_card_common.class.php | 8 ++-- .../canvas/company/tpl/card_create.tpl.php | 2 +- .../canvas/company/tpl/card_edit.tpl.php | 2 +- .../canvas/company/tpl/card_view.tpl.php | 4 +- .../canvas/individual/tpl/card_create.tpl.php | 2 +- .../canvas/individual/tpl/card_edit.tpl.php | 2 +- .../canvas/individual/tpl/card_view.tpl.php | 4 +- htdocs/societe/class/societe.class.php | 12 +++--- htdocs/societe/document.php | 2 +- htdocs/societe/index.php | 2 +- htdocs/societe/info.php | 2 +- htdocs/societe/note.php | 2 +- htdocs/societe/soc.php | 10 ++--- htdocs/societe/societe.php | 2 +- htdocs/theme/auguria/style.css.php | 2 +- htdocs/theme/bureau2crea/style.css.php | 2 +- htdocs/theme/cameleo/style.css.php | 2 +- htdocs/user/class/usergroup.class.php | 2 +- htdocs/user/fiche.php | 4 +- htdocs/user/passwordforgotten.php | 4 +- htdocs/webservices/admin/webservices.php | 12 +++--- htdocs/webservices/index.php | 12 +++--- 193 files changed, 529 insertions(+), 529 deletions(-) diff --git a/htdocs/adherents/admin/adherent.php b/htdocs/adherents/admin/adherent.php index 8d0cd566a7f..4b9f5e672e8 100644 --- a/htdocs/adherents/admin/adherent.php +++ b/htdocs/adherents/admin/adherent.php @@ -178,7 +178,7 @@ print ''; print ''; print ''; print ''.$langs->trans("AddSubscriptionIntoAccount").''; -if ($conf->banque->enabled) +if (! empty($conf->banque->enabled)) { print ''; print $form->selectyesno('constvalue',$conf->global->ADHERENT_BANK_USE,1); diff --git a/htdocs/adherents/admin/mailman.php b/htdocs/adherents/admin/mailman.php index 05dba9a696c..b3169c721f2 100644 --- a/htdocs/adherents/admin/mailman.php +++ b/htdocs/adherents/admin/mailman.php @@ -163,7 +163,7 @@ dol_htmloutput_mesg($mesg); * Mailman */ $var=!$var; -if ($conf->global->ADHERENT_USE_MAILMAN) +if (! empty($conf->global->ADHERENT_USE_MAILMAN)) { //$lien=img_picto($langs->trans("Active"),'tick').' '; $lien='
'; @@ -214,7 +214,7 @@ else dol_fiche_end(); -if ($conf->global->ADHERENT_USE_MAILMAN) +if (! empty($conf->global->ADHERENT_USE_MAILMAN)) { print '
'; print ''; diff --git a/htdocs/adherents/admin/public.php b/htdocs/adherents/admin/public.php index 37ae2d63c25..9dfac613f2a 100755 --- a/htdocs/adherents/admin/public.php +++ b/htdocs/adherents/admin/public.php @@ -167,8 +167,8 @@ if (! empty($conf->paybox->enabled) || ! empty($conf->paypal->enabled)) print $langs->trans("MEMBER_NEWFORM_PAYONLINE"); print ''; $listofval=array(); - if ($conf->paybox->enabled) $listofval['paybox']='Paybox'; - if ($conf->paypal->enabled) $listofval['paypal']='PayPal'; + if (! empty($conf->paybox->enabled)) $listofval['paybox']='Paybox'; + if (! empty($conf->paypal->enabled)) $listofval['paypal']='PayPal'; print $form->selectarray("MEMBER_NEWFORM_PAYONLINE",$listofval,(! empty($conf->global->MEMBER_NEWFORM_PAYONLINE)?$conf->global->MEMBER_NEWFORM_PAYONLINE:''),1); print "\n"; } diff --git a/htdocs/adherents/admin/spip.php b/htdocs/adherents/admin/spip.php index c099d0a93a3..29ae8e9e894 100644 --- a/htdocs/adherents/admin/spip.php +++ b/htdocs/adherents/admin/spip.php @@ -123,7 +123,7 @@ dol_htmloutput_mesg($mesg); * Spip */ $var=!$var; -if ($conf->global->ADHERENT_USE_SPIP) +if (! empty($conf->global->ADHERENT_USE_SPIP)) { //$lien=img_picto($langs->trans("Active"),'tick').' '; $lien=''; diff --git a/htdocs/adherents/agenda.php b/htdocs/adherents/agenda.php index db8a055e32f..487c7636445 100644 --- a/htdocs/adherents/agenda.php +++ b/htdocs/adherents/agenda.php @@ -79,7 +79,7 @@ if ($id) llxHeader("",$langs->trans("Agenda"),''); - if ($conf->notification->enabled) $langs->load("mails"); + if (! empty($conf->notification->enabled)) $langs->load("mails"); $head = member_prepare_head($object); dol_fiche_head($head, 'agenda', $langs->trans("Member"),0,'user'); @@ -142,7 +142,7 @@ if ($id) print '
'; - if ($conf->agenda->enabled) + if (! empty($conf->agenda->enabled)) { print ''.$langs->trans("AddAction").''; } diff --git a/htdocs/adherents/card_subscriptions.php b/htdocs/adherents/card_subscriptions.php index 61ef0da1314..77814af9620 100644 --- a/htdocs/adherents/card_subscriptions.php +++ b/htdocs/adherents/card_subscriptions.php @@ -479,7 +479,7 @@ if ($rowid) $rowspan=9; if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) $rowspan+=1; - if ($conf->societe->enabled) $rowspan++; + if (! empty($conf->societe->enabled)) $rowspan++; print ''; print ''; @@ -545,7 +545,7 @@ if ($rowid) print ''; // Third party Dolibarr - if ($conf->societe->enabled) + if (! empty($conf->societe->enabled)) { print ''; print ''; print ''; print ''; - if ($conf->banque->enabled) + if (! empty($conf->banque->enabled)) { print ''; } @@ -693,7 +693,7 @@ if ($rowid) print '\n"; print '\n"; print ''; - if ($conf->banque->enabled) + if (! empty($conf->banque->enabled)) { print ''; print ''; // Banque - if ($conf->banque->enabled) + if (! empty($conf->banque->enabled)) { if ($objp->fk_account) { @@ -207,7 +207,7 @@ if ($result) print "\n"; print "\n"; print "\n"; - if ($conf->banque->enabled) + if (! empty($conf->banque->enabled)) { print ''; } diff --git a/htdocs/adherents/fiche.php b/htdocs/adherents/fiche.php index 5647ae16839..e12ec01d3a9 100644 --- a/htdocs/adherents/fiche.php +++ b/htdocs/adherents/fiche.php @@ -54,7 +54,7 @@ $socid=GETPOST('socid','int'); // Security check $result=restrictedArea($user,'adherent',$rowid); -if ($conf->mailmanspip->enabled) +if (! empty($conf->mailmanspip->enabled)) { include_once DOL_DOCUMENT_ROOT.'/mailmanspip/class/mailmanspip.class.php'; @@ -212,7 +212,7 @@ if ($action == 'confirm_sendinfo' && $confirm == 'yes') if ($object->email) { $from=$conf->email_from; - if ($conf->global->ADHERENT_MAIL_FROM) $from=$conf->global->ADHERENT_MAIL_FROM; + if (! empty($conf->global->ADHERENT_MAIL_FROM)) $from=$conf->global->ADHERENT_MAIL_FROM; $result=$object->send_an_email($langs->transnoentitiesnoconv("ThisIsContentOfYourCard")."\n\n%INFOS%\n\n",$langs->transnoentitiesnoconv("CardContent")); @@ -844,7 +844,7 @@ if ($action == 'create') /* // Third party Dolibarr - if ($conf->societe->enabled) + if (! empty($conf->societe->enabled)) { print '
'; @@ -675,7 +675,7 @@ if ($rowid) print ''.$langs->trans("DateSubscription").''.$langs->trans("DateEnd").''.$langs->trans("Amount").''.$langs->trans("Account").''.dol_print_date($db->jdate($objp->dateadh),'day')."'.dol_print_date($db->jdate($objp->datef),'day')."'.price($objp->cotisation).''; if ($objp->bid) @@ -720,7 +720,7 @@ if ($rowid) // Link for paypal payment - if ($conf->paypal->enabled) + if (! empty($conf->paypal->enabled)) { include_once DOL_DOCUMENT_ROOT.'/paypal/lib/paypal.lib.php'; print showPaypalPaymentUrl('membersubscription',$object->ref); @@ -889,7 +889,7 @@ if ($rowid) print ''; print ' '.$langs->trans("None").'
'; - if ($conf->banque->enabled) + if (! empty($conf->banque->enabled)) { print ' '.$langs->trans("MoreActionBankDirect").'
'; diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 3c0290b4eeb..ebdb9f824cc 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -160,7 +160,7 @@ class Adherent extends CommonObject // Envoi mail confirmation $from=$conf->email_from; - if ($conf->global->ADHERENT_MAIL_FROM) $from=$conf->global->ADHERENT_MAIL_FROM; + if (! empty($conf->global->ADHERENT_MAIL_FROM)) $from=$conf->global->ADHERENT_MAIL_FROM; include_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; $mailfile = new CMailFile($subjecttosend, $this->email, $from, $texttosend, $filename_list, $mimetype_list, $mimefilename_list, $addr_cc, $addr_bcc, $deliveryreceipt, $msgishtml); diff --git a/htdocs/adherents/cotisations.php b/htdocs/adherents/cotisations.php index b0a75427697..e7b898ffd1e 100644 --- a/htdocs/adherents/cotisations.php +++ b/htdocs/adherents/cotisations.php @@ -99,7 +99,7 @@ if ($result) print_liste_field_titre($langs->trans("Name"),"cotisations.php","d.nom",$param,"","",$sortfield,$sortorder); print_liste_field_titre($langs->trans("Login"),"cotisations.php","d.login",$param,"","",$sortfield,$sortorder); print_liste_field_titre($langs->trans("Label"),"cotisations.php","c.note",$param,"",'align="left"',$sortfield,$sortorder); - if ($conf->banque->enabled) + if (! empty($conf->banque->enabled)) { print_liste_field_titre($langs->trans("Account"),"cotisations.php","b.fk_account",$pram,"","",$sortfield,$sortorder); } @@ -153,7 +153,7 @@ if ($result) print '
    
'.$langs->trans("LinkedToDolibarrThirdParty").''; print $form->select_company($object->fk_soc,'socid','',1); @@ -924,7 +924,7 @@ if ($action == 'edit') $rowspan=15; if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) $rowspan++; - if ($conf->societe->enabled) $rowspan++; + if (! empty($conf->societe->enabled)) $rowspan++; print ''; print ''; @@ -1064,7 +1064,7 @@ if ($action == 'edit') } // Third party Dolibarr - if ($conf->societe->enabled) + if (! empty($conf->societe->enabled)) { print '
'.$langs->trans("LinkedToDolibarrThirdParty").''; if ($object->fk_soc) @@ -1148,7 +1148,7 @@ if ($rowid && $action != 'edit') array('label' => $langs->trans("LoginToCreate"), 'type' => 'text', 'name' => 'login', 'value' => $login) ); $text=$langs->trans("ConfirmCreateLogin").'
'; - if ($conf->societe->enabled) + if (! empty($conf->societe->enabled)) { if ($object->fk_soc > 0) $text.=$langs->trans("UserWillBeExternalUser"); else $text.=$langs->trans("UserWillBeInternalUser"); @@ -1204,8 +1204,8 @@ if ($rowid && $action != 'edit') // Cree un tableau formulaire $formquestion=array(); if ($object->email) $formquestion[]=array('type' => 'checkbox', 'name' => 'send_mail', 'label' => $label, 'value' => ($conf->global->ADHERENT_DEFAULT_SENDINFOBYMAIL?true:false)); - if ($conf->global->ADHERENT_USE_MAILMAN) { $formquestion[]=array('type'=>'other','label'=>$langs->transnoentitiesnoconv("SynchroMailManEnabled"),'value'=>''); } - if ($conf->global->ADHERENT_USE_SPIP) { $formquestion[]=array('type'=>'other','label'=>$langs->transnoentitiesnoconv("SynchroSpipEnabled"),'value'=>''); } + if (! empty($conf->global->ADHERENT_USE_MAILMAN)) { $formquestion[]=array('type'=>'other','label'=>$langs->transnoentitiesnoconv("SynchroMailManEnabled"),'value'=>''); } + if (! empty($conf->global->ADHERENT_USE_SPIP)) { $formquestion[]=array('type'=>'other','label'=>$langs->transnoentitiesnoconv("SynchroSpipEnabled"),'value'=>''); } print $form->formconfirm("fiche.php?rowid=".$rowid,$langs->trans("ValidateMember"),$langs->trans("ConfirmValidateMember"),"confirm_valid",$formquestion,1); } @@ -1276,7 +1276,7 @@ if ($rowid && $action != 'edit') $rowspan=17; if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) $rowspan++; - if ($conf->societe->enabled) $rowspan++; + if (! empty($conf->societe->enabled)) $rowspan++; print ''; @@ -1382,7 +1382,7 @@ if ($rowid && $action != 'edit') } // Third party Dolibarr - if ($conf->societe->enabled) + if (! empty($conf->societe->enabled)) { print '
'; print ''; // Bank line - if ($conf->banque->enabled) + if (! empty($conf->banque->enabled)) { if ($conf->global->ADHERENT_BANK_USE || $subscription->fk_bank) { @@ -335,7 +335,7 @@ if ($rowid && $action != 'edit') print ''; // Bank line - if ($conf->banque->enabled) + if (! empty($conf->banque->enabled)) { if ($conf->global->ADHERENT_BANK_USE || $subscription->fk_bank) { diff --git a/htdocs/adherents/ldap.php b/htdocs/adherents/ldap.php index a97c729a908..5cc02159675 100644 --- a/htdocs/adherents/ldap.php +++ b/htdocs/adherents/ldap.php @@ -120,7 +120,7 @@ print ''; print ''; // Password not crypted -if ($conf->global->LDAP_MEMBER_FIELD_PASSWORD) +if (! empty($conf->global->LDAP_MEMBER_FIELD_PASSWORD)) { print ''; print ''; @@ -128,7 +128,7 @@ if ($conf->global->LDAP_MEMBER_FIELD_PASSWORD) } // Password crypted -if ($conf->global->LDAP_MEMBER_FIELD_PASSWORD_CRYPTED) +if (! empty($conf->global->LDAP_MEMBER_FIELD_PASSWORD_CRYPTED)) { print ''; print ''; diff --git a/htdocs/adherents/liste.php b/htdocs/adherents/liste.php index 93549d1c516..ca87562153a 100644 --- a/htdocs/adherents/liste.php +++ b/htdocs/adherents/liste.php @@ -198,7 +198,7 @@ if ($resql) // Filter on categories $moreforfilter=''; - if ($conf->categorie->enabled) + if (! empty($conf->categorie->enabled)) { $moreforfilter.=$langs->trans('Categories'). ': '; $moreforfilter.=$formother->select_categories(3,$search_categ,'search_categ',1); diff --git a/htdocs/admin/barcode.php b/htdocs/admin/barcode.php index 91c376a32f6..2bd8736dfda 100644 --- a/htdocs/admin/barcode.php +++ b/htdocs/admin/barcode.php @@ -290,7 +290,7 @@ if (! isset($_SERVER['WINDIR'])) } // Module produits -if ($conf->societe->enabled) +if (! empty($conf->societe->enabled)) { $var=!$var; print ""; @@ -308,7 +308,7 @@ if ($conf->societe->enabled) } // Module produits -if ($conf->product->enabled) +if (! empty($conf->product->enabled)) { $var=!$var; print ""; diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php index 18d7aafe3f5..b1838928511 100644 --- a/htdocs/admin/company.php +++ b/htdocs/admin/company.php @@ -661,7 +661,7 @@ else $var=!$var; print ''; diff --git a/htdocs/admin/compta.php b/htdocs/admin/compta.php index 86d87117ac1..6f45e70bc98 100644 --- a/htdocs/admin/compta.php +++ b/htdocs/admin/compta.php @@ -113,7 +113,7 @@ print "\n"; print ''; print ''; print ""; print "'; // Synchro contact active -if ($conf->societe->enabled) +if (! empty($conf->societe->enabled)) { $var=!$var; print ''; // Port $var=!$var; print ''; // Pass $var=!$var; print '"; print ''; print '"; } -if($conf->global->DATABASE_PWD_ENCRYPTED) +if (! empty($conf->global->DATABASE_PWD_ENCRYPTED)) { print '\n"; print ''."\n"; $var=true; -if ($conf->facture->enabled) +if (! empty($conf->facture->enabled)) { $var=!$var; print ""; @@ -147,7 +147,7 @@ if ($conf->facture->enabled) print "\n\n\n"; } -if ($conf->commande->enabled) +if (! empty($conf->commande->enabled)) { $var=!$var; print ""; @@ -161,7 +161,7 @@ if ($conf->commande->enabled) print "\n\n\n"; } -if ($conf->expedition->enabled) +if (! empty($conf->expedition->enabled)) { $var=!$var; print ""; @@ -183,7 +183,7 @@ print " \n"; print ''."\n"; $var=true; -if ($conf->fournisseur->enabled) +if (! empty($conf->fournisseur->enabled)) { $var=!$var; print ""; @@ -197,7 +197,7 @@ if ($conf->fournisseur->enabled) print "\n\n\n"; } -if ($conf->fournisseur->enabled) +if (! empty($conf->fournisseur->enabled)) { $var=!$var; print ""; @@ -210,7 +210,7 @@ if ($conf->fournisseur->enabled) print ''; print "\n\n\n"; } -if ($conf->fournisseur->enabled) +if (! empty($conf->fournisseur->enabled)) { $var=!$var; print ""; diff --git a/htdocs/admin/tools/purge.php b/htdocs/admin/tools/purge.php index b835b4a5953..46eebf3f299 100644 --- a/htdocs/admin/tools/purge.php +++ b/htdocs/admin/tools/purge.php @@ -36,7 +36,7 @@ $choice=GETPOST('choice'); // Define filelog to discard it from purge $filelog=''; -if ($conf->syslog->enabled) +if (! empty($conf->syslog->enabled)) { $filelog=SYSLOG_FILE; $filelog=preg_replace('/DOL_DATA_ROOT/i',DOL_DATA_ROOT,$filelog); @@ -131,7 +131,7 @@ print '
'; diff --git a/htdocs/adherents/fiche_subscription.php b/htdocs/adherents/fiche_subscription.php index 02c9539d262..e9fa20f7e98 100644 --- a/htdocs/adherents/fiche_subscription.php +++ b/htdocs/adherents/fiche_subscription.php @@ -220,7 +220,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'edit') print '
'.$langs->trans("Label").''.$subscription->note.'
'.$langs->trans("Login").''.$adh->login.' 
'.$langs->trans("LDAPFieldPasswordNotCrypted").''.$adh->pass.'
'.$langs->trans("LDAPFieldPasswordCrypted").''.$adh->pass_crypted.'
'.$langs->trans("State").''; - if ($conf->global->MAIN_INFO_SOCIETE_DEPARTEMENT) print getState($conf->global->MAIN_INFO_SOCIETE_DEPARTEMENT); + if (! empty($conf->global->MAIN_INFO_SOCIETE_DEPARTEMENT)) print getState($conf->global->MAIN_INFO_SOCIETE_DEPARTEMENT); else print ' '; print '
'.$langs->trans('OptionModeTrue').''.nl2br($langs->trans('OptionModeTrueDesc')); // Write info on way to count VAT -if ($conf->global->MAIN_MODULE_COMPTABILITE) +if (! empty($conf->global->MAIN_MODULE_COMPTABILITE)) { // print "
\n"; // print nl2br($langs->trans('OptionModeTrueInfoModuleComptabilite')); diff --git a/htdocs/admin/confexped.php b/htdocs/admin/confexped.php index d6859188a25..ddbbb7ece69 100644 --- a/htdocs/admin/confexped.php +++ b/htdocs/admin/confexped.php @@ -84,14 +84,14 @@ $head[$h][1] = $langs->trans("Setup"); $hselected=$h; $h++; -if ($conf->global->MAIN_SUBMODULE_EXPEDITION) +if (! empty($conf->global->MAIN_SUBMODULE_EXPEDITION)) { $head[$h][0] = DOL_URL_ROOT."/admin/expedition.php"; $head[$h][1] = $langs->trans("Sending"); $h++; } -if ($conf->global->MAIN_SUBMODULE_LIVRAISON) +if (! empty($conf->global->MAIN_SUBMODULE_LIVRAISON)) { $head[$h][0] = DOL_URL_ROOT."/admin/livraison.php"; $head[$h][1] = $langs->trans("Receivings"); diff --git a/htdocs/admin/expedition.php b/htdocs/admin/expedition.php index 43814ccb377..d83a089c20c 100644 --- a/htdocs/admin/expedition.php +++ b/htdocs/admin/expedition.php @@ -206,7 +206,7 @@ $head[$h][1] = $langs->trans("Sending"); $hselected=$h; $h++; -if ($conf->global->MAIN_SUBMODULE_LIVRAISON) +if (! empty($conf->global->MAIN_SUBMODULE_LIVRAISON)) { $head[$h][0] = DOL_URL_ROOT."/admin/livraison.php"; $head[$h][1] = $langs->trans("Receivings"); diff --git a/htdocs/admin/facture.php b/htdocs/admin/facture.php index 3dbcbda8133..402bc7501cb 100644 --- a/htdocs/admin/facture.php +++ b/htdocs/admin/facture.php @@ -628,7 +628,7 @@ $var=!$var; print '
".$langs->trans("SuggestPaymentByRIBOnAccount").""; -if ($conf->banque->enabled) +if (! empty($conf->banque->enabled)) { $sql = "SELECT rowid, label"; $sql.= " FROM ".MAIN_DB_PREFIX."bank_account"; diff --git a/htdocs/admin/ldap.php b/htdocs/admin/ldap.php index ba4b76a7e2a..09b11f2c5cd 100644 --- a/htdocs/admin/ldap.php +++ b/htdocs/admin/ldap.php @@ -124,7 +124,7 @@ if ($conf->global->LDAP_SYNCHRO_ACTIVE && ! $conf->global->LDAP_USER_DN) print '
'.$langs->trans("LDAPDnContactActive").''; @@ -136,7 +136,7 @@ if ($conf->societe->enabled) } // Synchro adherentt active -if ($conf->adherent->enabled) +if (! empty($conf->adherent->enabled)) { $var=!$var; print '
'.$langs->trans("LDAPDnMemberActive").''; @@ -189,7 +189,7 @@ print ''.$langs->trans("LDAPServerExample").'
'.$langs->trans("LDAPServerPort").''; -if ($conf->global->LDAP_SERVER_PORT) +if (! empty($conf->global->LDAP_SERVER_PORT)) { print ''; } @@ -227,7 +227,7 @@ print ''.$langs->trans("LDAPAdminDnExample").'
'.$langs->trans("LDAPPassword").''; -if ($conf->global->LDAP_ADMIN_PASS) +if (! empty($conf->global->LDAP_ADMIN_PASS)) { print '';// je le met en visible pour test } @@ -252,7 +252,7 @@ print ''; */ if (function_exists("ldap_connect")) { - if ($conf->global->LDAP_SERVER_HOST) + if (! empty($conf->global->LDAP_SERVER_HOST)) { print ''.$langs->trans("LDAPTestConnect").'

'; } diff --git a/htdocs/admin/ldap_members.php b/htdocs/admin/ldap_members.php index 83dcb2c50c4..61a1b2fa3a7 100644 --- a/htdocs/admin/ldap_members.php +++ b/htdocs/admin/ldap_members.php @@ -373,7 +373,7 @@ print info_admin($langs->trans("LDAPDescValues")); /* * Test de la connexion */ -if ($conf->global->LDAP_MEMBER_ACTIVE) +if (! empty($conf->global->LDAP_MEMBER_ACTIVE)) { $butlabel=$langs->trans("LDAPTestSynchroMember"); $testlabel='testmember'; diff --git a/htdocs/admin/livraison.php b/htdocs/admin/livraison.php index 9a23e3f968d..8a9c4759568 100644 --- a/htdocs/admin/livraison.php +++ b/htdocs/admin/livraison.php @@ -189,7 +189,7 @@ $head[$h][0] = DOL_URL_ROOT."/admin/confexped.php"; $head[$h][1] = $langs->trans("Setup"); $h++; -if ($conf->global->MAIN_SUBMODULE_EXPEDITION) +if (! empty($conf->global->MAIN_SUBMODULE_EXPEDITION)) { $head[$h][0] = DOL_URL_ROOT."/admin/expedition.php"; $head[$h][1] = $langs->trans("Sending"); diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php index b2341019ead..6d869ba7a78 100644 --- a/htdocs/admin/mails.php +++ b/htdocs/admin/mails.php @@ -627,7 +627,7 @@ else print ''.$langs->trans("DoTestSend").''; - if ($conf->fckeditor->enabled) + if (! empty($conf->fckeditor->enabled)) { print ''.$langs->trans("DoTestSendHTML").''; } diff --git a/htdocs/admin/prelevement.php b/htdocs/admin/prelevement.php index bee489b5454..453acee46fe 100644 --- a/htdocs/admin/prelevement.php +++ b/htdocs/admin/prelevement.php @@ -160,7 +160,7 @@ print '
'; * Notifications */ -if ($conf->global->MAIN_MODULE_NOTIFICATION) +if (! empty($conf->global->MAIN_MODULE_NOTIFICATION)) { $langs->load("mails"); print_titre($langs->trans("Notifications")); diff --git a/htdocs/admin/security.php b/htdocs/admin/security.php index 5d1c218f6a3..4413ab2c51b 100644 --- a/htdocs/admin/security.php +++ b/htdocs/admin/security.php @@ -301,7 +301,7 @@ $var=!$var; print "
'.$langs->trans("DoNotStoreClearPassword").''; -if ($conf->global->DATABASE_PWD_ENCRYPTED) +if (! empty($conf->global->DATABASE_PWD_ENCRYPTED)) { print img_picto($langs->trans("Active"),'tick'); } @@ -312,7 +312,7 @@ if (! $conf->global->DATABASE_PWD_ENCRYPTED) print ''.$langs->trans("Activate").''; print "'; if ($allow_disable_encryption) diff --git a/htdocs/admin/stock.php b/htdocs/admin/stock.php index deb55ee311c..cc604597d17 100644 --- a/htdocs/admin/stock.php +++ b/htdocs/admin/stock.php @@ -133,7 +133,7 @@ print "  
 
'; print ''; -if ($conf->banque->enabled) +if (! empty($conf->banque->enabled)) { $var=!$var; print ''; @@ -126,7 +126,7 @@ if ($conf->banque->enabled) print ''; } -if ($conf->stock->enabled) +if (! empty($conf->stock->enabled)) { $var=!$var; print ''; @@ -135,7 +135,7 @@ if ($conf->stock->enabled) print ''; } -if ($conf->service->enabled) +if (! empty($conf->service->enabled)) { $var=! $var; print ''; print "\n"; -if ($conf->stock->enabled) +if (! empty($conf->stock->enabled)) { $langs->load("stocks"); print ""; diff --git a/htdocs/cashdesk/validation_verif.php b/htdocs/cashdesk/validation_verif.php index fcd8eda6873..bb1df0af089 100644 --- a/htdocs/cashdesk/validation_verif.php +++ b/htdocs/cashdesk/validation_verif.php @@ -161,7 +161,7 @@ switch ($action) $product->fetch($tab_liste[$i]['fk_article']); $ret=array('label'=>$product->label,'tva_tx'=>$product->tva_tx,'price'=>$product->price); - if ($conf->global->PRODUIT_MULTIPRICES) + if (! empty($conf->global->PRODUIT_MULTIPRICES)) { if (isset($product->multiprices[$societe->price_level])) { diff --git a/htdocs/categories/categorie.php b/htdocs/categories/categorie.php index a50a3a53896..a69ded5360d 100644 --- a/htdocs/categories/categorie.php +++ b/htdocs/categories/categorie.php @@ -182,7 +182,7 @@ if ($socid) require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; $langs->load("companies"); - if ($conf->notification->enabled) $langs->load("mails"); + if (! empty($conf->notification->enabled)) $langs->load("mails"); $soc = new Societe($db); $result = $soc->fetch($socid); @@ -363,7 +363,7 @@ else if ($id || $ref) $rowspan=5; if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) $rowspan+=1; - if ($conf->societe->enabled) $rowspan++; + if (! empty($conf->societe->enabled)) $rowspan++; print '
'; -if ($conf->syslog->enabled) +if (! empty($conf->syslog->enabled)) { print ''.$langs->trans("CashDeskThirdPartyFo print ''; print $form->select_company($conf->global->CASHDESK_ID_THIRDPARTY,'socid','s.client in (1,3)',1,1); print '
'.$langs->trans("CashDeskBankAccountForSell").'
'.$langs->trans("CashDeskIdWareHouse").'
'; diff --git a/htdocs/cashdesk/class/Facturation.class.php b/htdocs/cashdesk/class/Facturation.class.php index fb072f27d33..af0b033d81f 100644 --- a/htdocs/cashdesk/class/Facturation.class.php +++ b/htdocs/cashdesk/class/Facturation.class.php @@ -144,7 +144,7 @@ class Facturation $newcartarray[$i]['price']=$product->price; $newcartarray[$i]['price_ttc']=$product->price_ttc; - if ($conf->global->PRODUIT_MULTIPRICES) + if (! empty($conf->global->PRODUIT_MULTIPRICES)) { if (isset($product->multiprices[$societe->price_level])) { diff --git a/htdocs/cashdesk/facturation.php b/htdocs/cashdesk/facturation.php index 3d1f28768bf..89a358808e4 100644 --- a/htdocs/cashdesk/facturation.php +++ b/htdocs/cashdesk/facturation.php @@ -37,7 +37,7 @@ if ( $_GET['filtre'] ) { $sql.= " AND p.tosell = 1"; if(!$conf->global->CASHDESK_SERVICES) $sql.= " AND p.fk_product_type = 0"; $sql.= " AND (p.ref LIKE '%".$_GET['filtre']."%' OR p.label LIKE '%".$_GET['filtre']."%' "; - if ($conf->barcode->enabled) $sql.= " OR p.barcode LIKE '%".$_GET['filtre']."%')"; + if (! empty($conf->barcode->enabled)) $sql.= " OR p.barcode LIKE '%".$_GET['filtre']."%')"; else $sql.= ")"; $sql.= " ORDER BY label"; diff --git a/htdocs/cashdesk/facturation_verif.php b/htdocs/cashdesk/facturation_verif.php index 86be5906cc4..92ed6fc144b 100644 --- a/htdocs/cashdesk/facturation_verif.php +++ b/htdocs/cashdesk/facturation_verif.php @@ -62,7 +62,7 @@ switch ( $_GET['action'] ) } /** add Ditto for MultiPrix*/ - if ($conf->global->PRODUIT_MULTIPRICES) + if (! empty($conf->global->PRODUIT_MULTIPRICES)) { $thirdpartyid = $_SESSION['CASHDESK_ID_THIRDPARTY']; $productid = $ret['rowid']; diff --git a/htdocs/cashdesk/index.php b/htdocs/cashdesk/index.php index 4fe0a225e3f..3dac2d0f57d 100644 --- a/htdocs/cashdesk/index.php +++ b/htdocs/cashdesk/index.php @@ -98,7 +98,7 @@ print $form->select_company(GETPOST('socid','int')?GETPOST('socid','int'):$conf- print '
'; diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index 34adae9b9d0..abf85d69cde 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -147,7 +147,7 @@ class Categorie dol_syslog(get_class($this).'::create sql='.$sql); $sql = "INSERT INTO ".MAIN_DB_PREFIX."categorie (label, description,"; - if ($conf->global->CATEGORY_ASSIGNED_TO_A_CUSTOMER) + if (! empty($conf->global->CATEGORY_ASSIGNED_TO_A_CUSTOMER)) { $sql.= "fk_soc,"; } @@ -157,7 +157,7 @@ class Categorie //$sql.= ", fk_parent_id"; $sql.= ")"; $sql.= " VALUES ('".$this->db->escape($this->label)."', '".$this->db->escape($this->description)."',"; - if ($conf->global->CATEGORY_ASSIGNED_TO_A_CUSTOMER) + if (! empty($conf->global->CATEGORY_ASSIGNED_TO_A_CUSTOMER)) { $sql.= ($this->socid != -1 ? $this->socid : 'null').","; } @@ -269,7 +269,7 @@ class Categorie { $sql .= ", description = '".$this->db->escape($this->description)."'"; } - if ($conf->global->CATEGORY_ASSIGNED_TO_A_CUSTOMER) + if (! empty($conf->global->CATEGORY_ASSIGNED_TO_A_CUSTOMER)) { $sql .= ", fk_soc = ".($this->socid != -1 ? $this->socid : 'null'); } diff --git a/htdocs/comm/action/document.php b/htdocs/comm/action/document.php index bde511d28ff..7fa1a71c5f3 100755 --- a/htdocs/comm/action/document.php +++ b/htdocs/comm/action/document.php @@ -33,7 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; -if ($conf->projet->enabled) require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; +if (! empty($conf->projet->enabled)) require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; $langs->load("companies"); $langs->load("commercial"); @@ -222,7 +222,7 @@ if ($objectid > 0) print ''; // Project - if ($conf->projet->enabled) + if (! empty($conf->projet->enabled)) { print ''; // Project - if ($conf->projet->enabled) + if (! empty($conf->projet->enabled)) { // Projet associe $langs->load("project"); @@ -927,7 +927,7 @@ if ($id) print ''; // Project - if ($conf->projet->enabled) + if (! empty($conf->projet->enabled)) { print '"; // Project - if ($conf->projet->enabled) + if (! empty($conf->projet->enabled)) { $projectid = 0; if ($origin == 'project') $projectid = ($originid?$originid:0); @@ -294,7 +294,7 @@ if ($action == 'create') } print ''; - if ($conf->global->PRODUCT_SHOW_WHEN_CREATE) print ''; + if (! empty($conf->global->PRODUCT_SHOW_WHEN_CREATE)) print ''; print ''; print ''; diff --git a/htdocs/comm/fiche.php b/htdocs/comm/fiche.php index f5b3b5a611b..2b6e08bd406 100644 --- a/htdocs/comm/fiche.php +++ b/htdocs/comm/fiche.php @@ -31,20 +31,20 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; -if ($conf->facture->enabled) require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; -if ($conf->propal->enabled) require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; -if ($conf->commande->enabled) require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; -if ($conf->contrat->enabled) require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; -if ($conf->adherent->enabled) require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; -if ($conf->ficheinter->enabled) require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php'; +if (! empty($conf->facture->enabled)) require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; +if (! empty($conf->propal->enabled)) require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; +if (! empty($conf->commande->enabled)) require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; +if (! empty($conf->contrat->enabled)) require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; +if (! empty($conf->adherent->enabled)) require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; +if (! empty($conf->ficheinter->enabled)) require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php'; $langs->load("companies"); -if ($conf->contrat->enabled) $langs->load("contracts"); -if ($conf->commande->enabled) $langs->load("orders"); -if ($conf->facture->enabled) $langs->load("bills"); -if ($conf->projet->enabled) $langs->load("projects"); -if ($conf->ficheinter->enabled) $langs->load("interventions"); -if ($conf->notification->enabled) $langs->load("mails"); +if (! empty($conf->contrat->enabled)) $langs->load("contracts"); +if (! empty($conf->commande->enabled)) $langs->load("orders"); +if (! empty($conf->facture->enabled)) $langs->load("bills"); +if (! empty($conf->projet->enabled)) $langs->load("projects"); +if (! empty($conf->ficheinter->enabled)) $langs->load("interventions"); +if (! empty($conf->notification->enabled)) $langs->load("mails"); // Security check $id = (GETPOST('socid','int') ? GETPOST('socid','int') : GETPOST('id','int')); @@ -345,7 +345,7 @@ if ($id > 0) print ''; // Multiprice level - if ($conf->global->PRODUIT_MULTIPRICES) + if (! empty($conf->global->PRODUIT_MULTIPRICES)) { print '
'.$langs->trans("Project").''; if ($act->fk_project) diff --git a/htdocs/comm/action/fiche.php b/htdocs/comm/action/fiche.php index 837a995c966..6cdb7a77580 100644 --- a/htdocs/comm/action/fiche.php +++ b/htdocs/comm/action/fiche.php @@ -760,7 +760,7 @@ if ($id) print '
'.$langs->trans("Project").''; if ($act->fk_project) diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index bf0f58e5843..abd61760e75 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -31,7 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/agenda.lib.php'; -if ($conf->projet->enabled) require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; +if (! empty($conf->projet->enabled)) require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; if (! isset($conf->global->AGENDA_MAX_EVENTS_DAY_VIEW)) $conf->global->AGENDA_MAX_EVENTS_DAY_VIEW=3; diff --git a/htdocs/comm/addpropal.php b/htdocs/comm/addpropal.php index 69adcb1bd9e..19272a22e3d 100644 --- a/htdocs/comm/addpropal.php +++ b/htdocs/comm/addpropal.php @@ -212,7 +212,7 @@ if ($action == 'create') print "
 
 
'.$langs->trans("CreateEmptyPropal").'
'; print ''; // Multiprice level - if ($conf->global->PRODUIT_MULTIPRICES) + if (! empty($conf->global->PRODUIT_MULTIPRICES)) { print '
'; @@ -364,7 +364,7 @@ if ($id > 0) include DOL_DOCUMENT_ROOT.'/societe/tpl/linesalesrepresentative.tpl.php'; // Module Adherent - if ($conf->adherent->enabled) + if (! empty($conf->adherent->enabled)) { $langs->load("members"); $langs->load("users"); @@ -750,13 +750,13 @@ if ($id > 0) // Add invoice if ($user->societe_id == 0) { - if ($conf->deplacement->enabled) + if (! empty($conf->deplacement->enabled)) { $langs->load("trips"); print ''.$langs->trans("AddTrip").''; } - if ($conf->facture->enabled) + if (! empty($conf->facture->enabled)) { if ($user->rights->facture->creer) { diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php index 7ba7a2412fb..2bc4da5a112 100644 --- a/htdocs/comm/index.php +++ b/htdocs/comm/index.php @@ -28,8 +28,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/societe/class/client.class.php'; require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/agenda.lib.php'; -if ($conf->contrat->enabled) require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; -if ($conf->propal->enabled) require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; +if (! empty($conf->contrat->enabled)) require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; +if (! empty($conf->propal->enabled)) require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; if (! $user->rights->societe->lire) accessforbidden(); @@ -80,7 +80,7 @@ $now=dol_now(); $form = new Form($db); $formfile = new FormFile($db); $companystatic=new Societe($db); -if ($conf->propal->enabled) $propalstatic=new Propal($db); +if (! empty($conf->propal->enabled)) $propalstatic=new Propal($db); llxHeader(); diff --git a/htdocs/comm/list.php b/htdocs/comm/list.php index f7da122ad49..da457735f9a 100755 --- a/htdocs/comm/list.php +++ b/htdocs/comm/list.php @@ -145,7 +145,7 @@ if ($result) // Filter on categories $moreforfilter=''; - if ($conf->categorie->enabled) + if (! empty($conf->categorie->enabled)) { $moreforfilter.=$langs->trans('Categories'). ': '; $moreforfilter.=$formother->select_categories(2,$search_categ,'search_categ',1); diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index 84a6e6eb5ca..10d126a62dd 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -1231,7 +1231,7 @@ else if ($action == 'validate') } $text=$langs->trans('ConfirmValidateProp',$numref); - if ($conf->notification->enabled) + if (! empty($conf->notification->enabled)) { require_once DOL_DOCUMENT_ROOT .'/core/class/notify.class.php'; $notify=new Notify($db); diff --git a/htdocs/comm/propal/apercu.php b/htdocs/comm/propal/apercu.php index 5b4fc238342..d09ea9802e3 100644 --- a/htdocs/comm/propal/apercu.php +++ b/htdocs/comm/propal/apercu.php @@ -29,7 +29,7 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/propal.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; -if ($conf->projet->enabled) require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; +if (! empty($conf->projet->enabled)) require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; $langs->load('propal'); $langs->load("bills"); diff --git a/htdocs/comm/propal/index.php b/htdocs/comm/propal/index.php index b341e8a9c11..fb6fa29902e 100644 --- a/htdocs/comm/propal/index.php +++ b/htdocs/comm/propal/index.php @@ -151,7 +151,7 @@ else /* * Draft proposals */ -if ($conf->propal->enabled) +if (! empty($conf->propal->enabled)) { $sql = "SELECT c.rowid, c.ref, s.nom as socname, s.rowid as socid, s.canvas, s.client"; $sql.= " FROM ".MAIN_DB_PREFIX."propal as c"; @@ -369,7 +369,7 @@ if (! empty($conf->propal->enabled) && $user->rights->propale->lire) * Proposals to process */ /* -if ($conf->propal->enabled) +if (! empty($conf->propal->enabled)) { $sql = "SELECT c.rowid, c.ref, c.fk_statut, s.nom, s.rowid as socid"; $sql.=" FROM ".MAIN_DB_PREFIX."propal as c"; @@ -441,7 +441,7 @@ if ($conf->propal->enabled) /* * Proposal that are in a shipping process */ -/*if ($conf->propal->enabled) +/*if (! empty($conf->propal->enabled)) { $sql = "SELECT c.rowid, c.ref, c.fk_statut, c.facture, s.nom, s.rowid as socid"; $sql.= " FROM ".MAIN_DB_PREFIX."commande as c"; diff --git a/htdocs/comm/prospect/fiche.php b/htdocs/comm/prospect/fiche.php index 3a16307a760..0abde58fc86 100644 --- a/htdocs/comm/prospect/fiche.php +++ b/htdocs/comm/prospect/fiche.php @@ -29,8 +29,8 @@ require_once DOL_DOCUMENT_ROOT.'/comm/prospect/class/prospect.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; -if ($conf->adherent->enabled) require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; -if ($conf->propal->enabled) require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; +if (! empty($conf->adherent->enabled)) require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; +if (! empty($conf->propal->enabled)) require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; $langs->load('companies'); $langs->load('projects'); @@ -152,7 +152,7 @@ if ($socid > 0) print '
'; print '
'; @@ -181,7 +181,7 @@ if ($socid > 0) include DOL_DOCUMENT_ROOT.'/societe/tpl/linesalesrepresentative.tpl.php'; // Module Adherent - if ($conf->adherent->enabled) + if (! empty($conf->adherent->enabled)) { $langs->load("members"); $langs->load("users"); diff --git a/htdocs/comm/prospect/index.php b/htdocs/comm/prospect/index.php index 3280c456e4f..f72cae173d3 100644 --- a/htdocs/comm/prospect/index.php +++ b/htdocs/comm/prospect/index.php @@ -50,7 +50,7 @@ print ''; print '
'; -if ($conf->propal->enabled) +if (! empty($conf->propal->enabled)) { $var=false; print ''; @@ -164,7 +164,7 @@ if ($conf->propal->enabled && $user->rights->propale->lire) */ print ''; // Delivery address - if ($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) + if (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT)) { print ''; } - if ($conf->projet->enabled) + if (! empty($conf->projet->enabled)) { print ''; print 'global->DISPLAY_MARGIN_RATES) + if (! empty($conf->global->DISPLAY_MARGIN_RATES)) $colspan++; - if($conf->global->DISPLAY_MARK_RATES) + if (! empty($conf->global->DISPLAY_MARK_RATES)) $colspan++; } ?> @@ -89,9 +89,9 @@ if (! empty($conf->margin->enabled)) { ?> global->DISPLAY_MARGIN_RATES) + if (! empty($conf->global->DISPLAY_MARGIN_RATES)) $colspan++; - if($conf->global->DISPLAY_MARK_RATES) + if (! empty($conf->global->DISPLAY_MARK_RATES)) $colspan++; } ?> @@ -105,9 +105,9 @@ if(! empty($conf->global->MAIN_VIEW_LINE_NUMBER)) else $colspan = 9; if (! empty($conf->margin->enabled)) { - if($conf->global->DISPLAY_MARGIN_RATES) + if (! empty($conf->global->DISPLAY_MARGIN_RATES)) $colspan++; - if($conf->global->DISPLAY_MARK_RATES) + if (! empty($conf->global->DISPLAY_MARK_RATES)) $colspan++; } ?> diff --git a/htdocs/core/tpl/objectline_add.tpl.php b/htdocs/core/tpl/objectline_add.tpl.php index 4fa3a8274df..b9ec775b592 100644 --- a/htdocs/core/tpl/objectline_add.tpl.php +++ b/htdocs/core/tpl/objectline_add.tpl.php @@ -168,9 +168,9 @@ if (! empty($conf->margin->enabled)) { global->DISPLAY_MARGIN_RATES) + if (! empty($conf->global->DISPLAY_MARGIN_RATES)) $colspan++; - if($conf->global->DISPLAY_MARK_RATES) + if (! empty($conf->global->DISPLAY_MARK_RATES)) $colspan++; } ?> @@ -184,9 +184,9 @@ if (! empty($conf->global->MAIN_VIEW_LINE_NUMBER)) else $colspan = 11; if (! empty($conf->margin->enabled)) { - if ($conf->global->DISPLAY_MARGIN_RATES) + if (! empty($conf->global->DISPLAY_MARGIN_RATES)) $colspan++; - if($conf->global->DISPLAY_MARK_RATES) + if (! empty($conf->global->DISPLAY_MARK_RATES)) $colspan++; } ?> diff --git a/htdocs/core/tpl/objectline_view.tpl.php b/htdocs/core/tpl/objectline_view.tpl.php index 3b0251ea91d..cc90227dcba 100644 --- a/htdocs/core/tpl/objectline_view.tpl.php +++ b/htdocs/core/tpl/objectline_view.tpl.php @@ -115,11 +115,11 @@ if (! empty($conf->margin->enabled)) { ?> - global->DISPLAY_MARGIN_RATES) {?> + global->DISPLAY_MARGIN_RATES)) {?> global->DISPLAY_MARK_RATES) {?> + if (! empty($conf->global->DISPLAY_MARK_RATES)) {?> diff --git a/htdocs/core/tpl/predefinedproductline_create.tpl.php b/htdocs/core/tpl/predefinedproductline_create.tpl.php index f0c11c07f87..5eafe1d4b27 100644 --- a/htdocs/core/tpl/predefinedproductline_create.tpl.php +++ b/htdocs/core/tpl/predefinedproductline_create.tpl.php @@ -32,7 +32,7 @@ global->MAIN_VIEW_LINE_NUMBER) ? ' colspan="4"' : ' colspan="3"'); ?>> trans("AddNewLine").' - '; - if ($conf->service->enabled) + if (! empty($conf->service->enabled)) echo $langs->trans('RecordedProductsAndServices'); else echo $langs->trans('RecordedProducts'); @@ -46,9 +46,9 @@ if (! empty($conf->margin->enabled)) { ?> global->DISPLAY_MARGIN_RATES) + if (! empty($conf->global->DISPLAY_MARGIN_RATES)) $colspan++; - if($conf->global->DISPLAY_MARK_RATES) + if (! empty($conf->global->DISPLAY_MARK_RATES)) $colspan++; } ?> @@ -100,9 +100,9 @@ if (! empty($conf->margin->enabled)) { "> global->DISPLAY_MARGIN_RATES) + if (! empty($conf->global->DISPLAY_MARGIN_RATES)) $colspan++; - if($conf->global->DISPLAY_MARK_RATES) + if (! empty($conf->global->DISPLAY_MARK_RATES)) $colspan++; } ?> @@ -115,9 +115,9 @@ if (! empty($conf->global->MAIN_VIEW_LINE_NUMBER)) else $colspan = 9; if (! empty($conf->margin->enabled)) { - if($conf->global->DISPLAY_MARGIN_RATES) + if (! empty($conf->global->DISPLAY_MARGIN_RATES)) $colspan++; - if($conf->global->DISPLAY_MARK_RATES) + if (! empty($conf->global->DISPLAY_MARK_RATES)) $colspan++; } ?> diff --git a/htdocs/core/triggers/interface_50_modLdap_Ldapsynchro.class.php b/htdocs/core/triggers/interface_50_modLdap_Ldapsynchro.class.php index 2f674860440..b9e18d3533e 100755 --- a/htdocs/core/triggers/interface_50_modLdap_Ldapsynchro.class.php +++ b/htdocs/core/triggers/interface_50_modLdap_Ldapsynchro.class.php @@ -457,7 +457,7 @@ class InterfaceLdapsynchro if ($conf->ldap->enabled && $conf->global->LDAP_MEMBER_ACTIVE) { // If status field is setup to be synchronized - if ($conf->global->LDAP_FIELD_MEMBER_STATUS) + if (! empty($conf->global->LDAP_FIELD_MEMBER_STATUS)) { $ldap=new Ldap(); $ldap->connect_bind(); @@ -564,7 +564,7 @@ class InterfaceLdapsynchro if ($conf->ldap->enabled && $conf->global->LDAP_MEMBER_ACTIVE) { // If status field is setup to be synchronized - if ($conf->global->LDAP_FIELD_MEMBER_STATUS) + if (! empty($conf->global->LDAP_FIELD_MEMBER_STATUS)) { $ldap=new Ldap(); $ldap->connect_bind(); diff --git a/htdocs/document.php b/htdocs/document.php index 22240663b19..030efe333dc 100644 --- a/htdocs/document.php +++ b/htdocs/document.php @@ -271,8 +271,8 @@ if ($modulepart) { $accessallowed=1; } - if ($conf->product->enabled) $original_file=$conf->product->multidir_output[$entity].'/'.$original_file; - elseif ($conf->service->enabled) $original_file=$conf->service->multidir_output[$entity].'/'.$original_file; + if (! empty($conf->product->enabled)) $original_file=$conf->product->multidir_output[$entity].'/'.$original_file; + elseif (! empty($conf->service->enabled)) $original_file=$conf->service->multidir_output[$entity].'/'.$original_file; } // Wrapping pour les contrats diff --git a/htdocs/ecm/index.php b/htdocs/ecm/index.php index c15fc75023c..42f1535dfde 100644 --- a/htdocs/ecm/index.php +++ b/htdocs/ecm/index.php @@ -381,14 +381,14 @@ llxHeader($moreheadcss.$moreheadjs,$langs->trans("ECMArea"),'','','','',$morejs, $rowspan=0; $sectionauto=array(); if ($conf->product->enabled || $conf->service->enabled) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'product', 'test'=>($conf->product->enabled || $conf->service->enabled), 'label'=>$langs->trans("ProductsAndServices"), 'desc'=>$langs->trans("ECMDocsByProducts")); } -if ($conf->societe->enabled) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'company', 'test'=>$conf->societe->enabled, 'label'=>$langs->trans("ThirdParties"), 'desc'=>$langs->trans("ECMDocsByThirdParties")); } -if ($conf->propal->enabled) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'propal', 'test'=>$conf->propal->enabled, 'label'=>$langs->trans("Prop"), 'desc'=>$langs->trans("ECMDocsByProposals")); } -if ($conf->contrat->enabled) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'contract','test'=>$conf->contrat->enabled, 'label'=>$langs->trans("Contracts"), 'desc'=>$langs->trans("ECMDocsByContracts")); } -if ($conf->commande->enabled) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'order', 'test'=>$conf->commande->enabled,'label'=>$langs->trans("CustomersOrders"), 'desc'=>$langs->trans("ECMDocsByOrders")); } -if ($conf->facture->enabled) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'invoice', 'test'=>$conf->facture->enabled, 'label'=>$langs->trans("CustomersInvoices"), 'desc'=>$langs->trans("ECMDocsByInvoices")); } -if ($conf->fournisseur->enabled) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'order_supplier', 'test'=>$conf->fournisseur->enabled, 'label'=>$langs->trans("SuppliersOrders"), 'desc'=>$langs->trans("ECMDocsByOrders")); } -if ($conf->fournisseur->enabled) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'invoice_supplier', 'test'=>$conf->fournisseur->enabled, 'label'=>$langs->trans("SuppliersInvoices"), 'desc'=>$langs->trans("ECMDocsByInvoices")); } -if ($conf->tax->enabled) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'tax', 'test'=>$conf->tax->enabled, 'label'=>$langs->trans("SocialContributions"), 'desc'=>$langs->trans("ECMDocsBySocialContributions")); } +if (! empty($conf->societe->enabled)) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'company', 'test'=>$conf->societe->enabled, 'label'=>$langs->trans("ThirdParties"), 'desc'=>$langs->trans("ECMDocsByThirdParties")); } +if (! empty($conf->propal->enabled)) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'propal', 'test'=>$conf->propal->enabled, 'label'=>$langs->trans("Prop"), 'desc'=>$langs->trans("ECMDocsByProposals")); } +if (! empty($conf->contrat->enabled)) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'contract','test'=>$conf->contrat->enabled, 'label'=>$langs->trans("Contracts"), 'desc'=>$langs->trans("ECMDocsByContracts")); } +if (! empty($conf->commande->enabled)) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'order', 'test'=>$conf->commande->enabled,'label'=>$langs->trans("CustomersOrders"), 'desc'=>$langs->trans("ECMDocsByOrders")); } +if (! empty($conf->facture->enabled)) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'invoice', 'test'=>$conf->facture->enabled, 'label'=>$langs->trans("CustomersInvoices"), 'desc'=>$langs->trans("ECMDocsByInvoices")); } +if (! empty($conf->fournisseur->enabled)) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'order_supplier', 'test'=>$conf->fournisseur->enabled, 'label'=>$langs->trans("SuppliersOrders"), 'desc'=>$langs->trans("ECMDocsByOrders")); } +if (! empty($conf->fournisseur->enabled)) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'invoice_supplier', 'test'=>$conf->fournisseur->enabled, 'label'=>$langs->trans("SuppliersInvoices"), 'desc'=>$langs->trans("ECMDocsByInvoices")); } +if (! empty($conf->tax->enabled)) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'tax', 'test'=>$conf->tax->enabled, 'label'=>$langs->trans("SocialContributions"), 'desc'=>$langs->trans("ECMDocsBySocialContributions")); } print_fiche_titre($langs->trans("ECMArea").' - '.$langs->trans("ECMFileManager")); diff --git a/htdocs/ecm/search.php b/htdocs/ecm/search.php index 8870d50c639..b3081991290 100644 --- a/htdocs/ecm/search.php +++ b/htdocs/ecm/search.php @@ -104,13 +104,13 @@ $userstatic = new User($db); $rowspan=0; $sectionauto=array(); if ($conf->product->enabled || $conf->service->enabled) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'product', 'test'=>$conf->product->enabled, 'label'=>$langs->trans("ProductsAndServices"), 'desc'=>$langs->trans("ECMDocsByProducts")); } -if ($conf->societe->enabled) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'company', 'test'=>$conf->societe->enabled, 'label'=>$langs->trans("ThirdParties"), 'desc'=>$langs->trans("ECMDocsByThirdParties")); } -if ($conf->propal->enabled) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'propal', 'test'=>$conf->propal->enabled, 'label'=>$langs->trans("Prop"), 'desc'=>$langs->trans("ECMDocsByProposals")); } -if ($conf->contrat->enabled) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'contract','test'=>$conf->contrat->enabled, 'label'=>$langs->trans("Contracts"), 'desc'=>$langs->trans("ECMDocsByContracts")); } -if ($conf->commande->enabled) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'order', 'test'=>$conf->commande->enabled,'label'=>$langs->trans("CustomersOrders"), 'desc'=>$langs->trans("ECMDocsByOrders")); } -if ($conf->fournisseur->enabled) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'order_supplier', 'test'=>$conf->fournisseur->enabled, 'label'=>$langs->trans("SuppliersInvoices"), 'desc'=>$langs->trans("ECMDocsByOrders")); } -if ($conf->facture->enabled) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'invoice', 'test'=>$conf->facture->enabled, 'label'=>$langs->trans("CustomersInvoices"), 'desc'=>$langs->trans("ECMDocsByInvoices")); } -if ($conf->fournisseur->enabled) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'invoice_supplier', 'test'=>$conf->fournisseur->enabled, 'label'=>$langs->trans("SuppliersOrders"), 'desc'=>$langs->trans("ECMDocsByOrders")); } +if (! empty($conf->societe->enabled)) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'company', 'test'=>$conf->societe->enabled, 'label'=>$langs->trans("ThirdParties"), 'desc'=>$langs->trans("ECMDocsByThirdParties")); } +if (! empty($conf->propal->enabled)) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'propal', 'test'=>$conf->propal->enabled, 'label'=>$langs->trans("Prop"), 'desc'=>$langs->trans("ECMDocsByProposals")); } +if (! empty($conf->contrat->enabled)) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'contract','test'=>$conf->contrat->enabled, 'label'=>$langs->trans("Contracts"), 'desc'=>$langs->trans("ECMDocsByContracts")); } +if (! empty($conf->commande->enabled)) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'order', 'test'=>$conf->commande->enabled,'label'=>$langs->trans("CustomersOrders"), 'desc'=>$langs->trans("ECMDocsByOrders")); } +if (! empty($conf->fournisseur->enabled)) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'order_supplier', 'test'=>$conf->fournisseur->enabled, 'label'=>$langs->trans("SuppliersInvoices"), 'desc'=>$langs->trans("ECMDocsByOrders")); } +if (! empty($conf->facture->enabled)) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'invoice', 'test'=>$conf->facture->enabled, 'label'=>$langs->trans("CustomersInvoices"), 'desc'=>$langs->trans("ECMDocsByInvoices")); } +if (! empty($conf->fournisseur->enabled)) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'invoice_supplier', 'test'=>$conf->fournisseur->enabled, 'label'=>$langs->trans("SuppliersOrders"), 'desc'=>$langs->trans("ECMDocsByOrders")); } //*********************** diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index be5978f5a33..06109252a25 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -26,8 +26,8 @@ */ require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; -if ($conf->propal->enabled) require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; -if ($conf->commande->enabled) require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; +if (! empty($conf->propal->enabled)) require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; +if (! empty($conf->commande->enabled)) require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; /** diff --git a/htdocs/expedition/contact.php b/htdocs/expedition/contact.php index a4977cf9861..340e3d6dfd7 100644 --- a/htdocs/expedition/contact.php +++ b/htdocs/expedition/contact.php @@ -213,7 +213,7 @@ if ($id > 0 || ! empty($ref)) print ''; // Delivery address - if ($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) + if (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT)) { print ''; - if ($conf->categorie->enabled) + if (! empty($conf->categorie->enabled)) { print ''; print ''; diff --git a/htdocs/product/document.php b/htdocs/product/document.php index 7ee96daf980..d04923bce54 100755 --- a/htdocs/product/document.php +++ b/htdocs/product/document.php @@ -63,8 +63,8 @@ if ($id > 0 || ! empty($ref)) { $result = $object->fetch($id, $ref); - if ($conf->product->enabled) $upload_dir = $conf->product->multidir_output[$object->entity].'/'.dol_sanitizeFileName($object->ref); - elseif ($conf->service->enabled) $upload_dir = $conf->service->multidir_output[$object->entity].'/'.dol_sanitizeFileName($object->ref); + if (! empty($conf->product->enabled)) $upload_dir = $conf->product->multidir_output[$object->entity].'/'.dol_sanitizeFileName($object->ref); + elseif (! empty($conf->service->enabled)) $upload_dir = $conf->service->multidir_output[$object->entity].'/'.dol_sanitizeFileName($object->ref); } $modulepart='produit'; diff --git a/htdocs/product/fiche.php b/htdocs/product/fiche.php index 5e7ee4a4207..d0cbdc2180f 100644 --- a/htdocs/product/fiche.php +++ b/htdocs/product/fiche.php @@ -842,7 +842,7 @@ else print '
'; - if ($conf->global->PRODUIT_MULTIPRICES) + if (! empty($conf->global->PRODUIT_MULTIPRICES)) { // We do no show price array on create when multiprices enabled. // We must set them on prices tab. diff --git a/htdocs/product/index.php b/htdocs/product/index.php index 1e873ef9d9a..59333c02927 100644 --- a/htdocs/product/index.php +++ b/htdocs/product/index.php @@ -117,7 +117,7 @@ while ($objp = $db->fetch_object($result)) print '
'; -if ($conf->agenda->enabled) show_array_actions_to_do(10); +if (! empty($conf->agenda->enabled)) show_array_actions_to_do(10); /* * Dernieres propales ouvertes diff --git a/htdocs/comm/prospect/list.php b/htdocs/comm/prospect/list.php index d24ac0c2e47..caac721333c 100755 --- a/htdocs/comm/prospect/list.php +++ b/htdocs/comm/prospect/list.php @@ -261,7 +261,7 @@ if ($resql) // Filter on categories $moreforfilter=''; - if ($conf->categorie->enabled) + if (! empty($conf->categorie->enabled)) { $moreforfilter.=$langs->trans('Categories'). ': '; $moreforfilter.=$formother->select_categories(2,$search_categ,'search_categ',1); diff --git a/htdocs/comm/prospect/recap-prospect.php b/htdocs/comm/prospect/recap-prospect.php index 3640cee6279..02c6b2508e3 100644 --- a/htdocs/comm/prospect/recap-prospect.php +++ b/htdocs/comm/prospect/recap-prospect.php @@ -28,7 +28,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; $langs->load("companies"); $langs->load('other'); -if ($conf->facture->enabled) $langs->load("bills"); +if (! empty($conf->facture->enabled)) $langs->load("bills"); // Security check $socid = $_GET["socid"]; diff --git a/htdocs/comm/recap-client.php b/htdocs/comm/recap-client.php index fe240ac2266..8b1d4c8aef1 100644 --- a/htdocs/comm/recap-client.php +++ b/htdocs/comm/recap-client.php @@ -27,7 +27,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; $langs->load("companies"); -if ($conf->facture->enabled) $langs->load("bills"); +if (! empty($conf->facture->enabled)) $langs->load("bills"); // Security check $socid = $_GET["socid"]; diff --git a/htdocs/commande/apercu.php b/htdocs/commande/apercu.php index 83822aa2407..87d84d297d3 100644 --- a/htdocs/commande/apercu.php +++ b/htdocs/commande/apercu.php @@ -29,8 +29,8 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/order.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; -if ($conf->propal->enabled) require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; -if ($conf->projet->enabled) require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; +if (! empty($conf->propal->enabled)) require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; +if (! empty($conf->projet->enabled)) require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; $langs->load('orders'); $langs->load('propal'); diff --git a/htdocs/commande/contact.php b/htdocs/commande/contact.php index 0caf1c80d63..d190a550834 100644 --- a/htdocs/commande/contact.php +++ b/htdocs/commande/contact.php @@ -178,7 +178,7 @@ if ($id > 0 || ! empty($ref)) print ''.$object->client->getNomUrl(1).'
'; print ''; // Project - if ($conf->projet->enabled) + if (! empty($conf->projet->enabled)) { $langs->load('projects'); print ''; // Accountancy code - if ($conf->global->MAIN_BANK_ACCOUNTANCY_CODE_ALWAYS_REQUIRED) + if (! empty($conf->global->MAIN_BANK_ACCOUNTANCY_CODE_ALWAYS_REQUIRED)) { print ''; print ''; @@ -563,7 +563,7 @@ else print ''; // Accountancy code - if ($conf->global->MAIN_BANK_ACCOUNTANCY_CODE_ALWAYS_REQUIRED) + if (! empty($conf->global->MAIN_BANK_ACCOUNTANCY_CODE_ALWAYS_REQUIRED)) { print ''; print ''; diff --git a/htdocs/compta/bank/ligne.php b/htdocs/compta/bank/ligne.php index 584afaa321f..18227bf825d 100644 --- a/htdocs/compta/bank/ligne.php +++ b/htdocs/compta/bank/ligne.php @@ -32,7 +32,7 @@ $langs->load("banks"); $langs->load("compta"); $langs->load("bills"); $langs->load("categories"); -if ($conf->adherent->enabled) $langs->load("members"); +if (! empty($conf->adherent->enabled)) $langs->load("members"); $id = (GETPOST('id','int') ? GETPOST('id','int') : GETPOST('account','int')); diff --git a/htdocs/compta/deplacement/fiche.php b/htdocs/compta/deplacement/fiche.php index df453887ea1..754764fa32c 100644 --- a/htdocs/compta/deplacement/fiche.php +++ b/htdocs/compta/deplacement/fiche.php @@ -27,7 +27,7 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/trip.lib.php'; require_once DOL_DOCUMENT_ROOT.'/compta/deplacement/class/deplacement.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; -if ($conf->projet->enabled) +if (! empty($conf->projet->enabled)) { require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; @@ -489,7 +489,7 @@ else if ($id) print ''; // Project - if ($conf->projet->enabled) + if (! empty($conf->projet->enabled)) { $langs->load('projects'); print ''; diff --git a/htdocs/compta/dons/fiche.php b/htdocs/compta/dons/fiche.php index fb6c8de4f5a..e6ec1a422ae 100644 --- a/htdocs/compta/dons/fiche.php +++ b/htdocs/compta/dons/fiche.php @@ -29,7 +29,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/dons/class/don.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; -if ($conf->projet->enabled) require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; +if (! empty($conf->projet->enabled)) require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; $langs->load("companies"); $langs->load("donations"); @@ -280,7 +280,7 @@ if ($action == 'create') print ''; $nbrows=11; - if ($conf->projet->enabled) $nbrows++; + if (! empty($conf->projet->enabled)) $nbrows++; // Date print '\n"; - if ($conf->projet->enabled) + if (! empty($conf->projet->enabled)) { // Si module projet actif print "'; $nbrows=12; - if ($conf->projet->enabled) $nbrows++; + if (! empty($conf->projet->enabled)) $nbrows++; // Date print "".'".'".''; // Project - if ($conf->projet->enabled) + if (! empty($conf->projet->enabled)) { print "".''; } diff --git a/htdocs/compta/dons/liste.php b/htdocs/compta/dons/liste.php index ced00f94c50..3a3a8d7a180 100644 --- a/htdocs/compta/dons/liste.php +++ b/htdocs/compta/dons/liste.php @@ -53,7 +53,7 @@ if (!$user->rights->don->lire) accessforbidden(); * View */ -if ($conf->projet->enabled) $projectstatic=new Project($db); +if (! empty($conf->projet->enabled)) $projectstatic=new Project($db); llxHeader('',$langs->trans("Donations"),'EN:Module_Donations|FR:Module_Dons|ES:Módulo_Donaciones'); @@ -160,7 +160,7 @@ if ($resql) print "\n"; print "\n"; print ''; - if ($conf->projet->enabled) + if (! empty($conf->projet->enabled)) { print "'."\n"; // Proforma - if ($conf->global->FACTURE_USE_PROFORMAT) + if (! empty($conf->global->FACTURE_USE_PROFORMAT)) { print ''; // Project - if ($conf->projet->enabled) + if (! empty($conf->projet->enabled)) { $langs->load('projects'); print ''; print ''; print ''; - if ($conf->service->enabled) + if (! empty($conf->service->enabled)) { print ''; } @@ -2090,7 +2090,7 @@ if ($action == 'create') print ''; print ''; print ''; // Si le module service est actif, on propose des dates de debut et fin a la ligne - if ($conf->service->enabled) + if (! empty($conf->service->enabled)) { print ''; - if ($conf->banque->enabled) + if (! empty($conf->banque->enabled)) { print ''; - if ($conf->banque->enabled) + if (! empty($conf->banque->enabled)) { if ($vatpayment->fk_account > 0) { diff --git a/htdocs/compta/paiement.php b/htdocs/compta/paiement.php index 974b266354c..fbf44961722 100644 --- a/htdocs/compta/paiement.php +++ b/htdocs/compta/paiement.php @@ -97,7 +97,7 @@ if ($action == 'add_paiement' || ($action == 'confirm_paiement' && $confirm=='ye $error++; } - if ($conf->banque->enabled) + if (! empty($conf->banque->enabled)) { // Si module bank actif, un compte est obligatoire lors de la saisie // d'un paiement @@ -385,7 +385,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie // Bank account print ''; - if ($conf->banque->enabled) + if (! empty($conf->banque->enabled)) { if ($facture->type != 2) print ''; if ($facture->type == 2) print ''; @@ -589,10 +589,10 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie { // print ''; diff --git a/htdocs/compta/paiement/class/paiement.class.php b/htdocs/compta/paiement/class/paiement.class.php index 74d891a7764..3d23f896c0e 100644 --- a/htdocs/compta/paiement/class/paiement.class.php +++ b/htdocs/compta/paiement/class/paiement.class.php @@ -192,7 +192,7 @@ class Paiement extends CommonObject // This payment might be this one or a previous one if ($paym['type']=='PRE') { - if ($conf->prelevement->enabled) + if (! empty($conf->prelevement->enabled)) { // TODO Check if this payment has a withdraw request // if not, $mustwait++; // This will disable automatic close on invoice to allow to process @@ -377,7 +377,7 @@ class Paiement extends CommonObject $bank_line_id=0; $this->fk_account=$accountid; - if ($conf->banque->enabled) + if (! empty($conf->banque->enabled)) { require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; diff --git a/htdocs/compta/paiement/fiche.php b/htdocs/compta/paiement/fiche.php index acd041cc5c3..96b13604708 100644 --- a/htdocs/compta/paiement/fiche.php +++ b/htdocs/compta/paiement/fiche.php @@ -29,7 +29,7 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT .'/core/modules/facture/modules_facture.php'; -if ($conf->banque->enabled) require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; +if (! empty($conf->banque->enabled)) require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; $langs->load('bills'); $langs->load('banks'); @@ -238,7 +238,7 @@ print $form->editfieldval("Note",'note',$object->note,$object,$user->rights->fac print ''; // Bank account -if ($conf->banque->enabled) +if (! empty($conf->banque->enabled)) { if ($object->bank_account) { @@ -355,7 +355,7 @@ print ''; print '
'; -if ($conf->global->BILL_ADD_PAYMENT_VALIDATION) +if (! empty($conf->global->BILL_ADD_PAYMENT_VALIDATION)) { if ($user->societe_id == 0 && $object->statut == 0 && $_GET['action'] == '') { diff --git a/htdocs/compta/paiement/liste.php b/htdocs/compta/paiement/liste.php index 714d8a20d59..e1d460e0051 100644 --- a/htdocs/compta/paiement/liste.php +++ b/htdocs/compta/paiement/liste.php @@ -143,7 +143,7 @@ if ($resql) print_liste_field_titre($langs->trans("Account"),$_SERVER["PHP_SELF"],"ba.label","",$paramlist,"",$sortfield,$sortorder); print_liste_field_titre($langs->trans("Amount"),$_SERVER["PHP_SELF"],"p.amount","",$paramlist,'align="right"',$sortfield,$sortorder); //print_liste_field_titre($langs->trans("Invoices"),"","","",$paramlist,'align="left"',$sortfield,$sortorder); - if ($conf->global->BILL_ADD_PAYMENT_VALIDATION) + if (! empty($conf->global->BILL_ADD_PAYMENT_VALIDATION)) { print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"p.statut","",$paramlist,'align="right"',$sortfield,$sortorder); } @@ -168,7 +168,7 @@ if ($resql) print ''; print ''; print ''; - if ($conf->global->BILL_ADD_PAYMENT_VALIDATION) + if (! empty($conf->global->BILL_ADD_PAYMENT_VALIDATION)) { print '
'; @@ -213,7 +213,7 @@ if ($resql) print ''; print ''; - if ($conf->global->BILL_ADD_PAYMENT_VALIDATION) + if (! empty($conf->global->BILL_ADD_PAYMENT_VALIDATION)) { print ''; // Bank account -if ($conf->banque->enabled) +if (! empty($conf->banque->enabled)) { if ($paiement->bank_account) { @@ -293,7 +293,7 @@ print ''; print '
'; /* -if ($conf->global->BILL_ADD_PAYMENT_VALIDATION) +if (! empty($conf->global->BILL_ADD_PAYMENT_VALIDATION)) { if ($user->societe_id == 0 && $paiement->statut == 0 && $_GET['action'] == '') { diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index 0081af46ecf..11c575f701d 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -1185,7 +1185,7 @@ class BonPrelevement extends CommonObject if ($mysoc->country_code=='ES') { // TODO replace by a hook (external modules) - if ($conf->esaeb->enabled) + if (! empty($conf->esaeb->enabled)) { //Head $esaeb19 = new AEB19DocWritter; diff --git a/htdocs/compta/recap-compta.php b/htdocs/compta/recap-compta.php index c458f55813d..8a2e3228e37 100644 --- a/htdocs/compta/recap-compta.php +++ b/htdocs/compta/recap-compta.php @@ -27,7 +27,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; $langs->load("companies"); -if ($conf->facture->enabled) $langs->load("bills"); +if (! empty($conf->facture->enabled)) $langs->load("bills"); // Security check $socid = $_GET["socid"]; diff --git a/htdocs/compta/sociales/class/paymentsocialcontribution.class.php b/htdocs/compta/sociales/class/paymentsocialcontribution.class.php index 7bff88b37a4..cfbf7a91568 100644 --- a/htdocs/compta/sociales/class/paymentsocialcontribution.class.php +++ b/htdocs/compta/sociales/class/paymentsocialcontribution.class.php @@ -472,7 +472,7 @@ class PaymentSocialContribution extends CommonObject $error=0; - if ($conf->banque->enabled) + if (! empty($conf->banque->enabled)) { require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; diff --git a/htdocs/compta/tva/class/tva.class.php b/htdocs/compta/tva/class/tva.class.php index 23d01de6631..d7d14938a6f 100644 --- a/htdocs/compta/tva/class/tva.class.php +++ b/htdocs/compta/tva/class/tva.class.php @@ -525,7 +525,7 @@ class Tva extends CommonObject if ($this->id > 0) { $ok=1; - if ($conf->banque->enabled) + if (! empty($conf->banque->enabled)) { // Insertion dans llx_bank require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; diff --git a/htdocs/compta/tva/clients.php b/htdocs/compta/tva/clients.php index 71dbdb6c947..68bfe41d968 100644 --- a/htdocs/compta/tva/clients.php +++ b/htdocs/compta/tva/clients.php @@ -117,7 +117,7 @@ if ($modetax==1) // Calculate on invoice for goods and services $description.='
'; $description.=$langs->trans("RulesVATDueProducts"); //if ($conf->global->MAIN_MODULE_COMPTABILITE || $conf->global->MAIN_MODULE_ACCOUNTING) $description.='
'.img_warning().' '.$langs->trans('OptionVatInfoModuleComptabilite'); - //if ($conf->global->MAIN_MODULE_COMPTABILITE) $description.='
'.$langs->trans("WarningDepositsNotIncluded"); + //if (! empty($conf->global->MAIN_MODULE_COMPTABILITE)) $description.='
'.$langs->trans("WarningDepositsNotIncluded"); if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $description.='
'.$langs->trans("DepositsAreNotIncluded"); else $description.='
'.$langs->trans("DepositsAreIncluded"); $description.=$fsearch; @@ -147,7 +147,7 @@ if ($modetax==0) // Invoice for goods, payment for services if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $description.=' '.$langs->trans("DepositsAreNotIncluded"); else $description.=' '.$langs->trans("DepositsAreIncluded"); //if ($conf->global->MAIN_MODULE_COMPTABILITE || $conf->global->MAIN_MODULE_ACCOUNTING) $description.='
'.img_warning().' '.$langs->trans('OptionVatInfoModuleComptabilite'); - //if ($conf->global->MAIN_MODULE_COMPTABILITE) $description.='
'.$langs->trans("WarningDepositsNotIncluded"); + //if (! empty($conf->global->MAIN_MODULE_COMPTABILITE)) $description.='
'.$langs->trans("WarningDepositsNotIncluded"); $description.=$fsearch; $description.='
('.$langs->trans("TaxModuleSetupToModifyRules",DOL_URL_ROOT.'/admin/taxes.php').')'; $builddate=time(); diff --git a/htdocs/compta/tva/fiche.php b/htdocs/compta/tva/fiche.php index a5e1693c8f2..765b0d77fb8 100644 --- a/htdocs/compta/tva/fiche.php +++ b/htdocs/compta/tva/fiche.php @@ -172,7 +172,7 @@ if ($_GET["action"] == 'create') // Amount print '
'; - if ($conf->banque->enabled) + if (! empty($conf->banque->enabled)) { print ''; - if ($conf->banque->enabled) + if (! empty($conf->banque->enabled)) { if ($vatpayment->fk_account > 0) { diff --git a/htdocs/compta/tva/quadri_detail.php b/htdocs/compta/tva/quadri_detail.php index 1bcd7cabb47..e323117091d 100644 --- a/htdocs/compta/tva/quadri_detail.php +++ b/htdocs/compta/tva/quadri_detail.php @@ -137,7 +137,7 @@ if ($modetax==1) // Calculate on invoice for goods and services $description.='
'; $description.=$langs->trans("RulesVATDueProducts"); //if ($conf->global->MAIN_MODULE_COMPTABILITE || $conf->global->MAIN_MODULE_ACCOUNTING) $description.='
'.img_warning().' '.$langs->trans('OptionVatInfoModuleComptabilite'); - //if ($conf->global->MAIN_MODULE_COMPTABILITE) $description.='
'.$langs->trans("WarningDepositsNotIncluded"); + //if (! empty($conf->global->MAIN_MODULE_COMPTABILITE)) $description.='
'.$langs->trans("WarningDepositsNotIncluded"); if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $description.='
'.$langs->trans("DepositsAreNotIncluded"); else $description.='
'.$langs->trans("DepositsAreIncluded"); $description.='
('.$langs->trans("TaxModuleSetupToModifyRules",DOL_URL_ROOT.'/admin/taxes.php').')'; @@ -174,7 +174,7 @@ if ($modetax==0) // Invoice for goods, payment for services if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $description.=' '.$langs->trans("DepositsAreNotIncluded"); else $description.=' '.$langs->trans("DepositsAreIncluded"); //if ($conf->global->MAIN_MODULE_COMPTABILITE || $conf->global->MAIN_MODULE_ACCOUNTING) $description.='
'.img_warning().' '.$langs->trans('OptionVatInfoModuleComptabilite'); - //if ($conf->global->MAIN_MODULE_COMPTABILITE) $description.='
'.$langs->trans("WarningDepositsNotIncluded"); + //if (! empty($conf->global->MAIN_MODULE_COMPTABILITE)) $description.='
'.$langs->trans("WarningDepositsNotIncluded"); $description.=$fsearch; $description.='
('.$langs->trans("TaxModuleSetupToModifyRules",DOL_URL_ROOT.'/admin/taxes.php').')'; $builddate=time(); diff --git a/htdocs/contact/canvas/actions_contactcard_common.class.php b/htdocs/contact/canvas/actions_contactcard_common.class.php index c839f7a24e1..bcfaa39be96 100644 --- a/htdocs/contact/canvas/actions_contactcard_common.class.php +++ b/htdocs/contact/canvas/actions_contactcard_common.class.php @@ -310,7 +310,7 @@ abstract class ActionsContactCardCommon if ($action == 'view' || $action == 'edit' || $action == 'delete') { // Emailing - if ($conf->mailing->enabled) + if (! empty($conf->mailing->enabled)) { $langs->load("mails"); $this->tpl['nb_emailing'] = $this->object->getNbOfEMailings(); @@ -322,25 +322,25 @@ abstract class ActionsContactCardCommon $this->object->load_ref_elements(); - if ($conf->commande->enabled) + if (! empty($conf->commande->enabled)) { $this->tpl['contact_element'][$i]['linked_element_label'] = $langs->trans("ContactForOrders"); $this->tpl['contact_element'][$i]['linked_element_value'] = $this->object->ref_commande?$this->object->ref_commande:$langs->trans("NoContactForAnyOrder"); $i++; } - if ($conf->propal->enabled) + if (! empty($conf->propal->enabled)) { $this->tpl['contact_element'][$i]['linked_element_label'] = $langs->trans("ContactForProposals"); $this->tpl['contact_element'][$i]['linked_element_value'] = $this->object->ref_propal?$this->object->ref_propal:$langs->trans("NoContactForAnyProposal"); $i++; } - if ($conf->contrat->enabled) + if (! empty($conf->contrat->enabled)) { $this->tpl['contact_element'][$i]['linked_element_label'] = $langs->trans("ContactForContracts"); $this->tpl['contact_element'][$i]['linked_element_value'] = $this->object->ref_contrat?$this->object->ref_contrat:$langs->trans("NoContactForAnyContract"); $i++; } - if ($conf->facture->enabled) + if (! empty($conf->facture->enabled)) { $this->tpl['contact_element'][$i]['linked_element_label'] = $langs->trans("ContactForInvoices"); $this->tpl['contact_element'][$i]['linked_element_value'] = $this->object->ref_facturation?$this->object->ref_facturation:$langs->trans("NoContactForAnyInvoice"); diff --git a/htdocs/contact/fiche.php b/htdocs/contact/fiche.php index 03a356a8a72..07d2ee9e5c2 100644 --- a/htdocs/contact/fiche.php +++ b/htdocs/contact/fiche.php @@ -658,28 +658,28 @@ else $object->load_ref_elements(); - if ($conf->commande->enabled) + if (! empty($conf->commande->enabled)) { print ''; } - if ($conf->propal->enabled) + if (! empty($conf->propal->enabled)) { print ''; } - if ($conf->contrat->enabled) + if (! empty($conf->contrat->enabled)) { print ''; } - if ($conf->facture->enabled) + if (! empty($conf->facture->enabled)) { print ''; - if ($conf->mailing->enabled) + if (! empty($conf->mailing->enabled)) { $langs->load("mails"); print ''; @@ -857,28 +857,28 @@ else $object->load_ref_elements(); - if ($conf->commande->enabled) + if (! empty($conf->commande->enabled)) { print ''; } - if ($conf->propal->enabled) + if (! empty($conf->propal->enabled)) { print ''; } - if ($conf->contrat->enabled) + if (! empty($conf->contrat->enabled)) { print ''; } - if ($conf->facture->enabled) + if (! empty($conf->facture->enabled)) { print '"; - if ($conf->projet->enabled) + if (! empty($conf->projet->enabled)) { print '\n"; // Projet - if ($conf->projet->enabled) + if (! empty($conf->projet->enabled)) { $langs->load("projects"); print '"; print ''; print ''; print ''; - if($conf->global->DISPLAY_MARGIN_RATES) + if (! empty($conf->global->DISPLAY_MARGIN_RATES)) print ''; - if($conf->global->DISPLAY_MARK_RATES) + if (! empty($conf->global->DISPLAY_MARK_RATES)) print ''; print ''; //if ($marginInfo['margin_on_products'] != 0 && $marginInfo['margin_on_services'] != 0) { @@ -2970,9 +2970,9 @@ abstract class CommonObject print ''; print ''; print ''; - if($conf->global->DISPLAY_MARGIN_RATES) + if (! empty($conf->global->DISPLAY_MARGIN_RATES)) print ''; - if($conf->global->DISPLAY_MARK_RATES) + if (! empty($conf->global->DISPLAY_MARK_RATES)) print ''; print ''; print ''; @@ -2980,9 +2980,9 @@ abstract class CommonObject print ''; print ''; print ''; - if($conf->global->DISPLAY_MARGIN_RATES) + if (! empty($conf->global->DISPLAY_MARGIN_RATES)) print ''; - if($conf->global->DISPLAY_MARK_RATES) + if (! empty($conf->global->DISPLAY_MARK_RATES)) print ''; print ''; //} @@ -2991,9 +2991,9 @@ abstract class CommonObject print ''; print ''; print ''; - if($conf->global->DISPLAY_MARGIN_RATES) + if (! empty($conf->global->DISPLAY_MARGIN_RATES)) print ''; - if($conf->global->DISPLAY_MARK_RATES) + if (! empty($conf->global->DISPLAY_MARK_RATES)) print ''; print ''; print '
'; diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php index 2c665ec982c..8d8a1354dd4 100644 --- a/htdocs/commande/fiche.php +++ b/htdocs/commande/fiche.php @@ -1462,7 +1462,7 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G // Date de livraison print "
".$langs->trans("DeliveryDate").''; - if ($conf->global->DATE_LIVRAISON_WEEK_DELAY) + if (! empty($conf->global->DATE_LIVRAISON_WEEK_DELAY)) { $datedelivery = time() + ((7*$conf->global->DATE_LIVRAISON_WEEK_DELAY) * 24 * 60 * 60); } @@ -1699,7 +1699,7 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G } $text=$langs->trans('ConfirmValidateOrder',$numref); - if ($conf->notification->enabled) + if (! empty($conf->notification->enabled)) { require_once DOL_DOCUMENT_ROOT .'/core/class/notify.class.php'; $notify=new Notify($db); @@ -1808,7 +1808,7 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G * Commande */ $nbrow=9; - if ($conf->projet->enabled) $nbrow++; + if (! empty($conf->projet->enabled)) $nbrow++; //Local taxes if ($mysoc->country_code=='ES') @@ -2201,7 +2201,7 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G // Ship $numshipping=0; - if ($conf->expedition->enabled) + if (! empty($conf->expedition->enabled)) { $numshipping = $object->nb_expedition(); diff --git a/htdocs/commande/index.php b/htdocs/commande/index.php index 7b5e3391330..af38165d48a 100644 --- a/htdocs/commande/index.php +++ b/htdocs/commande/index.php @@ -165,7 +165,7 @@ else /* * Draft orders */ -if ($conf->commande->enabled) +if (! empty($conf->commande->enabled)) { $sql = "SELECT c.rowid, c.ref, s.nom, s.rowid as socid"; $sql.= " FROM ".MAIN_DB_PREFIX."commande as c"; @@ -282,7 +282,7 @@ else dol_print_error($db); /* * Orders to process */ -if ($conf->commande->enabled) +if (! empty($conf->commande->enabled)) { $sql = "SELECT c.rowid, c.ref, c.fk_statut, c.facture, s.nom, s.rowid as socid"; $sql.=" FROM ".MAIN_DB_PREFIX."commande as c"; @@ -353,7 +353,7 @@ if ($conf->commande->enabled) /* * Orders thar are in a shipping process */ -if ($conf->commande->enabled) +if (! empty($conf->commande->enabled)) { $sql = "SELECT c.rowid, c.ref, c.fk_statut, c.facture, s.nom, s.rowid as socid"; $sql.= " FROM ".MAIN_DB_PREFIX."commande as c"; diff --git a/htdocs/commande/orderstoinvoice.php b/htdocs/commande/orderstoinvoice.php index ec94022d853..3cc4ded371b 100755 --- a/htdocs/commande/orderstoinvoice.php +++ b/htdocs/commande/orderstoinvoice.php @@ -34,7 +34,7 @@ require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/report.lib.php'; -if ($conf->projet->enabled) require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; +if (! empty($conf->projet->enabled)) require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; $langs->load('orders'); $langs->load('deliveries'); @@ -416,7 +416,7 @@ if ($action == 'create') $html->select_types_paiements(isset($_POST['mode_reglement_id'])?$_POST['mode_reglement_id']:$mode_reglement_id,'mode_reglement_id'); print '
'.$langs->trans('Project').''; diff --git a/htdocs/compta/bank/fiche.php b/htdocs/compta/bank/fiche.php index 65abe9ccb5f..490b228f25a 100644 --- a/htdocs/compta/bank/fiche.php +++ b/htdocs/compta/bank/fiche.php @@ -281,7 +281,7 @@ if ($action == 'create') print '
'.$langs->trans("AccountancyCode").'
'.$langs->trans("AccountancyCode").'account_number).'">
'.$langs->trans("Date").''; @@ -318,7 +318,7 @@ if ($action == 'create') $form->select_types_paiements('', 'modepaiement', 'CRDT', 0, 1); print "
".$langs->trans("Project").""; @@ -368,7 +368,7 @@ if (! empty($id) && $action == 'edit') print '
'.$langs->trans("Date").''; @@ -458,7 +458,7 @@ if (! empty($id) && $action != 'edit') $linkback = ''.$langs->trans("BackToList").''; $nbrows=12; - if ($conf->projet->enabled) $nbrows++; + if (! empty($conf->projet->enabled)) $nbrows++; // Ref print "
'.$langs->trans("Ref").''; @@ -502,7 +502,7 @@ if (! empty($id) && $action != 'edit') print "
'.$langs->trans("Status").''.$don->getLibStatut(4).'
'.$langs->trans("Project").''.$don->projet.'
".$objp->societe."".$donationstatic->getFullName($langs)."'.dol_print_date($db->jdate($objp->datedon),'day').'"; if ($objp->pid) diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 4e928108813..dbb6b43703c 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -1882,7 +1882,7 @@ if ($action == 'create') print '
'; print ''; @@ -1973,7 +1973,7 @@ if ($action == 'create') print '
'.$langs->trans('Project').''; @@ -2080,7 +2080,7 @@ if ($action == 'create') print ''.$langs->trans('Qty').''.$langs->trans('ReductionShort').'     '.$langs->trans('ServiceLimitedDuration').'
'; // multiprix - if($conf->global->PRODUIT_MULTIPRICES) + if (! empty($conf->global->PRODUIT_MULTIPRICES)) $form->select_produits('','idprod'.$i,'',$conf->product->limit_size,$soc->price_level); else $form->select_produits('','idprod'.$i,'',$conf->product->limit_size); @@ -2099,7 +2099,7 @@ if ($action == 'create') print '% '; print ''; @@ -2243,7 +2243,7 @@ else if ($id > 0 || ! empty($ref)) } $text=$langs->trans('ConfirmValidateBill',$numref); - if ($conf->notification->enabled) + if (! empty($conf->notification->enabled)) { require_once DOL_DOCUMENT_ROOT .'/core/class/notify.class.php'; $notify=new Notify($db); @@ -2624,8 +2624,8 @@ else if ($id > 0 || ! empty($ref)) */ $nbrows=8; $nbcols=2; - if ($conf->projet->enabled) $nbrows++; - if ($conf->banque->enabled) $nbcols++; + if (! empty($conf->projet->enabled)) $nbrows++; + if (! empty($conf->banque->enabled)) $nbcols++; //Local taxes if ($mysoc->pays_code=='ES') @@ -2642,7 +2642,7 @@ else if ($id > 0 || ! empty($ref)) print ''; print ''; print ''; - if ($conf->banque->enabled) print ''; + if (! empty($conf->banque->enabled)) print ''; print ''; print ''; print ''; @@ -2679,7 +2679,7 @@ else if ($id > 0 || ! empty($ref)) print dol_print_date($db->jdate($objp->dp),'day').''; $label=($langs->trans("PaymentType".$objp->payment_code)!=("PaymentType".$objp->payment_code))?$langs->trans("PaymentType".$objp->payment_code):$objp->payment_label; print ''; - if ($conf->banque->enabled) + if (! empty($conf->banque->enabled)) { $bankaccountstatic->id=$objp->baid; $bankaccountstatic->ref=$objp->ref; diff --git a/htdocs/compta/facture/apercu.php b/htdocs/compta/facture/apercu.php index bac78a55c78..1ad6c0480ba 100644 --- a/htdocs/compta/facture/apercu.php +++ b/htdocs/compta/facture/apercu.php @@ -30,7 +30,7 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/invoice.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; -if ($conf->projet->enabled) require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; +if (! empty($conf->projet->enabled)) require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; $langs->load("bills"); @@ -288,7 +288,7 @@ if ($id > 0 || ! empty($ref)) print ''; $nbrows=5; - if ($conf->projet->enabled) $nbrows++; + if (! empty($conf->projet->enabled)) $nbrows++; print ''; // Projet - if ($conf->projet->enabled) + if (! empty($conf->projet->enabled)) { $langs->load("projects"); print ''; diff --git a/htdocs/compta/facture/impayees.php b/htdocs/compta/facture/impayees.php index f81252e39e6..7b60344fc06 100644 --- a/htdocs/compta/facture/impayees.php +++ b/htdocs/compta/facture/impayees.php @@ -88,7 +88,7 @@ if ($action == "builddoc" && $user->rights->facture->lire) } $pdf->SetFont(pdf_getPDFFont($outputlangs)); - if ($conf->global->MAIN_DISABLE_PDF_COMPRESSION) $pdf->SetCompression(false); + if (! empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) $pdf->SetCompression(false); // Add all others foreach($files as $file) diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php index a0ffe2b9035..3fea5bcd1c1 100644 --- a/htdocs/compta/index.php +++ b/htdocs/compta/index.php @@ -27,9 +27,9 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; -if ($conf->commande->enabled) require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; -if ($conf->commande->enabled) require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; -if ($conf->tax->enabled) require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php'; +if (! empty($conf->commande->enabled)) require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; +if (! empty($conf->commande->enabled)) require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; +if (! empty($conf->tax->enabled)) require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php'; // L'espace compta/treso doit toujours etre actif car c'est un espace partage // par de nombreux modules (banque, facture, commande a facturer, etc...) independamment @@ -40,7 +40,7 @@ if ($conf->tax->enabled) require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/ $langs->load("compta"); $langs->load("bills"); -if ($conf->commande->enabled) $langs->load("orders"); +if (! empty($conf->commande->enabled)) $langs->load("orders"); // Security check $socid=''; @@ -349,7 +349,7 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire) print '
'.($object->type == 2 ? $langs->trans("PaymentsBack") : $langs->trans('Payments')).''.$langs->trans('Type').''.$langs->trans('BankAccount').''.$langs->trans('BankAccount').''.$langs->trans('Amount').' 
'.$label.' '.$objp->num_paiement.''; /* @@ -366,7 +366,7 @@ if ($id > 0 || ! empty($ref)) print '
'.$langs->trans('Status').''.($object->getLibStatut(4,$totalpaye)).'
'; print ''; - if ($conf->global->MAIN_SHOW_HT_ON_SUMMARY) print ''; + if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print ''; print ''; print ''; print ''; @@ -388,7 +388,7 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire) $thirdpartystatic->client=1; print $thirdpartystatic->getNomUrl(1,'customer',44); print ''; - if ($conf->global->MAIN_SHOW_HT_ON_SUMMARY) print ''; + if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print ''; print ''; print ''; print ''; @@ -404,7 +404,7 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire) else { $colspan=5; - if ($conf->global->MAIN_SHOW_HT_ON_SUMMARY) $colspan++; + if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) $colspan++; print ''; } print '
'.$langs->trans("BoxTitleLastCustomerBills",$max).''.$langs->trans("AmountHT").''.$langs->trans("AmountHT").''.$langs->trans("AmountTTC").''.$langs->trans("DateModificationShort").' '.price($obj->total).''.price($obj->total).''.price($obj->total_ttc).''.dol_print_date($db->jdate($obj->tms),'day').''.$facstatic->LibStatut($obj->paye,$obj->fk_statut,3,$obj->am).'
'.$langs->trans("NoInvoice").'

'; @@ -446,7 +446,7 @@ if ($conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire) print ''; print ''; - if ($conf->global->MAIN_SHOW_HT_ON_SUMMARY) print ''; + if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print ''; print ''; print ''; print ''; @@ -469,7 +469,7 @@ if ($conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire) $thirdpartystatic->fournisseur=1; print $thirdpartystatic->getNomUrl(1,'supplier',44); print ''; - if ($conf->global->MAIN_SHOW_HT_ON_SUMMARY) print ''; + if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print ''; print ''; print ''; print ''; @@ -484,7 +484,7 @@ if ($conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire) else { $colspan=5; - if ($conf->global->MAIN_SHOW_HT_ON_SUMMARY) $colspan++; + if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) $colspan++; print ''; } print '
'.$langs->trans("BoxTitleLastSupplierBills",$max).''.$langs->trans("AmountHT").''.$langs->trans("AmountHT").''.$langs->trans("AmountTTC").''.$langs->trans("DateModificationShort").' '.price($obj->total_ht).''.price($obj->total_ht).''.price($obj->total_ttc).''.dol_print_date($db->jdate($obj->tms),'day').''.$facstatic->LibStatut($obj->paye,$obj->fk_statut,3).'
'.$langs->trans("NoInvoice").'

'; @@ -742,7 +742,7 @@ if (! empty($conf->facture->enabled) && ! empty($conf->commande->enabled) && $us print ''; print ""; print ''; - if ($conf->global->MAIN_SHOW_HT_ON_SUMMARY) print ''; + if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print ''; print ''; print ''; print ''; @@ -781,7 +781,7 @@ if (! empty($conf->facture->enabled) && ! empty($conf->commande->enabled) && $us $societestatic->client=1; print $societestatic->getNomUrl(1,'customer',44); print ''; - if ($conf->global->MAIN_SHOW_HT_ON_SUMMARY) print ''; + if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print ''; print ''; print ''; print ''; @@ -795,7 +795,7 @@ if (! empty($conf->facture->enabled) && ! empty($conf->commande->enabled) && $us } print ''; - if ($conf->global->MAIN_SHOW_HT_ON_SUMMARY) print ''; + if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print ''; print ''; print ''; print ''; @@ -840,7 +840,7 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire) print '
'.$langs->trans("OrdersToBill").' ('.$num.')'.$langs->trans("AmountHT").''.$langs->trans("AmountHT").''.$langs->trans("AmountTTC").''.$langs->trans("ToBill").' '.price($obj->total_ht).''.price($obj->total_ht).''.price($obj->total_ttc).''.price($obj->total_ttc-$obj->tot_fttc).''.$commandestatic->LibStatut($obj->fk_statut,$obj->facture,3).'
'.$langs->trans("Total").'   ('.$langs->trans("RemainderToBill").': '.price($tot_tobill).') '.price($tot_ht).''.price($tot_ht).''.price($tot_ttc).''.price($tot_tobill).' 
'; print ''; - if ($conf->global->MAIN_SHOW_HT_ON_SUMMARY) print ''; + if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print ''; print ''; print ''; print ''; @@ -880,7 +880,7 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire) $societestatic->client=1; print $societestatic->getNomUrl(1,'customer',44); print ''; - if ($conf->global->MAIN_SHOW_HT_ON_SUMMARY) print ''; + if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print ''; print ''; print ''; print ''; @@ -894,7 +894,7 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire) } print ''; - if ($conf->global->MAIN_SHOW_HT_ON_SUMMARY) print ''; + if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print ''; print ''; print ''; print ''; @@ -903,7 +903,7 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire) else { $colspan=5; - if ($conf->global->MAIN_SHOW_HT_ON_SUMMARY) $colspan++; + if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) $colspan++; print ''; } print '
'.$langs->trans("BillsCustomersUnpaid",$num).' ('.$num.')'.$langs->trans("AmountHT").''.$langs->trans("AmountHT").''.$langs->trans("AmountTTC").''.$langs->trans("Received").' '.price($obj->total).''.price($obj->total).''.price($obj->total_ttc).''.price($obj->am).''.$facstatic->LibStatut($obj->paye,$obj->fk_statut,3,$obj->am).'
'.$langs->trans("Total").'   ('.$langs->trans("RemainderToTake").': '.price($total_ttc-$totalam).') '.price($total).''.price($total).''.price($total_ttc).''.price($totalam).' 
'.$langs->trans("NoInvoice").'

'; @@ -944,7 +944,7 @@ if ($conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire) print ''; print ''; - if ($conf->global->MAIN_SHOW_HT_ON_SUMMARY) print ''; + if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print ''; print ''; print ''; print ''; @@ -967,7 +967,7 @@ if ($conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire) $societestatic->nom=$obj->nom; $societestatic->client=0; print ''; - if ($conf->global->MAIN_SHOW_HT_ON_SUMMARY) print ''; + if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print ''; print ''; print ''; print ''; @@ -980,7 +980,7 @@ if ($conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire) } print ''; - if ($conf->global->MAIN_SHOW_HT_ON_SUMMARY) print ''; + if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print ''; print ''; print ''; print ''; @@ -989,7 +989,7 @@ if ($conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire) else { $colspan=5; - if ($conf->global->MAIN_SHOW_HT_ON_SUMMARY) $colspan++; + if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) $colspan++; print ''; } print '
'.$langs->trans("BillsSuppliersUnpaid",$num).' ('.$num.')'.$langs->trans("AmountHT").''.$langs->trans("AmountHT").''.$langs->trans("AmountTTC").''.$langs->trans("Paid").' '.$societestatic->getNomUrl(1, 'supplier', 44).''.price($obj->total_ht).''.price($obj->total_ht).''.price($obj->total_ttc).''.price($obj->am).''.$facstatic->LibStatut($obj->paye,$obj->fk_statut,3).'
'.$langs->trans("Total").'   ('.$langs->trans("RemainderToPay").': '.price($total_ttc-$totalam).') '.price($total).''.price($total).''.price($total_ttc).''.price($totalam).' 
'.$langs->trans("NoInvoice").'

'; diff --git a/htdocs/compta/localtax/class/localtax.class.php b/htdocs/compta/localtax/class/localtax.class.php index 3ad10ec2d08..8dded9ae73b 100644 --- a/htdocs/compta/localtax/class/localtax.class.php +++ b/htdocs/compta/localtax/class/localtax.class.php @@ -496,7 +496,7 @@ class Localtax extends CommonObject if ($this->id > 0) { $ok=1; - if ($conf->banque->enabled) + if (! empty($conf->banque->enabled)) { // Insertion dans llx_bank require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; diff --git a/htdocs/compta/localtax/clients.php b/htdocs/compta/localtax/clients.php index e62dc08adc9..ed0b7e11752 100644 --- a/htdocs/compta/localtax/clients.php +++ b/htdocs/compta/localtax/clients.php @@ -107,7 +107,7 @@ if ($modetax==1) // Calculate on invoice for goods and services $nom=$langs->transcountry("LT2ReportByCustomersInInputOutputMode",$mysoc->country_code); $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1); $description=$langs->trans("RulesVATDue"); - if ($conf->global->MAIN_MODULE_COMPTABILITE) $description.='
'.$langs->trans("WarningDepositsNotIncluded"); + if (! empty($conf->global->MAIN_MODULE_COMPTABILITE)) $description.='
'.$langs->trans("WarningDepositsNotIncluded"); $description.=$fsearch; $description.='
('.$langs->trans("TaxModuleSetupToModifyRules",DOL_URL_ROOT.'/admin/taxes.php').')'; $builddate=time(); @@ -124,7 +124,7 @@ if ($modetax==0) // Invoice for goods, payment for services $nom=$langs->transcountry("LT2ReportByCustomersInInputOutputMode",$mysoc->country_code); $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1); $description=$langs->trans("RulesVATIn"); - if ($conf->global->MAIN_MODULE_COMPTABILITE) $description.='
'.$langs->trans("WarningDepositsNotIncluded"); + if (! empty($conf->global->MAIN_MODULE_COMPTABILITE)) $description.='
'.$langs->trans("WarningDepositsNotIncluded"); $description.=$fsearch; $description.='
('.$langs->trans("TaxModuleSetupToModifyRules",DOL_URL_ROOT.'/admin/taxes.php').')'; $builddate=time(); diff --git a/htdocs/compta/localtax/fiche.php b/htdocs/compta/localtax/fiche.php index cccee441ac5..ce8ce775cf3 100644 --- a/htdocs/compta/localtax/fiche.php +++ b/htdocs/compta/localtax/fiche.php @@ -168,7 +168,7 @@ if ($_GET["action"] == 'create') // Amount print '
'.$langs->trans("Amount").'
'.$langs->trans("Account").''; $form->select_comptes($_POST["accountid"],"accountid",0,"courant=1",1); // Affiche liste des comptes courant @@ -227,7 +227,7 @@ if ($id) print '
'.$langs->trans("Amount").''.price($vatpayment->amount).'
'.$langs->trans('AccountToCredit').''.$langs->trans('AccountToDebit').'
'; print '

'.$langs->trans("ClosePaidInvoicesAutomatically"); - /*if ($conf->prelevement->enabled) + /*if (! empty($conf->prelevement->enabled)) { $langs->load("withdrawals"); - if ($conf->global->WITHDRAW_DISABLE_AUTOCREATE_ONPAYMENTS) print '
'.$langs->trans("IfInvoiceNeedOnWithdrawPaymentWontBeClosed"); + if (! empty($conf->global->WITHDRAW_DISABLE_AUTOCREATE_ONPAYMENTS)) print '
'.$langs->trans("IfInvoiceNeedOnWithdrawPaymentWontBeClosed"); }*/ print '


'; // print '
'; print ''.price($objp->amount).''; if ($objp->statut == 0) print ''; diff --git a/htdocs/compta/payment_sc/fiche.php b/htdocs/compta/payment_sc/fiche.php index de865468d60..222c78a7f1d 100644 --- a/htdocs/compta/payment_sc/fiche.php +++ b/htdocs/compta/payment_sc/fiche.php @@ -30,7 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php' require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/paymentsocialcontribution.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/modules/facture/modules_facture.php'; -if ($conf->banque->enabled) require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; +if (! empty($conf->banque->enabled)) require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; $langs->load('bills'); $langs->load('banks'); @@ -189,7 +189,7 @@ print '
'.$langs->trans('Amount').''.pr print '
'.$langs->trans('Note').''.nl2br($paiement->note).'
'.$langs->trans("Amount").'
'.$langs->trans("Account").''; $form->select_comptes($_POST["accountid"],"accountid",0,"courant=1",1); // Affiche liste des comptes courant @@ -236,7 +236,7 @@ if ($id) print '
'.$langs->trans("Amount").''.price($vatpayment->amount).'
'.$langs->trans("ContactForOrders").''; print $object->ref_commande?$object->ref_commande:$langs->trans("NoContactForAnyOrder"); print '
'.$langs->trans("ContactForProposals").''; print $object->ref_propal?$object->ref_propal:$langs->trans("NoContactForAnyProposal"); print '
'.$langs->trans("ContactForContracts").''; print $object->ref_contrat?$object->ref_contrat:$langs->trans("NoContactForAnyContract"); print '
'.$langs->trans("ContactForInvoices").''; print $object->ref_facturation?$object->ref_facturation:$langs->trans("NoContactForAnyInvoice"); @@ -744,7 +744,7 @@ else //array('label' => $form->textwithpicto($langs->trans("Type"),$langs->trans("InternalExternalDesc")), 'type' => 'select', 'name' => 'intern', 'default' => 1, 'values' => array(0=>$langs->trans('Internal'),1=>$langs->trans('External'))) ); $text=$langs->trans("ConfirmCreateContact").'
'; - if ($conf->societe->enabled) + if (! empty($conf->societe->enabled)) { if ($object->socid > 0) $text.=$langs->trans("UserWillBeExternalUser"); else $text.=$langs->trans("UserWillBeInternalUser"); @@ -823,7 +823,7 @@ else // Email print '
'.$langs->trans("EMail").''.dol_print_email($object->email,$object->id,$object->socid,'AC_EMAIL').''.$langs->trans("NbOfEMailingsReceived").'
'.$langs->trans("ContactForOrders").''; print $object->ref_commande?$object->ref_commande:$langs->trans("NoContactForAnyOrder"); print '
'.$langs->trans("ContactForProposals").''; print $object->ref_propal?$object->ref_propal:$langs->trans("NoContactForAnyProposal"); print '
'.$langs->trans("ContactForContracts").''; print $object->ref_contrat?$object->ref_contrat:$langs->trans("NoContactForAnyContract"); print '
'.$langs->trans("ContactForInvoices").''; print $object->ref_facturation?$object->ref_facturation:$langs->trans("NoContactForAnyInvoice"); diff --git a/htdocs/contrat/fiche.php b/htdocs/contrat/fiche.php index 4c9ba902cd0..e49c8b3e5a3 100644 --- a/htdocs/contrat/fiche.php +++ b/htdocs/contrat/fiche.php @@ -33,7 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/modules/contract/modules_contract.php'; if (! empty($conf->produit->enabled) || ! empty($conf->service->enabled)) require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; if (! empty($conf->propal->enabled)) require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; -if ($conf->projet->enabled) { +if (! empty($conf->projet->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; } @@ -618,7 +618,7 @@ if ($action == 'create') $form->select_date($datecontrat,'',0,0,'',"contrat"); print "
'.$langs->trans("Project").''; select_projects($soc->id,GETPOST("projectid"),"projectid"); @@ -767,7 +767,7 @@ else print ''.dol_print_date($object->date_contrat,"dayhour")."
'; @@ -1276,7 +1276,7 @@ else print "
'; // multiprix - if($conf->global->PRODUIT_MULTIPRICES) + if (! empty($conf->global->PRODUIT_MULTIPRICES)) $form->select_produits('','idprod',1,$conf->product->limit_size,$object->thirdparty->price_level); else $form->select_produits('','idprod',1,$conf->product->limit_size); diff --git a/htdocs/core/ajax/ziptown.php b/htdocs/core/ajax/ziptown.php index c9dfed825d6..eae960970a9 100644 --- a/htdocs/core/ajax/ziptown.php +++ b/htdocs/core/ajax/ziptown.php @@ -60,7 +60,7 @@ if (! empty($_GET['zipcode']) || ! empty($_GET['town'])) $zipcode = $_GET['zipcode']?$_GET['zipcode']:''; $town = $_GET['town']?$_GET['town']:''; - if ($conf->global->MAIN_USE_ZIPTOWN_DICTIONNARY) // Use zip-town table + if (! empty($conf->global->MAIN_USE_ZIPTOWN_DICTIONNARY)) // Use zip-town table { $sql = "SELECT z.rowid, z.zip, z.town, z.fk_county, z.fk_pays as fk_country"; $sql.= ", p.rowid as fk_country, p.code as country_code, p.libelle as country"; diff --git a/htdocs/core/boxes/box_produits.php b/htdocs/core/boxes/box_produits.php index f0645659062..627ffad350f 100644 --- a/htdocs/core/boxes/box_produits.php +++ b/htdocs/core/boxes/box_produits.php @@ -93,7 +93,7 @@ class box_produits extends ModeleBoxes $datem=$db->jdate($objp->tms); // Multilangs - if ($conf->global->MAIN_MULTILANGS) // si l'option est active + if (! empty($conf->global->MAIN_MULTILANGS)) // si l'option est active { $sqld = "SELECT label"; $sqld.= " FROM ".MAIN_DB_PREFIX."product_lang"; diff --git a/htdocs/core/boxes/box_services_contracts.php b/htdocs/core/boxes/box_services_contracts.php index d4a701ca5ef..ff082c23b23 100644 --- a/htdocs/core/boxes/box_services_contracts.php +++ b/htdocs/core/boxes/box_services_contracts.php @@ -105,7 +105,7 @@ class box_services_contracts extends ModeleBoxes $datem=$db->jdate($objp->datem); // Multilangs - if ($conf->global->MAIN_MULTILANGS) // si l'option est active + if (! empty($conf->global->MAIN_MULTILANGS)) // si l'option est active { $sqld = "SELECT label"; $sqld.= " FROM ".MAIN_DB_PREFIX."product_lang"; diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php index 2da3527aa6f..ae7efcac3b9 100644 --- a/htdocs/core/class/CMailFile.class.php +++ b/htdocs/core/class/CMailFile.class.php @@ -1050,7 +1050,7 @@ class CMailFile } if ($format == 0 || $format == 3) { - if ($conf->global->MAIN_MAIL_NO_FULL_EMAIL) $newemail='<'.$email.'>'; + if (! empty($conf->global->MAIN_MAIL_NO_FULL_EMAIL)) $newemail='<'.$email.'>'; elseif (! $name) $newemail='<'.$email.'>'; else $newemail=($format==3?'"':'').($encode?$this->encodetorfc2822($name):$name).($format==3?'"':'').' <'.$email.'>'; } diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index bf577e76229..29e58b35135 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -2959,9 +2959,9 @@ abstract class CommonObject print ''.$langs->trans('SellingPrice').''.$langs->trans('BuyingPrice').''.$langs->trans('Margin').''.$langs->trans('MarginRate').''.$langs->trans('MarkRate').'
'.price($marginInfo['pv_products']).''.price($marginInfo['pa_products']).''.price($marginInfo['margin_on_products']).''.(($marginInfo['margin_rate_products'] == '')?'n/a':price($marginInfo['margin_rate_products']).'%').''.(($marginInfo['mark_rate_products'] == '')?'n/a':price($marginInfo['mark_rate_products']).'%').'
'.price($marginInfo['pv_services']).''.price($marginInfo['pa_services']).''.price($marginInfo['margin_on_services']).''.(($marginInfo['margin_rate_services'] == '')?'n/a':price($marginInfo['margin_rate_services']).'%').''.(($marginInfo['mark_rate_services'] == '')?'n/a':price($marginInfo['mark_rate_services']).'%').'
'.price($marginInfo['pv_total']).''.price($marginInfo['pa_total']).''.price($marginInfo['total_margin']).''.(($marginInfo['total_margin_rate'] == '')?'n/a':price($marginInfo['total_margin_rate']).'%').''.(($marginInfo['total_mark_rate'] == '')?'n/a':price($marginInfo['total_mark_rate']).'%').'
'; diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index b7f3bb0e6b4..07f51ebd72c 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -65,7 +65,7 @@ class FormFile { global $conf,$langs; - if ($conf->global->MAIN_USE_JQUERY_FILEUPLOAD) + if (! empty($conf->global->MAIN_USE_JQUERY_FILEUPLOAD)) { return $this->_formAjaxFileUpload($object); } diff --git a/htdocs/core/class/ldap.class.php b/htdocs/core/class/ldap.class.php index 35da1b90beb..9e06d62ff74 100644 --- a/htdocs/core/class/ldap.class.php +++ b/htdocs/core/class/ldap.class.php @@ -107,8 +107,8 @@ class Ldap global $conf; //Server - if ($conf->global->LDAP_SERVER_HOST) $this->server[] = $conf->global->LDAP_SERVER_HOST; - if ($conf->global->LDAP_SERVER_HOST_SLAVE) $this->server[] = $conf->global->LDAP_SERVER_HOST_SLAVE; + if (! empty($conf->global->LDAP_SERVER_HOST)) $this->server[] = $conf->global->LDAP_SERVER_HOST; + if (! empty($conf->global->LDAP_SERVER_HOST_SLAVE)) $this->server[] = $conf->global->LDAP_SERVER_HOST_SLAVE; $this->serverPort = $conf->global->LDAP_SERVER_PORT; $this->ldapProtocolVersion = $conf->global->LDAP_SERVER_PROTOCOLVERSION; $this->dn = $conf->global->LDAP_SERVER_DN; diff --git a/htdocs/core/lib/agenda.lib.php b/htdocs/core/lib/agenda.lib.php index 30989a272e7..1e8003d22fb 100644 --- a/htdocs/core/lib/agenda.lib.php +++ b/htdocs/core/lib/agenda.lib.php @@ -97,7 +97,7 @@ function print_actions_filter($form,$canedit,$status,$year,$month,$day,$showbirt print '
'; diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 00ff7db6ddd..0e00f836eee 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -510,7 +510,7 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='') $contactstatic = new Contact($db); - if ($conf->clicktodial->enabled) + if (! empty($conf->clicktodial->enabled)) { $user->fetch_clicktodial(); // lecture des infos de clicktodial } @@ -729,7 +729,7 @@ function show_actions_todo($conf,$langs,$db,$object,$objcon='',$noprint=0) $now=dol_now(); $out=''; - if ($conf->agenda->enabled) + if (! empty($conf->agenda->enabled)) { require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; $actionstatic=new ActionComm($db); @@ -891,7 +891,7 @@ function show_actions_done($conf,$langs,$db,$object,$objcon='',$noprint=0) $numaction = 0 ; $now=dol_now(); - if ($conf->agenda->enabled) + if (! empty($conf->agenda->enabled)) { // Recherche histo sur actioncomm $sql = "SELECT a.id, a.label,"; diff --git a/htdocs/core/lib/invoice.lib.php b/htdocs/core/lib/invoice.lib.php index 07e7550994b..8d3990942c1 100644 --- a/htdocs/core/lib/invoice.lib.php +++ b/htdocs/core/lib/invoice.lib.php @@ -57,7 +57,7 @@ function facture_prepare_head($object) } //if ($fac->mode_reglement_code == 'PRE') - if ($conf->prelevement->enabled) + if (! empty($conf->prelevement->enabled)) { $head[$h][0] = DOL_URL_ROOT.'/compta/facture/prelevement.php?facid='.$object->id; $head[$h][1] = $langs->trans('StandingOrders'); diff --git a/htdocs/core/lib/ldap.lib.php b/htdocs/core/lib/ldap.lib.php index a5200a320d9..981ae2f25ef 100644 --- a/htdocs/core/lib/ldap.lib.php +++ b/htdocs/core/lib/ldap.lib.php @@ -41,7 +41,7 @@ function ldap_prepare_head() $head[$h][2] = 'ldap'; $h++; - if ($conf->global->LDAP_SYNCHRO_ACTIVE) + if (! empty($conf->global->LDAP_SYNCHRO_ACTIVE)) { $head[$h][0] = DOL_URL_ROOT."/admin/ldap_users.php"; $head[$h][1] = $langs->trans("LDAPUsersSynchro"); @@ -49,7 +49,7 @@ function ldap_prepare_head() $h++; } - if ($conf->global->LDAP_SYNCHRO_ACTIVE) + if (! empty($conf->global->LDAP_SYNCHRO_ACTIVE)) { $head[$h][0] = DOL_URL_ROOT."/admin/ldap_groups.php"; $head[$h][1] = $langs->trans("LDAPGroupsSynchro"); diff --git a/htdocs/core/lib/order.lib.php b/htdocs/core/lib/order.lib.php index 2bd4fd8779b..f344ef8681d 100644 --- a/htdocs/core/lib/order.lib.php +++ b/htdocs/core/lib/order.lib.php @@ -34,7 +34,7 @@ function commande_prepare_head($object) { global $langs, $conf, $user; - if ($conf->expedition->enabled) $langs->load("sendings"); + if (! empty($conf->expedition->enabled)) $langs->load("sendings"); $langs->load("orders"); $h = 0; diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 33e562c464f..7cbcdb4854d 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -668,7 +668,7 @@ function pdf_pagefoot(&$pdf,$outputlangs,$paramfreetext,$fromcompany,$marge_bass { $pdf->SetXY($dims['lm'],-$posy); $width=20000; $align='L'; // By default, ask a manual break: We use a large value 20000, to not have automatic wrap. This make user understand, he need to add CR on its text. - if ($conf->global->MAIN_USE_AUTOWRAP_ON_FREETEXT) { $width=200; $align='C'; } + if (! empty($conf->global->MAIN_USE_AUTOWRAP_ON_FREETEXT)) { $width=200; $align='C'; } $pdf->MultiCell($width, 3, $line, 0, $align, 0); $posy-=($nbofline*3); // 6 of ligne + 3 of MultiCell } diff --git a/htdocs/core/lib/product.lib.php b/htdocs/core/lib/product.lib.php index c78fb19af09..06e421db700 100644 --- a/htdocs/core/lib/product.lib.php +++ b/htdocs/core/lib/product.lib.php @@ -72,7 +72,7 @@ function product_prepare_head($object, $user) } // Multilangs - if($conf->global->MAIN_MULTILANGS) + if (! empty($conf->global->MAIN_MULTILANGS)) { $head[$h][0] = DOL_URL_ROOT."/product/traduction.php?id=".$object->id; $head[$h][1] = $langs->trans("Translation"); @@ -81,7 +81,7 @@ function product_prepare_head($object, $user) } // Sub products - if($conf->global->PRODUIT_SOUSPRODUITS) + if (! empty($conf->global->PRODUIT_SOUSPRODUITS)) { $head[$h][0] = DOL_URL_ROOT."/product/composition/fiche.php?id=".$object->id; $head[$h][1] = $langs->trans('AssociatedProducts'); diff --git a/htdocs/core/lib/security2.lib.php b/htdocs/core/lib/security2.lib.php index 3d1b69279f6..5f402fad68c 100644 --- a/htdocs/core/lib/security2.lib.php +++ b/htdocs/core/lib/security2.lib.php @@ -432,7 +432,7 @@ function getRandomPassword($generic=false) $generated_password=''; if ($generic) $generated_password=dol_hash(mt_rand()); - else if ($conf->global->USER_PASSWORD_GENERATED) + else if (! empty($conf->global->USER_PASSWORD_GENERATED)) { $nomclass="modGeneratePass".ucfirst($conf->global->USER_PASSWORD_GENERATED); $nomfichier=$nomclass.".class.php"; diff --git a/htdocs/core/lib/stock.lib.php b/htdocs/core/lib/stock.lib.php index caf9d7ef43d..7fb81297cb3 100644 --- a/htdocs/core/lib/stock.lib.php +++ b/htdocs/core/lib/stock.lib.php @@ -52,7 +52,7 @@ function stock_prepare_head($object) */ /* Disabled because will never be implemented. Table always empty. - if ($conf->global->STOCK_USE_WAREHOUSE_BY_USER) + if (! empty($conf->global->STOCK_USE_WAREHOUSE_BY_USER)) { // Should not be enabled by defaut because does not work yet correctly because // personnal stocks are not tagged into table llx_entrepot diff --git a/htdocs/core/lib/tax.lib.php b/htdocs/core/lib/tax.lib.php index 7bd6e542a42..eab91d27d4b 100644 --- a/htdocs/core/lib/tax.lib.php +++ b/htdocs/core/lib/tax.lib.php @@ -106,7 +106,7 @@ function vat_by_thirdparty($db, $y, $date_start, $date_end, $modetax, $direction if ($modetax == 1) { // If vat paid on due invoices (non draft) - if ($conf->global->MAIN_MODULE_ACCOUNTING) + if (! empty($conf->global->MAIN_MODULE_ACCOUNTING)) { // TODO a ce jour on se sait pas la compter car le montant tva d'un payment // n'est pas stocke dans la table des payments. @@ -115,7 +115,7 @@ function vat_by_thirdparty($db, $y, $date_start, $date_end, $modetax, $direction // detail part tva et part ht). $sql = 'TODO'; } - if ($conf->global->MAIN_MODULE_COMPTABILITE) + if (! empty($conf->global->MAIN_MODULE_COMPTABILITE)) { $sql = "SELECT s.rowid as socid, s.nom as nom, s.siren as tva_intra, s.tva_assuj as assuj,"; $sql.= " sum(fd.total_ht) as amount, sum(fd.".$total_tva.") as tva,"; @@ -145,7 +145,7 @@ function vat_by_thirdparty($db, $y, $date_start, $date_end, $modetax, $direction } else { - if ($conf->global->MAIN_MODULE_ACCOUNTING) + if (! empty($conf->global->MAIN_MODULE_ACCOUNTING)) { // If vat paid on payments // TODO a ce jour on se sait pas la compter car le montant tva d'un payment @@ -155,7 +155,7 @@ function vat_by_thirdparty($db, $y, $date_start, $date_end, $modetax, $direction // detail part tva et part ht). $sql = 'TODO'; } - if ($conf->global->MAIN_MODULE_COMPTABILITE) + if (! empty($conf->global->MAIN_MODULE_COMPTABILITE)) { // Tva sur factures payes (should be on payment) /* $sql = "SELECT s.rowid as socid, s.nom as nom, s.tva_intra as tva_intra, s.tva_assuj as assuj,"; @@ -262,7 +262,7 @@ function vat_by_date($db, $y, $q, $date_start, $date_end, $modetax, $direction, $sql=''; if ($modetax == 1) // Option vat on delivery for goods (payment) and debit invoice for services { - if ($conf->global->MAIN_MODULE_ACCOUNTING) + if (! empty($conf->global->MAIN_MODULE_ACCOUNTING)) { // TODO a ce jour on se sait pas la compter car le montant tva d'un payment // n'est pas stocke dans la table des payments. @@ -271,7 +271,7 @@ function vat_by_date($db, $y, $q, $date_start, $date_end, $modetax, $direction, // detail part tva et part ht). $sql='TODO'; } - if ($conf->global->MAIN_MODULE_COMPTABILITE) + if (! empty($conf->global->MAIN_MODULE_COMPTABILITE)) { // Count on delivery date (use invoice date as delivery is unknown) $sql = "SELECT d.rowid, d.product_type as dtype, d.".$fk_facture." as facid, d.tva_tx as rate, d.total_ht as total_ht, d.total_ttc as total_ttc, d.".$total_tva." as total_vat, d.description as descr,"; @@ -307,7 +307,7 @@ function vat_by_date($db, $y, $q, $date_start, $date_end, $modetax, $direction, } else // Option vat on delivery for goods (payments) and payments for services { - if ($conf->global->MAIN_MODULE_ACCOUNTING) + if (! empty($conf->global->MAIN_MODULE_ACCOUNTING)) { // TODO a ce jour on se sait pas la compter car le montant tva d'un payment // n'est pas stocke dans la table des payments. @@ -316,7 +316,7 @@ function vat_by_date($db, $y, $q, $date_start, $date_end, $modetax, $direction, // detail part tva et part ht). $sql='TODO'; } - if ($conf->global->MAIN_MODULE_COMPTABILITE) + if (! empty($conf->global->MAIN_MODULE_COMPTABILITE)) { // Count on delivery date (use invoice date as delivery is unknown) $sql = "SELECT d.rowid, d.product_type as dtype, d.".$fk_facture." as facid, d.tva_tx as rate, d.total_ht as total_ht, d.total_ttc as total_ttc, d.".$total_tva." as total_vat, d.description as descr,"; @@ -419,7 +419,7 @@ function vat_by_date($db, $y, $q, $date_start, $date_end, $modetax, $direction, $sql=''; if ($modetax == 1) // Option vat on delivery for goods (payment) and debit invoice for services { - if ($conf->global->MAIN_MODULE_ACCOUNTING) + if (! empty($conf->global->MAIN_MODULE_ACCOUNTING)) { // Count on invoice date // TODO a ce jour on se sait pas la compter car le montant tva d'un payment @@ -429,7 +429,7 @@ function vat_by_date($db, $y, $q, $date_start, $date_end, $modetax, $direction, // detail part tva et part ht). $sql='TODO'; } - if ($conf->global->MAIN_MODULE_COMPTABILITE) + if (! empty($conf->global->MAIN_MODULE_COMPTABILITE)) { // Count on invoice date $sql = "SELECT d.rowid, d.product_type as dtype, d.".$fk_facture." as facid, d.tva_tx as rate, d.total_ht as total_ht, d.total_ttc as total_ttc, d.".$total_tva." as total_vat, d.description as descr,"; @@ -465,7 +465,7 @@ function vat_by_date($db, $y, $q, $date_start, $date_end, $modetax, $direction, } else // Option vat on delivery for goods (payments) and payments for services { - if ($conf->global->MAIN_MODULE_ACCOUNTING) + if (! empty($conf->global->MAIN_MODULE_ACCOUNTING)) { // Count on payments date // TODO a ce jour on se sait pas la compter car le montant tva d'un payment @@ -475,7 +475,7 @@ function vat_by_date($db, $y, $q, $date_start, $date_end, $modetax, $direction, // detail part tva et part ht). $sql='TODO'; } - if ($conf->global->MAIN_MODULE_COMPTABILITE) + if (! empty($conf->global->MAIN_MODULE_COMPTABILITE)) { // Count on payments date $sql = "SELECT d.rowid, d.product_type as dtype, d.".$fk_facture." as facid, d.tva_tx as rate, d.total_ht as total_ht, d.total_ttc as total_ttc, d.".$total_tva." as total_vat, d.description as descr,"; diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 512c358b3c3..ae95eafd3e6 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -124,9 +124,9 @@ function print_eldy_menu($db,$atarget,$type_user) $classname = 'class="tmenu"'; } $chaine=""; - if ($conf->product->enabled) { $chaine.=$langs->trans("Products"); } + if (! empty($conf->product->enabled)) { $chaine.=$langs->trans("Products"); } if ($conf->product->enabled && $conf->service->enabled) { $chaine.="/"; } - if ($conf->service->enabled) { $chaine.=$langs->trans("Services"); } + if (! empty($conf->service->enabled)) { $chaine.=$langs->trans("Services"); } $idsel='products'; if ($user->rights->produit->lire || $user->rights->service->lire) @@ -738,7 +738,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after) if ($mainmenu == 'companies') { // Societes - if ($conf->societe->enabled) + if (! empty($conf->societe->enabled)) { $langs->load("companies"); $newmenu->add("/societe/index.php?leftmenu=thirdparties", $langs->trans("ThirdParty"), 0, $user->rights->societe->lire, '', $mainmenu, 'thirdparties'); @@ -767,7 +767,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after) } // Clients - if ($conf->societe->enabled) + if (! empty($conf->societe->enabled)) { $langs->load("commercial"); $newmenu->add("/comm/list.php?leftmenu=customers", $langs->trans("ListCustomersShort"), 1, $user->rights->societe->lire, '', $mainmenu, 'customers'); @@ -796,12 +796,12 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after) $newmenu->add("/contact/list.php?leftmenu=contacts", $langs->trans("List"), 1, $user->rights->societe->contact->lire); if (empty($conf->global->SOCIETE_DISABLE_PROSPECTS)) $newmenu->add("/contact/list.php?leftmenu=contacts&type=p", $langs->trans("Prospects"), 2, $user->rights->societe->contact->lire); $newmenu->add("/contact/list.php?leftmenu=contacts&type=c", $langs->trans("Customers"), 2, $user->rights->societe->contact->lire); - if ($conf->fournisseur->enabled) $newmenu->add("/contact/list.php?leftmenu=contacts&type=f", $langs->trans("Suppliers"), 2, $user->rights->societe->contact->lire); + if (! empty($conf->fournisseur->enabled)) $newmenu->add("/contact/list.php?leftmenu=contacts&type=f", $langs->trans("Suppliers"), 2, $user->rights->societe->contact->lire); $newmenu->add("/contact/list.php?leftmenu=contacts&type=o", $langs->trans("Others"), 2, $user->rights->societe->contact->lire); //$newmenu->add("/contact/list.php?userid=$user->id", $langs->trans("MyContacts"), 1, $user->rights->societe->contact->lire); // Categories - if ($conf->categorie->enabled) + if (! empty($conf->categorie->enabled)) { $langs->load("categories"); // Categories prospects/customers @@ -811,7 +811,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after) $newmenu->add("/categories/fiche.php?action=create&type=2", $langs->trans("NewCategory"), 1, $user->rights->categorie->creer); } // Categories suppliers - if ($conf->fournisseur->enabled) + if (! empty($conf->fournisseur->enabled)) { $newmenu->add("/categories/index.php?leftmenu=cat&type=1", $langs->trans("SuppliersCategoriesShort"), 0, $user->rights->categorie->lire); if (empty($user->societe_id)) @@ -1047,7 +1047,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after) /* if ($leftmenu=="ca") $newmenu->add("/compta/stats/cumul.php?leftmenu=ca","Cumule",2,$user->rights->compta->resultat->lire); - if ($conf->propal->enabled) { + if (! empty($conf->propal->enabled)) { if ($leftmenu=="ca") $newmenu->add("/compta/stats/prev.php?leftmenu=ca","Previsionnel",2,$user->rights->compta->resultat->lire); if ($leftmenu=="ca") $newmenu->add("/compta/stats/comp.php?leftmenu=ca","Transforme",2,$user->rights->compta->resultat->lire); } @@ -1129,11 +1129,11 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after) $newmenu->add("/product/fiche.php?leftmenu=product&action=create&type=0", $langs->trans("NewProduct"), 1, $user->rights->produit->creer); $newmenu->add("/product/liste.php?leftmenu=product&type=0", $langs->trans("List"), 1, $user->rights->produit->lire); } - if ($conf->propal->enabled) + if (! empty($conf->propal->enabled)) { $newmenu->add("/product/popuprop.php?leftmenu=stats&type=0", $langs->trans("Statistics"), 1, $user->rights->produit->lire && $user->rights->propale->lire); } - if ($conf->stock->enabled) + if (! empty($conf->stock->enabled)) { $newmenu->add("/product/reassort.php?type=0", $langs->trans("Stocks"), 1, $user->rights->produit->lire && $user->rights->stock->lire); } @@ -1148,7 +1148,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after) $newmenu->add("/product/fiche.php?leftmenu=service&action=create&type=1", $langs->trans("NewService"), 1, $user->rights->service->creer); } $newmenu->add("/product/liste.php?leftmenu=service&type=1", $langs->trans("List"), 1, $user->rights->service->lire); - if ($conf->propal->enabled) + if (! empty($conf->propal->enabled)) { $newmenu->add("/product/popuprop.php?leftmenu=stats&type=1", $langs->trans("Statistics"), 1, $user->rights->service->lire && $user->rights->propale->lire); } diff --git a/htdocs/core/modules/cheque/pdf/modules_chequereceipts.php b/htdocs/core/modules/cheque/pdf/modules_chequereceipts.php index f031ea2d4aa..66115ca5068 100644 --- a/htdocs/core/modules/cheque/pdf/modules_chequereceipts.php +++ b/htdocs/core/modules/cheque/pdf/modules_chequereceipts.php @@ -83,7 +83,7 @@ function chequereceipt_pdf_create($db, $id, $message, $modele, $outputlangs) // Positionne modele sur le nom du modele a utiliser if (! dol_strlen($modele)) { - if ($conf->global->FACTURE_ADDON_PDF) + if (! empty($conf->global->FACTURE_ADDON_PDF)) { $modele = $conf->global->FACTURE_ADDON_PDF; } diff --git a/htdocs/core/modules/cheque/pdf/pdf_blochet.class.php b/htdocs/core/modules/cheque/pdf/pdf_blochet.class.php index c54a539f297..c56f20f8773 100644 --- a/htdocs/core/modules/cheque/pdf/pdf_blochet.class.php +++ b/htdocs/core/modules/cheque/pdf/pdf_blochet.class.php @@ -135,7 +135,7 @@ class BordereauChequeBlochet extends ModeleChequeReceipts $pdf->SetCreator("Dolibarr ".DOL_VERSION); $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs))); $pdf->SetKeyWords($outputlangs->transnoentities("CheckReceipt")." ".$number); - if ($conf->global->MAIN_DISABLE_PDF_COMPRESSION) $pdf->SetCompression(false); + if (! empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) $pdf->SetCompression(false); $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right diff --git a/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php b/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php index e46a7bfc2b6..90e1ab86aeb 100644 --- a/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php +++ b/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php @@ -315,7 +315,7 @@ class doc_generic_order_odt extends ModelePDFCommandes if (! empty($usecontact)) { // On peut utiliser le nom de la societe du contact - if ($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) $socobject = $object->contact; + if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socobject = $object->contact; else $socobject = $object->client; } else diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index f6b29b52b0a..5d693e675a8 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -203,7 +203,7 @@ class pdf_einstein extends ModelePDFCommandes $pdf->SetCreator("Dolibarr ".DOL_VERSION); $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs))); $pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("Order")); - if ($conf->global->MAIN_DISABLE_PDF_COMPRESSION) $pdf->SetCompression(false); + if (! empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) $pdf->SetCompression(false); $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right @@ -531,7 +531,7 @@ if ($pageposafter > $pageposbefore) { if (empty($object->mode_reglement_code) || $object->mode_reglement_code == 'CHQ') { // Si mode reglement non force ou si force a CHQ - if ($conf->global->FACTURE_CHQ_NUMBER) + if (! empty($conf->global->FACTURE_CHQ_NUMBER)) { if ($conf->global->FACTURE_CHQ_NUMBER > 0) { diff --git a/htdocs/core/modules/dons/modules_don.php b/htdocs/core/modules/dons/modules_don.php index c86a75652a5..922685bf649 100644 --- a/htdocs/core/modules/dons/modules_don.php +++ b/htdocs/core/modules/dons/modules_don.php @@ -167,7 +167,7 @@ function don_create($db, $id, $message, $modele, $outputlangs) // Set template to use if (! dol_strlen($modele)) { - if ($conf->global->DON_ADDON_MODEL) + if (! empty($conf->global->DON_ADDON_MODEL)) { $modele = $conf->global->DON_ADDON_MODEL; } diff --git a/htdocs/core/modules/expedition/doc/pdf_expedition_merou.modules.php b/htdocs/core/modules/expedition/doc/pdf_expedition_merou.modules.php index 906a1a74e37..d569c780512 100644 --- a/htdocs/core/modules/expedition/doc/pdf_expedition_merou.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_expedition_merou.modules.php @@ -169,7 +169,7 @@ class pdf_expedition_merou extends ModelePdfExpedition $pdf->SetCreator("Dolibarr ".DOL_VERSION); $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs))); $pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("Sending")); - if ($conf->global->MAIN_DISABLE_PDF_COMPRESSION) $pdf->SetCompression(false); + if (! empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) $pdf->SetCompression(false); $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right @@ -571,7 +571,7 @@ class pdf_expedition_merou extends ModelePdfExpedition if (! empty($usecontact)) { // On peut utiliser le nom de la societe du contact - if ($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) $socname = $object->contact->socname; + if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socname = $object->contact->socname; else $socname = $object->client->nom; $carac_client_name=$outputlangs->convToOutputCharset($socname); } diff --git a/htdocs/core/modules/expedition/doc/pdf_expedition_rouget.modules.php b/htdocs/core/modules/expedition/doc/pdf_expedition_rouget.modules.php index f30b676cfc0..ce7e5db6dfb 100644 --- a/htdocs/core/modules/expedition/doc/pdf_expedition_rouget.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_expedition_rouget.modules.php @@ -156,7 +156,7 @@ class pdf_expedition_rouget extends ModelePdfExpedition $pdf->SetCreator("Dolibarr ".DOL_VERSION); $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs))); $pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("Sending")); - if ($conf->global->MAIN_DISABLE_PDF_COMPRESSION) $pdf->SetCompression(false); + if (! empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) $pdf->SetCompression(false); $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right @@ -436,7 +436,7 @@ class pdf_expedition_rouget extends ModelePdfExpedition } // Show barcode - if ($conf->barcode->enabled) + if (! empty($conf->barcode->enabled)) { $posx=105; } @@ -445,7 +445,7 @@ class pdf_expedition_rouget extends ModelePdfExpedition $posx=$this->marge_gauche+3; } //$pdf->Rect($this->marge_gauche, $this->marge_haute, $this->page_largeur-$this->marge_gauche-$this->marge_droite, 30); - if ($conf->barcode->enabled) + if (! empty($conf->barcode->enabled)) { // TODO Build code bar with function writeBarCode of barcode module for sending ref $object->ref //$pdf->SetXY($this->marge_gauche+3, $this->marge_haute+3); @@ -453,7 +453,7 @@ class pdf_expedition_rouget extends ModelePdfExpedition } $pdf->SetDrawColor(128,128,128); - if ($conf->barcode->enabled) + if (! empty($conf->barcode->enabled)) { // TODO Build code bar with function writeBarCode of barcode module for sending ref $object->ref //$pdf->SetXY($this->marge_gauche+3, $this->marge_haute+3); @@ -579,7 +579,7 @@ class pdf_expedition_rouget extends ModelePdfExpedition if (! empty($usecontact)) { // On peut utiliser le nom de la societe du contact - if ($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) $socname = $object->contact->socname; + if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socname = $object->contact->socname; else $socname = $object->client->nom; $carac_client_name=$outputlangs->convToOutputCharset($socname); } diff --git a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php index d796fee8441..78e28d24fec 100644 --- a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php +++ b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php @@ -326,7 +326,7 @@ class doc_generic_invoice_odt extends ModelePDFFactures if (! empty($usecontact)) { // On peut utiliser le nom de la societe du contact - if ($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) $socobject = $object->contact; + if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socobject = $object->contact; else $socobject = $object->client; } else diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index 2804e78fb6a..b723206ef5c 100755 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -204,7 +204,7 @@ class pdf_crabe extends ModelePDFFactures $pdf->SetCreator("Dolibarr ".DOL_VERSION); $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs))); $pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("Invoice")); - if ($conf->global->MAIN_DISABLE_PDF_COMPRESSION) $pdf->SetCompression(false); + if (! empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) $pdf->SetCompression(false); $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right @@ -643,7 +643,7 @@ if ($pageposafter > $pageposbefore) { if (empty($object->mode_reglement_code) || $object->mode_reglement_code == 'CHQ') { // Si mode reglement non force ou si force a CHQ - if ($conf->global->FACTURE_CHQ_NUMBER) + if (! empty($conf->global->FACTURE_CHQ_NUMBER)) { if ($conf->global->FACTURE_CHQ_NUMBER > 0) { diff --git a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php index 653ec0d4344..d12c18b8ee2 100644 --- a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php +++ b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php @@ -161,7 +161,7 @@ class pdf_soleil extends ModelePDFFicheinter $pdf->SetCreator("Dolibarr ".DOL_VERSION); $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs))); $pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("InterventionCard")); - if ($conf->global->MAIN_DISABLE_PDF_COMPRESSION) $pdf->SetCompression(false); + if (! empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) $pdf->SetCompression(false); $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right @@ -559,7 +559,7 @@ class pdf_soleil extends ModelePDFFicheinter if (! empty($usecontact)) { // On peut utiliser le nom de la societe du contact - if ($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) $socname = $object->contact->socname; + if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socname = $object->contact->socname; else $socname = $object->client->nom; $carac_client_name=$outputlangs->convToOutputCharset($socname); } diff --git a/htdocs/core/modules/fichinter/modules_fichinter.php b/htdocs/core/modules/fichinter/modules_fichinter.php index 0cda5ac63b7..452e94f9ad0 100644 --- a/htdocs/core/modules/fichinter/modules_fichinter.php +++ b/htdocs/core/modules/fichinter/modules_fichinter.php @@ -166,7 +166,7 @@ function fichinter_create($db, $object, $modele, $outputlangs, $hidedetails=0, $ // Positionne modele sur le nom du modele de fichinter a utiliser if (! dol_strlen($modele)) { - if ($conf->global->FICHEINTER_ADDON_PDF) + if (! empty($conf->global->FICHEINTER_ADDON_PDF)) { $modele = $conf->global->FICHEINTER_ADDON_PDF; } diff --git a/htdocs/core/modules/livraison/modules_livraison.php b/htdocs/core/modules/livraison/modules_livraison.php index 663c7198755..3e6d48bd29d 100644 --- a/htdocs/core/modules/livraison/modules_livraison.php +++ b/htdocs/core/modules/livraison/modules_livraison.php @@ -167,7 +167,7 @@ function delivery_order_pdf_create($db, $object, $modele, $outputlangs='') // Positionne modele sur le nom du modele de bon de livraison a utiliser if (! dol_strlen($modele)) { - if ($conf->global->LIVRAISON_ADDON_PDF) + if (! empty($conf->global->LIVRAISON_ADDON_PDF)) { $modele = $conf->global->LIVRAISON_ADDON_PDF; } diff --git a/htdocs/core/modules/livraison/pdf/pdf_sirocco.modules.php b/htdocs/core/modules/livraison/pdf/pdf_sirocco.modules.php index 78a16adf15f..6b9aa3a0279 100644 --- a/htdocs/core/modules/livraison/pdf/pdf_sirocco.modules.php +++ b/htdocs/core/modules/livraison/pdf/pdf_sirocco.modules.php @@ -158,7 +158,7 @@ class pdf_sirocco extends ModelePDFDeliveryOrder $pdf->SetCreator("Dolibarr ".DOL_VERSION); $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs))); $pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("DeliveryOrder")); - if ($conf->global->MAIN_DISABLE_PDF_COMPRESSION) $pdf->SetCompression(false); + if (! empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) $pdf->SetCompression(false); $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right @@ -351,7 +351,7 @@ if ($pageposafter > $pageposbefore) { $pdf->SetXY($this->marge_gauche,$posy); - if ($conf->global->MAIN_INFO_SOCIETE_NOM) + if (! empty($conf->global->MAIN_INFO_SOCIETE_NOM)) { $pdf->SetTextColor(0,0,200); $pdf->SetFont('','B', $default_font_size + 2); @@ -383,7 +383,7 @@ if ($pageposafter > $pageposbefore) { if (! empty($usecontact)) { // On peut utiliser le nom de la societe du contact - if ($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) $socname = $object->contact->socname; + if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socname = $object->contact->socname; else $socname = $object->client->nom; $carac_client_name=$outputlangs->convToOutputCharset($socname); } diff --git a/htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php b/htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php index eebe473fd1e..51f5bf88b69 100644 --- a/htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php +++ b/htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php @@ -181,7 +181,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder $pdf->SetCreator("Dolibarr ".DOL_VERSION); $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs))); $pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("DeliveryOrder")); - if ($conf->global->MAIN_DISABLE_PDF_COMPRESSION) $pdf->SetCompression(false); + if (! empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) $pdf->SetCompression(false); $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right @@ -642,7 +642,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder if (! empty($usecontact)) { // On peut utiliser le nom de la societe du contact - if ($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) $socname = $object->contact->socname; + if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socname = $object->contact->socname; else $socname = $object->client->nom; $carac_client_name=$outputlangs->convToOutputCharset($socname); } diff --git a/htdocs/core/modules/member/doc/pdf_standard.class.php b/htdocs/core/modules/member/doc/pdf_standard.class.php index e80973afd67..cf01009e6c2 100644 --- a/htdocs/core/modules/member/doc/pdf_standard.class.php +++ b/htdocs/core/modules/member/doc/pdf_standard.class.php @@ -461,7 +461,7 @@ class pdf_standard $pdf->SetCreator("Dolibarr ".DOL_VERSION); $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs))); $pdf->SetKeyWords($outputlangs->transnoentities('MembersCards')." ".$outputlangs->transnoentities("Foundation")." ".$outputlangs->convToOutputCharset($mysoc->name)); - if ($conf->global->MAIN_DISABLE_PDF_COMPRESSION) $pdf->SetCompression(false); + if (! empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) $pdf->SetCompression(false); $pdf->SetMargins(0,0); $pdf->SetAutoPageBreak(false); diff --git a/htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php b/htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php index 575d0172402..2b6ab211153 100644 --- a/htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php +++ b/htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php @@ -447,7 +447,7 @@ class pdf_standardlabel $pdf->SetCreator("Dolibarr ".DOL_VERSION); $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs))); $pdf->SetKeyWords($outputlangs->transnoentities('MembersLabels')." ".$outputlangs->transnoentities("Foundation")." ".$outputlangs->convToOutputCharset($mysoc->name)); - if ($conf->global->MAIN_DISABLE_PDF_COMPRESSION) $pdf->SetCompression(false); + if (! empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) $pdf->SetCompression(false); $pdf->SetMargins(0,0); $pdf->SetAutoPageBreak(false); diff --git a/htdocs/core/modules/project/pdf/pdf_baleine.modules.php b/htdocs/core/modules/project/pdf/pdf_baleine.modules.php index 72d5c19b697..dea29ca8bdb 100644 --- a/htdocs/core/modules/project/pdf/pdf_baleine.modules.php +++ b/htdocs/core/modules/project/pdf/pdf_baleine.modules.php @@ -154,7 +154,7 @@ class pdf_baleine extends ModelePDFProjects $pdf->SetCreator("Dolibarr ".DOL_VERSION); $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs))); $pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("Project")); - if ($conf->global->MAIN_DISABLE_PDF_COMPRESSION) $pdf->SetCompression(false); + if (! empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) $pdf->SetCompression(false); $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right diff --git a/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php b/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php index 86ff65a677a..5f15d9b86dc 100644 --- a/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php +++ b/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php @@ -314,7 +314,7 @@ class doc_generic_proposal_odt extends ModelePDFPropales if (! empty($usecontact)) { // On peut utiliser le nom de la societe du contact - if ($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) $socobject = $object->contact; + if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socobject = $object->contact; else $socobject = $object->client; } else diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index 6213ed5fd3a..f35957f44e5 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -203,7 +203,7 @@ class pdf_azur extends ModelePDFPropales $pdf->SetCreator("Dolibarr ".DOL_VERSION); $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs))); $pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("CommercialProposal")); - if ($conf->global->MAIN_DISABLE_PDF_COMPRESSION) $pdf->SetCompression(false); + if (! empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) $pdf->SetCompression(false); $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right @@ -563,7 +563,7 @@ class pdf_azur extends ModelePDFPropales if (empty($object->mode_reglement_code) || $object->mode_reglement_code == 'CHQ') { // Si mode reglement non force ou si force a CHQ - if ($conf->global->FACTURE_CHQ_NUMBER) + if (! empty($conf->global->FACTURE_CHQ_NUMBER)) { if ($conf->global->FACTURE_CHQ_NUMBER > 0) { diff --git a/htdocs/core/modules/rapport/pdf_paiement.class.php b/htdocs/core/modules/rapport/pdf_paiement.class.php index b238ee3cfe6..d18c14b6b6d 100644 --- a/htdocs/core/modules/rapport/pdf_paiement.class.php +++ b/htdocs/core/modules/rapport/pdf_paiement.class.php @@ -180,7 +180,7 @@ class pdf_paiement $pdf->SetCreator("Dolibarr ".DOL_VERSION); $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs))); //$pdf->SetKeyWords(); - if ($conf->global->MAIN_DISABLE_PDF_COMPRESSION) $pdf->SetCompression(false); + if (! empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) $pdf->SetCompression(false); $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right $pdf->SetAutoPageBreak(1,0); diff --git a/htdocs/core/modules/societe/modules_societe.class.php b/htdocs/core/modules/societe/modules_societe.class.php index fc96075f430..63b470a28a1 100644 --- a/htdocs/core/modules/societe/modules_societe.class.php +++ b/htdocs/core/modules/societe/modules_societe.class.php @@ -381,7 +381,7 @@ function thirdparty_doc_create($db, $object, $message, $modele, $outputlangs) // Positionne modele sur le nom du modele a utiliser if (! dol_strlen($modele)) { - if ($conf->global->COMPANY_ADDON_PDF) + if (! empty($conf->global->COMPANY_ADDON_PDF)) { $modele = $conf->global->COMPANY_ADDON_PDF; } diff --git a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php index 652082cc57a..76a7d0f7fe9 100755 --- a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php +++ b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php @@ -202,7 +202,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $pdf->SetCreator("Dolibarr ".DOL_VERSION); $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs))); $pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("Order")); - if ($conf->global->MAIN_DISABLE_PDF_COMPRESSION) $pdf->SetCompression(false); + if (! empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) $pdf->SetCompression(false); $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right @@ -913,7 +913,7 @@ if ($pageposafter > $pageposbefore) { if (! empty($usecontact)) { // On peut utiliser le nom de la societe du contact - if ($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) $socname = $object->contact->socname; + if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socname = $object->contact->socname; else $socname = $mysoc->nom; $carac_client_name=$outputlangs->convToOutputCharset($socname); } diff --git a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php index 9e8e5bdd064..3067a82ae45 100644 --- a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php +++ b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php @@ -214,7 +214,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $pdf->SetCreator("Dolibarr ".DOL_VERSION); $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs))); $pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("Order")); - if ($conf->global->MAIN_DISABLE_PDF_COMPRESSION) $pdf->SetCompression(false); + if (! empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) $pdf->SetCompression(false); $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right @@ -540,7 +540,7 @@ if ($pageposafter > $pageposbefore) { if (empty($object->mode_reglement_code) || $object->mode_reglement_code == 'CHQ') { // Si mode reglement non force ou si force a CHQ - if ($conf->global->FACTURE_CHQ_NUMBER) + if (! empty($conf->global->FACTURE_CHQ_NUMBER)) { if ($conf->global->FACTURE_CHQ_NUMBER > 0) { @@ -1016,7 +1016,7 @@ if ($pageposafter > $pageposbefore) { if (! empty($usecontact)) { // On peut utiliser le nom de la societe du contact - if ($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) $socname = $object->contact->socname; + if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socname = $object->contact->socname; else $socname = $object->client->name; $carac_client_name=$outputlangs->convToOutputCharset($socname); } diff --git a/htdocs/core/tpl/freeproductline_create.tpl.php b/htdocs/core/tpl/freeproductline_create.tpl.php index 013d6adb8c3..6dd54d977a8 100644 --- a/htdocs/core/tpl/freeproductline_create.tpl.php +++ b/htdocs/core/tpl/freeproductline_create.tpl.php @@ -39,9 +39,9 @@ if (! empty($conf->margin->enabled)) { ?> trans('BuyingPrice'); ?> "> pa_ht); ?>pa_ht == 0)?'n/a':price($line->marge_tx).'%'); ?> marque_tx).'%'; ?> trans('BuyingPrice'); ?>
'; print ''; print ''; print ''; - if ($conf->stock->enabled) + if (! empty($conf->stock->enabled)) { print ''; } @@ -741,7 +741,7 @@ if ($action == 'create') print_date_range($db->jdate($line->date_start),$db->jdate($line->date_end)); // Add description in form - if ($conf->global->PRODUIT_DESC_IN_FORM) + if (! empty($conf->global->PRODUIT_DESC_IN_FORM)) { print ($line->desc && $line->desc!=$line->product_label)?'
'.dol_htmlentitiesbr($line->desc):''; } @@ -800,7 +800,7 @@ if ($action == 'create') print ''; // Stock - if ($conf->stock->enabled) + if (! empty($conf->stock->enabled)) { print ''; //print ''; - if ($conf->stock->enabled) + if (! empty($conf->stock->enabled)) { print ''; } @@ -1266,7 +1266,7 @@ else //print ''; // Entrepot source - if ($conf->stock->enabled) + if (! empty($conf->stock->enabled)) { print ''; print ''; - if ($conf->stock->enabled) print ''; + if (! empty($conf->stock->enabled)) print ''; print ''; } print '
'; diff --git a/htdocs/expedition/fiche.php b/htdocs/expedition/fiche.php index 08d397603eb..0e09e08a240 100644 --- a/htdocs/expedition/fiche.php +++ b/htdocs/expedition/fiche.php @@ -33,9 +33,9 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/sendings.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/modules/expedition/modules_expedition.php'; if ($conf->product->enabled || $conf->service->enabled) require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; -if ($conf->propal->enabled) require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; -if ($conf->commande->enabled) require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; -if ($conf->stock->enabled) require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php'; +if (! empty($conf->propal->enabled)) require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; +if (! empty($conf->commande->enabled)) require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; +if (! empty($conf->stock->enabled)) require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php'; $langs->load("sendings"); $langs->load("companies"); @@ -581,7 +581,7 @@ if ($action == 'create') $author = new User($db); $author->fetch($object->user_author_id); - if ($conf->stock->enabled) $entrepot = new Entrepot($db); + if (! empty($conf->stock->enabled)) $entrepot = new Entrepot($db); /* * Document source @@ -694,7 +694,7 @@ if ($action == 'create') print ''.$langs->trans("QtyOrdered").''.$langs->trans("QtyShipped").''.$langs->trans("QtyToShip").''.$langs->trans("Warehouse").' / '.$langs->trans("Stock").''; if ($line->product_type == 0 || ! empty($conf->global->STOCK_SUPPORTS_SERVICES)) @@ -1166,7 +1166,7 @@ else print ''.$langs->trans("CalculatedVolume").''.$langs->trans("Size").''.$langs->trans("WarehouseSource").''.$lines[$i]->volume*$lines[$i]->qty_shipped.' '.measuring_units_string($lines[$i]->volume_units,"volume").''; if ($lines[$i]->entrepot_id > 0) diff --git a/htdocs/expedition/shipment.php b/htdocs/expedition/shipment.php index 1e0fa24744b..cfe6d41abba 100644 --- a/htdocs/expedition/shipment.php +++ b/htdocs/expedition/shipment.php @@ -172,7 +172,7 @@ if ($id > 0 || ! empty($ref)) // Onglet commande $nbrow=7; - if ($conf->projet->enabled) $nbrow++; + if (! empty($conf->projet->enabled)) $nbrow++; print ''; @@ -314,7 +314,7 @@ if ($id > 0 || ! empty($ref)) print ''; // Project - if ($conf->projet->enabled) + if (! empty($conf->projet->enabled)) { $langs->load('projects'); print ''; print ''; print ''; - if ($conf->stock->enabled) + if (! empty($conf->stock->enabled)) { print ''; } @@ -455,7 +455,7 @@ if ($id > 0 || ! empty($ref)) print_date_range($db->jdate($objp->date_start),$db->jdate($objp->date_end)); // Add description in form - if ($conf->global->PRODUIT_DESC_IN_FORM) + if (! empty($conf->global->PRODUIT_DESC_IN_FORM)) { print ($objp->description && $objp->description!=$objp->product_label)?'
'.dol_htmlentitiesbr($objp->description):''; } @@ -624,7 +624,7 @@ if ($id > 0 || ! empty($ref)) print ''; - if ($conf->stock->enabled) + if (! empty($conf->stock->enabled)) { print ''; print ''; // Project - if ($conf->projet->enabled) + if (! empty($conf->projet->enabled)) { $langs->load("project"); @@ -917,7 +917,7 @@ else if ($id > 0 || ! empty($ref)) print ''; // Project - if ($conf->projet->enabled) + if (! empty($conf->projet->enabled)) { $langs->load('projects'); print ''; diff --git a/htdocs/fourn/commande/dispatch.php b/htdocs/fourn/commande/dispatch.php index 18dd0fcd216..8c21eb7db28 100644 --- a/htdocs/fourn/commande/dispatch.php +++ b/htdocs/fourn/commande/dispatch.php @@ -31,7 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/modules/supplier_order/modules_commandefou require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/fourn.lib.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; -if ($conf->projet->enabled) require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; +if (! empty($conf->projet->enabled)) require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; $langs->load('orders'); $langs->load('sendings'); @@ -182,7 +182,7 @@ if ($id > 0 || ! empty($ref)) $disabled=1; - if ($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER) $disabled=0; + if (! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER)) $disabled=0; /* * Lignes de commandes diff --git a/htdocs/fourn/commande/fiche.php b/htdocs/fourn/commande/fiche.php index ecf15a06384..e1480bd6636 100644 --- a/htdocs/fourn/commande/fiche.php +++ b/htdocs/fourn/commande/fiche.php @@ -997,7 +997,7 @@ if ($id > 0 || ! empty($ref)) else $newref = $object->ref; $text=$langs->trans('ConfirmValidateOrder',$newref); - if ($conf->notification->enabled) + if (! empty($conf->notification->enabled)) { require_once DOL_DOCUMENT_ROOT .'/core/class/notify.class.php'; $notify=new Notify($db); @@ -1069,7 +1069,7 @@ if ($id > 0 || ! empty($ref)) * Commande */ $nbrow=8; - if ($conf->projet->enabled) $nbrow++; + if (! empty($conf->projet->enabled)) $nbrow++; //Local taxes if ($mysoc->country_code=='ES') @@ -1337,7 +1337,7 @@ if ($id > 0 || ! empty($ref)) print_date_range($date_start,$date_end); // Add description in form - if ($conf->global->PRODUIT_DESC_IN_FORM) print ($line->description && $line->description!=$product_static->libelle)?'
'.dol_htmlentitiesbr($line->description):''; + if (! empty($conf->global->PRODUIT_DESC_IN_FORM)) print ($line->description && $line->description!=$product_static->libelle)?'
'.dol_htmlentitiesbr($line->description):''; } // Description - Editor wysiwyg @@ -1509,7 +1509,7 @@ if ($id > 0 || ! empty($ref)) print ''; print ''."\n"; // Proforma - if ($conf->global->FACTURE_USE_PROFORMAT) + if (! empty($conf->global->FACTURE_USE_PROFORMAT)) { print ''; print ''; print ''; - if ($conf->banque->enabled) print ''; + if (! empty($conf->banque->enabled)) print ''; print ''; print ''; print ''; @@ -1399,7 +1399,7 @@ else print ''; print '\n"; print ''; - if ($conf->banque->enabled) + if (! empty($conf->banque->enabled)) { $bankaccountstatic->id=$objp->baid; $bankaccountstatic->ref=$objp->ref; @@ -1485,7 +1485,7 @@ else print ''; // Project - if ($conf->projet->enabled) + if (! empty($conf->projet->enabled)) { $langs->load('projects'); print ''; @@ -1668,7 +1668,7 @@ else print_date_range($date_start,$date_end); // Add description in form - if ($conf->global->PRODUIT_DESC_IN_FORM) print ($object->lines[$i]->description && $object->lines[$i]->description!=$product_static->libelle)?'
'.dol_htmlentitiesbr($object->lines[$i]->description):''; + if (! empty($conf->global->PRODUIT_DESC_IN_FORM)) print ($object->lines[$i]->description && $object->lines[$i]->description!=$product_static->libelle)?'
'.dol_htmlentitiesbr($object->lines[$i]->description):''; } // Description - Editor wysiwyg @@ -1784,7 +1784,7 @@ else print ''; print ''; print ''; - if ($conf->banque->enabled) + if (! empty($conf->banque->enabled)) { print ''; // Module Adherent - if ($conf->adherent->enabled) + if (! empty($conf->adherent->enabled)) { $langs->load("members"); $langs->load("users"); diff --git a/htdocs/fourn/index.php b/htdocs/fourn/index.php index b3935d7c6e6..a6db039d2c9 100644 --- a/htdocs/fourn/index.php +++ b/htdocs/fourn/index.php @@ -99,7 +99,7 @@ else // Draft orders -if ($conf->fournisseur->enabled) +if (! empty($conf->fournisseur->enabled)) { $langs->load("orders"); diff --git a/htdocs/fourn/liste.php b/htdocs/fourn/liste.php index 956dbf82b7e..5c99d0d0bc6 100644 --- a/htdocs/fourn/liste.php +++ b/htdocs/fourn/liste.php @@ -119,7 +119,7 @@ if ($resql) // Filter on categories $moreforfilter=''; - if ($conf->categorie->enabled) + if (! empty($conf->categorie->enabled)) { $moreforfilter.=$langs->trans('Categories'). ': '; $moreforfilter.=$htmlother->select_categories(1,$search_categ,'search_categ',1); diff --git a/htdocs/fourn/paiement/fiche.php b/htdocs/fourn/paiement/fiche.php index e8b601fe43c..d5b40c491cb 100644 --- a/htdocs/fourn/paiement/fiche.php +++ b/htdocs/fourn/paiement/fiche.php @@ -197,7 +197,7 @@ if ($result > 0) // Amount print ''; - if ($conf->global->BILL_ADD_PAYMENT_VALIDATION) + if (! empty($conf->global->BILL_ADD_PAYMENT_VALIDATION)) { print ''; } @@ -208,7 +208,7 @@ if ($result > 0) print ''; // Bank account - if ($conf->banque->enabled) + if (! empty($conf->banque->enabled)) { if ($object->bank_account) { @@ -308,7 +308,7 @@ if ($result > 0) */ print '
'; - if ($conf->global->BILL_ADD_PAYMENT_VALIDATION) + if (! empty($conf->global->BILL_ADD_PAYMENT_VALIDATION)) { if ($user->societe_id == 0 && $object->statut == 0 && $action == '') { diff --git a/htdocs/fourn/product/categorie.php b/htdocs/fourn/product/categorie.php index 653093695d3..2b230edf3c1 100644 --- a/htdocs/fourn/product/categorie.php +++ b/htdocs/fourn/product/categorie.php @@ -77,14 +77,14 @@ if ($_GET["id"]) $h++; - if ($conf->stock->enabled) + if (! empty($conf->stock->enabled)) { $head[$h][0] = DOL_URL_ROOT."/product/stock/product.php?id=".$product->id; $head[$h][1] = $langs->trans("Stock"); $h++; } - if ($conf->fournisseur->enabled) + if (! empty($conf->fournisseur->enabled)) { $head[$h][0] = DOL_URL_ROOT."/product/fournisseurs.php?id=".$product->id; $head[$h][1] = $langs->trans("Suppliers"); @@ -100,7 +100,7 @@ if ($_GET["id"]) $h++; //affichage onglet cat�gorie - if ($conf->categorie->enabled){ + if (! empty($conf->categorie->enabled)){ $head[$h][0] = DOL_URL_ROOT."/fourn/product/categorie.php?id=".$product->id; $head[$h][1] = $langs->trans('Categories'); $hselected = $h; diff --git a/htdocs/fourn/product/index.php b/htdocs/fourn/product/index.php index 05451b8b751..8a56d9e9fe3 100644 --- a/htdocs/fourn/product/index.php +++ b/htdocs/fourn/product/index.php @@ -78,13 +78,13 @@ if ($resql) print '
'; @@ -389,7 +389,7 @@ if ($id > 0 || ! empty($ref)) print ''.$langs->trans("QtyOrdered").''.$langs->trans("QtyShipped").''.$langs->trans("KeepToShip").''.$langs->trans("Stock").'
'.$langs->trans("WarehouseSource").''; diff --git a/htdocs/fichinter/apercu.php b/htdocs/fichinter/apercu.php index 2501f4cd88f..1e0a61b429f 100644 --- a/htdocs/fichinter/apercu.php +++ b/htdocs/fichinter/apercu.php @@ -28,7 +28,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/fichinter.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php'; -if ($conf->projet->enabled) require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; +if (! empty($conf->projet->enabled)) require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; $langs->load('interventions'); diff --git a/htdocs/fichinter/fiche.php b/htdocs/fichinter/fiche.php index b8bed3409d7..5de9d2203c6 100644 --- a/htdocs/fichinter/fiche.php +++ b/htdocs/fichinter/fiche.php @@ -30,7 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/modules/fichinter/modules_fichinter.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/fichinter.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; -if ($conf->projet->enabled) +if (! empty($conf->projet->enabled)) { require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; @@ -771,7 +771,7 @@ if ($action == 'create') print '
'; print $langs->trans("AddNewLine").' - '; - if ($conf->service->enabled) + if (! empty($conf->service->enabled)) { print $langs->trans('RecordedProductsAndServices'); } diff --git a/htdocs/fourn/facture/fiche.php b/htdocs/fourn/facture/fiche.php index 34e2cf02795..52509de0d45 100644 --- a/htdocs/fourn/facture/fiche.php +++ b/htdocs/fourn/facture/fiche.php @@ -34,7 +34,7 @@ require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/paiementfourn.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/fourn.lib.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; -if ($conf->projet->enabled) require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; +if (! empty($conf->projet->enabled)) require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; $langs->load('bills'); @@ -1033,7 +1033,7 @@ if ($action == 'create') print '
'; print ''; @@ -1351,8 +1351,8 @@ else * List of payments */ $nbrows=7; $nbcols=2; - if ($conf->projet->enabled) $nbrows++; - if ($conf->banque->enabled) $nbcols++; + if (! empty($conf->projet->enabled)) $nbrows++; + if (! empty($conf->banque->enabled)) $nbcols++; // Local taxes if ($mysoc->country_code=='ES') @@ -1384,7 +1384,7 @@ else print '
'.$langs->trans('Payments').''.$langs->trans('Type').''.$langs->trans('BankAccount').''.$langs->trans('BankAccount').''.$langs->trans('Amount').' 
'.img_object($langs->trans('ShowPayment'),'payment').' '.dol_print_date($db->jdate($objp->dp),'day')."'.$objp->paiement_type.' '.$objp->num_paiement.'
'.$langs->trans('AmountTTC').''.price($object->total_ttc).''.$langs->trans('Currency'.$conf->currency).'
'; print $langs->trans("AddNewLine").' - '; - if ($conf->service->enabled) + if (! empty($conf->service->enabled)) { print $langs->trans('RecordedProductsAndServices'); } diff --git a/htdocs/fourn/facture/paiement.php b/htdocs/fourn/facture/paiement.php index ea3a11927ab..8e45d645873 100644 --- a/htdocs/fourn/facture/paiement.php +++ b/htdocs/fourn/facture/paiement.php @@ -90,7 +90,7 @@ if ($action == 'add_paiement') $error++; } - if ($conf->banque->enabled) + if (! empty($conf->banque->enabled)) { // Si module bank actif, un compte est obligatoire lors de la saisie // d'un paiement @@ -239,7 +239,7 @@ if ($action == 'create' || $action == 'add_paiement') print ''; print '
'.$langs->trans('Numero').'
'.$langs->trans('Account').''; $form->select_comptes(empty($_POST['accountid'])?'':$_POST['accountid'],'accountid',0,'',2); diff --git a/htdocs/fourn/fiche.php b/htdocs/fourn/fiche.php index 488f260237a..d085c478710 100644 --- a/htdocs/fourn/fiche.php +++ b/htdocs/fourn/fiche.php @@ -30,7 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; -if ($conf->adherent->enabled) require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; +if (! empty($conf->adherent->enabled)) require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; $langs->load('suppliers'); $langs->load('products'); @@ -184,7 +184,7 @@ if ($object->fetch($id)) print '
'.$langs->trans('Amount').''.price($object->montant).' '.$langs->trans('Currency'.$conf->currency).'
'.$langs->trans('Status').''.$object->getLibStatut(4).'
'; print ''; -if ($conf->product->enabled) +if (! empty($conf->product->enabled)) { print ""; print ''; print ""; } -if ($conf->service->enabled) +if (! empty($conf->service->enabled)) { print ""; print ''; diff --git a/htdocs/fourn/product/photos.php b/htdocs/fourn/product/photos.php index 7dc2d69c44d..acaf3227e3c 100644 --- a/htdocs/fourn/product/photos.php +++ b/htdocs/fourn/product/photos.php @@ -70,7 +70,7 @@ if ($id) $h++; - if ($conf->stock->enabled) + if (! empty($conf->stock->enabled)) { $head[$h][0] = DOL_URL_ROOT."/product/stock/product.php?id=".$object->id; $head[$h][1] = $langs->trans("Stock"); @@ -83,7 +83,7 @@ if ($id) $h++; //Affichage onglet Categories - if ($conf->categorie->enabled){ + if (! empty($conf->categorie->enabled)){ $head[$h][0] = DOL_URL_ROOT."/fourn/product/categorie.php?id=".$object->id; $head[$h][1] = $langs->trans('Categories'); $h++; diff --git a/htdocs/livraison/class/livraison.class.php b/htdocs/livraison/class/livraison.class.php index e653f6f59d1..3a26cda4c67 100644 --- a/htdocs/livraison/class/livraison.class.php +++ b/htdocs/livraison/class/livraison.class.php @@ -28,8 +28,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php'; -if ($conf->propal->enabled) require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; -if ($conf->commande->enabled) require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; +if (! empty($conf->propal->enabled)) require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; +if (! empty($conf->commande->enabled)) require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; /** @@ -334,7 +334,7 @@ class Livraison extends CommonObject if ($user->rights->expedition->livraison->valider) { - if ($conf->global->LIVRAISON_ADDON) + if (! empty($conf->global->LIVRAISON_ADDON)) { // Definition du nom de module de numerotation de commande $modName = $conf->global->LIVRAISON_ADDON; diff --git a/htdocs/livraison/fiche.php b/htdocs/livraison/fiche.php index 5c36dbd04fd..d6e005ea5dd 100644 --- a/htdocs/livraison/fiche.php +++ b/htdocs/livraison/fiche.php @@ -314,7 +314,7 @@ if ($action == 'create') print ''; print ''; print ''; - if ($conf->stock->enabled) + if (! empty($conf->stock->enabled)) { print ''; } @@ -386,7 +386,7 @@ if ($action == 'create') $quantite_commandee = $line->qty; $quantite_a_livrer = $quantite_commandee - $quantite_livree; - if ($conf->stock->enabled) + if (! empty($conf->stock->enabled)) { $stock = $product->stock_warehouse[$_GET["entrepot_id"]]->real; $stock+=0; // Convertit en numerique diff --git a/htdocs/paybox/admin/paybox.php b/htdocs/paybox/admin/paybox.php index af7821b5bd2..f7965619ac3 100644 --- a/htdocs/paybox/admin/paybox.php +++ b/htdocs/paybox/admin/paybox.php @@ -194,23 +194,23 @@ print '

'; print ''.$langs->trans("FollowingUrlAreAvailableToMakePayments").':
'; print img_picto('','object_globe.png').' '.$langs->trans("ToOfferALinkForOnlinePaymentOnFreeAmount",$servicename).':
'; print ''.DOL_MAIN_URL_ROOT.'/public/paybox/newpayment.php?amount=9.99&tag=your_free_tag'."
\n"; -if ($conf->commande->enabled) +if (! empty($conf->commande->enabled)) { print img_picto('','object_globe.png').' '.$langs->trans("ToOfferALinkForOnlinePaymentOnOrder",$servicename).':
'; print ''.DOL_MAIN_URL_ROOT.'/public/paybox/newpayment.php?source=order&ref=order_ref'."
\n"; } -if ($conf->facture->enabled) +if (! empty($conf->facture->enabled)) { print img_picto('','object_globe.png').' '.$langs->trans("ToOfferALinkForOnlinePaymentOnInvoice",$servicename).':
'; print ''.DOL_MAIN_URL_ROOT.'/public/paybox/newpayment.php?source=invoice&ref=invoice_ref'."
\n"; // print $langs->trans("SetupPayBoxToHavePaymentCreatedAutomatically",$langs->transnoentitiesnoconv("FeatureNotYetAvailable"))."
\n"; } -if ($conf->contrat->enabled) +if (! empty($conf->contrat->enabled)) { print img_picto('','object_globe.png').' '.$langs->trans("ToOfferALinkForOnlinePaymentOnContractLine",$servicename).':
'; print ''.DOL_MAIN_URL_ROOT.'/public/paybox/newpayment.php?source=contractline&ref=contractline_ref'."
\n"; } -if ($conf->adherent->enabled) +if (! empty($conf->adherent->enabled)) { print img_picto('','object_globe.png').' '.$langs->trans("ToOfferALinkForOnlinePaymentOnMemberSubscription",$servicename).':
'; print ''.DOL_MAIN_URL_ROOT.'/public/paybox/newpayment.php?source=membersubscription&ref=member_ref'."
\n"; diff --git a/htdocs/paybox/lib/paybox.lib.php b/htdocs/paybox/lib/paybox.lib.php index 925fda59120..13247bc1637 100755 --- a/htdocs/paybox/lib/paybox.lib.php +++ b/htdocs/paybox/lib/paybox.lib.php @@ -47,7 +47,7 @@ function llxHeaderPaybox($title, $head = "") print ''."\n"; print "".$title."\n"; if ($head) print $head."\n"; - if ($conf->global->PAYBOX_CSS_URL) print ''."\n"; + if (! empty($conf->global->PAYBOX_CSS_URL)) print ''."\n"; else { print ''."\n"; @@ -91,11 +91,11 @@ function print_paybox_redirect($PRICE,$CURRENCY,$EMAIL,$urlok,$urlko,$TAG) // Clean parameters $PBX_IDENTIFIANT="2"; // Identifiant pour v2 test - if ($conf->global->PAYBOX_PBX_IDENTIFIANT) $PBX_IDENTIFIANT=$conf->global->PAYBOX_PBX_IDENTIFIANT; + if (! empty($conf->global->PAYBOX_PBX_IDENTIFIANT)) $PBX_IDENTIFIANT=$conf->global->PAYBOX_PBX_IDENTIFIANT; $IBS_SITE="1999888"; // Site test - if ($conf->global->PAYBOX_IBS_SITE) $IBS_SITE=$conf->global->PAYBOX_IBS_SITE; + if (! empty($conf->global->PAYBOX_IBS_SITE)) $IBS_SITE=$conf->global->PAYBOX_IBS_SITE; $IBS_RANG="99"; // Rang test - if ($conf->global->PAYBOX_IBS_RANG) $IBS_RANG=$conf->global->PAYBOX_IBS_RANG; + if (! empty($conf->global->PAYBOX_IBS_RANG)) $IBS_RANG=$conf->global->PAYBOX_IBS_RANG; $IBS_DEVISE="840"; // Currency (Dollar US by default) if ($CURRENCY == 'EUR') $IBS_DEVISE="978"; if ($CURRENCY == 'USD') $IBS_DEVISE="840"; diff --git a/htdocs/paypal/admin/paypal.php b/htdocs/paypal/admin/paypal.php index 5a2b28b722b..c94d49d4da0 100644 --- a/htdocs/paypal/admin/paypal.php +++ b/htdocs/paypal/admin/paypal.php @@ -283,7 +283,7 @@ $token=''; print ''.$langs->trans("FollowingUrlAreAvailableToMakePayments").':
'; print img_picto('','object_globe.png').' '.$langs->trans("ToOfferALinkForOnlinePaymentOnFreeAmount",$servicename).':
'; print ''.getPaypalPaymentUrl(1,'free')."

\n"; -if ($conf->commande->enabled) +if (! empty($conf->commande->enabled)) { print img_picto('','object_globe.png').' '.$langs->trans("ToOfferALinkForOnlinePaymentOnOrder",$servicename).':
'; print ''.getPaypalPaymentUrl(1,'order')."
\n"; @@ -305,7 +305,7 @@ if ($conf->commande->enabled) } print '
'; } -if ($conf->facture->enabled) +if (! empty($conf->facture->enabled)) { print img_picto('','object_globe.png').' '.$langs->trans("ToOfferALinkForOnlinePaymentOnInvoice",$servicename).':
'; print ''.getPaypalPaymentUrl(1,'invoice')."
\n"; @@ -327,7 +327,7 @@ if ($conf->facture->enabled) } print '
'; } -if ($conf->contrat->enabled) +if (! empty($conf->contrat->enabled)) { print img_picto('','object_globe.png').' '.$langs->trans("ToOfferALinkForOnlinePaymentOnContractLine",$servicename).':
'; print ''.getPaypalPaymentUrl(1,'contractline')."
\n"; @@ -349,7 +349,7 @@ if ($conf->contrat->enabled) } print '
'; } -if ($conf->adherent->enabled) +if (! empty($conf->adherent->enabled)) { print img_picto('','object_globe.png').' '.$langs->trans("ToOfferALinkForOnlinePaymentOnMemberSubscription",$servicename).':
'; print ''.getPaypalPaymentUrl(1,'membersubscription')."
\n"; diff --git a/htdocs/paypal/lib/paypal.lib.php b/htdocs/paypal/lib/paypal.lib.php index dbaadbce9fb..72843f6aeeb 100755 --- a/htdocs/paypal/lib/paypal.lib.php +++ b/htdocs/paypal/lib/paypal.lib.php @@ -46,7 +46,7 @@ function llxHeaderPaypal($title, $head = "") print ''."\n"; print "".$title."\n"; if ($head) print $head."\n"; - if ($conf->global->PAYPAL_CSS_URL) print ''."\n"; + if (! empty($conf->global->PAYPAL_CSS_URL)) print ''."\n"; else { print ''."\n"; @@ -643,7 +643,7 @@ function hash_call($methodName,$nvpStr) // TODO problem with triggers $API_version="56"; - if ($conf->global->PAYPAL_API_SANDBOX) + if (! empty($conf->global->PAYPAL_API_SANDBOX)) { $API_Endpoint = "https://api-3t.sandbox.paypal.com/nvp"; $API_Url = "https://www.sandbox.paypal.com/webscr?cmd=_express-checkout&token="; @@ -656,13 +656,13 @@ function hash_call($methodName,$nvpStr) // Clean parameters $PAYPAL_API_USER=""; - if ($conf->global->PAYPAL_API_USER) $PAYPAL_API_USER=$conf->global->PAYPAL_API_USER; + if (! empty($conf->global->PAYPAL_API_USER)) $PAYPAL_API_USER=$conf->global->PAYPAL_API_USER; $PAYPAL_API_PASSWORD=""; - if ($conf->global->PAYPAL_API_PASSWORD) $PAYPAL_API_PASSWORD=$conf->global->PAYPAL_API_PASSWORD; + if (! empty($conf->global->PAYPAL_API_PASSWORD)) $PAYPAL_API_PASSWORD=$conf->global->PAYPAL_API_PASSWORD; $PAYPAL_API_SIGNATURE=""; - if ($conf->global->PAYPAL_API_SIGNATURE) $PAYPAL_API_SIGNATURE=$conf->global->PAYPAL_API_SIGNATURE; + if (! empty($conf->global->PAYPAL_API_SIGNATURE)) $PAYPAL_API_SIGNATURE=$conf->global->PAYPAL_API_SIGNATURE; $PAYPAL_API_SANDBOX=""; - if ($conf->global->PAYPAL_API_SANDBOX) $PAYPAL_API_SANDBOX=$conf->global->PAYPAL_API_SANDBOX; + if (! empty($conf->global->PAYPAL_API_SANDBOX)) $PAYPAL_API_SANDBOX=$conf->global->PAYPAL_API_SANDBOX; // TODO END problem with triggers dol_syslog("Paypal API endpoint ".$API_Endpoint); diff --git a/htdocs/paypal/lib/paypalfunctions.lib.php b/htdocs/paypal/lib/paypalfunctions.lib.php index 07e0e2bbb3f..ad8aae0d05e 100755 --- a/htdocs/paypal/lib/paypalfunctions.lib.php +++ b/htdocs/paypal/lib/paypalfunctions.lib.php @@ -48,7 +48,7 @@ $API_version="56"; ' For the sandbox, the URL is https://www.sandbox.paypal.com/webscr&cmd=_express-checkout&token= ' For the live site, the URL is https://www.paypal.com/webscr&cmd=_express-checkout&token= */ -if ($conf->global->PAYPAL_API_SANDBOX) +if (! empty($conf->global->PAYPAL_API_SANDBOX)) { $API_Endpoint = "https://api-3t.sandbox.paypal.com/nvp"; $API_Url = "https://www.sandbox.paypal.com/webscr?cmd=_express-checkout&token="; @@ -61,13 +61,13 @@ else // Clean parameters $PAYPAL_API_USER=""; -if ($conf->global->PAYPAL_API_USER) $PAYPAL_API_USER=$conf->global->PAYPAL_API_USER; +if (! empty($conf->global->PAYPAL_API_USER)) $PAYPAL_API_USER=$conf->global->PAYPAL_API_USER; $PAYPAL_API_PASSWORD=""; -if ($conf->global->PAYPAL_API_PASSWORD) $PAYPAL_API_PASSWORD=$conf->global->PAYPAL_API_PASSWORD; +if (! empty($conf->global->PAYPAL_API_PASSWORD)) $PAYPAL_API_PASSWORD=$conf->global->PAYPAL_API_PASSWORD; $PAYPAL_API_SIGNATURE=""; -if ($conf->global->PAYPAL_API_SIGNATURE) $PAYPAL_API_SIGNATURE=$conf->global->PAYPAL_API_SIGNATURE; +if (! empty($conf->global->PAYPAL_API_SIGNATURE)) $PAYPAL_API_SIGNATURE=$conf->global->PAYPAL_API_SIGNATURE; $PAYPAL_API_SANDBOX=""; -if ($conf->global->PAYPAL_API_SANDBOX) $PAYPAL_API_SANDBOX=$conf->global->PAYPAL_API_SANDBOX; +if (! empty($conf->global->PAYPAL_API_SANDBOX)) $PAYPAL_API_SANDBOX=$conf->global->PAYPAL_API_SANDBOX; // Proxy $PROXY_HOST = $conf->global->MAIN_PROXY_HOST; diff --git a/htdocs/product/canvas/product/tpl/card_create.tpl.php b/htdocs/product/canvas/product/tpl/card_create.tpl.php index 65439ec797b..88738b97f51 100755 --- a/htdocs/product/canvas/product/tpl/card_create.tpl.php +++ b/htdocs/product/canvas/product/tpl/card_create.tpl.php @@ -57,7 +57,7 @@ $statutarray=array('1' => $langs->trans("OnSell"), '0' => $langs->trans("NotOnSe -stock->enabled) { ?> +stock->enabled)) { ?> diff --git a/htdocs/product/canvas/product/tpl/card_edit.tpl.php b/htdocs/product/canvas/product/tpl/card_edit.tpl.php index 2fd2d3a5fc1..a60865e0867 100755 --- a/htdocs/product/canvas/product/tpl/card_edit.tpl.php +++ b/htdocs/product/canvas/product/tpl/card_edit.tpl.php @@ -57,7 +57,7 @@ dol_htmloutput_errors($object->error,$object->errors); -stock->enabled) { ?> +stock->enabled)) { ?> diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 5b9d06cb8cc..54995bb2e32 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -477,7 +477,7 @@ class Product extends CommonObject $this->id = $id; // Multilangs - if($conf->global->MAIN_MULTILANGS) + if (! empty($conf->global->MAIN_MULTILANGS)) { if ( $this->setMultiLangs() < 0) { diff --git a/htdocs/product/composition/fiche.php b/htdocs/product/composition/fiche.php index 15d1cfc6b27..407c2869225 100644 --- a/htdocs/product/composition/fiche.php +++ b/htdocs/product/composition/fiche.php @@ -126,14 +126,14 @@ if ($action == 'search') $current_lang = $langs->getDefaultLang(); $sql = 'SELECT DISTINCT p.rowid, p.ref, p.label, p.price, p.fk_product_type as type'; - if ($conf->global->MAIN_MULTILANGS) $sql.= ', pl.label as labelm, pl.description as descriptionm'; + if (! empty($conf->global->MAIN_MULTILANGS)) $sql.= ', pl.label as labelm, pl.description as descriptionm'; $sql.= ' FROM '.MAIN_DB_PREFIX.'product as p'; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie_product as cp ON p.rowid = cp.fk_product'; - if ($conf->global->MAIN_MULTILANGS) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_lang as pl ON pl.fk_product = p.rowid AND lang='".($current_lang)."'"; + if (! empty($conf->global->MAIN_MULTILANGS)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_lang as pl ON pl.fk_product = p.rowid AND lang='".($current_lang)."'"; $sql.= ' WHERE p.entity IN ('.getEntity("product", 1).')'; if ($key != "") { - if ($conf->global->MAIN_MULTILANGS) + if (! empty($conf->global->MAIN_MULTILANGS)) { $sql.= " AND (p.ref LIKE '%".$key."%'"; $sql.= " OR pl.label LIKE '%".$key."%')"; @@ -217,14 +217,14 @@ if ($id || $ref) $productstatic->id=$value['id']; $productstatic->type=$value['type']; $productstatic->ref=$value['fullpath']; - if ($conf->stock->enabled) $productstatic->load_stock(); + if (! empty($conf->stock->enabled)) $productstatic->load_stock(); //var_dump($value); //print '
'.$productstatic->ref.'
'; //print $productstatic->getNomUrl(1).'
'; //print $value[0]; // This contains a tr line. print ''; print ''; - if ($conf->stock->enabled) print ''; + if (! empty($conf->stock->enabled)) print ''; print ''; } print '
'.$langs->trans("Statistics").'
'.$langs->trans("Products").''.round($prodser[0]).'
'.$langs->trans("Services").''.round($prodser[1]).'Quan. commandeeQuan. livreeQuan. a livrer'.$langs->trans("Stock").'selectarray('statut_buy',$statutarray,$object->status_tobuy); ?>
trans("StockLimit"); ?>
selectarray('statut_buy',$statutarray,$object->status_tobuy); ?>
trans("StockLimit"); ?>
'.$productstatic->getNomUrl(1,'composition').' ('.$value['nb'].')    '.$langs->trans("Stock").' : '.$productstatic->stock_reel.''.$langs->trans("Stock").' : '.$productstatic->stock_reel.'
'; @@ -302,14 +302,14 @@ if ($id || $ref) $productstatic->id=$value['id']; $productstatic->type=$value['type']; $productstatic->ref=$value['fullpath']; - if ($conf->stock->enabled) $productstatic->load_stock(); + if (! empty($conf->stock->enabled)) $productstatic->load_stock(); //var_dump($value); //print '
'.$productstatic->ref.'
'; //print $productstatic->getNomUrl(1).'
'; //print $value[0]; // This contains a tr line. print '
'.$productstatic->getNomUrl(1,'composition').' ('.$value['nb'].')    '.$langs->trans("Stock").' : '.$productstatic->stock_reel.''.$langs->trans("Stock").' : '.$productstatic->stock_reel.'
'; @@ -345,7 +345,7 @@ if ($id || $ref) print '
'; $rowspan=1; - if ($conf->categorie->enabled) $rowspan++; + if (! empty($conf->categorie->enabled)) $rowspan++; print_fiche_titre($langs->trans("ProductToAddSearch"),'',''); print '
'; @@ -363,7 +363,7 @@ if ($id || $ref) print '
'; print ''; print '
'.$langs->trans("CategoryFilter").'   '.$form->select_all_categories(0,$catMere).'
'; print ''; -if ($conf->product->enabled) +if (! empty($conf->product->enabled)) { $statProducts = ""; $statProducts.= ''; @@ -126,7 +126,7 @@ if ($conf->product->enabled) $statProducts.= ''; $statProducts.= ""; } -if ($conf->service->enabled) +if (! empty($conf->service->enabled)) { $statServices = ""; $statServices.= ''; @@ -198,7 +198,7 @@ if ($result) $objp = $db->fetch_object($result); //Multilangs - if ($conf->global->MAIN_MULTILANGS) + if (! empty($conf->global->MAIN_MULTILANGS)) { $sql = "SELECT label"; $sql.= " FROM ".MAIN_DB_PREFIX."product_lang"; diff --git a/htdocs/product/price.php b/htdocs/product/price.php index 724b13a0467..cd0ce9ba307 100644 --- a/htdocs/product/price.php +++ b/htdocs/product/price.php @@ -53,7 +53,7 @@ if ($action == 'update_price' && ! $_POST["cancel"] && ($user->rights->produit-> $result = $object->fetch($id); // MultiPrix - if($conf->global->PRODUIT_MULTIPRICES) + if (! empty($conf->global->PRODUIT_MULTIPRICES)) { $newprice=''; $newprice_min=''; @@ -462,7 +462,7 @@ if ($result) print ''; print ''; - if($conf->global->PRODUIT_MULTIPRICES) + if (! empty($conf->global->PRODUIT_MULTIPRICES)) { print ''; } @@ -488,7 +488,7 @@ if ($result) print ""; // Price level - if ($conf->global->PRODUIT_MULTIPRICES) + if (! empty($conf->global->PRODUIT_MULTIPRICES)) { print '"; } diff --git a/htdocs/product/stock/fiche.php b/htdocs/product/stock/fiche.php index b748d03069b..f4807cfb822 100644 --- a/htdocs/product/stock/fiche.php +++ b/htdocs/product/stock/fiche.php @@ -390,7 +390,7 @@ else $objp = $db->fetch_object($resql); // Multilangs - if ($conf->global->MAIN_MULTILANGS) // si l'option est active + if (! empty($conf->global->MAIN_MULTILANGS)) // si l'option est active { $sql = "SELECT label"; $sql.= " FROM ".MAIN_DB_PREFIX."product_lang"; diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php index 23e884c2e4a..dc3491d1e18 100644 --- a/htdocs/product/stock/product.php +++ b/htdocs/product/stock/product.php @@ -252,17 +252,17 @@ if ($id > 0 || $ref) print ''; // Calculating a theorical value of stock if stock increment is done on real sending - if ($conf->global->STOCK_CALCULATE_ON_SHIPMENT) + if (! empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT)) { $stock_commande_client=$stock_commande_fournisseur=0; - if ($conf->commande->enabled) + if (! empty($conf->commande->enabled)) { $result=$product->load_stats_commande(0,'1,2'); if ($result < 0) dol_print_error($db,$product->error); $stock_commande_client=$product->stats_commande['qty']; } - if ($conf->fournisseur->enabled) + if (! empty($conf->fournisseur->enabled)) { $result=$product->load_stats_commande_fournisseur(0,'3'); if ($result < 0) dol_print_error($db,$product->error); @@ -290,7 +290,7 @@ if ($id > 0 || $ref) $found=0; // Nbre de commande clients en cours - if ($conf->commande->enabled) + if (! empty($conf->commande->enabled)) { if ($found) print '
'; else $found=1; print $langs->trans("CustomersOrdersRunning").': '.($stock_commande_client+$stock_sending_client); @@ -302,7 +302,7 @@ if ($id > 0 || $ref) } // Nbre de commande fournisseurs en cours - if ($conf->fournisseur->enabled) + if (! empty($conf->fournisseur->enabled)) { if ($found) print '
'; else $found=1; print $langs->trans("SuppliersOrdersRunning").': '.$stock_commande_fournisseur; diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index ee236837a3e..18638682133 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -27,24 +27,24 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; -if ($conf->propal->enabled) require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; -if ($conf->facture->enabled) require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; -if ($conf->facture->enabled) require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture-rec.class.php'; -if ($conf->commande->enabled) require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; -if ($conf->fournisseur->enabled) require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; -if ($conf->fournisseur->enabled) require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; -if ($conf->contrat->enabled) require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; -if ($conf->ficheinter->enabled) require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php'; -if ($conf->deplacement->enabled) require_once DOL_DOCUMENT_ROOT.'/compta/deplacement/class/deplacement.class.php'; -if ($conf->agenda->enabled) require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; +if (! empty($conf->propal->enabled)) require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; +if (! empty($conf->facture->enabled)) require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; +if (! empty($conf->facture->enabled)) require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture-rec.class.php'; +if (! empty($conf->commande->enabled)) require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; +if (! empty($conf->fournisseur->enabled)) require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; +if (! empty($conf->fournisseur->enabled)) require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; +if (! empty($conf->contrat->enabled)) require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; +if (! empty($conf->ficheinter->enabled)) require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php'; +if (! empty($conf->deplacement->enabled)) require_once DOL_DOCUMENT_ROOT.'/compta/deplacement/class/deplacement.class.php'; +if (! empty($conf->agenda->enabled)) require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; $langs->load("projects"); $langs->load("companies"); $langs->load("suppliers"); -if ($conf->facture->enabled) $langs->load("bills"); -if ($conf->commande->enabled) $langs->load("orders"); -if ($conf->propal->enabled) $langs->load("propal"); -if ($conf->ficheinter->enabled) $langs->load("interventions"); +if (! empty($conf->facture->enabled)) $langs->load("bills"); +if (! empty($conf->commande->enabled)) $langs->load("orders"); +if (! empty($conf->propal->enabled)) $langs->load("propal"); +if (! empty($conf->ficheinter->enabled)) $langs->load("interventions"); $projectid=GETPOST('id'); $ref=GETPOST('ref'); diff --git a/htdocs/public/members/new.php b/htdocs/public/members/new.php index 5ad4c62bf93..f692e633e93 100644 --- a/htdocs/public/members/new.php +++ b/htdocs/public/members/new.php @@ -289,7 +289,7 @@ if ($action == 'add') } if (! empty($backtopage)) $urlback=$backtopage; - else if ($conf->global->MEMBER_URL_REDIRECT_SUBSCRIPTION) + else if (! empty($conf->global->MEMBER_URL_REDIRECT_SUBSCRIPTION)) { $urlback=$conf->global->MEMBER_URL_REDIRECT_SUBSCRIPTION; // TODO Make replacement of __AMOUNT__, etc... diff --git a/htdocs/public/paybox/newpayment.php b/htdocs/public/paybox/newpayment.php index febd6130f67..89c57e87139 100644 --- a/htdocs/public/paybox/newpayment.php +++ b/htdocs/public/paybox/newpayment.php @@ -500,7 +500,7 @@ if (GETPOST("source") == 'contractline' && $valid) $result=$product->fetch($contractline->fk_product); // We define price for product (TODO Put this in a method in product class) - if ($conf->global->PRODUIT_MULTIPRICES) + if (! empty($conf->global->PRODUIT_MULTIPRICES)) { $pu_ht = $product->multiprices[$contract->thirdparty->price_level]; $pu_ttc = $product->multiprices_ttc[$contract->thirdparty->price_level]; diff --git a/htdocs/public/paypal/newpayment.php b/htdocs/public/paypal/newpayment.php index acea9f714d0..afd0cb40c1d 100755 --- a/htdocs/public/paypal/newpayment.php +++ b/htdocs/public/paypal/newpayment.php @@ -639,7 +639,7 @@ if (GETPOST("source") == 'contractline' && $valid) $result=$product->fetch($contractline->fk_product); // We define price for product (TODO Put this in a method in product class) - if ($conf->global->PRODUIT_MULTIPRICES) + if (! empty($conf->global->PRODUIT_MULTIPRICES)) { $pu_ht = $product->multiprices[$contract->thirdparty->price_level]; $pu_ttc = $product->multiprices_ttc[$contract->thirdparty->price_level]; diff --git a/htdocs/public/paypal/paymentok.php b/htdocs/public/paypal/paymentok.php index 5c24d29041d..d6d31201e17 100755 --- a/htdocs/public/paypal/paymentok.php +++ b/htdocs/public/paypal/paymentok.php @@ -54,13 +54,13 @@ $langs->load("paypal"); // Clean parameters $PAYPAL_API_USER=""; -if ($conf->global->PAYPAL_API_USER) $PAYPAL_API_USER=$conf->global->PAYPAL_API_USER; +if (! empty($conf->global->PAYPAL_API_USER)) $PAYPAL_API_USER=$conf->global->PAYPAL_API_USER; $PAYPAL_API_PASSWORD=""; -if ($conf->global->PAYPAL_API_PASSWORD) $PAYPAL_API_PASSWORD=$conf->global->PAYPAL_API_PASSWORD; +if (! empty($conf->global->PAYPAL_API_PASSWORD)) $PAYPAL_API_PASSWORD=$conf->global->PAYPAL_API_PASSWORD; $PAYPAL_API_SIGNATURE=""; -if ($conf->global->PAYPAL_API_SIGNATURE) $PAYPAL_API_SIGNATURE=$conf->global->PAYPAL_API_SIGNATURE; +if (! empty($conf->global->PAYPAL_API_SIGNATURE)) $PAYPAL_API_SIGNATURE=$conf->global->PAYPAL_API_SIGNATURE; $PAYPAL_API_SANDBOX=""; -if ($conf->global->PAYPAL_API_SANDBOX) $PAYPAL_API_SANDBOX=$conf->global->PAYPAL_API_SANDBOX; +if (! empty($conf->global->PAYPAL_API_SANDBOX)) $PAYPAL_API_SANDBOX=$conf->global->PAYPAL_API_SANDBOX; $PAYPAL_API_OK=""; if ($urlok) $PAYPAL_API_OK=$urlok; $PAYPAL_API_KO=""; diff --git a/htdocs/societe/agenda.php b/htdocs/societe/agenda.php index 6a72d73cb50..62c382460e7 100644 --- a/htdocs/societe/agenda.php +++ b/htdocs/societe/agenda.php @@ -71,7 +71,7 @@ if ($socid) $result = $soc->fetch($socid); llxHeader("",$langs->trans("Agenda"),''); - if ($conf->notification->enabled) $langs->load("mails"); + if (! empty($conf->notification->enabled)) $langs->load("mails"); $head = societe_prepare_head($soc); dol_fiche_head($head, 'agenda', $langs->trans("ThirdParty"),0,'company'); @@ -154,7 +154,7 @@ if ($socid) print '
'; - if ($conf->agenda->enabled) + if (! empty($conf->agenda->enabled)) { print ''.$langs->trans("AddAction").''; } diff --git a/htdocs/societe/ajaxcompanies.php b/htdocs/societe/ajaxcompanies.php index b960eb0b087..874bda75d6f 100644 --- a/htdocs/societe/ajaxcompanies.php +++ b/htdocs/societe/ajaxcompanies.php @@ -78,7 +78,7 @@ if (GETPOST('newcompany') || GETPOST('socid','int') || GETPOST('id_fourn')) $sql.=" OR code_client LIKE '%" . $db->escape($socid) . "%'"; $sql.=" OR code_fournisseur LIKE '%" . $db->escape($socid) . "%'"; } - if ($conf->global->SOCIETE_ALLOW_SEARCH_ON_ROWID) $sql.=" OR rowid = '" . $db->escape($socid) . "'"; + if (! empty($conf->global->SOCIETE_ALLOW_SEARCH_ON_ROWID)) $sql.=" OR rowid = '" . $db->escape($socid) . "'"; $sql.=")"; } if (! empty($_GET["filter"])) $sql.= " AND ".$_GET["filter"]; // Add other filters diff --git a/htdocs/societe/canvas/actions_card_common.class.php b/htdocs/societe/canvas/actions_card_common.class.php index 3faba3cf2d8..e486e4c6fe9 100644 --- a/htdocs/societe/canvas/actions_card_common.class.php +++ b/htdocs/societe/canvas/actions_card_common.class.php @@ -456,7 +456,7 @@ abstract class ActionsCardCommon $s=$modCodeClient->getToolTip($langs,$this->object,0); $this->tpl['help_customercode'] = $form->textwithpicto('',$s,1); - if ($conf->fournisseur->enabled) + if (! empty($conf->fournisseur->enabled)) { $this->tpl['supplier_enabled'] = 1; @@ -510,7 +510,7 @@ abstract class ActionsCardCommon else $this->tpl['select_state'] = $countrynotdefined; // Language - if ($conf->global->MAIN_MULTILANGS) $this->tpl['select_lang'] = $formadmin->select_language(($this->object->default_lang?$this->object->default_lang:$conf->global->MAIN_LANG_DEFAULT),'default_lang',0,0,1); + if (! empty($conf->global->MAIN_MULTILANGS)) $this->tpl['select_lang'] = $formadmin->select_language(($this->object->default_lang?$this->object->default_lang:$conf->global->MAIN_LANG_DEFAULT),'default_lang',0,0,1); // VAT $this->tpl['yn_assujtva'] = $form->selectyesno('assujtva_value',$this->tpl['tva_assuj'],1); // Assujeti par defaut en creation @@ -575,7 +575,7 @@ abstract class ActionsCardCommon $arr = $formcompany->typent_array(1); $this->tpl['typent'] = $arr[$this->object->typent_code]; - if ($conf->global->MAIN_MULTILANGS) + if (! empty($conf->global->MAIN_MULTILANGS)) { require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; //$s=picto_from_langcode($this->default_lang); @@ -615,7 +615,7 @@ abstract class ActionsCardCommon else $this->tpl['sales_representatives'].= $langs->trans("NoSalesRepresentativeAffected"); // Linked member - if ($conf->adherent->enabled) + if (! empty($conf->adherent->enabled)) { $langs->load("members"); $adh=new Adherent($this->db); diff --git a/htdocs/societe/canvas/company/tpl/card_create.tpl.php b/htdocs/societe/canvas/company/tpl/card_create.tpl.php index d519f125c09..1133da8a79d 100644 --- a/htdocs/societe/canvas/company/tpl/card_create.tpl.php +++ b/htdocs/societe/canvas/company/tpl/card_create.tpl.php @@ -172,7 +172,7 @@ for ($i=1; $i<=4; $i++) {
-global->MAIN_MULTILANGS) { ?> +global->MAIN_MULTILANGS)) { ?> diff --git a/htdocs/societe/canvas/company/tpl/card_edit.tpl.php b/htdocs/societe/canvas/company/tpl/card_edit.tpl.php index 4d89f95b8c8..76dbccd1019 100644 --- a/htdocs/societe/canvas/company/tpl/card_edit.tpl.php +++ b/htdocs/societe/canvas/company/tpl/card_edit.tpl.php @@ -194,7 +194,7 @@ for ($i=1; $i<=4; $i++) { -global->MAIN_MULTILANGS) { ?> +global->MAIN_MULTILANGS)) { ?> diff --git a/htdocs/societe/canvas/company/tpl/card_view.tpl.php b/htdocs/societe/canvas/company/tpl/card_view.tpl.php index 1eaf013af0d..8d79db94ea7 100644 --- a/htdocs/societe/canvas/company/tpl/card_view.tpl.php +++ b/htdocs/societe/canvas/company/tpl/card_view.tpl.php @@ -164,7 +164,7 @@ for ($i=1; $i<=4; $i++) { -global->MAIN_MULTILANGS) { ?> +global->MAIN_MULTILANGS)) { ?> @@ -225,7 +225,7 @@ for ($i=1; $i<=4; $i++) { -adherent->enabled) { ?> +adherent->enabled)) { ?> diff --git a/htdocs/societe/canvas/individual/tpl/card_create.tpl.php b/htdocs/societe/canvas/individual/tpl/card_create.tpl.php index ac4e4cceef0..b84ebc82f98 100644 --- a/htdocs/societe/canvas/individual/tpl/card_create.tpl.php +++ b/htdocs/societe/canvas/individual/tpl/card_create.tpl.php @@ -149,7 +149,7 @@ -global->MAIN_MULTILANGS) { ?> +global->MAIN_MULTILANGS)) { ?> diff --git a/htdocs/societe/canvas/individual/tpl/card_edit.tpl.php b/htdocs/societe/canvas/individual/tpl/card_edit.tpl.php index 296869bbae3..597fb95ccc8 100644 --- a/htdocs/societe/canvas/individual/tpl/card_edit.tpl.php +++ b/htdocs/societe/canvas/individual/tpl/card_edit.tpl.php @@ -151,7 +151,7 @@ if ($this->control->tpl['fournisseur']) { -global->MAIN_MULTILANGS) { ?> +global->MAIN_MULTILANGS)) { ?> diff --git a/htdocs/societe/canvas/individual/tpl/card_view.tpl.php b/htdocs/societe/canvas/individual/tpl/card_view.tpl.php index a47f3c7711f..1b680b809b0 100644 --- a/htdocs/societe/canvas/individual/tpl/card_view.tpl.php +++ b/htdocs/societe/canvas/individual/tpl/card_view.tpl.php @@ -123,7 +123,7 @@ dol_fiche_head($head, 'card', $langs->trans("ThirdParty"),0,'company'); -global->MAIN_MULTILANGS) { ?> +global->MAIN_MULTILANGS)) { ?> @@ -166,7 +166,7 @@ dol_fiche_head($head, 'card', $langs->trans("ThirdParty"),0,'company'); -adherent->enabled) { ?> +adherent->enabled)) { ?> diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index f51390d90b4..047a61f4e02 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -1624,7 +1624,7 @@ class Societe extends CommonObject function get_codeclient($objsoc=0,$type=0) { global $conf; - if ($conf->global->SOCIETE_CODECLIENT_ADDON) + if (! empty($conf->global->SOCIETE_CODECLIENT_ADDON)) { $dirsociete=array_merge(array('/core/modules/societe/'),$conf->societe_modules); foreach ($dirsociete as $dirroot) @@ -1653,7 +1653,7 @@ class Societe extends CommonObject function get_codefournisseur($objsoc=0,$type=1) { global $conf; - if ($conf->global->SOCIETE_CODEFOURNISSEUR_ADDON) + if (! empty($conf->global->SOCIETE_CODEFOURNISSEUR_ADDON)) { $dirsociete=array_merge(array('/core/modules/societe/'),$conf->societe_modules); foreach ($dirsociete as $dirroot) @@ -1679,7 +1679,7 @@ class Societe extends CommonObject function codeclient_modifiable() { global $conf; - if ($conf->global->SOCIETE_CODECLIENT_ADDON) + if (! empty($conf->global->SOCIETE_CODECLIENT_ADDON)) { $dirsociete=array_merge(array('/core/modules/societe/'),$conf->societe_modules); foreach ($dirsociete as $dirroot) @@ -1713,7 +1713,7 @@ class Societe extends CommonObject function codefournisseur_modifiable() { global $conf; - if ($conf->global->SOCIETE_CODEFOURNISSEUR_ADDON) + if (! empty($conf->global->SOCIETE_CODEFOURNISSEUR_ADDON)) { $dirsociete=array_merge(array('/core/modules/societe/'),$conf->societe_modules); foreach ($dirsociete as $dirroot) @@ -1751,7 +1751,7 @@ class Societe extends CommonObject function check_codeclient() { global $conf; - if ($conf->global->SOCIETE_CODECLIENT_ADDON) + if (! empty($conf->global->SOCIETE_CODECLIENT_ADDON)) { $dirsociete=array_merge(array('/core/modules/societe/'),$conf->societe_modules); foreach ($dirsociete as $dirroot) @@ -1786,7 +1786,7 @@ class Societe extends CommonObject function check_codefournisseur() { global $conf; - if ($conf->global->SOCIETE_CODEFOURNISSEUR_ADDON) + if (! empty($conf->global->SOCIETE_CODEFOURNISSEUR_ADDON)) { $dirsociete=array_merge(array('/core/modules/societe/'),$conf->societe_modules); foreach ($dirsociete as $dirroot) diff --git a/htdocs/societe/document.php b/htdocs/societe/document.php index edca64dfcf8..2e8f659a738 100644 --- a/htdocs/societe/document.php +++ b/htdocs/societe/document.php @@ -113,7 +113,7 @@ if ($object->id) /* * Affichage onglets */ - if ($conf->notification->enabled) $langs->load("mails"); + if (! empty($conf->notification->enabled)) $langs->load("mails"); $head = societe_prepare_head($object); $form=new Form($db); diff --git a/htdocs/societe/index.php b/htdocs/societe/index.php index fcc8a4f6efe..2d3fe14b97e 100644 --- a/htdocs/societe/index.php +++ b/htdocs/societe/index.php @@ -115,7 +115,7 @@ if (! empty($conf->use_javascript_ajax) && ((round($third['prospect'])?1:0)+(rou if ($conf->societe->enabled && empty($conf->global->SOCIETE_DISABLE_PROSPECTS_STATS)) $dataseries[]=array('label'=>$langs->trans("Prospects"),'data'=>round($third['prospect'])); if ($conf->societe->enabled && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS_STATS)) $dataseries[]=array('label'=>$langs->trans("Customers"),'data'=>round($third['customer'])); if ($conf->fournisseur->enabled && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS)) $dataseries[]=array('label'=>$langs->trans("Suppliers"),'data'=>round($third['supplier'])); - if ($conf->societe->enabled) $dataseries[]=array('label'=>$langs->trans("Others"),'data'=>round($third['other'])); + if (! empty($conf->societe->enabled)) $dataseries[]=array('label'=>$langs->trans("Others"),'data'=>round($third['other'])); $data=array('series'=>$dataseries); dol_print_graph('stats',300,180,$data,1,'pie',0); print ''; diff --git a/htdocs/societe/info.php b/htdocs/societe/info.php index 28d626c37f2..5f8468fd1f6 100644 --- a/htdocs/societe/info.php +++ b/htdocs/societe/info.php @@ -30,7 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; $langs->load("companies"); $langs->load("other"); -if ($conf->notification->enabled) $langs->load("mails"); +if (! empty($conf->notification->enabled)) $langs->load("mails"); // Security check $socid = GETPOST('socid','int'); diff --git a/htdocs/societe/note.php b/htdocs/societe/note.php index 00e1a182dfe..952d1c5e6ed 100644 --- a/htdocs/societe/note.php +++ b/htdocs/societe/note.php @@ -69,7 +69,7 @@ if ($socid > 0) /* * Affichage onglets */ - if ($conf->notification->enabled) $langs->load("mails"); + if (! empty($conf->notification->enabled)) $langs->load("mails"); $head = societe_prepare_head($object); diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index 0a5888eb77c..f4a221fb098 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -36,14 +36,14 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; -if ($conf->adherent->enabled) require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; +if (! empty($conf->adherent->enabled)) require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; $langs->load("companies"); $langs->load("commercial"); $langs->load("bills"); $langs->load("banks"); $langs->load("users"); -if ($conf->notification->enabled) $langs->load("mails"); +if (! empty($conf->notification->enabled)) $langs->load("mails"); $mesg=''; $error=0; $errors=array(); @@ -1363,7 +1363,7 @@ else print ''; // Default language - if ($conf->global->MAIN_MULTILANGS) + if (! empty($conf->global->MAIN_MULTILANGS)) { print ''; // Default language - if ($conf->global->MAIN_MULTILANGS) + if (! empty($conf->global->MAIN_MULTILANGS)) { require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; print ''; diff --git a/htdocs/societe/societe.php b/htdocs/societe/societe.php index 4913d6c7521..9002814e0b3 100644 --- a/htdocs/societe/societe.php +++ b/htdocs/societe/societe.php @@ -302,7 +302,7 @@ if ($resql) // Filter on categories /* Not possible in this page because list is for ALL third parties type $moreforfilter=''; - if ($conf->categorie->enabled) + if (! empty($conf->categorie->enabled)) { $moreforfilter.=$langs->trans('Categories'). ': '; $moreforfilter.=$htmlother->select_categories(2,$search_categ,'search_categ'); diff --git a/htdocs/theme/auguria/style.css.php b/htdocs/theme/auguria/style.css.php index 8cba8d76e4f..8ac5fde2fe4 100644 --- a/htdocs/theme/auguria/style.css.php +++ b/htdocs/theme/auguria/style.css.php @@ -2226,7 +2226,7 @@ div.ecmjqft { .jnotify-container { position: fixed !important; -global->MAIN_JQUERY_JNOTIFY_BOTTOM) { ?> +global->MAIN_JQUERY_JNOTIFY_BOTTOM)) { ?> top: auto !important; bottom: 4px !important; diff --git a/htdocs/theme/bureau2crea/style.css.php b/htdocs/theme/bureau2crea/style.css.php index 475428486d2..26f8993c354 100644 --- a/htdocs/theme/bureau2crea/style.css.php +++ b/htdocs/theme/bureau2crea/style.css.php @@ -2448,7 +2448,7 @@ div.ecmjqft { .jnotify-container { position: fixed !important; -global->MAIN_JQUERY_JNOTIFY_BOTTOM) { ?> +global->MAIN_JQUERY_JNOTIFY_BOTTOM)) { ?> top: auto !important; bottom: 4px !important; diff --git a/htdocs/theme/cameleo/style.css.php b/htdocs/theme/cameleo/style.css.php index 1501cfe8899..54880874716 100644 --- a/htdocs/theme/cameleo/style.css.php +++ b/htdocs/theme/cameleo/style.css.php @@ -2281,7 +2281,7 @@ div.ecmjqft { .jnotify-container { position: fixed !important; -global->MAIN_JQUERY_JNOTIFY_BOTTOM) { ?> +global->MAIN_JQUERY_JNOTIFY_BOTTOM)) { ?> top: auto !important; bottom: 4px !important; diff --git a/htdocs/user/class/usergroup.class.php b/htdocs/user/class/usergroup.class.php index 487557b939d..f49cdde8a78 100644 --- a/htdocs/user/class/usergroup.class.php +++ b/htdocs/user/class/usergroup.class.php @@ -690,7 +690,7 @@ class UserGroup extends CommonObject if ($this->nom && $conf->global->LDAP_GROUP_FIELD_FULLNAME) $info[$conf->global->LDAP_GROUP_FIELD_FULLNAME] = $this->nom; //if ($this->nom && $conf->global->LDAP_GROUP_FIELD_NAME) $info[$conf->global->LDAP_GROUP_FIELD_NAME] = $this->nom; if ($this->note && $conf->global->LDAP_GROUP_FIELD_DESCRIPTION) $info[$conf->global->LDAP_GROUP_FIELD_DESCRIPTION] = $this->note; - if ($conf->global->LDAP_GROUP_FIELD_GROUPMEMBERS) + if (! empty($conf->global->LDAP_GROUP_FIELD_GROUPMEMBERS)) { $valueofldapfield=array(); foreach($this->members as $key=>$val) // This is array of users for group into dolibarr database. diff --git a/htdocs/user/fiche.php b/htdocs/user/fiche.php index 4198f8c2a3f..3191ae10578 100644 --- a/htdocs/user/fiche.php +++ b/htdocs/user/fiche.php @@ -203,7 +203,7 @@ if ($action == 'add' && $canadduser) $edituser->note = $_POST["note"]; $edituser->ldap_sid = $_POST["ldap_sid"]; // If multicompany is off, admin users must all be on entity 0. - if ($conf->multicompany->enabled) + if (! empty($conf->multicompany->enabled)) { if (! empty($_POST["superadmin"])) { @@ -319,7 +319,7 @@ if ($action == 'update' && ! $_POST["cancel"]) $edituser->webcal_login = $_POST["webcal_login"]; $edituser->phenix_login = $_POST["phenix_login"]; $edituser->phenix_pass = $_POST["phenix_pass"]; - if ($conf->multicompany->enabled) + if (! empty($conf->multicompany->enabled)) { if (! empty($_POST["superadmin"])) { diff --git a/htdocs/user/passwordforgotten.php b/htdocs/user/passwordforgotten.php index cf3776b6c10..d00ed40c564 100644 --- a/htdocs/user/passwordforgotten.php +++ b/htdocs/user/passwordforgotten.php @@ -37,7 +37,7 @@ $langs->load("ldap"); $langs->load("other"); // Security check -if ($conf->global->MAIN_SECURITY_DISABLEFORGETPASSLINK) +if (! empty($conf->global->MAIN_SECURITY_DISABLEFORGETPASSLINK)) { header("Location: ".DOL_URL_ROOT.'/'); exit; @@ -194,7 +194,7 @@ else $focus_element = 'password'; // Send password button enabled ? $disabled='disabled'; if (preg_match('/dolibarr/i',$mode)) $disabled=''; -if ($conf->global->MAIN_SECURITY_ENABLE_SENDPASSWORD) $disabled=''; // To force button enabled +if (! empty($conf->global->MAIN_SECURITY_ENABLE_SENDPASSWORD)) $disabled=''; // To force button enabled // Show logo (search in order: small company logo, large company logo, theme logo, common logo) $width=0; diff --git a/htdocs/webservices/admin/webservices.php b/htdocs/webservices/admin/webservices.php index bc47a4a8be8..163b0fb024a 100644 --- a/htdocs/webservices/admin/webservices.php +++ b/htdocs/webservices/admin/webservices.php @@ -106,17 +106,17 @@ if ($conf->product->enabled || $conf->service->enabled) $url=DOL_MAIN_URL_ROOT.'/webservices/server_productorservice.php?wsdl'; print img_picto('','object_globe.png').' '.$url."
\n"; } -if ($conf->societe->enabled) +if (! empty($conf->societe->enabled)) { $url=DOL_MAIN_URL_ROOT.'/webservices/server_thirdparty.php?wsdl'; print img_picto('','object_globe.png').' '.$url."
\n"; } -if ($conf->facture->enabled) +if (! empty($conf->facture->enabled)) { $url=DOL_MAIN_URL_ROOT.'/webservices/server_invoice.php?wsdl'; print img_picto('','object_globe.png').' '.$url."
\n"; } -if ($conf->fournisseur->enabled) +if (! empty($conf->fournisseur->enabled)) { $url=DOL_MAIN_URL_ROOT.'/webservices/server_supplier_invoice.php?wsdl'; print img_picto('','object_globe.png').' '.$url."
\n"; @@ -133,17 +133,17 @@ if ($conf->product->enabled || $conf->service->enabled) $url=DOL_MAIN_URL_ROOT.'/webservices/server_productorservice.php'; print img_picto('','object_globe.png').' '.$url."
\n"; } -if ($conf->societe->enabled) +if (! empty($conf->societe->enabled)) { $url=DOL_MAIN_URL_ROOT.'/webservices/server_thirdparty.php'; print img_picto('','object_globe.png').' '.$url."
\n"; } -if ($conf->facture->enabled) +if (! empty($conf->facture->enabled)) { $url=DOL_MAIN_URL_ROOT.'/webservices/server_invoice.php'; print img_picto('','object_globe.png').' '.$url."
\n"; } -if ($conf->fournisseur->enabled) +if (! empty($conf->fournisseur->enabled)) { $url=DOL_MAIN_URL_ROOT.'/webservices/server_supplier_invoice.php'; print img_picto('','object_globe.png').' '.$url."
\n"; diff --git a/htdocs/webservices/index.php b/htdocs/webservices/index.php index a448425ac26..f584fd32ce4 100644 --- a/htdocs/webservices/index.php +++ b/htdocs/webservices/index.php @@ -53,17 +53,17 @@ if (empty($conf->global->MAIN_MODULE_WEBSERVICES)) print ''.$langs->trans("WSDLCanBeDownloadedHere").':
'; $url=DOL_MAIN_URL_ROOT.'/webservices/server_other.php?wsdl'; print img_picto('','object_globe.png') . ' ' . $url . "
\n"; -if ($conf->societe->enabled) +if (! empty($conf->societe->enabled)) { $url=DOL_MAIN_URL_ROOT.'/webservices/server_thirdparty.php?wsdl'; print img_picto('','object_globe.png') . ' ' . $url . "
\n"; } -if ($conf->facture->enabled) +if (! empty($conf->facture->enabled)) { $url=DOL_MAIN_URL_ROOT.'/webservices/server_invoice.php?wsdl'; print img_picto('','object_globe.png') . ' ' . $url . "
\n"; } -if ($conf->fournisseur->enabled) +if (! empty($conf->fournisseur->enabled)) { $url=DOL_MAIN_URL_ROOT.'/webservices/server_supplier_invoice.php?wsdl'; print img_picto('','object_globe.png') . ' ' . $url . "
\n"; @@ -77,17 +77,17 @@ print '
'; print ''.$langs->trans("EndPointIs").':
'; $url=DOL_MAIN_URL_ROOT.'/webservices/server_other.php'; print img_picto('','object_globe.png') . ' ' . $url . "
\n"; -if ($conf->societe->enabled) +if (! empty($conf->societe->enabled)) { $url=DOL_MAIN_URL_ROOT.'/webservices/server_thirdparty.php'; print img_picto('','object_globe.png') . ' ' . $url . "
\n"; } -if ($conf->facture->enabled) +if (! empty($conf->facture->enabled)) { $url=DOL_MAIN_URL_ROOT.'/webservices/server_invoice.php'; print img_picto('','object_globe.png') . ' ' . $url . "
\n"; } -if ($conf->fournisseur->enabled) +if (! empty($conf->fournisseur->enabled)) { $url=DOL_MAIN_URL_ROOT.'/webservices/server_supplier_invoice.php'; print img_picto('','object_globe.png') . ' ' . $url . "
\n"; From 43c0a03758a6cef3acc513bdbe8f48fa757842ac Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sat, 15 Sep 2012 11:21:22 +0200 Subject: [PATCH 6/6] Fix: strict mode tornado --- htdocs/adherents/card_subscriptions.php | 12 ++--- htdocs/adherents/class/adherent.class.php | 50 +++++++++---------- htdocs/adherents/cotisations.php | 4 +- htdocs/adherents/fiche.php | 4 +- htdocs/adherents/fiche_subscription.php | 2 +- htdocs/admin/fckeditor.php | 2 +- htdocs/admin/ldap.php | 2 +- htdocs/asterisk/wrapper.php | 2 +- htdocs/cashdesk/facturation.php | 8 +-- htdocs/cashdesk/facturation_dhtml.php | 4 +- htdocs/cashdesk/facturation_verif.php | 4 +- htdocs/cashdesk/index_verif.php | 4 +- htdocs/cashdesk/tpl/facturation1.tpl.php | 4 +- htdocs/cashdesk/tpl/menu.tpl.php | 4 +- htdocs/categories/photos.php | 2 +- htdocs/comm/addpropal.php | 2 +- htdocs/comm/fiche.php | 18 +++---- htdocs/comm/index.php | 28 +++++------ htdocs/comm/propal.php | 4 +- htdocs/comm/prospect/fiche.php | 6 +-- htdocs/comm/prospect/index.php | 4 +- htdocs/commande/class/commande.class.php | 8 +-- htdocs/commande/fiche.php | 4 +- htdocs/compta/bank/account.php | 8 +-- htdocs/compta/facture.php | 4 +- htdocs/compta/facture/class/facture.class.php | 2 +- htdocs/compta/index.php | 20 ++++---- .../compta/localtax/class/localtax.class.php | 4 +- htdocs/compta/paiement.php | 2 +- htdocs/compta/paiement_charge.php | 2 +- htdocs/compta/recap-compta.php | 2 +- htdocs/compta/stats/cabyuser.php | 6 +-- htdocs/compta/stats/casoc.php | 6 +-- htdocs/compta/tva/class/tva.class.php | 4 +- htdocs/contact/class/contact.class.php | 26 +++++----- htdocs/contrat/fiche.php | 2 +- htdocs/core/boxes/box_activity.php | 6 +-- htdocs/core/class/extrafields.class.php | 2 +- htdocs/core/class/html.formbarcode.class.php | 4 +- htdocs/core/class/html.formcompany.class.php | 4 +- htdocs/core/class/html.formmail.class.php | 2 +- htdocs/core/lib/agenda.lib.php | 4 +- htdocs/core/lib/company.lib.php | 8 +-- htdocs/core/lib/functions.lib.php | 4 +- htdocs/core/lib/ldap.lib.php | 4 +- htdocs/core/lib/order.lib.php | 2 +- htdocs/core/lib/product.lib.php | 18 +++---- htdocs/core/lib/project.lib.php | 5 +- htdocs/core/lib/propal.lib.php | 7 ++- htdocs/core/login/functions_ldap.php | 2 +- htdocs/core/menus/standard/eldy.lib.php | 10 ++-- htdocs/core/tpl/contacts.tpl.php | 2 +- .../core/tpl/freeproductline_create.tpl.php | 4 +- htdocs/core/tpl/objectline_edit.tpl.php | 2 +- ...interface_50_modLdap_Ldapsynchro.class.php | 38 +++++++------- htdocs/ecm/index.php | 2 +- htdocs/ecm/search.php | 2 +- htdocs/expedition/class/expedition.class.php | 2 +- htdocs/expedition/contact.php | 8 +-- htdocs/expedition/fiche.php | 12 ++--- htdocs/expedition/shipment.php | 6 +-- htdocs/fichinter/fiche.php | 2 +- .../class/fournisseur.commande.class.php | 6 +-- .../fourn/class/fournisseur.facture.class.php | 4 +- htdocs/fourn/commande/fiche.php | 6 +-- htdocs/fourn/facture/fiche.php | 8 +-- htdocs/fourn/fiche.php | 4 +- htdocs/fourn/index.php | 2 +- htdocs/fourn/recap-fourn.php | 2 +- htdocs/holiday/admin/holiday.php | 2 +- htdocs/index.php | 24 ++++----- htdocs/livraison/fiche.php | 14 +++--- htdocs/product/composition/fiche.php | 6 +-- htdocs/product/fiche.php | 6 +-- htdocs/product/liste.php | 2 +- htdocs/product/reassort.php | 2 +- .../stock/class/mouvementstock.class.php | 4 +- htdocs/projet/element.php | 10 ++-- htdocs/public/agenda/agendaexport.php | 2 +- htdocs/societe/index.php | 14 +++--- htdocs/societe/soc.php | 6 +-- htdocs/societe/societe.php | 2 +- htdocs/user/class/user.class.php | 30 +++++------ htdocs/user/class/usergroup.class.php | 6 +-- htdocs/user/group/fiche.php | 2 +- htdocs/webservices/admin/webservices.php | 4 +- 86 files changed, 300 insertions(+), 300 deletions(-) diff --git a/htdocs/adherents/card_subscriptions.php b/htdocs/adherents/card_subscriptions.php index 77814af9620..400e386ef8e 100644 --- a/htdocs/adherents/card_subscriptions.php +++ b/htdocs/adherents/card_subscriptions.php @@ -246,7 +246,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'cotisation' && ! $ } else { - if ($conf->banque->enabled && $_POST["paymentsave"] != 'none') + if (! empty($conf->banque->enabled) && $_POST["paymentsave"] != 'none') { if ($_POST["cotisation"]) { @@ -740,8 +740,8 @@ if ($rowid) $bankdirect=0; // Option to write to bank is on by default $bankviainvoice=0; // Option to write via invoice is on by default $invoiceonly=0; - if ($conf->banque->enabled && $conf->global->ADHERENT_BANK_USE && (empty($_POST['paymentsave']) || $_POST["paymentsave"] == 'bankdirect')) $bankdirect=1; - if ($conf->banque->enabled && $conf->societe->enabled && $conf->facture->enabled && $object->fk_soc) $bankviainvoice=1; + if (! empty($conf->banque->enabled) && $conf->global->ADHERENT_BANK_USE && (empty($_POST['paymentsave']) || $_POST["paymentsave"] == 'bankdirect')) $bankdirect=1; + if (! empty($conf->banque->enabled) && ! empty($conf->societe->enabled) && ! empty($conf->facture->enabled) && $object->fk_soc) $bankviainvoice=1; print "\n\n\n"; @@ -873,7 +873,7 @@ if ($rowid) print dol_print_date(($datefrom?$datefrom:time()),"%Y").'" >'; // Complementary action - if ($conf->banque->enabled || $conf->facture->enabled) + if (! empty($conf->banque->enabled) || ! empty($conf->facture->enabled)) { $company=new Societe($db); if ($object->fk_soc) @@ -894,7 +894,7 @@ if ($rowid) print ' '.$langs->trans("MoreActionBankDirect").'
'; } - if ($conf->societe->enabled && $conf->facture->enabled) + if (! empty($conf->societe->enabled) && ! empty($conf->facture->enabled)) { print 'fk_soc) || empty($bankviainvoice)) print ' disabled="disabled"'; @@ -909,7 +909,7 @@ if ($rowid) } print '
'; } - if ($conf->banque->enabled && $conf->societe->enabled && $conf->facture->enabled) + if (! empty($conf->banque->enabled) && ! empty($conf->societe->enabled) && ! empty($conf->facture->enabled)) { print 'fk_soc) || empty($bankviainvoice)) print ' disabled="disabled"'; diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index ebdb9f824cc..c9f4a3de738 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -1382,7 +1382,7 @@ class Adherent extends CommonObject } // spip - if ($conf->global->ADHERENT_USE_SPIP && $conf->mailmanspip->enabled) + if ($conf->global->ADHERENT_USE_SPIP && ! empty($conf->mailmanspip->enabled)) { $result=$mailmanspip->add_to_spip($this); if ($result < 0) @@ -1427,7 +1427,7 @@ class Adherent extends CommonObject } } - if ($conf->global->ADHERENT_USE_SPIP && $conf->mailmanspip->enabled) + if ($conf->global->ADHERENT_USE_SPIP && ! empty($conf->mailmanspip->enabled)) { $result=$mailmanspip->del_to_spip($this); if ($result < 0) @@ -1787,31 +1787,31 @@ class Adherent extends CommonObject $this->fullname=$this->getFullName($langs); // Member - if ($this->fullname && $conf->global->LDAP_MEMBER_FIELD_FULLNAME) $info[$conf->global->LDAP_MEMBER_FIELD_FULLNAME] = $this->fullname; - if ($this->nom && $conf->global->LDAP_MEMBER_FIELD_NAME) $info[$conf->global->LDAP_MEMBER_FIELD_NAME] = $this->nom; - if ($this->prenom && $conf->global->LDAP_MEMBER_FIELD_FIRSTNAME) $info[$conf->global->LDAP_MEMBER_FIELD_FIRSTNAME] = $this->prenom; - if ($this->login && $conf->global->LDAP_MEMBER_FIELD_LOGIN) $info[$conf->global->LDAP_MEMBER_FIELD_LOGIN] = $this->login; - if ($this->pass && $conf->global->LDAP_MEMBER_FIELD_PASSWORD) $info[$conf->global->LDAP_MEMBER_FIELD_PASSWORD] = $this->pass; // this->pass = mot de passe non crypte - if ($this->poste && $conf->global->LDAP_MEMBER_FIELD_TITLE) $info[$conf->global->LDAP_MEMBER_FIELD_TITLE] = $this->poste; - if ($this->adresse && $conf->global->LDAP_MEMBER_FIELD_ADDRESS) $info[$conf->global->LDAP_MEMBER_FIELD_ADDRESS] = $this->adresse; - if ($this->cp && $conf->global->LDAP_MEMBER_FIELD_ZIP) $info[$conf->global->LDAP_MEMBER_FIELD_ZIP] = $this->cp; - if ($this->ville && $conf->global->LDAP_MEMBER_FIELD_TOWN) $info[$conf->global->LDAP_MEMBER_FIELD_TOWN] = $this->ville; - if ($this->country_code && $conf->global->LDAP_MEMBER_FIELD_COUNTRY) $info[$conf->global->LDAP_MEMBER_FIELD_COUNTRY] = $this->country_code; - if ($this->email && $conf->global->LDAP_MEMBER_FIELD_MAIL) $info[$conf->global->LDAP_MEMBER_FIELD_MAIL] = $this->email; - if ($this->phone && $conf->global->LDAP_MEMBER_FIELD_PHONE) $info[$conf->global->LDAP_MEMBER_FIELD_PHONE] = $this->phone; - if ($this->phone_perso && $conf->global->LDAP_MEMBER_FIELD_PHONE_PERSO) $info[$conf->global->LDAP_MEMBER_FIELD_PHONE_PERSO] = $this->phone_perso; - if ($this->phone_mobile && $conf->global->LDAP_MEMBER_FIELD_MOBILE) $info[$conf->global->LDAP_MEMBER_FIELD_MOBILE] = $this->phone_mobile; - if ($this->fax && $conf->global->LDAP_MEMBER_FIELD_FAX) $info[$conf->global->LDAP_MEMBER_FIELD_FAX] = $this->fax; - if ($this->note && $conf->global->LDAP_MEMBER_FIELD_DESCRIPTION) $info[$conf->global->LDAP_MEMBER_FIELD_DESCRIPTION] = $this->note; - if ($this->naiss && $conf->global->LDAP_MEMBER_FIELD_BIRTHDATE) $info[$conf->global->LDAP_MEMBER_FIELD_BIRTHDATE] = dol_print_date($this->naiss,'dayhourldap'); - if (isset($this->statut) && $conf->global->LDAP_FIELD_MEMBER_STATUS) $info[$conf->global->LDAP_FIELD_MEMBER_STATUS] = $this->statut; - if ($this->datefin && $conf->global->LDAP_FIELD_MEMBER_END_LASTSUBSCRIPTION) $info[$conf->global->LDAP_FIELD_MEMBER_END_LASTSUBSCRIPTION] = dol_print_date($this->datefin,'dayhourldap'); + if ($this->fullname && ! empty($conf->global->LDAP_MEMBER_FIELD_FULLNAME)) $info[$conf->global->LDAP_MEMBER_FIELD_FULLNAME] = $this->fullname; + if ($this->nom && ! empty($conf->global->LDAP_MEMBER_FIELD_NAME)) $info[$conf->global->LDAP_MEMBER_FIELD_NAME] = $this->nom; + if ($this->prenom && ! empty($conf->global->LDAP_MEMBER_FIELD_FIRSTNAME)) $info[$conf->global->LDAP_MEMBER_FIELD_FIRSTNAME] = $this->prenom; + if ($this->login && ! empty($conf->global->LDAP_MEMBER_FIELD_LOGIN)) $info[$conf->global->LDAP_MEMBER_FIELD_LOGIN] = $this->login; + if ($this->pass && ! empty($conf->global->LDAP_MEMBER_FIELD_PASSWORD)) $info[$conf->global->LDAP_MEMBER_FIELD_PASSWORD] = $this->pass; // this->pass = mot de passe non crypte + if ($this->poste && ! empty($conf->global->LDAP_MEMBER_FIELD_TITLE)) $info[$conf->global->LDAP_MEMBER_FIELD_TITLE] = $this->poste; + if ($this->adresse && ! empty($conf->global->LDAP_MEMBER_FIELD_ADDRESS)) $info[$conf->global->LDAP_MEMBER_FIELD_ADDRESS] = $this->adresse; + if ($this->cp && ! empty($conf->global->LDAP_MEMBER_FIELD_ZIP)) $info[$conf->global->LDAP_MEMBER_FIELD_ZIP] = $this->cp; + if ($this->ville && ! empty($conf->global->LDAP_MEMBER_FIELD_TOWN)) $info[$conf->global->LDAP_MEMBER_FIELD_TOWN] = $this->ville; + if ($this->country_code && ! empty($conf->global->LDAP_MEMBER_FIELD_COUNTRY)) $info[$conf->global->LDAP_MEMBER_FIELD_COUNTRY] = $this->country_code; + if ($this->email && ! empty($conf->global->LDAP_MEMBER_FIELD_MAIL)) $info[$conf->global->LDAP_MEMBER_FIELD_MAIL] = $this->email; + if ($this->phone && ! empty($conf->global->LDAP_MEMBER_FIELD_PHONE)) $info[$conf->global->LDAP_MEMBER_FIELD_PHONE] = $this->phone; + if ($this->phone_perso && ! empty($conf->global->LDAP_MEMBER_FIELD_PHONE_PERSO)) $info[$conf->global->LDAP_MEMBER_FIELD_PHONE_PERSO] = $this->phone_perso; + if ($this->phone_mobile && ! empty($conf->global->LDAP_MEMBER_FIELD_MOBILE)) $info[$conf->global->LDAP_MEMBER_FIELD_MOBILE] = $this->phone_mobile; + if ($this->fax && ! empty($conf->global->LDAP_MEMBER_FIELD_FAX)) $info[$conf->global->LDAP_MEMBER_FIELD_FAX] = $this->fax; + if ($this->note && ! empty($conf->global->LDAP_MEMBER_FIELD_DESCRIPTION)) $info[$conf->global->LDAP_MEMBER_FIELD_DESCRIPTION] = $this->note; + if ($this->naiss && ! empty($conf->global->LDAP_MEMBER_FIELD_BIRTHDATE)) $info[$conf->global->LDAP_MEMBER_FIELD_BIRTHDATE] = dol_print_date($this->naiss,'dayhourldap'); + if (isset($this->statut) && ! empty($conf->global->LDAP_FIELD_MEMBER_STATUS)) $info[$conf->global->LDAP_FIELD_MEMBER_STATUS] = $this->statut; + if ($this->datefin && ! empty($conf->global->LDAP_FIELD_MEMBER_END_LASTSUBSCRIPTION)) $info[$conf->global->LDAP_FIELD_MEMBER_END_LASTSUBSCRIPTION] = dol_print_date($this->datefin,'dayhourldap'); // Subscriptions - if ($this->first_subscription_date && $conf->global->LDAP_FIELD_MEMBER_FIRSTSUBSCRIPTION_DATE) $info[$conf->global->LDAP_FIELD_MEMBER_FIRSTSUBSCRIPTION_DATE] = dol_print_date($this->first_subscription_date,'dayhourldap'); - if (isset($this->first_subscription_amount) && $conf->global->LDAP_FIELD_MEMBER_FIRSTSUBSCRIPTION_AMOUNT) $info[$conf->global->LDAP_FIELD_MEMBER_FIRSTSUBSCRIPTION_AMOUNT] = $this->first_subscription_amount; - if ($this->last_subscription_date && $conf->global->LDAP_FIELD_MEMBER_LASTSUBSCRIPTION_DATE) $info[$conf->global->LDAP_FIELD_MEMBER_LASTSUBSCRIPTION_DATE] = dol_print_date($this->last_subscription_date,'dayhourldap'); - if (isset($this->last_subscription_amount) && $conf->global->LDAP_FIELD_MEMBER_LASTSUBSCRIPTION_AMOUNT) $info[$conf->global->LDAP_FIELD_MEMBER_LASTSUBSCRIPTION_AMOUNT] = $this->last_subscription_amount; + if ($this->first_subscription_date && ! empty($conf->global->LDAP_FIELD_MEMBER_FIRSTSUBSCRIPTION_DATE)) $info[$conf->global->LDAP_FIELD_MEMBER_FIRSTSUBSCRIPTION_DATE] = dol_print_date($this->first_subscription_date,'dayhourldap'); + if (isset($this->first_subscription_amount) && ! empty($conf->global->LDAP_FIELD_MEMBER_FIRSTSUBSCRIPTION_AMOUNT)) $info[$conf->global->LDAP_FIELD_MEMBER_FIRSTSUBSCRIPTION_AMOUNT] = $this->first_subscription_amount; + if ($this->last_subscription_date && ! empty($conf->global->LDAP_FIELD_MEMBER_LASTSUBSCRIPTION_DATE)) $info[$conf->global->LDAP_FIELD_MEMBER_LASTSUBSCRIPTION_DATE] = dol_print_date($this->last_subscription_date,'dayhourldap'); + if (isset($this->last_subscription_amount) && ! empty($conf->global->LDAP_FIELD_MEMBER_LASTSUBSCRIPTION_AMOUNT)) $info[$conf->global->LDAP_FIELD_MEMBER_LASTSUBSCRIPTION_AMOUNT] = $this->last_subscription_amount; return $info; } diff --git a/htdocs/adherents/cotisations.php b/htdocs/adherents/cotisations.php index e7b898ffd1e..1b4fabaf47e 100644 --- a/htdocs/adherents/cotisations.php +++ b/htdocs/adherents/cotisations.php @@ -131,7 +131,7 @@ if ($result) $var=!$var; - if ($allowinsertbankafter && ! $objp->fk_account && $conf->banque->enabled && $objp->cotisation) + if ($allowinsertbankafter && ! $objp->fk_account && ! empty($conf->banque->enabled) && $objp->cotisation) { print ""; print ''; @@ -193,7 +193,7 @@ if ($result) print ''; print ""; - if ($allowinsertbankafter && ! $objp->fk_account && $conf->banque->enabled && $objp->cotisation) + if ($allowinsertbankafter && ! $objp->fk_account && ! empty($conf->banque->enabled) && $objp->cotisation) { print "\n"; } diff --git a/htdocs/adherents/fiche.php b/htdocs/adherents/fiche.php index e12ec01d3a9..7ca413a0c4a 100644 --- a/htdocs/adherents/fiche.php +++ b/htdocs/adherents/fiche.php @@ -1532,7 +1532,7 @@ if ($rowid && $action != 'edit') } // Create third party - if ($conf->societe->enabled && ! $object->fk_soc) + if (! empty($conf->societe->enabled) && ! $object->fk_soc) { if ($user->rights->societe->creer) { @@ -1570,7 +1570,7 @@ if ($rowid && $action != 'edit') } // Action SPIP - if ($conf->mailmanspip->enabled && $conf->global->ADHERENT_USE_SPIP) + if (! empty($conf->mailmanspip->enabled) && ! empty($conf->global->ADHERENT_USE_SPIP)) { $isinspip = $mailmanspip->is_in_spip($object); diff --git a/htdocs/adherents/fiche_subscription.php b/htdocs/adherents/fiche_subscription.php index e9fa20f7e98..b78e40fcb1b 100644 --- a/htdocs/adherents/fiche_subscription.php +++ b/htdocs/adherents/fiche_subscription.php @@ -290,7 +290,7 @@ if ($rowid && $action != 'edit') //$formquestion=array(); //$formquestion['text']=''.$langs->trans("ThisWillAlsoDeleteBankRecord").''; $text=$langs->trans("ConfirmDeleteSubscription"); - if ($conf->banque->enabled && $conf->global->ADHERENT_BANK_USE) $text.='
'.img_warning().' '.$langs->trans("ThisWillAlsoDeleteBankRecord"); + if (! empty($conf->banque->enabled) && ! empty($conf->global->ADHERENT_BANK_USE)) $text.='
'.img_warning().' '.$langs->trans("ThisWillAlsoDeleteBankRecord"); $ret=$form->form_confirm($_SERVER["PHP_SELF"]."?rowid=".$subscription->id,$langs->trans("DeleteSubscription"),$text,"confirm_delete",$formquestion,0,1); if ($ret == 'html') print '
'; } diff --git a/htdocs/admin/fckeditor.php b/htdocs/admin/fckeditor.php index d1a4ff48f67..17d4ddca75f 100644 --- a/htdocs/admin/fckeditor.php +++ b/htdocs/admin/fckeditor.php @@ -69,7 +69,7 @@ foreach($modules as $const => $desc) { dolibarr_set_const($db, "FCKEDITOR_ENABLE_".$const, "1",'chaine',0,'',$conf->entity); // Si fckeditor est active dans la description produit/service, on l'active dans les formulaires - if ($const == 'PRODUCTDESC' && $conf->global->PRODUIT_DESC_IN_FORM) + if ($const == 'PRODUCTDESC' && ! empty($conf->global->PRODUIT_DESC_IN_FORM)) { dolibarr_set_const($db, "FCKEDITOR_ENABLE_DETAILS", "1",'chaine',0,'',$conf->entity); } diff --git a/htdocs/admin/ldap.php b/htdocs/admin/ldap.php index 09b11f2c5cd..6cc42777343 100644 --- a/htdocs/admin/ldap.php +++ b/htdocs/admin/ldap.php @@ -269,7 +269,7 @@ if (function_exists("ldap_connect")) print ''.$langs->trans("LDAPTCPConnectOK",$conf->global->LDAP_SERVER_HOST,$conf->global->LDAP_SERVER_PORT).''; print '
'; - if ($conf->global->LDAP_ADMIN_DN && $conf->global->LDAP_ADMIN_PASS) + if ($conf->global->LDAP_ADMIN_DN && ! empty($conf->global->LDAP_ADMIN_PASS)) { if ($result == 2) { diff --git a/htdocs/asterisk/wrapper.php b/htdocs/asterisk/wrapper.php index 21aa75a4cae..3e342177980 100644 --- a/htdocs/asterisk/wrapper.php +++ b/htdocs/asterisk/wrapper.php @@ -66,7 +66,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; // Security check -if (! $conf->clicktodial->enabled) +if (empty($conf->clicktodial->enabled)) { accessforbidden(); exit; diff --git a/htdocs/cashdesk/facturation.php b/htdocs/cashdesk/facturation.php index 89a358808e4..09c1353e7e9 100644 --- a/htdocs/cashdesk/facturation.php +++ b/htdocs/cashdesk/facturation.php @@ -30,9 +30,9 @@ if ( $_GET['filtre'] ) { $ret=array(); $i=0; $sql = "SELECT p.rowid, p.ref, p.label, p.tva_tx, p.fk_product_type"; - if ($conf->stock->enabled && !empty($conf_fkentrepot)) $sql.= ", ps.reel"; + if (! empty($conf->stock->enabled) && !empty($conf_fkentrepot)) $sql.= ", ps.reel"; $sql.= " FROM ".MAIN_DB_PREFIX."product as p"; - if ($conf->stock->enabled && !empty($conf_fkentrepot)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_stock as ps ON p.rowid = ps.fk_product AND ps.fk_entrepot = '".$conf_fkentrepot."'"; + if (! empty($conf->stock->enabled) && !empty($conf_fkentrepot)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_stock as ps ON p.rowid = ps.fk_product AND ps.fk_entrepot = '".$conf_fkentrepot."'"; $sql.= " WHERE p.entity IN (".getEntity('product', 1).")"; $sql.= " AND p.tosell = 1"; if(!$conf->global->CASHDESK_SERVICES) $sql.= " AND p.fk_product_type = 0"; @@ -67,9 +67,9 @@ if ( $_GET['filtre'] ) { $i=0; $sql = "SELECT p.rowid, ref, label, tva_tx, p.fk_product_type"; - if ($conf->stock->enabled && !empty($conf_fkentrepot)) $sql.= ", ps.reel"; + if (! empty($conf->stock->enabled) && !empty($conf_fkentrepot)) $sql.= ", ps.reel"; $sql.= " FROM ".MAIN_DB_PREFIX."product as p"; - if ($conf->stock->enabled && !empty($conf_fkentrepot)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_stock as ps ON p.rowid = ps.fk_product AND ps.fk_entrepot = '".$conf_fkentrepot."'"; + if (! empty($conf->stock->enabled) && !empty($conf_fkentrepot)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_stock as ps ON p.rowid = ps.fk_product AND ps.fk_entrepot = '".$conf_fkentrepot."'"; $sql.= " WHERE p.entity IN (".getEntity('product', 1).")"; $sql.= " AND p.tosell = 1"; if(!$conf->global->CASHDESK_SERVICES) $sql.= " AND p.fk_product_type = 0"; diff --git a/htdocs/cashdesk/facturation_dhtml.php b/htdocs/cashdesk/facturation_dhtml.php index d327b2af07c..911aae6a576 100644 --- a/htdocs/cashdesk/facturation_dhtml.php +++ b/htdocs/cashdesk/facturation_dhtml.php @@ -44,9 +44,9 @@ header("Content-type: text/html; charset=".$conf->file->character_set_client); if (dol_strlen($_GET["code"]) >= 0) // If search criteria is on char length at least { $sql = "SELECT p.rowid, p.ref, p.label, p.tva_tx"; - if ($conf->stock->enabled && !empty($conf_fkentrepot)) $sql.= ", ps.reel"; + if (! empty($conf->stock->enabled) && !empty($conf_fkentrepot)) $sql.= ", ps.reel"; $sql.= " FROM ".MAIN_DB_PREFIX."product as p"; - if ($conf->stock->enabled && !empty($conf_fkentrepot)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_stock as ps ON p.rowid = ps.fk_product AND ps.fk_entrepot = '".$conf_fkentrepot."'"; + if (! empty($conf->stock->enabled) && !empty($conf_fkentrepot)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_stock as ps ON p.rowid = ps.fk_product AND ps.fk_entrepot = '".$conf_fkentrepot."'"; $sql.= " WHERE p.entity IN (".getEntity('product', 1).")"; $sql.= " AND p.tosell = 1"; $sql.= " AND p.fk_product_type = 0"; diff --git a/htdocs/cashdesk/facturation_verif.php b/htdocs/cashdesk/facturation_verif.php index 92ed6fc144b..ea2700e9a22 100644 --- a/htdocs/cashdesk/facturation_verif.php +++ b/htdocs/cashdesk/facturation_verif.php @@ -32,9 +32,9 @@ switch ( $_GET['action'] ) if ( $_POST['hdnSource'] != 'NULL' ) { $sql = "SELECT p.rowid, p.ref, p.price, p.tva_tx"; - if ($conf->stock->enabled && !empty($conf_fkentrepot)) $sql.= ", ps.reel"; + if (! empty($conf->stock->enabled) && !empty($conf_fkentrepot)) $sql.= ", ps.reel"; $sql.= " FROM ".MAIN_DB_PREFIX."product as p"; - if ($conf->stock->enabled && !empty($conf_fkentrepot)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_stock as ps ON p.rowid = ps.fk_product AND ps.fk_entrepot = ".$conf_fkentrepot; + if (! empty($conf->stock->enabled) && !empty($conf_fkentrepot)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_stock as ps ON p.rowid = ps.fk_product AND ps.fk_entrepot = ".$conf_fkentrepot; $sql.= " WHERE p.entity IN (".getEntity('product', 1).")"; // Recuperation des donnees en fonction de la source (liste deroulante ou champ texte) ... diff --git a/htdocs/cashdesk/index_verif.php b/htdocs/cashdesk/index_verif.php index d71b2cb866f..0b42d4a78fd 100644 --- a/htdocs/cashdesk/index_verif.php +++ b/htdocs/cashdesk/index_verif.php @@ -49,14 +49,14 @@ if (! ($thirdpartyid > 0)) } // If we setup stock module to ask movement on invoices, we must not allow access if required setup not finished. -if ($conf->stock->enabled && $conf->global->STOCK_CALCULATE_ON_BILL && ! ($warehouseid > 0)) +if (! empty($conf->stock->enabled) && $conf->global->STOCK_CALCULATE_ON_BILL && ! ($warehouseid > 0)) { $retour=$langs->trans("CashDeskSetupStock"); header('Location: '.DOL_URL_ROOT.'/cashdesk/index.php?err='.urlencode($retour).'&user='.$username.'&socid='.$thirdpartyid.'&warehouseid='.$warehouseid); exit; } -if (! empty($_POST['txtUsername']) && $conf->banque->enabled && (empty($conf_fkaccount_cash) || empty($conf_fkaccount_cheque) || empty($conf_fkaccount_cb))) +if (! empty($_POST['txtUsername']) && ! empty($conf->banque->enabled) && (empty($conf_fkaccount_cash) || empty($conf_fkaccount_cheque) || empty($conf_fkaccount_cb))) { $langs->load("errors"); $retour=$langs->trans("ErrorModuleSetupNotComplete"); diff --git a/htdocs/cashdesk/tpl/facturation1.tpl.php b/htdocs/cashdesk/tpl/facturation1.tpl.php index fc1a3f431c5..ec465c4bd6b 100644 --- a/htdocs/cashdesk/tpl/facturation1.tpl.php +++ b/htdocs/cashdesk/tpl/facturation1.tpl.php @@ -74,7 +74,7 @@ $langs->load("cashdesk"); $label = $tab_designations[$i]['label']; print ''."\n "; } @@ -92,7 +92,7 @@ $langs->load("cashdesk"); $label = $tab_designations[$i]['label']; print ''."\n "; } diff --git a/htdocs/cashdesk/tpl/menu.tpl.php b/htdocs/cashdesk/tpl/menu.tpl.php index ba9767e5983..b1cdf424f89 100644 --- a/htdocs/cashdesk/tpl/menu.tpl.php +++ b/htdocs/cashdesk/tpl/menu.tpl.php @@ -48,7 +48,7 @@ if (!empty($conf->global->CASHDESK_ID_BANKACCOUNT_CHEQUE)) $bankcheque->fetch($conf->global->CASHDESK_ID_BANKACCOUNT_CHEQUE); $bankchequeLink = $bankcheque->getNomUrl(1); } -if (!empty($_SESSION["CASHDESK_ID_WAREHOUSE"]) && $conf->stock->enabled) +if (!empty($_SESSION["CASHDESK_ID_WAREHOUSE"]) && ! empty($conf->stock->enabled)) { $warehouse=new Entrepot($db); $warehouse->fetch($_SESSION["CASHDESK_ID_WAREHOUSE"]); @@ -72,7 +72,7 @@ print $langs->trans("CashDeskThirdParty").': '.$companyLink.'
'; /*print $langs->trans("CashDeskBankCash").': '.$bankcashLink.'
'; print $langs->trans("CashDeskBankCB").': '.$bankcbLink.'
'; print $langs->trans("CashDeskBankCheque").': '.$bankchequeLink.'
';*/ -if (!empty($_SESSION["CASHDESK_ID_WAREHOUSE"]) && $conf->stock->enabled) +if (!empty($_SESSION["CASHDESK_ID_WAREHOUSE"]) && ! empty($conf->stock->enabled)) { print $langs->trans("CashDeskWarehouse").': '.$warehouseLink; } diff --git a/htdocs/categories/photos.php b/htdocs/categories/photos.php index 36bd186c627..5e1598fcc4c 100644 --- a/htdocs/categories/photos.php +++ b/htdocs/categories/photos.php @@ -129,7 +129,7 @@ if ($object->id) print ''; // Visibility - /* if ($type == 0 && $conf->global->CATEGORY_ASSIGNED_TO_A_CUSTOMER) + /* if ($type == 0 && ! empty($conf->global->CATEGORY_ASSIGNED_TO_A_CUSTOMER)) { if ($object->socid) { diff --git a/htdocs/comm/addpropal.php b/htdocs/comm/addpropal.php index 19272a22e3d..52f63e172a7 100644 --- a/htdocs/comm/addpropal.php +++ b/htdocs/comm/addpropal.php @@ -303,7 +303,7 @@ if ($action == 'create') if (! empty($conf->global->PRODUCT_SHOW_WHEN_CREATE)) { print '
'.$langs->trans("Statistics").'
'.$langs->trans("ProductsNotOnSell").''.round($prodser[0][0]).''.$langs->trans("ProductsOnSell").''.round($prodser[0][1]).'
'.$langs->trans("ServicesNotOnSell").''.round($prodser[1][0]).'
'.$langs->trans("AppliedPricesFrom").''.$langs->trans("MultiPriceLevelsName").'".dol_print_date($db->jdate($objp->dp),"dayhour")."'.$objp->price_level."
control->tpl['select_workforce']; echo $this->control->tpl['info_admin']; ?>
trans("DefaultLang"); ?> control->tpl['select_lang']; ?>control->tpl['select_workforce']; echo $this->control->tpl['info_admin']; ?>
trans("DefaultLang"); ?> control->tpl['select_lang']; ?>control->tpl['effectif']; ?>
trans("DefaultLang"); ?> control->tpl['default_lang']; ?>control->tpl['sales_representatives']; ?>
trans("LinkedToDolibarrMember"); ?> control->tpl['linked_member']; ?>
trans("DefaultLang"); ?> control->tpl['select_lang']; ?>
trans("DefaultLang"); ?> control->tpl['select_lang']; ?>control->tpl['typent']; ?>
trans("DefaultLang"); ?> control->tpl['default_lang']; ?>control->tpl['sales_representatives']; ?>
trans("LinkedToDolibarrMember"); ?> control->tpl['linked_member']; ?>
'.$langs->trans("Capital").' '.$langs->trans("Currency".$conf->currency).'
'.$langs->trans("DefaultLang").''."\n"; print $formadmin->select_language($object->default_lang,'default_lang',0,0,1); @@ -1677,7 +1677,7 @@ else print '
'.$langs->trans("DefaultLang").''; @@ -1752,7 +1752,7 @@ else include DOL_DOCUMENT_ROOT.'/societe/tpl/linesalesrepresentative.tpl.php'; // Module Adherent - if ($conf->adherent->enabled) + if (! empty($conf->adherent->enabled)) { $langs->load("members"); print '
'.$langs->trans("LinkedToDolibarrMember").'
'.price($objp->cotisation).'
'; - if ($conf->product->enabled || $conf->service->enabled) + if (! empty($conf->product->enabled) || ! empty($conf->service->enabled)) { $lib=$langs->trans("ProductsAndServices"); diff --git a/htdocs/comm/fiche.php b/htdocs/comm/fiche.php index 2b6e08bd406..889f13c635e 100644 --- a/htdocs/comm/fiche.php +++ b/htdocs/comm/fiche.php @@ -410,7 +410,7 @@ if ($id > 0) /* * Last proposals */ - if ($conf->propal->enabled && $user->rights->propal->lire) + if (! empty($conf->propal->enabled) && $user->rights->propal->lire) { $propal_static = new Propal($db); @@ -472,7 +472,7 @@ if ($id > 0) /* * Last orders */ - if ($conf->commande->enabled && $user->rights->commande->lire) + if (! empty($conf->commande->enabled) && $user->rights->commande->lire) { $commande_static=new Commande($db); @@ -527,7 +527,7 @@ if ($id > 0) /* * Last linked contracts */ - if ($conf->contrat->enabled && $user->rights->contrat->lire) + if (! empty($conf->contrat->enabled) && $user->rights->contrat->lire) { $contratstatic=new Contrat($db); @@ -587,7 +587,7 @@ if ($id > 0) /* * Last interventions */ - if ($conf->ficheinter->enabled && $user->rights->ficheinter->lire) + if (! empty($conf->ficheinter->enabled) && $user->rights->ficheinter->lire) { $sql = "SELECT s.nom, s.rowid, f.rowid as id, f.ref, f.fk_statut, f.duree as duration, f.datei as startdate"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."fichinter as f"; @@ -642,7 +642,7 @@ if ($id > 0) /* * Last invoices */ - if ($conf->facture->enabled && $user->rights->facture->lire) + if (! empty($conf->facture->enabled) && $user->rights->facture->lire) { $facturestatic = new Facture($db); @@ -723,13 +723,13 @@ if ($id > 0) */ print '
'; - if ($conf->propal->enabled && $user->rights->propal->creer) + if (! empty($conf->propal->enabled) && $user->rights->propal->creer) { $langs->load("propal"); print ''.$langs->trans("AddProp").''; } - if ($conf->commande->enabled && $user->rights->commande->creer) + if (! empty($conf->commande->enabled) && $user->rights->commande->creer) { $langs->load("orders"); print ''.$langs->trans("AddOrder").''; @@ -741,7 +741,7 @@ if ($id > 0) print ''.$langs->trans("AddContract").''; } - if ($conf->ficheinter->enabled && $user->rights->ficheinter->creer) + if (! empty($conf->ficheinter->enabled) && $user->rights->ficheinter->creer) { $langs->load("fichinter"); print ''.$langs->trans("AddIntervention").''; @@ -772,7 +772,7 @@ if ($id > 0) } // Add action - if ($conf->agenda->enabled && ! empty($conf->global->MAIN_REPEATTASKONEACHTAB)) + if (! empty($conf->agenda->enabled) && ! empty($conf->global->MAIN_REPEATTASKONEACHTAB)) { if ($user->rights->agenda->myactions->create) { diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php index 2bc4da5a112..d124b836692 100644 --- a/htdocs/comm/index.php +++ b/htdocs/comm/index.php @@ -89,15 +89,15 @@ print_fiche_titre($langs->trans("CustomerArea")); print ''; print ''; -if (($conf->propal->enabled && $user->rights->propale->lire) || - ($conf->contrat->enabled && $user->rights->contrat->lire) || - ($conf->commande->enabled && $user->rights->commande->lire)) +if ((! empty($conf->propal->enabled) && $user->rights->propale->lire) || + (! empty($conf->contrat->enabled) && $user->rights->contrat->lire) || + (! empty($conf->commande->enabled) && $user->rights->commande->lire)) { print ''; print ''; print "\n"; diff --git a/htdocs/compta/stats/casoc.php b/htdocs/compta/stats/casoc.php index 3bf19f18942..1460cb185e5 100644 --- a/htdocs/compta/stats/casoc.php +++ b/htdocs/compta/stats/casoc.php @@ -292,9 +292,9 @@ if (count($amount)) // Other stats print ''; print "\n"; diff --git a/htdocs/compta/tva/class/tva.class.php b/htdocs/compta/tva/class/tva.class.php index d7d14938a6f..7e2eeeebc0d 100644 --- a/htdocs/compta/tva/class/tva.class.php +++ b/htdocs/compta/tva/class/tva.class.php @@ -485,12 +485,12 @@ class Tva extends CommonObject $this->error=$langs->trans("ErrorFieldRequired",$langs->transnoentities("Amount")); return -4; } - if ($conf->banque->enabled && (empty($this->accountid) || $this->accountid <= 0)) + if (! empty($conf->banque->enabled) && (empty($this->accountid) || $this->accountid <= 0)) { $this->error=$langs->trans("ErrorFieldRequired",$langs->transnoentities("Account")); return -5; } - if ($conf->banque->enabled && (empty($this->paymenttype) || $this->paymenttype <= 0)) + if (! empty($conf->banque->enabled) && (empty($this->paymenttype) || $this->paymenttype <= 0)) { $this->error=$langs->trans("ErrorFieldRequired",$langs->transnoentities("PaymentMode")); return -5; diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index 93ee8e61692..7e09f688d2a 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -331,9 +331,9 @@ class Contact extends CommonObject $this->fullname=$this->getFullName($langs); // Fields - if ($this->fullname && $conf->global->LDAP_CONTACT_FIELD_FULLNAME) $info[$conf->global->LDAP_CONTACT_FIELD_FULLNAME] = $this->fullname; - if ($this->lastname && $conf->global->LDAP_CONTACT_FIELD_NAME) $info[$conf->global->LDAP_CONTACT_FIELD_NAME] = $this->lastname; - if ($this->firstname && $conf->global->LDAP_CONTACT_FIELD_FIRSTNAME) $info[$conf->global->LDAP_CONTACT_FIELD_FIRSTNAME] = $this->firstname; + if ($this->fullname && ! empty($conf->global->LDAP_CONTACT_FIELD_FULLNAME)) $info[$conf->global->LDAP_CONTACT_FIELD_FULLNAME] = $this->fullname; + if ($this->lastname && ! empty($conf->global->LDAP_CONTACT_FIELD_NAME)) $info[$conf->global->LDAP_CONTACT_FIELD_NAME] = $this->lastname; + if ($this->firstname && ! empty($conf->global->LDAP_CONTACT_FIELD_FIRSTNAME)) $info[$conf->global->LDAP_CONTACT_FIELD_FIRSTNAME] = $this->firstname; if ($this->poste) $info["title"] = $this->poste; if ($this->socid > 0) @@ -346,16 +346,16 @@ class Contact extends CommonObject if ($soc->client == 2) $info["businessCategory"] = "Prospects"; if ($soc->fournisseur == 1) $info["businessCategory"] = "Suppliers"; } - if ($this->address && $conf->global->LDAP_CONTACT_FIELD_ADDRESS) $info[$conf->global->LDAP_CONTACT_FIELD_ADDRESS] = $this->address; - if ($this->cp && $conf->global->LDAP_CONTACT_FIELD_ZIP) $info[$conf->global->LDAP_CONTACT_FIELD_ZIP] = $this->cp; - if ($this->ville && $conf->global->LDAP_CONTACT_FIELD_TOWN) $info[$conf->global->LDAP_CONTACT_FIELD_TOWN] = $this->ville; - if ($this->country_code && $conf->global->LDAP_CONTACT_FIELD_COUNTRY) $info[$conf->global->LDAP_CONTACT_FIELD_COUNTRY] = $this->country_code; - if ($this->phone_pro && $conf->global->LDAP_CONTACT_FIELD_PHONE) $info[$conf->global->LDAP_CONTACT_FIELD_PHONE] = $this->phone_pro; - if ($this->phone_perso && $conf->global->LDAP_CONTACT_FIELD_HOMEPHONE) $info[$conf->global->LDAP_CONTACT_FIELD_HOMEPHONE] = $this->phone_perso; - if ($this->phone_mobile && $conf->global->LDAP_CONTACT_FIELD_MOBILE) $info[$conf->global->LDAP_CONTACT_FIELD_MOBILE] = $this->phone_mobile; - if ($this->fax && $conf->global->LDAP_CONTACT_FIELD_FAX) $info[$conf->global->LDAP_CONTACT_FIELD_FAX] = $this->fax; - if ($this->note && $conf->global->LDAP_CONTACT_FIELD_DESCRIPTION) $info[$conf->global->LDAP_CONTACT_FIELD_DESCRIPTION] = $this->note; - if ($this->email && $conf->global->LDAP_CONTACT_FIELD_MAIL) $info[$conf->global->LDAP_CONTACT_FIELD_MAIL] = $this->email; + if ($this->address && ! empty($conf->global->LDAP_CONTACT_FIELD_ADDRESS)) $info[$conf->global->LDAP_CONTACT_FIELD_ADDRESS] = $this->address; + if ($this->cp && ! empty($conf->global->LDAP_CONTACT_FIELD_ZIP)) $info[$conf->global->LDAP_CONTACT_FIELD_ZIP] = $this->cp; + if ($this->ville && ! empty($conf->global->LDAP_CONTACT_FIELD_TOWN)) $info[$conf->global->LDAP_CONTACT_FIELD_TOWN] = $this->ville; + if ($this->country_code && ! empty($conf->global->LDAP_CONTACT_FIELD_COUNTRY)) $info[$conf->global->LDAP_CONTACT_FIELD_COUNTRY] = $this->country_code; + if ($this->phone_pro && ! empty($conf->global->LDAP_CONTACT_FIELD_PHONE)) $info[$conf->global->LDAP_CONTACT_FIELD_PHONE] = $this->phone_pro; + if ($this->phone_perso && ! empty($conf->global->LDAP_CONTACT_FIELD_HOMEPHONE)) $info[$conf->global->LDAP_CONTACT_FIELD_HOMEPHONE] = $this->phone_perso; + if ($this->phone_mobile && ! empty($conf->global->LDAP_CONTACT_FIELD_MOBILE)) $info[$conf->global->LDAP_CONTACT_FIELD_MOBILE] = $this->phone_mobile; + if ($this->fax && ! empty($conf->global->LDAP_CONTACT_FIELD_FAX)) $info[$conf->global->LDAP_CONTACT_FIELD_FAX] = $this->fax; + if ($this->note && ! empty($conf->global->LDAP_CONTACT_FIELD_DESCRIPTION)) $info[$conf->global->LDAP_CONTACT_FIELD_DESCRIPTION] = $this->note; + if ($this->email && ! empty($conf->global->LDAP_CONTACT_FIELD_MAIL)) $info[$conf->global->LDAP_CONTACT_FIELD_MAIL] = $this->email; if ($conf->global->LDAP_SERVER_TYPE == 'egroupware') { diff --git a/htdocs/contrat/fiche.php b/htdocs/contrat/fiche.php index e49c8b3e5a3..c402c184366 100644 --- a/htdocs/contrat/fiche.php +++ b/htdocs/contrat/fiche.php @@ -1359,7 +1359,7 @@ else else print ''.$langs->trans("Validate").''; } - if ($conf->facture->enabled && $object->statut > 0 && $object->nbofservicesclosed < $nbofservices) + if (! empty($conf->facture->enabled) && $object->statut > 0 && $object->nbofservicesclosed < $nbofservices) { $langs->load("bills"); if ($user->rights->facture->creer) print ''.$langs->trans("CreateBill").''; diff --git a/htdocs/core/boxes/box_activity.php b/htdocs/core/boxes/box_activity.php index 762d79bda25..5e4267bd12c 100644 --- a/htdocs/core/boxes/box_activity.php +++ b/htdocs/core/boxes/box_activity.php @@ -77,7 +77,7 @@ class box_activity extends ModeleBoxes $this->info_box_head = array('text' => $textHead, 'limit'=> dol_strlen($textHead)); // list the summary of the bills - if ($conf->facture->enabled && $user->rights->facture->lire) + if (! empty($conf->facture->enabled) && $user->rights->facture->lire) { $sql = "SELECT f.paye, f.fk_statut, sum(f.total_ttc) as Mnttot, count(*) as nb"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f"; @@ -133,7 +133,7 @@ class box_activity extends ModeleBoxes } // list the summary of the orders - if ($conf->commande->enabled && $user->rights->commande->lire) + if (! empty($conf->commande->enabled) && $user->rights->commande->lire) { $sql = "SELECT c.fk_statut,c.facture, sum(c.total_ttc) as Mnttot, count(*) as nb"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."commande as c"; @@ -175,7 +175,7 @@ class box_activity extends ModeleBoxes } // list the summary of the propals - if ($conf->propal->enabled && $user->rights->propal->lire) + if (! empty($conf->propal->enabled) && $user->rights->propal->lire) { $sql = "SELECT p.fk_statut, sum(p.total) as Mnttot, count(*) as nb"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."propal as p"; diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index af20aaf1a03..92c38a2d408 100755 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -483,7 +483,7 @@ class ExtraFields else if ($type == 'text') { require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor=new DolEditor('options_'.$key,$value,'',200,'dolibarr_notes','In',false,false,$conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_SOCIETE,5,100); + $doleditor=new DolEditor('options_'.$key,$value,'',200,'dolibarr_notes','In',false,false,! empty($conf->fckeditor->enabled) && $conf->global->FCKEDITOR_ENABLE_SOCIETE,5,100); $out=$doleditor->Create(1); } // Add comments diff --git a/htdocs/core/class/html.formbarcode.class.php b/htdocs/core/class/html.formbarcode.class.php index 5a9ab8b6ee8..86ef77b3536 100644 --- a/htdocs/core/class/html.formbarcode.class.php +++ b/htdocs/core/class/html.formbarcode.class.php @@ -74,8 +74,8 @@ class FormBarCode } // We check if barcode is already selected by default - if ((($conf->product->enabled || $conf->service->enabled) && $conf->global->PRODUIT_DEFAULT_BARCODE_TYPE == $code_id) || - ($conf->societe->enabled && $conf->global->GENBARCODE_BARCODETYPE_THIRDPARTY == $code_id)) + if (((! empty($conf->product->enabled) || ! empty($conf->service->enabled)) && $conf->global->PRODUIT_DEFAULT_BARCODE_TYPE == $code_id) || + (! empty($conf->societe->enabled) && $conf->global->GENBARCODE_BARCODETYPE_THIRDPARTY == $code_id)) { $disable = 'disabled="disabled"'; } diff --git a/htdocs/core/class/html.formcompany.class.php b/htdocs/core/class/html.formcompany.class.php index b848d6b2759..f4eca4bc09b 100644 --- a/htdocs/core/class/html.formcompany.class.php +++ b/htdocs/core/class/html.formcompany.class.php @@ -521,7 +521,7 @@ class FormCompany $sql = "SELECT s.rowid, s.nom FROM"; $sql.= " ".MAIN_DB_PREFIX."societe as s"; $sql.= " WHERE s.entity IN (".getEntity('societe', 1).")"; - if ($selected && $conf->use_javascript_ajax && $conf->global->COMPANY_USE_SEARCH_TO_SELECT) $sql.= " AND rowid = ".$selected; + if ($selected && $conf->use_javascript_ajax && ! empty($conf->global->COMPANY_USE_SEARCH_TO_SELECT)) $sql.= " AND rowid = ".$selected; else { // For ajax search we limit here. For combo list, we limit later @@ -536,7 +536,7 @@ class FormCompany $resql = $this->db->query($sql); if ($resql) { - if ($conf->use_javascript_ajax && $conf->global->COMPANY_USE_SEARCH_TO_SELECT) + if ($conf->use_javascript_ajax && ! empty($conf->global->COMPANY_USE_SEARCH_TO_SELECT)) { $minLength = (is_numeric($conf->global->COMPANY_USE_SEARCH_TO_SELECT)?$conf->global->COMPANY_USE_SEARCH_TO_SELECT:2); diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index df775c55cd7..174b76231da 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -567,7 +567,7 @@ class FormMail elseif (! is_numeric($this->withbody)) { $defaultmessage=$this->withbody; } // Complete substitution array - if ($conf->paypal->enabled && $conf->global->PAYPAL_ADD_PAYMENT_URL) + if (! empty($conf->paypal->enabled) && ! empty($conf->global->PAYPAL_ADD_PAYMENT_URL)) { require_once DOL_DOCUMENT_ROOT.'/paypal/lib/paypal.lib.php'; diff --git a/htdocs/core/lib/agenda.lib.php b/htdocs/core/lib/agenda.lib.php index 1e8003d22fb..990fee14ae9 100644 --- a/htdocs/core/lib/agenda.lib.php +++ b/htdocs/core/lib/agenda.lib.php @@ -47,7 +47,7 @@ function print_actions_filter($form,$canedit,$status,$year,$month,$day,$showbirt global $conf,$langs,$db; // Filters - if ($canedit || $conf->projet->enabled) + if ($canedit || ! empty($conf->projet->enabled)) { print ''; print ''; @@ -57,7 +57,7 @@ function print_actions_filter($form,$canedit,$status,$year,$month,$day,$showbirt print ''; print ''; print '
'; } // Recherche Propal -if ($conf->propal->enabled && $user->rights->propal->lire) +if (! empty($conf->propal->enabled) && $user->rights->propal->lire) { $var=false; print '
'; @@ -116,7 +116,7 @@ if ($conf->propal->enabled && $user->rights->propal->lire) /* * Recherche Contrat */ -if ($conf->contrat->enabled && $user->rights->contrat->lire) +if (! empty($conf->contrat->enabled) && $user->rights->contrat->lire) { $var=false; print ''; @@ -135,7 +135,7 @@ if ($conf->contrat->enabled && $user->rights->contrat->lire) /* * Draft proposals */ -if ($conf->propal->enabled && $user->rights->propal->lire) +if (! empty($conf->propal->enabled) && $user->rights->propal->lire) { $sql = "SELECT p.rowid, p.ref, p.total_ht, s.rowid as socid, s.nom as name, s.client, s.canvas"; $sql.= " FROM ".MAIN_DB_PREFIX."propal as p"; @@ -200,7 +200,7 @@ if ($conf->propal->enabled && $user->rights->propal->lire) /* * Draft orders */ -if ($conf->commande->enabled && $user->rights->commande->lire) +if (! empty($conf->commande->enabled) && $user->rights->commande->lire) { $langs->load("orders"); @@ -255,9 +255,9 @@ if ($conf->commande->enabled && $user->rights->commande->lire) } } -if (($conf->propal->enabled && $user->rights->propale->lire) || - ($conf->contrat->enabled && $user->rights->contrat->lire) || - ($conf->commande->enabled && $user->rights->commande->lire)) +if ((! empty($conf->propal->enabled) && $user->rights->propale->lire) || + (! empty($conf->contrat->enabled) && $user->rights->contrat->lire) || + (! empty($conf->commande->enabled) && $user->rights->commande->lire)) { print '
'; @@ -276,7 +276,7 @@ $max=3; /* * Last modified customers or prospects */ -if ($conf->societe->enabled && $user->rights->societe->lire) +if (! empty($conf->societe->enabled) && $user->rights->societe->lire) { $langs->load("boxes"); @@ -336,7 +336,7 @@ if ($conf->societe->enabled && $user->rights->societe->lire) } // Last suppliers -if ($conf->fournisseur->enabled && $user->rights->societe->lire) +if (! empty($conf->fournisseur->enabled) && $user->rights->societe->lire) { $langs->load("boxes"); @@ -408,7 +408,7 @@ if ($user->rights->agenda->myactions->read) /* * Last contracts */ -if ($conf->contrat->enabled && $user->rights->contrat->lire && 0) // TODO A REFAIRE DEPUIS NOUVEAU CONTRAT +if (! empty($conf->contrat->enabled) && $user->rights->contrat->lire && 0) // TODO A REFAIRE DEPUIS NOUVEAU CONTRAT { $langs->load("contracts"); @@ -466,7 +466,7 @@ if ($conf->contrat->enabled && $user->rights->contrat->lire && 0) // TODO A REFA /* * Opened proposals */ -if ($conf->propal->enabled && $user->rights->propal->lire) +if (! empty($conf->propal->enabled) && $user->rights->propal->lire) { $langs->load("propal"); diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index 10d126a62dd..d30f466df27 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -1640,7 +1640,7 @@ if ($object->statut == 0 && $user->rights->propal->creer) $object->formAddFreeProduct(0,$mysoc,$soc,$hookmanager); // Add predefined products/services - if ($conf->product->enabled || $conf->service->enabled) + if (! empty($conf->product->enabled) || ! empty($conf->service->enabled)) { $var=!$var; $object->formAddPredefinedProduct(0,$mysoc,$soc,$hookmanager); @@ -1738,7 +1738,7 @@ if ($action != 'presend') // Create an invoice and classify billed if ($object->statut == 2 && $user->societe_id == 0) { - if ($conf->facture->enabled && $user->rights->facture->creer) + if (! empty($conf->facture->enabled) && $user->rights->facture->creer) { print ''.$langs->trans("AddBill").''; } diff --git a/htdocs/comm/prospect/fiche.php b/htdocs/comm/prospect/fiche.php index 0abde58fc86..14264358cfa 100644 --- a/htdocs/comm/prospect/fiche.php +++ b/htdocs/comm/prospect/fiche.php @@ -225,7 +225,7 @@ if ($socid > 0) /* * Last proposals */ - if ($conf->propal->enabled && $user->rights->propale->lire) + if (! empty($conf->propal->enabled) && $user->rights->propale->lire) { $propal_static=new Propal($db); @@ -297,13 +297,13 @@ if ($socid > 0) print '
'; - if ($conf->propal->enabled && $user->rights->propale->creer) + if (! empty($conf->propal->enabled) && $user->rights->propale->creer) { print ''.$langs->trans("AddProp").''; } // Add action - if ($conf->agenda->enabled && ! empty($conf->global->MAIN_REPEATTASKONEACHTAB)) + if (! empty($conf->agenda->enabled) && ! empty($conf->global->MAIN_REPEATTASKONEACHTAB)) { if ($user->rights->agenda->myactions->create) { diff --git a/htdocs/comm/prospect/index.php b/htdocs/comm/prospect/index.php index f72cae173d3..f4f603fb45b 100644 --- a/htdocs/comm/prospect/index.php +++ b/htdocs/comm/prospect/index.php @@ -111,7 +111,7 @@ if ($resql) /* * Liste des propal brouillons */ -if ($conf->propal->enabled && $user->rights->propale->lire) +if (! empty($conf->propal->enabled) && $user->rights->propale->lire) { $sql = "SELECT p.rowid, p.ref, p.price, s.nom as sname"; $sql.= " FROM ".MAIN_DB_PREFIX."propal as p"; @@ -170,7 +170,7 @@ if (! empty($conf->agenda->enabled)) show_array_actions_to_do(10); * Dernieres propales ouvertes * */ -if ($conf->propal->enabled && $user->rights->propale->lire) +if (! empty($conf->propal->enabled) && $user->rights->propale->lire) { $sql = "SELECT s.nom as name, s.rowid as socid, s.client, s.canvas,"; $sql.= " p.rowid as propalid, p.total as total_ttc, p.ref, p.datep as dp, c.label as statut, c.id as statutid"; diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 091701aeeac..6d6181ad75c 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -237,7 +237,7 @@ class Commande extends CommonOrder if (! $error) { // If stock is incremented on validate order, we must increment it - if ($result >= 0 && $conf->stock->enabled && $conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER == 1) + if ($result >= 0 && ! empty($conf->stock->enabled) && $conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER == 1) { require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php'; $langs->load("agenda"); @@ -351,7 +351,7 @@ class Commande extends CommonOrder if ($this->db->query($sql)) { // If stock is decremented on validate order, we must reincrement it - if ($conf->stock->enabled && $conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER == 1) + if (! empty($conf->stock->enabled) && $conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER == 1) { require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php'; $langs->load("agenda"); @@ -534,7 +534,7 @@ class Commande extends CommonOrder if ($this->db->query($sql)) { // If stock is decremented on validate order, we must reincrement it - if ($conf->stock->enabled && $conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER == 1) + if (! empty($conf->stock->enabled) && $conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER == 1) { require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php'; $langs->load("agenda"); @@ -2538,7 +2538,7 @@ class Commande extends CommonOrder $result=''; - if ($conf->expedition->enabled && ($option == 1 || $option == 2)) $url = DOL_URL_ROOT.'/expedition/shipment.php?id='.$this->id; + if (! empty($conf->expedition->enabled) && ($option == 1 || $option == 2)) $url = DOL_URL_ROOT.'/expedition/shipment.php?id='.$this->id; else $url = DOL_URL_ROOT.'/commande/fiche.php?id='.$this->id; if ($short) return $url; diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php index 8d8a1354dd4..c186f05df5a 100644 --- a/htdocs/commande/fiche.php +++ b/htdocs/commande/fiche.php @@ -2153,7 +2153,7 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G $object->formAddFreeProduct(1,$mysoc,$soc,$hookmanager); // Add predefined products/services - if ($conf->product->enabled || $conf->service->enabled) + if (! empty($conf->product->enabled) || ! empty($conf->service->enabled)) { $var=!$var; $object->formAddPredefinedProduct(1,$mysoc,$soc,$hookmanager); @@ -2235,7 +2235,7 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G // Create bill and Classify billed - if ($conf->facture->enabled && $object->statut > 0 && ! $object->billed) + if (! empty($conf->facture->enabled) && $object->statut > 0 && ! $object->billed) { if ($user->rights->facture->creer && empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) { diff --git a/htdocs/compta/bank/account.php b/htdocs/compta/bank/account.php index e215dbdcca2..e6c5cb4f580 100644 --- a/htdocs/compta/bank/account.php +++ b/htdocs/compta/bank/account.php @@ -429,11 +429,11 @@ if ($id > 0 || ! empty($ref)) $sql.= ", s.rowid as socid, s.nom as thirdparty"; } /* - if ($mode_search && $conf->adherent->enabled) + if ($mode_search && ! empty($conf->adherent->enabled)) { } - if ($mode_search && $conf->tax->enabled) + if ($mode_search && ! empty($conf->tax->enabled)) { } @@ -445,12 +445,12 @@ if ($id > 0 || ! empty($ref)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank_url as bu1 ON bu1.fk_bank = b.rowid AND bu1.type='company'"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON bu1.url_id = s.rowid"; } - if ($mode_search && $conf->tax->enabled) + if ($mode_search && ! empty($conf->tax->enabled)) { $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank_url as bu2 ON bu2.fk_bank = b.rowid AND bu2.type='payment_vat'"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."tva as t ON bu2.url_id = t.rowid"; } - if ($mode_search && $conf->adherent->enabled) + if ($mode_search && ! empty($conf->adherent->enabled)) { // TODO Mettre jointure sur adherent pour recherche sur un adherent //$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank_url as bu3 ON bu3.fk_bank = b.rowid AND bu3.type='company'"; diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index dbb6b43703c..0c6e0e6c9b9 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -3016,7 +3016,7 @@ else if ($id > 0 || ! empty($ref)) $object->formAddFreeProduct(1,$mysoc,$soc,$hookmanager); // Add predefined products/services - if ($conf->product->enabled || $conf->service->enabled) + if (! empty($conf->product->enabled) || ! empty($conf->service->enabled)) { $var=!$var; $object->formAddPredefinedProduct(1,$mysoc,$soc,$hookmanager); @@ -3268,7 +3268,7 @@ else if ($id > 0 || ! empty($ref)) $somethingshown=$object->showLinkedObjectBlock(); // Link for paypal payment - if ($conf->paypal->enabled && $object->statut != 0) + if (! empty($conf->paypal->enabled) && $object->statut != 0) { include_once DOL_DOCUMENT_ROOT.'/paypal/lib/paypal.lib.php'; print showPaypalPaymentUrl('invoice',$object->ref); diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 054b2a13760..6f6c85abd59 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -1809,7 +1809,7 @@ class Facture extends CommonInvoice if ($result) { // Si on decremente le produit principal et ses composants a la validation de facture, on réincrement - if ($this->type != 3 && $result >= 0 && $conf->stock->enabled && $conf->global->STOCK_CALCULATE_ON_BILL) + if ($this->type != 3 && $result >= 0 && ! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_BILL)) { require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php'; $langs->load("agenda"); diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php index 3fea5bcd1c1..7cbbbb8e5da 100644 --- a/htdocs/compta/index.php +++ b/htdocs/compta/index.php @@ -108,7 +108,7 @@ $max=3; /* * Search invoices */ -if ($conf->facture->enabled && $user->rights->facture->lire) +if (! empty($conf->facture->enabled) && $user->rights->facture->lire) { print ''; print ''; @@ -125,7 +125,7 @@ if ($conf->facture->enabled && $user->rights->facture->lire) /* * Search supplier invoices */ -if ($conf->fournisseur->enabled && $user->rights->fournisseur->lire) +if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->lire) { print ''; print ''; @@ -142,7 +142,7 @@ if ($conf->fournisseur->enabled && $user->rights->fournisseur->lire) /* * Search donations */ -if ($conf->don->enabled && $user->rights->don->lire) +if (! empty($conf->don->enabled) && $user->rights->don->lire) { print ''; print ''; @@ -159,7 +159,7 @@ if ($conf->don->enabled && $user->rights->don->lire) /* * Search expenses */ -if ($conf->deplacement->enabled && $user->rights->deplacement->lire) +if (! empty($conf->deplacement->enabled) && $user->rights->deplacement->lire) { print ''; print ''; @@ -176,7 +176,7 @@ if ($conf->deplacement->enabled && $user->rights->deplacement->lire) /** * Draft customers invoices */ -if ($conf->facture->enabled && $user->rights->facture->lire) +if (! empty($conf->facture->enabled) && $user->rights->facture->lire) { $sql = "SELECT f.facnumber, f.rowid, f.total_ttc, f.type,"; $sql.= " s.nom, s.rowid as socid"; @@ -250,7 +250,7 @@ if ($conf->facture->enabled && $user->rights->facture->lire) /** * Draft suppliers invoices */ -if ($conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire) +if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture->lire) { $sql = "SELECT f.facnumber, f.rowid, f.total_ttc, f.type,"; $sql.= " s.nom, s.rowid as socid"; @@ -419,7 +419,7 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire) // Last modified supplier invoices -if ($conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire) +if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture->lire) { $langs->load("boxes"); $facstatic=new FactureFournisseur($db); @@ -498,7 +498,7 @@ if ($conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire) // Last donations -if ($conf->don->enabled && $user->rights->societe->lire) +if (! empty($conf->don->enabled) && $user->rights->societe->lire) { include_once DOL_DOCUMENT_ROOT.'/compta/dons/class/don.class.php'; @@ -633,7 +633,7 @@ if (! empty($conf->deplacement->enabled) && $user->rights->deplacement->lire) /** * Social contributions to pay */ -if ($conf->tax->enabled && $user->rights->tax->charges->lire) +if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire) { if (!$socid) { @@ -918,7 +918,7 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire) /* * Unpayed supplier invoices */ -if ($conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire) +if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture->lire) { $facstatic=new FactureFournisseur($db); diff --git a/htdocs/compta/localtax/class/localtax.class.php b/htdocs/compta/localtax/class/localtax.class.php index 8dded9ae73b..a5afc66a9ef 100644 --- a/htdocs/compta/localtax/class/localtax.class.php +++ b/htdocs/compta/localtax/class/localtax.class.php @@ -464,12 +464,12 @@ class Localtax extends CommonObject $this->error=$langs->trans("ErrorFieldRequired",$langs->transnoentities("Amount")); return -4; } - if ($conf->banque->enabled && (empty($this->accountid) || $this->accountid <= 0)) + if (! empty($conf->banque->enabled) && (empty($this->accountid) || $this->accountid <= 0)) { $this->error=$langs->trans("ErrorFieldRequired",$langs->transnoentities("Account")); return -5; } - if ($conf->banque->enabled && (empty($this->paymenttype) || $this->paymenttype <= 0)) + if (! empty($conf->banque->enabled) && (empty($this->paymenttype) || $this->paymenttype <= 0)) { $this->error=$langs->trans("ErrorFieldRequired",$langs->transnoentities("PaymentMode")); return -5; diff --git a/htdocs/compta/paiement.php b/htdocs/compta/paiement.php index fbf44961722..ed6e0c7f0aa 100644 --- a/htdocs/compta/paiement.php +++ b/htdocs/compta/paiement.php @@ -245,7 +245,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie // Invoice with Paypal transaction // TODO add hook possibility (regis) - if ($conf->paypalplus->enabled && $conf->global->PAYPAL_ENABLE_TRANSACTION_MANAGEMENT && ! empty($facture->ref_int)) + if (! empty($conf->paypalplus->enabled) && $conf->global->PAYPAL_ENABLE_TRANSACTION_MANAGEMENT && ! empty($facture->ref_int)) { if (! empty($conf->global->PAYPAL_BANK_ACCOUNT)) $accountid=$conf->global->PAYPAL_BANK_ACCOUNT; $paymentnum=$facture->ref_int; diff --git a/htdocs/compta/paiement_charge.php b/htdocs/compta/paiement_charge.php index 8539e828ac5..ff53254f4aa 100755 --- a/htdocs/compta/paiement_charge.php +++ b/htdocs/compta/paiement_charge.php @@ -66,7 +66,7 @@ if ($_POST["action"] == 'add_payment') $mesg = $langs->trans("ErrorFieldRequired",$langs->transnoentities("Date")); $error++; } - if ($conf->banque->enabled && ! $_POST["accountid"] > 0) + if (! empty($conf->banque->enabled) && ! $_POST["accountid"] > 0) { $mesg = $langs->trans("ErrorFieldRequired",$langs->transnoentities("AccountToCredit")); $error++; diff --git a/htdocs/compta/recap-compta.php b/htdocs/compta/recap-compta.php index 8a2e3228e37..9b3cc8b487a 100644 --- a/htdocs/compta/recap-compta.php +++ b/htdocs/compta/recap-compta.php @@ -79,7 +79,7 @@ if ($socid > 0) print '
'; - if ($conf->facture->enabled && $user->rights->facture->lire) + if (! empty($conf->facture->enabled) && $user->rights->facture->lire) { // Factures print_fiche_titre($langs->trans("CustomerPreview")); diff --git a/htdocs/compta/stats/cabyuser.php b/htdocs/compta/stats/cabyuser.php index 31a86e475df..7087653459c 100644 --- a/htdocs/compta/stats/cabyuser.php +++ b/htdocs/compta/stats/cabyuser.php @@ -282,9 +282,9 @@ if (count($amount)) // Other stats print '
'; - if ($conf->propal->enabled && $key>0) print ' '.img_picto($langs->trans("ProposalStats"),"stats").' '; - if ($conf->commande->enabled && $key>0) print ' '.img_picto($langs->trans("OrderStats"),"stats").' '; - if ($conf->facture->enabled && $key>0) print ' '.img_picto($langs->trans("InvoiceStats"),"stats").' '; + if (! empty($conf->propal->enabled) && $key>0) print ' '.img_picto($langs->trans("ProposalStats"),"stats").' '; + if (! empty($conf->commande->enabled) && $key>0) print ' '.img_picto($langs->trans("OrderStats"),"stats").' '; + if (! empty($conf->facture->enabled) && $key>0) print ' '.img_picto($langs->trans("InvoiceStats"),"stats").' '; print '
'; - if ($conf->propal->enabled && $key>0) print ' '.img_picto($langs->trans("ProposalStats"),"stats").' '; - if ($conf->commande->enabled && $key>0) print ' '.img_picto($langs->trans("OrderStats"),"stats").' '; - if ($conf->facture->enabled && $key>0) print ' '.img_picto($langs->trans("InvoiceStats"),"stats").' '; + if (! empty($conf->propal->enabled) && $key>0) print ' '.img_picto($langs->trans("ProposalStats"),"stats").' '; + if (! empty($conf->commande->enabled) && $key>0) print ' '.img_picto($langs->trans("OrderStats"),"stats").' '; + if (! empty($conf->facture->enabled) && $key>0) print ' '.img_picto($langs->trans("InvoiceStats"),"stats").' '; print '
'; - if ($canedit || $conf->projet->enabled) + if ($canedit || ! empty($conf->projet->enabled)) { print ''; - if ($conf->agenda->enabled && $user->rights->agenda->myactions->create) + if (! empty($conf->agenda->enabled) && $user->rights->agenda->myactions->create) { print ''; // Propals - if ($conf->propal->enabled && $user->rights->propale->lire) + if (! empty($conf->propal->enabled) && $user->rights->propale->lire) { $ret=$product->load_stats_propale($socid); if ($ret < 0) dol_print_error($db); @@ -206,7 +206,7 @@ function show_stats_for_company($product,$socid) print ''; } // Commandes clients - if ($conf->commande->enabled && $user->rights->commande->lire) + if (! empty($conf->commande->enabled) && $user->rights->commande->lire) { $ret=$product->load_stats_commande($socid); if ($ret < 0) dol_print_error($db); @@ -223,7 +223,7 @@ function show_stats_for_company($product,$socid) print ''; } // Commandes fournisseurs - if ($conf->fournisseur->enabled && $user->rights->fournisseur->commande->lire) + if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->commande->lire) { $ret=$product->load_stats_commande_fournisseur($socid); if ($ret < 0) dol_print_error($db); @@ -240,7 +240,7 @@ function show_stats_for_company($product,$socid) print ''; } // Contrats - if ($conf->contrat->enabled && $user->rights->contrat->lire) + if (! empty($conf->contrat->enabled) && $user->rights->contrat->lire) { $ret=$product->load_stats_contrat($socid); if ($ret < 0) dol_print_error($db); @@ -257,7 +257,7 @@ function show_stats_for_company($product,$socid) print ''; } // Factures clients - if ($conf->facture->enabled && $user->rights->facture->lire) + if (! empty($conf->facture->enabled) && $user->rights->facture->lire) { $ret=$product->load_stats_facture($socid); if ($ret < 0) dol_print_error($db); @@ -274,7 +274,7 @@ function show_stats_for_company($product,$socid) print ''; } // Factures fournisseurs - if ($conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire) + if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture->lire) { $ret=$product->load_stats_facture_fournisseur($socid); if ($ret < 0) dol_print_error($db); diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index 3f8e5831d9d..563d3b638e0 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -48,8 +48,9 @@ function project_prepare_head($object) $head[$h][2] = 'contact'; $h++; - if ($conf->fournisseur->enabled || $conf->propal->enabled || $conf->commande->enabled || $conf->facture->enabled || $conf->contrat->enabled - || $conf->ficheinter->enabled || $conf->agenda->enabled || $conf->deplacement->enabled) + if (! empty($conf->fournisseur->enabled) || ! empty($conf->propal->enabled) || ! empty($conf->commande->enabled) + || ! empty($conf->facture->enabled) || ! empty($conf->contrat->enabled) + || ! empty($conf->ficheinter->enabled) || ! empty($conf->agenda->enabled) || ! empty($conf->deplacement->enabled)) { $head[$h][0] = DOL_URL_ROOT.'/projet/element.php?id='.$object->id; $head[$h][1] = $langs->trans("Referers"); diff --git a/htdocs/core/lib/propal.lib.php b/htdocs/core/lib/propal.lib.php index ca30e8631f1..a0922fc4c4c 100644 --- a/htdocs/core/lib/propal.lib.php +++ b/htdocs/core/lib/propal.lib.php @@ -43,9 +43,8 @@ function propal_prepare_head($object) $head[$h][2] = 'comm'; $h++; - if ((!$conf->commande->enabled && - (($conf->expedition_bon->enabled && $user->rights->expedition->lire) - || ($conf->livraison_bon->enabled && $user->rights->expedition->livraison->lire)))) + if ((empty($conf->commande->enabled) && ((! empty($conf->expedition_bon->enabled) && $user->rights->expedition->lire) + || (! empty($conf->livraison_bon->enabled) && $user->rights->expedition->livraison->lire)))) { $langs->load("sendings"); $head[$h][0] = DOL_URL_ROOT.'/expedition/propal.php?id='.$object->id; @@ -62,7 +61,7 @@ function propal_prepare_head($object) $head[$h][2] = 'preview'; $h++; } - + if (empty($conf->global->MAIN_DISABLE_CONTACTS_TAB)) { $head[$h][0] = DOL_URL_ROOT.'/comm/propal/contact.php?id='.$object->id; diff --git a/htdocs/core/login/functions_ldap.php b/htdocs/core/login/functions_ldap.php index e38e33e2c79..f39ce16b629 100644 --- a/htdocs/core/login/functions_ldap.php +++ b/htdocs/core/login/functions_ldap.php @@ -146,7 +146,7 @@ function check_user_password_ldap($usertotest,$passwordtotest,$entitytotest) $login=$usertotest; // ldap2dolibarr synchronisation - if ($login && $conf->ldap->enabled && $conf->global->LDAP_SYNCHRO_ACTIVE == 'ldap2dolibarr') + if ($login && ! empty($conf->ldap->enabled) && $conf->global->LDAP_SYNCHRO_ACTIVE == 'ldap2dolibarr') { // On charge les attributs du user ldap if ($ldapdebug) print "DEBUG: login ldap = ".$login."
\n"; diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index ae95eafd3e6..e6f170cb7a4 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -125,7 +125,7 @@ function print_eldy_menu($db,$atarget,$type_user) } $chaine=""; if (! empty($conf->product->enabled)) { $chaine.=$langs->trans("Products"); } - if ($conf->product->enabled && $conf->service->enabled) { $chaine.="/"; } + if (! empty($conf->product->enabled) && ! empty($conf->service->enabled)) { $chaine.="/"; } if (! empty($conf->service->enabled)) { $chaine.=$langs->trans("Services"); } $idsel='products'; @@ -751,7 +751,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after) } // Prospects - if ($conf->societe->enabled && empty($conf->global->SOCIETE_DISABLE_PROSPECTS)) + if (! empty($conf->societe->enabled) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS)) { $langs->load("commercial"); $newmenu->add("/comm/prospect/list.php?leftmenu=prospects", $langs->trans("ListProspectsShort"), 1, $user->rights->societe->lire, '', $mainmenu, 'prospects'); @@ -777,7 +777,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after) } // Fournisseurs - if ($conf->societe->enabled && $conf->fournisseur->enabled) + if (! empty($conf->societe->enabled) && ! empty($conf->fournisseur->enabled)) { $langs->load("suppliers"); $newmenu->add("/fourn/liste.php?leftmenu=suppliers", $langs->trans("ListSuppliersShort"), 1, $user->rights->fournisseur->lire, '', $mainmenu, 'suppliers'); @@ -856,7 +856,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after) $newmenu->add("/commande/liste.php?leftmenu=orders", $langs->trans("List"), 1, $user->rights->commande->lire); if ($leftmenu=="orders") $newmenu->add("/commande/liste.php?leftmenu=orders&viewstatut=0", $langs->trans("StatusOrderDraftShort"), 2, $user->rights->commande->lire); if ($leftmenu=="orders") $newmenu->add("/commande/liste.php?leftmenu=orders&viewstatut=1", $langs->trans("StatusOrderValidated"), 2, $user->rights->commande->lire); - if ($leftmenu=="orders" && $conf->expedition->enabled) $newmenu->add("/commande/liste.php?leftmenu=orders&viewstatut=2", $langs->trans("StatusOrderOnProcessShort"), 2, $user->rights->commande->lire); + if ($leftmenu=="orders" && ! empty($conf->expedition->enabled)) $newmenu->add("/commande/liste.php?leftmenu=orders&viewstatut=2", $langs->trans("StatusOrderOnProcessShort"), 2, $user->rights->commande->lire); if ($leftmenu=="orders") $newmenu->add("/commande/liste.php?leftmenu=orders&viewstatut=".($conf->expedition->enabled?"3":"-2"), $langs->trans("StatusOrderToBill"), 2, $user->rights->commande->lire); if ($leftmenu=="orders") $newmenu->add("/commande/liste.php?leftmenu=orders&viewstatut=4", $langs->trans("StatusOrderProcessed"), 2, $user->rights->commande->lire); if ($leftmenu=="orders") $newmenu->add("/commande/liste.php?leftmenu=orders&viewstatut=-1", $langs->trans("StatusOrderCanceledShort"), 2, $user->rights->commande->lire); @@ -1348,7 +1348,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after) } $newmenu->add("/adherents/index.php?leftmenu=export&mainmenu=members",$langs->trans("Exports"),0,$user->rights->adherent->export, '', $mainmenu, 'export'); - if ($conf->export->enabled && $leftmenu=="export") $newmenu->add("/exports/index.php?leftmenu=export",$langs->trans("Datas"),1,$user->rights->adherent->export); + if (! empty($conf->export->enabled) && $leftmenu=="export") $newmenu->add("/exports/index.php?leftmenu=export",$langs->trans("Datas"),1,$user->rights->adherent->export); if ($leftmenu=="export") $newmenu->add("/adherents/htpasswd.php?leftmenu=export",$langs->trans("Filehtpasswd"),1,$user->rights->adherent->export); if ($leftmenu=="export") $newmenu->add("/adherents/cartes/carte.php?leftmenu=export",$langs->trans("MembersCards"),1,$user->rights->adherent->export); diff --git a/htdocs/core/tpl/contacts.tpl.php b/htdocs/core/tpl/contacts.tpl.php index 77c882d61d3..2625a1ef23d 100644 --- a/htdocs/core/tpl/contacts.tpl.php +++ b/htdocs/core/tpl/contacts.tpl.php @@ -70,7 +70,7 @@ $userstatic=new User($db); > - use_javascript_ajax && $conf->global->COMPANY_USE_SEARCH_TO_SELECT) { ?> + use_javascript_ajax && ! empty($conf->global->COMPANY_USE_SEARCH_TO_SELECT)) { ?> -service->enabled && $dateSelector) { +service->enabled) && $dateSelector) { if(! empty($conf->global->MAIN_VIEW_LINE_NUMBER)) $colspan = 10; else diff --git a/htdocs/core/tpl/objectline_edit.tpl.php b/htdocs/core/tpl/objectline_edit.tpl.php index d0f838c6b5f..78290f896ca 100644 --- a/htdocs/core/tpl/objectline_edit.tpl.php +++ b/htdocs/core/tpl/objectline_edit.tpl.php @@ -133,7 +133,7 @@ -service->enabled && $line->product_type == 1 && $dateSelector) { ?> +service->enabled) && $line->product_type == 1 && $dateSelector) { ?> > "; // Linked documents - if ($typeobject == 'commande' && $object->$typeobject->id && $conf->commande->enabled) + if ($typeobject == 'commande' && $object->$typeobject->id && ! empty($conf->commande->enabled)) { print '\n"; print ''; } - if ($typeobject == 'propal' && $object->$typeobject->id && $conf->propal->enabled) + if ($typeobject == 'propal' && $object->$typeobject->id && ! empty($conf->propal->enabled)) { print '"; // Linked documents - if ($typeobject == 'commande' && $object->$typeobject->id && $conf->commande->enabled) + if ($typeobject == 'commande' && $object->$typeobject->id && ! empty($conf->commande->enabled)) { print '\n"; print ''; } - if ($typeobject == 'propal' && $object->$typeobject->id && $conf->propal->enabled) + if ($typeobject == 'propal' && $object->$typeobject->id && ! empty($conf->propal->enabled)) { print ''; print ''; print ''; @@ -1593,7 +1593,7 @@ else // Show product and description print '
'; diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 0e00f836eee..77b571e51c4 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -408,12 +408,12 @@ function show_projects($conf,$langs,$db,$object,$backtopage='') $i = -1 ; - if ($conf->projet->enabled && $user->rights->projet->lire) + if (! empty($conf->projet->enabled) && $user->rights->projet->lire) { $langs->load("projects"); $buttoncreate=''; - if ($conf->projet->enabled && $user->rights->projet->creer) + if (! empty($conf->projet->enabled) && $user->rights->projet->creer) { //$buttoncreate=''.$langs->trans("AddProject").''; $buttoncreate=''.$langs->trans("AddProject").' '.img_picto($langs->trans("AddProject"),'filenew').''."\n"; @@ -581,7 +581,7 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='') print dol_print_email($obj->email,$obj->rowid,$object->id,'AC_EMAIL'); print ''; print img_object($langs->trans("Rendez-Vous"),"action"); @@ -1001,7 +1001,7 @@ function show_actions_done($conf,$langs,$db,$object,$objcon='',$noprint=0) } - if ($conf->agenda->enabled || ($conf->mailing->enabled && ! empty($objcon->email))) + if (! empty($conf->agenda->enabled) || (! empty($conf->mailing->enabled) && ! empty($objcon->email))) { require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 73b8541ac2a..4d0ec456573 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -1149,7 +1149,7 @@ function dol_print_email($email,$cid=0,$socid=0,$addlink=0,$max=64,$showinvalid= $newemail.=img_warning($langs->trans("ErrorBadEMail",$email)); } - if (($cid || $socid) && $conf->agenda->enabled && $user->rights->agenda->myactions->create) + if (($cid || $socid) && ! empty($conf->agenda->enabled) && $user->rights->agenda->myactions->create) { $type='AC_EMAIL'; $link=''; if (! empty($conf->global->AGENDA_ADDACTIONFOREMAIL)) $link=''.img_object($langs->trans("AddAction"),"calendar").''; @@ -1236,7 +1236,7 @@ function dol_print_phone($phone,$country="FR",$cid=0,$socid=0,$addlink=0,$separ= $newphone.='>'.$newphonesav.''; } - //if (($cid || $socid) && $conf->agenda->enabled && $user->rights->agenda->myactions->create) + //if (($cid || $socid) && ! empty($conf->agenda->enabled) && $user->rights->agenda->myactions->create) if (! empty($conf->agenda->enabled) && $user->rights->agenda->myactions->create) { $type='AC_TEL'; $link=''; diff --git a/htdocs/core/lib/ldap.lib.php b/htdocs/core/lib/ldap.lib.php index 981ae2f25ef..fc8b139df1b 100644 --- a/htdocs/core/lib/ldap.lib.php +++ b/htdocs/core/lib/ldap.lib.php @@ -57,7 +57,7 @@ function ldap_prepare_head() $h++; } - if ($conf->societe->enabled && $conf->global->LDAP_CONTACT_ACTIVE) + if (! empty($conf->societe->enabled) && ! empty($conf->global->LDAP_CONTACT_ACTIVE)) { $head[$h][0] = DOL_URL_ROOT."/admin/ldap_contacts.php"; $head[$h][1] = $langs->trans("LDAPContactsSynchro"); @@ -65,7 +65,7 @@ function ldap_prepare_head() $h++; } - if ($conf->adherent->enabled && $conf->global->LDAP_MEMBER_ACTIVE) + if (! empty($conf->adherent->enabled) && ! empty($conf->global->LDAP_MEMBER_ACTIVE)) { $head[$h][0] = DOL_URL_ROOT."/admin/ldap_members.php"; $head[$h][1] = $langs->trans("LDAPMembersSynchro"); diff --git a/htdocs/core/lib/order.lib.php b/htdocs/core/lib/order.lib.php index f344ef8681d..3fc1bc73f04 100644 --- a/htdocs/core/lib/order.lib.php +++ b/htdocs/core/lib/order.lib.php @@ -40,7 +40,7 @@ function commande_prepare_head($object) $h = 0; $head = array(); - if ($conf->commande->enabled && $user->rights->commande->lire) + if (! empty($conf->commande->enabled) && $user->rights->commande->lire) { $head[$h][0] = DOL_URL_ROOT.'/commande/fiche.php?id='.$object->id; $head[$h][1] = $langs->trans("OrderCard"); diff --git a/htdocs/core/lib/product.lib.php b/htdocs/core/lib/product.lib.php index 06e421db700..b2cbb2f55a5 100644 --- a/htdocs/core/lib/product.lib.php +++ b/htdocs/core/lib/product.lib.php @@ -49,7 +49,7 @@ function product_prepare_head($object, $user) $head[$h][2] = 'price'; $h++; - if ($conf->fournisseur->enabled && $user->rights->fournisseur->lire) + if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->lire) { $head[$h][0] = DOL_URL_ROOT."/product/fournisseurs.php?id=".$object->id; $head[$h][1] = $langs->trans("SuppliersPrices"); @@ -63,7 +63,7 @@ function product_prepare_head($object, $user) $h++; // Show category tab - if ($conf->categorie->enabled && $user->rights->categorie->lire) + if (! empty($conf->categorie->enabled) && $user->rights->categorie->lire) { $head[$h][0] = DOL_URL_ROOT."/categories/categorie.php?id=".$object->id.'&type=0'; $head[$h][1] = $langs->trans('Categories'); @@ -101,7 +101,7 @@ function product_prepare_head($object, $user) if($object->isproduct()) // Si produit stockable { - if ($conf->stock->enabled && $user->rights->stock->lire) + if (! empty($conf->stock->enabled) && $user->rights->stock->lire) { $head[$h][0] = DOL_URL_ROOT."/product/stock/product.php?id=".$object->id; $head[$h][1] = $langs->trans("Stock"); @@ -189,7 +189,7 @@ function show_stats_for_company($product,$socid) print '
trans("ThirdPartyContacts"); ?> margin->enabled)) { global->MAIN_VIEW_LINE_NUMBER) ? ' colspan="2"' : ''); ?>> select_type_of_lines(isset($_POST["type"])?$_POST["type"]:-1,'type',1); - if (($conf->product->enabled && $conf->service->enabled) || (empty($conf->product->enabled) && empty($conf->service->enabled))) echo '
'; + if ((! empty($conf->product->enabled) && ! empty($conf->service->enabled)) || (empty($conf->product->enabled) && empty($conf->service->enabled))) echo '
'; if (is_object($hookmanager)) { @@ -99,7 +99,7 @@ if (! empty($conf->margin->enabled)) {
trans('ServiceLimitedDuration').' '.$langs->trans('From').' '; ?> name."' for action '$action' launched by ".__FILE__.". id=".$object->id); - if ($conf->ldap->enabled && $conf->global->LDAP_SYNCHRO_ACTIVE == 'dolibarr2ldap') + if (! empty($conf->ldap->enabled) && $conf->global->LDAP_SYNCHRO_ACTIVE == 'dolibarr2ldap') { $ldap=new Ldap(); $ldap->connect_bind(); @@ -129,7 +129,7 @@ class InterfaceLdapsynchro elseif ($action == 'USER_MODIFY') { dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); - if ($conf->ldap->enabled && $conf->global->LDAP_SYNCHRO_ACTIVE == 'dolibarr2ldap') + if (! empty($conf->ldap->enabled) && $conf->global->LDAP_SYNCHRO_ACTIVE == 'dolibarr2ldap') { $ldap=new Ldap(); $ldap->connect_bind(); @@ -160,7 +160,7 @@ class InterfaceLdapsynchro elseif ($action == 'USER_NEW_PASSWORD') { dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); - if ($conf->ldap->enabled && $conf->global->LDAP_SYNCHRO_ACTIVE == 'dolibarr2ldap') + if (! empty($conf->ldap->enabled) && $conf->global->LDAP_SYNCHRO_ACTIVE == 'dolibarr2ldap') { $ldap=new Ldap(); $ldap->connect_bind(); @@ -195,7 +195,7 @@ class InterfaceLdapsynchro elseif ($action == 'USER_DELETE') { dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); - if ($conf->ldap->enabled && $conf->global->LDAP_SYNCHRO_ACTIVE == 'dolibarr2ldap') + if (! empty($conf->ldap->enabled) && $conf->global->LDAP_SYNCHRO_ACTIVE == 'dolibarr2ldap') { $ldap=new Ldap(); $ldap->connect_bind(); @@ -214,7 +214,7 @@ class InterfaceLdapsynchro elseif ($action == 'USER_SETINGROUP') { dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); - if ($conf->ldap->enabled && $conf->global->LDAP_SYNCHRO_ACTIVE == 'dolibarr2ldap') + if (! empty($conf->ldap->enabled) && $conf->global->LDAP_SYNCHRO_ACTIVE == 'dolibarr2ldap') { $ldap=new Ldap(); $ldap->connect_bind(); @@ -252,7 +252,7 @@ class InterfaceLdapsynchro elseif ($action == 'USER_REMOVEFROMGROUP') { dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); - if ($conf->ldap->enabled && $conf->global->LDAP_SYNCHRO_ACTIVE == 'dolibarr2ldap') + if (! empty($conf->ldap->enabled) && $conf->global->LDAP_SYNCHRO_ACTIVE == 'dolibarr2ldap') { $ldap=new Ldap(); $ldap->connect_bind(); @@ -291,7 +291,7 @@ class InterfaceLdapsynchro // Groupes elseif ($action == 'GROUP_CREATE') { - if ($conf->ldap->enabled && $conf->global->LDAP_SYNCHRO_ACTIVE == 'dolibarr2ldap') + if (! empty($conf->ldap->enabled) && $conf->global->LDAP_SYNCHRO_ACTIVE == 'dolibarr2ldap') { $ldap=new Ldap(); $ldap->connect_bind(); @@ -313,7 +313,7 @@ class InterfaceLdapsynchro } elseif ($action == 'GROUP_MODIFY') { - if ($conf->ldap->enabled && $conf->global->LDAP_SYNCHRO_ACTIVE == 'dolibarr2ldap') + if (! empty($conf->ldap->enabled) && $conf->global->LDAP_SYNCHRO_ACTIVE == 'dolibarr2ldap') { $ldap=new Ldap(); $ldap->connect_bind(); @@ -343,7 +343,7 @@ class InterfaceLdapsynchro } elseif ($action == 'GROUP_DELETE') { - if ($conf->ldap->enabled && $conf->global->LDAP_SYNCHRO_ACTIVE == 'dolibarr2ldap') + if (! empty($conf->ldap->enabled) && $conf->global->LDAP_SYNCHRO_ACTIVE == 'dolibarr2ldap') { $ldap=new Ldap(); $ldap->connect_bind(); @@ -364,7 +364,7 @@ class InterfaceLdapsynchro elseif ($action == 'CONTACT_CREATE') { dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); - if ($conf->ldap->enabled && $conf->global->LDAP_CONTACT_ACTIVE) + if (! empty($conf->ldap->enabled) && ! empty($conf->global->LDAP_CONTACT_ACTIVE)) { $ldap=new Ldap(); $ldap->connect_bind(); @@ -383,7 +383,7 @@ class InterfaceLdapsynchro elseif ($action == 'CONTACT_MODIFY') { dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); - if ($conf->ldap->enabled && $conf->global->LDAP_CONTACT_ACTIVE) + if (! empty($conf->ldap->enabled) && ! empty($conf->global->LDAP_CONTACT_ACTIVE)) { $ldap=new Ldap(); $ldap->connect_bind(); @@ -414,7 +414,7 @@ class InterfaceLdapsynchro elseif ($action == 'CONTACT_DELETE') { dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); - if ($conf->ldap->enabled && $conf->global->LDAP_CONTACT_ACTIVE) + if (! empty($conf->ldap->enabled) && ! empty($conf->global->LDAP_CONTACT_ACTIVE)) { $ldap=new Ldap(); $ldap->connect_bind(); @@ -435,7 +435,7 @@ class InterfaceLdapsynchro elseif ($action == 'MEMBER_CREATE') { dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); - if ($conf->ldap->enabled && $conf->global->LDAP_MEMBER_ACTIVE) + if (! empty($conf->ldap->enabled) && ! empty($conf->global->LDAP_MEMBER_ACTIVE)) { $ldap=new Ldap(); $ldap->connect_bind(); @@ -454,7 +454,7 @@ class InterfaceLdapsynchro elseif ($action == 'MEMBER_VALIDATE') { dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); - if ($conf->ldap->enabled && $conf->global->LDAP_MEMBER_ACTIVE) + if (! empty($conf->ldap->enabled) && ! empty($conf->global->LDAP_MEMBER_ACTIVE)) { // If status field is setup to be synchronized if (! empty($conf->global->LDAP_FIELD_MEMBER_STATUS)) @@ -478,7 +478,7 @@ class InterfaceLdapsynchro elseif ($action == 'MEMBER_SUBSCRIPTION') { dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); - if ($conf->ldap->enabled && $conf->global->LDAP_MEMBER_ACTIVE) + if (! empty($conf->ldap->enabled) && ! empty($conf->global->LDAP_MEMBER_ACTIVE)) { // If subscriptions fields are setup to be synchronized if ($conf->global->LDAP_FIELD_MEMBER_FIRSTSUBSCRIPTION_DATE @@ -506,7 +506,7 @@ class InterfaceLdapsynchro elseif ($action == 'MEMBER_MODIFY') { dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); - if ($conf->ldap->enabled && $conf->global->LDAP_MEMBER_ACTIVE) + if (! empty($conf->ldap->enabled) && ! empty($conf->global->LDAP_MEMBER_ACTIVE)) { $ldap=new Ldap(); $ldap->connect_bind(); @@ -537,7 +537,7 @@ class InterfaceLdapsynchro elseif ($action == 'MEMBER_NEW_PASSWORD') { dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); - if ($conf->ldap->enabled && $conf->global->LDAP_MEMBER_ACTIVE) + if (! empty($conf->ldap->enabled) && ! empty($conf->global->LDAP_MEMBER_ACTIVE)) { // If password field is setup to be synchronized if ($conf->global->LDAP_FIELD_PASSWORD || $conf->global->LDAP_FIELD_PASSWORD_CRYPTED) @@ -561,7 +561,7 @@ class InterfaceLdapsynchro elseif ($action == 'MEMBER_RESILIATE') { dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); - if ($conf->ldap->enabled && $conf->global->LDAP_MEMBER_ACTIVE) + if (! empty($conf->ldap->enabled) && ! empty($conf->global->LDAP_MEMBER_ACTIVE)) { // If status field is setup to be synchronized if (! empty($conf->global->LDAP_FIELD_MEMBER_STATUS)) @@ -585,7 +585,7 @@ class InterfaceLdapsynchro elseif ($action == 'MEMBER_DELETE') { dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); - if ($conf->ldap->enabled && $conf->global->LDAP_MEMBER_ACTIVE) + if (! empty($conf->ldap->enabled) && ! empty($conf->global->LDAP_MEMBER_ACTIVE)) { $ldap=new Ldap(); $ldap->connect_bind(); diff --git a/htdocs/ecm/index.php b/htdocs/ecm/index.php index 42f1535dfde..af33f004067 100644 --- a/htdocs/ecm/index.php +++ b/htdocs/ecm/index.php @@ -380,7 +380,7 @@ llxHeader($moreheadcss.$moreheadjs,$langs->trans("ECMArea"),'','','','',$morejs, // Add sections to manage $rowspan=0; $sectionauto=array(); -if ($conf->product->enabled || $conf->service->enabled) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'product', 'test'=>($conf->product->enabled || $conf->service->enabled), 'label'=>$langs->trans("ProductsAndServices"), 'desc'=>$langs->trans("ECMDocsByProducts")); } +if (! empty($conf->product->enabled) || ! empty($conf->service->enabled)) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'product', 'test'=>(! empty($conf->product->enabled) || ! empty($conf->service->enabled)), 'label'=>$langs->trans("ProductsAndServices"), 'desc'=>$langs->trans("ECMDocsByProducts")); } if (! empty($conf->societe->enabled)) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'company', 'test'=>$conf->societe->enabled, 'label'=>$langs->trans("ThirdParties"), 'desc'=>$langs->trans("ECMDocsByThirdParties")); } if (! empty($conf->propal->enabled)) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'propal', 'test'=>$conf->propal->enabled, 'label'=>$langs->trans("Prop"), 'desc'=>$langs->trans("ECMDocsByProposals")); } if (! empty($conf->contrat->enabled)) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'contract','test'=>$conf->contrat->enabled, 'label'=>$langs->trans("Contracts"), 'desc'=>$langs->trans("ECMDocsByContracts")); } diff --git a/htdocs/ecm/search.php b/htdocs/ecm/search.php index b3081991290..1585248e64c 100644 --- a/htdocs/ecm/search.php +++ b/htdocs/ecm/search.php @@ -103,7 +103,7 @@ $userstatic = new User($db); // Ajout rubriques automatiques $rowspan=0; $sectionauto=array(); -if ($conf->product->enabled || $conf->service->enabled) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'product', 'test'=>$conf->product->enabled, 'label'=>$langs->trans("ProductsAndServices"), 'desc'=>$langs->trans("ECMDocsByProducts")); } +if (! empty($conf->product->enabled) || ! empty($conf->service->enabled)) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'product', 'test'=>$conf->product->enabled, 'label'=>$langs->trans("ProductsAndServices"), 'desc'=>$langs->trans("ECMDocsByProducts")); } if (! empty($conf->societe->enabled)) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'company', 'test'=>$conf->societe->enabled, 'label'=>$langs->trans("ThirdParties"), 'desc'=>$langs->trans("ECMDocsByThirdParties")); } if (! empty($conf->propal->enabled)) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'propal', 'test'=>$conf->propal->enabled, 'label'=>$langs->trans("Prop"), 'desc'=>$langs->trans("ECMDocsByProposals")); } if (! empty($conf->contrat->enabled)) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'contract','test'=>$conf->contrat->enabled, 'label'=>$langs->trans("Contracts"), 'desc'=>$langs->trans("ECMDocsByContracts")); } diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index 06109252a25..c9d0cb124fc 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -496,7 +496,7 @@ class Expedition extends CommonObject } // If stock increment is done on sending (recommanded choice) - if (! $error && $conf->stock->enabled && $conf->global->STOCK_CALCULATE_ON_SHIPMENT) + if (! $error && ! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT)) { require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php'; diff --git a/htdocs/expedition/contact.php b/htdocs/expedition/contact.php index 340e3d6dfd7..7f09e1e3c12 100644 --- a/htdocs/expedition/contact.php +++ b/htdocs/expedition/contact.php @@ -55,12 +55,12 @@ if ($id > 0 || ! empty($ref)) } // Linked documents - if ($typeobject == 'commande' && $object->$typeobject->id && $conf->commande->enabled) + if ($typeobject == 'commande' && $object->$typeobject->id && ! empty($conf->commande->enabled)) { $objectsrc=new Commande($db); $objectsrc->fetch($object->$typeobject->id); } - if ($typeobject == 'propal' && $object->$typeobject->id && $conf->propal->enabled) + if ($typeobject == 'propal' && $object->$typeobject->id && ! empty($conf->propal->enabled)) { $objectsrc=new Propal($db); $objectsrc->fetch($object->$typeobject->id); @@ -178,7 +178,7 @@ if ($id > 0 || ! empty($ref)) print "
'; $objectsrc=new Commande($db); @@ -189,7 +189,7 @@ if ($id > 0 || ! empty($ref)) print "
'; $objectsrc=new Propal($db); diff --git a/htdocs/expedition/fiche.php b/htdocs/expedition/fiche.php index 0e09e08a240..7ee312a200a 100644 --- a/htdocs/expedition/fiche.php +++ b/htdocs/expedition/fiche.php @@ -32,7 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/sendings.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/modules/expedition/modules_expedition.php'; -if ($conf->product->enabled || $conf->service->enabled) require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; +if (! empty($conf->product->enabled) || ! empty($conf->service->enabled)) require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; if (! empty($conf->propal->enabled)) require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; if (! empty($conf->commande->enabled)) require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; if (! empty($conf->stock->enabled)) require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php'; @@ -601,11 +601,11 @@ if ($action == 'create') // Ref print '
'; - if ($origin == 'commande' && $conf->commande->enabled) + if ($origin == 'commande' && ! empty($conf->commande->enabled)) { print $langs->trans("RefOrder").''.img_object($langs->trans("ShowOrder"),'order').' '.$object->ref; } - if ($origin == 'propal' && $conf->propal->enabled) + if ($origin == 'propal' && ! empty($conf->propal->enabled)) { print $langs->trans("RefProposal").''.img_object($langs->trans("ShowProposal"),'propal').' '.$object->ref; } @@ -991,7 +991,7 @@ else print "
'; $objectsrc=new Commande($db); @@ -1002,7 +1002,7 @@ else print "
'; $objectsrc=new Propal($db); @@ -1326,7 +1326,7 @@ else } // Create bill and Close shipment - if ($conf->facture->enabled && $object->statut > 0) + if (! empty($conf->facture->enabled) && $object->statut > 0) { if ($user->rights->facture->creer) { diff --git a/htdocs/expedition/shipment.php b/htdocs/expedition/shipment.php index cfe6d41abba..976d6c3660a 100644 --- a/htdocs/expedition/shipment.php +++ b/htdocs/expedition/shipment.php @@ -511,7 +511,7 @@ if ($id > 0 || ! empty($ref)) $product->fetch($objp->fk_product); } - if ($objp->fk_product > 0 && $type == 0 && $conf->stock->enabled) + if ($objp->fk_product > 0 && $type == 0 && ! empty($conf->stock->enabled)) { print ''; print $product->stock_reel; @@ -582,12 +582,12 @@ if ($id > 0 || ! empty($ref)) * Boutons Actions */ - if ($user->societe_id == 0) + if (empty($user->societe_id)) { print '
'; // Bouton expedier sans gestion des stocks - if (! $conf->stock->enabled && ($commande->statut > 0 && $commande->statut < 3)) + if (empty($conf->stock->enabled) && ($commande->statut > 0 && $commande->statut < 3)) { if ($user->rights->expedition->creer) { diff --git a/htdocs/fichinter/fiche.php b/htdocs/fichinter/fiche.php index 5de9d2203c6..4edf8a95091 100644 --- a/htdocs/fichinter/fiche.php +++ b/htdocs/fichinter/fiche.php @@ -1200,7 +1200,7 @@ else if ($id > 0 || ! empty($ref)) } // Invoicing - if ($conf->facture->enabled && $object->statut > 0) + if (! empty($conf->facture->enabled) && $object->statut > 0) { $langs->load("bills"); if ($object->statut < 2) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 1feea724fa3..d7e0f4e9ba1 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -449,7 +449,7 @@ class CommandeFournisseur extends CommonOrder if ($this->db->query($sql)) { // If stock is incremented on validate order, we must redecrement it - if ($conf->stock->enabled && $conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER) + if (! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER)) { require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php'; @@ -700,7 +700,7 @@ class CommandeFournisseur extends CommonOrder $this->log($user, 2, time()); // Statut 2 // If stock is incremented on validate order, we must increment it - if (! $error && $conf->stock->enabled && $conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER) + if (! $error && ! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER)) { require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php'; $langs->load("agenda"); @@ -1213,7 +1213,7 @@ class CommandeFournisseur extends CommonOrder } // Si module stock gere et que incrementation faite depuis un dispatching en stock - if (!$error && $entrepot > 0 && $conf->stock->enabled && $conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER) + if (!$error && $entrepot > 0 && ! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER)) { $mouv = new MouvementStock($this->db); if ($product > 0) diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 6dbab9c0ecd..9121756bd3b 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -837,7 +837,7 @@ class FactureFournisseur extends CommonInvoice if ($resql) { // Si on incrémente le produit principal et ses composants à la validation de facture fournisseur - if (! $error && $conf->stock->enabled && $conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL) + if (! $error && ! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL)) { require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php'; $langs->load("agenda"); @@ -915,7 +915,7 @@ class FactureFournisseur extends CommonInvoice if ($result) { // Si on incremente le produit principal et ses composants a la validation de facture fournisseur, on decremente - if ($result >= 0 && $conf->stock->enabled && $conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL) + if ($result >= 0 && ! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL)) { require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php'; $langs->load("agenda"); diff --git a/htdocs/fourn/commande/fiche.php b/htdocs/fourn/commande/fiche.php index e1480bd6636..ffc017d6782 100644 --- a/htdocs/fourn/commande/fiche.php +++ b/htdocs/fourn/commande/fiche.php @@ -1399,7 +1399,7 @@ if ($id > 0 || ! empty($ref)) print '
'; print ''; // ancre pour retourner sur la ligne - if (($conf->product->enabled || $conf->service->enabled) && $line->fk_product > 0) + if ((! empty($conf->product->enabled) || ! empty($conf->service->enabled)) && $line->fk_product > 0) { $product_static=new ProductFournisseur($db); $product_static->fetch($line->fk_product); @@ -1415,7 +1415,7 @@ if ($id > 0 || ! empty($ref)) else { print $form->select_type_of_lines($line->product_type,'type',1); - if ($conf->product->enabled && $conf->service->enabled) print '
'; + if (! empty($conf->product->enabled) && ! empty($conf->service->enabled)) print '
'; } if (is_object($hookmanager)) @@ -1619,7 +1619,7 @@ if ($id > 0 || ! empty($ref)) } // Create bill - if ($conf->fournisseur->enabled && $object->statut >= 2) // 2 means accepted + if (! empty($conf->fournisseur->enabled) && $object->statut >= 2) // 2 means accepted { if ($user->rights->fournisseur->facture->creer) { diff --git a/htdocs/fourn/facture/fiche.php b/htdocs/fourn/facture/fiche.php index 52509de0d45..c050c390c25 100644 --- a/htdocs/fourn/facture/fiche.php +++ b/htdocs/fourn/facture/fiche.php @@ -1144,7 +1144,7 @@ if ($action == 'create') else { // TODO more bugs - if (1==2 && $conf->global->PRODUCT_SHOW_WHEN_CREATE) + if (1==2 && ! empty($conf->global->PRODUCT_SHOW_WHEN_CREATE)) { print '
 '.$langs->trans('Label').''; - if (($conf->product->enabled || $conf->service->enabled) && $object->lines[$i]->fk_product) + if ((! empty($conf->product->enabled) || ! empty($conf->service->enabled)) && $object->lines[$i]->fk_product) { print ''; $product_static=new ProductFournisseur($db); @@ -1607,7 +1607,7 @@ else { $forceall=1; // For suppliers, we always show all types print $form->select_type_of_lines($object->lines[$i]->product_type,'type',1); - if ($forceall || ($conf->product->enabled && $conf->service->enabled) + if ($forceall || (! empty($conf->product->enabled) && ! empty($conf->service->enabled)) || (empty($conf->product->enabled) && empty($conf->service->enabled))) print '
'; } @@ -1744,7 +1744,7 @@ else $forceall=1; // For suppliers, we always show all types print $form->select_type_of_lines(isset($_POST["type"])?$_POST["type"]:-1,'type',1,0,$forceall); - if ($forceall || ($conf->product->enabled && $conf->service->enabled) + if ($forceall || (! empty($conf->product->enabled) && ! empty($conf->service->enabled)) || (empty($conf->product->enabled) && empty($conf->service->enabled))) print '
'; if (is_object($hookmanager)) diff --git a/htdocs/fourn/fiche.php b/htdocs/fourn/fiche.php index d085c478710..6d8f453357d 100644 --- a/htdocs/fourn/fiche.php +++ b/htdocs/fourn/fiche.php @@ -223,7 +223,7 @@ if ($object->fetch($id)) /* * List of products */ - if ($conf->product->enabled || $conf->service->enabled) + if (! empty($conf->product->enabled) || ! empty($conf->service->enabled)) { $langs->load("products"); print ''; @@ -382,7 +382,7 @@ if ($object->fetch($id)) } // Add action - if ($conf->agenda->enabled && ! empty($conf->global->MAIN_REPEATTASKONEACHTAB)) + if (! empty($conf->agenda->enabled) && ! empty($conf->global->MAIN_REPEATTASKONEACHTAB)) { if ($user->rights->agenda->myactions->create) { diff --git a/htdocs/fourn/index.php b/htdocs/fourn/index.php index a6db039d2c9..ef9b1b67625 100644 --- a/htdocs/fourn/index.php +++ b/htdocs/fourn/index.php @@ -158,7 +158,7 @@ if (! empty($conf->fournisseur->enabled)) } // Draft invoices -if ($conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire) +if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture->lire) { $sql = "SELECT ff.facnumber, ff.rowid, ff.total_ttc, ff.type"; $sql.= ", s.nom, s.rowid as socid"; diff --git a/htdocs/fourn/recap-fourn.php b/htdocs/fourn/recap-fourn.php index 48ccca8a0da..fcd7917be47 100644 --- a/htdocs/fourn/recap-fourn.php +++ b/htdocs/fourn/recap-fourn.php @@ -83,7 +83,7 @@ if ($socid > 0) - if ($conf->fournisseur->enabled && $user->rights->facture->lire) + if (! empty($conf->fournisseur->enabled) && $user->rights->facture->lire) { // Invoices list print_fiche_titre($langs->trans("SupplierPreview")); diff --git a/htdocs/holiday/admin/holiday.php b/htdocs/holiday/admin/holiday.php index b73694e187e..2b602118781 100644 --- a/htdocs/holiday/admin/holiday.php +++ b/htdocs/holiday/admin/holiday.php @@ -45,7 +45,7 @@ if (! $user->admin) accessforbidden(); */ // Vérification si module activé -if (! $conf->holiday->enabled) print $langs->trans('NotActiveModCP'); +if (empty($conf->holiday->enabled)) print $langs->trans('NotActiveModCP'); llxheader('',$langs->trans('TitleAdminCP')); diff --git a/htdocs/index.php b/htdocs/index.php index efcd24e7811..c11e567466c 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -287,7 +287,7 @@ print ''; // // Number of actions to do (late) -if ($conf->agenda->enabled && $user->rights->agenda->myactions->read) +if (! empty($conf->agenda->enabled) && $user->rights->agenda->myactions->read) { include_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; $board=new ActionComm($db); @@ -301,7 +301,7 @@ if ($conf->agenda->enabled && $user->rights->agenda->myactions->read) } // Number of customer orders a deal -if ($conf->commande->enabled && $user->rights->commande->lire) +if (! empty($conf->commande->enabled) && $user->rights->commande->lire) { include_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; $board=new Commande($db); @@ -315,7 +315,7 @@ if ($conf->commande->enabled && $user->rights->commande->lire) } // Number of suppliers orders a deal -if ($conf->fournisseur->enabled && $user->rights->fournisseur->commande->lire) +if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->commande->lire) { include_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; $board=new CommandeFournisseur($db); @@ -329,7 +329,7 @@ if ($conf->fournisseur->enabled && $user->rights->fournisseur->commande->lire) } // Number of commercial proposals opened (expired) -if ($conf->propal->enabled && $user->rights->propale->lire) +if (! empty($conf->propal->enabled) && $user->rights->propale->lire) { $langs->load("propal"); @@ -345,7 +345,7 @@ if ($conf->propal->enabled && $user->rights->propale->lire) } // Number of commercial proposals CLOSED signed (billed) -if ($conf->propal->enabled && $user->rights->propale->lire) +if (! empty($conf->propal->enabled) && $user->rights->propale->lire) { $langs->load("propal"); @@ -361,7 +361,7 @@ if ($conf->propal->enabled && $user->rights->propale->lire) } // Number of services enabled (delayed) -if ($conf->contrat->enabled && $user->rights->contrat->lire) +if (! empty($conf->contrat->enabled) && $user->rights->contrat->lire) { $langs->load("contracts"); @@ -377,7 +377,7 @@ if ($conf->contrat->enabled && $user->rights->contrat->lire) } // Number of active services (expired) -if ($conf->contrat->enabled && $user->rights->contrat->lire) +if (! empty($conf->contrat->enabled) && $user->rights->contrat->lire) { $langs->load("contracts"); @@ -392,7 +392,7 @@ if ($conf->contrat->enabled && $user->rights->contrat->lire) $dashboardlines[]=$board; } // Number of invoices customers (has paid) -if ($conf->facture->enabled && $user->rights->facture->lire) +if (! empty($conf->facture->enabled) && $user->rights->facture->lire) { $langs->load("bills"); @@ -408,7 +408,7 @@ if ($conf->facture->enabled && $user->rights->facture->lire) } // Number of supplier invoices (has paid) -if ($conf->fournisseur->enabled && $conf->facture->enabled && $user->rights->facture->lire) +if (! empty($conf->fournisseur->enabled) && ! empty($conf->facture->enabled) && $user->rights->facture->lire) { $langs->load("bills"); @@ -424,7 +424,7 @@ if ($conf->fournisseur->enabled && $conf->facture->enabled && $user->rights->fac } // Number of transactions to conciliate -if ($conf->banque->enabled && $user->rights->banque->lire && ! $user->societe_id) +if (! empty($conf->banque->enabled) && $user->rights->banque->lire && ! $user->societe_id) { $langs->load("banks"); @@ -443,7 +443,7 @@ if ($conf->banque->enabled && $user->rights->banque->lire && ! $user->societe_id } // Number of cheque to send -if ($conf->banque->enabled && $user->rights->banque->lire && ! $user->societe_id) +if (! empty($conf->banque->enabled) && $user->rights->banque->lire && ! $user->societe_id) { $langs->load("banks"); @@ -459,7 +459,7 @@ if ($conf->banque->enabled && $user->rights->banque->lire && ! $user->societe_id } // Number of foundation members -if ($conf->adherent->enabled && $user->rights->adherent->lire && ! $user->societe_id) +if (! empty($conf->adherent->enabled) && $user->rights->adherent->lire && ! $user->societe_id) { $langs->load("members"); diff --git a/htdocs/livraison/fiche.php b/htdocs/livraison/fiche.php index d6e005ea5dd..98ca4ce2f0e 100644 --- a/htdocs/livraison/fiche.php +++ b/htdocs/livraison/fiche.php @@ -67,7 +67,7 @@ if ($action == 'add') $delivery->note = $_POST["note"]; $delivery->commande_id = $_POST["commande_id"]; - if (!$conf->expedition_bon->enabled && $conf->stock->enabled) + if (!$conf->expedition_bon->enabled && ! empty($conf->stock->enabled)) { $expedition->entrepot_id = $_POST["entrepot_id"]; } @@ -244,7 +244,7 @@ if ($action == 'create') $author = new User($db); $author->fetch($commande->user_author_id); - if (!$conf->expedition_bon->enabled && $conf->stock->enabled) + if (!$conf->expedition_bon->enabled && ! empty($conf->stock->enabled)) { $entrepot = new Entrepot($db); } @@ -256,7 +256,7 @@ if ($action == 'create') print ''; print ''; print ''; - if (!$conf->expedition_bon->enabled && $conf->stock->enabled) + if (!$conf->expedition_bon->enabled && ! empty($conf->stock->enabled)) { print ''; } @@ -276,7 +276,7 @@ if ($action == 'create') print ''; - if (!$conf->expedition_bon->enabled && $conf->stock->enabled) + if (!$conf->expedition_bon->enabled && ! empty($conf->stock->enabled)) { print ''; print '"; // Document origine - if ($typeobject == 'commande' && $expedition->origin_id && $conf->commande->enabled) + if ($typeobject == 'commande' && $expedition->origin_id && ! empty($conf->commande->enabled)) { print ''; $order=new Commande($db); @@ -512,7 +512,7 @@ else print "\n"; print ''; } - if ($typeobject == 'propal' && $expedition->origin_id && $conf->propal->enabled) + if ($typeobject == 'propal' && $expedition->origin_id && ! empty($conf->propal->enabled)) { $propal=new Propal($db); $propal->fetch($expedition->origin_id); @@ -544,7 +544,7 @@ else print '\n"; print ''; - if (!$conf->expedition_bon->enabled && $conf->stock->enabled) + if (!$conf->expedition_bon->enabled && ! empty($conf->stock->enabled)) { // Entrepot $entrepot = new Entrepot($db); diff --git a/htdocs/product/composition/fiche.php b/htdocs/product/composition/fiche.php index 407c2869225..f8b90a48a00 100644 --- a/htdocs/product/composition/fiche.php +++ b/htdocs/product/composition/fiche.php @@ -144,7 +144,7 @@ if ($action == 'search') $sql.= " OR p.label LIKE '%".$key."%')"; } } - if ($conf->categorie->enabled && $catMere != -1 and $catMere) + if (! empty($conf->categorie->enabled) && $catMere != -1 and $catMere) { $sql.= " AND cp.fk_categorie ='".$db->escape($catMere)."'"; } @@ -185,7 +185,7 @@ if ($id || $ref) print ""; $nblignes=6; - if ($product->isproduct() && $conf->stock->enabled) $nblignes++; + if ($product->isproduct() && ! empty($conf->stock->enabled)) $nblignes++; if ($product->isservice()) $nblignes++; // Reference @@ -269,7 +269,7 @@ if ($id || $ref) print ""; $nblignes=6; - if ($product->isproduct() && $conf->stock->enabled) $nblignes++; + if ($product->isproduct() && ! empty($conf->stock->enabled)) $nblignes++; if ($product->isservice()) $nblignes++; // Reference diff --git a/htdocs/product/fiche.php b/htdocs/product/fiche.php index d0cbdc2180f..2f0c4e95f65 100644 --- a/htdocs/product/fiche.php +++ b/htdocs/product/fiche.php @@ -744,7 +744,7 @@ else print ''; // Stock min level - if ($type != 1 && $conf->stock->enabled) + if ($type != 1 && ! empty($conf->stock->enabled)) { print ''; } - if ($object->isproduct() && $conf->stock->enabled) + if ($object->isproduct() && ! empty($conf->stock->enabled)) { print "".''; // Type - if ($conf->produit->enabled && $conf->service->enabled) + if (! empty($conf->produit->enabled) && ! empty($conf->service->enabled)) { // TODO change for compatibility with edit in place $typeformat='select;0:'.$langs->trans("Product").',1:'.$langs->trans("Service"); diff --git a/htdocs/product/liste.php b/htdocs/product/liste.php index e750faa0357..017f78c7c03 100644 --- a/htdocs/product/liste.php +++ b/htdocs/product/liste.php @@ -407,7 +407,7 @@ else if ($product_fourn->product_fourn_price_id > 0) { $htmltext=$product_fourn->display_price_product_fournisseur(); - if ($conf->fournisseur->enabled && $user->rights->fournisseur->lire) print $form->textwithpicto(price($product_fourn->fourn_unitprice).' '.$langs->trans("HT"),$htmltext); + if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->lire) print $form->textwithpicto(price($product_fourn->fourn_unitprice).' '.$langs->trans("HT"),$htmltext); else print price($product_fourn->fourn_unitprice).' '.$langs->trans("HT"); } } diff --git a/htdocs/product/reassort.php b/htdocs/product/reassort.php index 3e9a71a31fc..de5c19ee716 100644 --- a/htdocs/product/reassort.php +++ b/htdocs/product/reassort.php @@ -240,7 +240,7 @@ if ($resql) print ""; print_liste_field_titre($langs->trans("Ref"),"reassort.php", "p.ref",$param,"","",$sortfield,$sortorder); print_liste_field_titre($langs->trans("Label"),"reassort.php", "p.label",$param,"","",$sortfield,$sortorder); - if ($conf->service->enabled && $type == 1) print_liste_field_titre($langs->trans("Duration"),"reassort.php", "p.duration",$param,"",'align="center"',$sortfield,$sortorder); + if (! empty($conf->service->enabled) && $type == 1) print_liste_field_titre($langs->trans("Duration"),"reassort.php", "p.duration",$param,"",'align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("MininumStock"),"reassort.php", "p.seuil_stock_alerte",$param,"",'align="right"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("PhysicalStock"),"reassort.php", "stock_physique",$param,"",'align="right"',$sortfield,$sortorder); // TODO Add info of running suppliers/customers orders diff --git a/htdocs/product/stock/class/mouvementstock.class.php b/htdocs/product/stock/class/mouvementstock.class.php index 85662fd1a30..ea0a4aee05b 100644 --- a/htdocs/product/stock/class/mouvementstock.class.php +++ b/htdocs/product/stock/class/mouvementstock.class.php @@ -208,14 +208,14 @@ class MouvementStock } // Add movement for sub products (recursive call) - if (! $error && $conf->global->PRODUIT_SOUSPRODUITS) + if (! $error && ! empty($conf->global->PRODUIT_SOUSPRODUITS)) { $error = $this->_createSubProduct($user, $fk_product, $entrepot_id, $qty, $type, 0, $label); // pmp is not change for subproduct } // Composition module (this is an external module) /* Removed. This code must be provided by module on trigger STOCK_MOVEMENT - if (! $error && $qty < 0 && $conf->global->MAIN_MODULE_COMPOSITION) + if (! $error && $qty < 0 && ! empty($conf->global->MAIN_MODULE_COMPOSITION)) { $error = $this->_createProductComposition($user, $fk_product, $entrepot_id, $qty, $type, 0, $label); // pmp is not change for subproduct }*/ diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index 18638682133..44d4d5a4aa6 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -263,26 +263,26 @@ foreach ($listofreferent as $key => $value) { if ($project->societe->prospect || $project->societe->client) { - if ($key == 'propal' && $conf->propal->enabled && $user->rights->propale->creer) + if ($key == 'propal' && ! empty($conf->propal->enabled) && $user->rights->propale->creer) { print ''.$langs->trans("AddProp").''; } - if ($key == 'order' && $conf->commande->enabled && $user->rights->commande->creer) + if ($key == 'order' && ! empty($conf->commande->enabled) && $user->rights->commande->creer) { print ''.$langs->trans("AddCustomerOrder").''; } - if ($key == 'invoice' && $conf->facture->enabled && $user->rights->facture->creer) + if ($key == 'invoice' && ! empty($conf->facture->enabled) && $user->rights->facture->creer) { print ''.$langs->trans("AddCustomerInvoice").''; } } if ($project->societe->fournisseur) { - if ($key == 'order_supplier' && $conf->fournisseur->enabled && $user->rights->fournisseur->commande->creer) + if ($key == 'order_supplier' && ! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->commande->creer) { print ''.$langs->trans("AddSupplierInvoice").''; } - if ($key == 'invoice_supplier' && $conf->fournisseur->enabled && $user->rights->fournisseur->facture->creer) + if ($key == 'invoice_supplier' && ! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture->creer) { print ''.$langs->trans("AddSupplierOrder").''; } diff --git a/htdocs/public/agenda/agendaexport.php b/htdocs/public/agenda/agendaexport.php index d2c3eb24a71..917db6195ce 100644 --- a/htdocs/public/agenda/agendaexport.php +++ b/htdocs/public/agenda/agendaexport.php @@ -53,7 +53,7 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; // Security check -if (! $conf->agenda->enabled) accessforbidden('',1,1,1); +if (empty($conf->agenda->enabled)) accessforbidden('',1,1,1); // Define format, type and filter $format='ical'; diff --git a/htdocs/societe/index.php b/htdocs/societe/index.php index 2d3fe14b97e..94ec053077f 100644 --- a/htdocs/societe/index.php +++ b/htdocs/societe/index.php @@ -112,9 +112,9 @@ if (! empty($conf->use_javascript_ajax) && ((round($third['prospect'])?1:0)+(rou { print '"; $statstring.= ''; $statstring.= ""; } - if ($conf->societe->enabled && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS_STATS)) + if (! empty($conf->societe->enabled) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS_STATS)) { $statstring.= ""; $statstring.= ''; $statstring.= ""; } - if ($conf->fournisseur->enabled && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS)) + if (! empty($conf->fournisseur->enabled) && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS)) { $statstring2 = ""; $statstring2.= ''; @@ -215,7 +215,7 @@ if ($result) $thirdparty_static->name=$langs->trans("Prospect"); print $thirdparty_static->getNomUrl(0,'prospect'); } - if ($conf->fournisseur->enabled && $thirdparty_static->fournisseur) + if (! empty($conf->fournisseur->enabled) && $thirdparty_static->fournisseur) { if ($thirdparty_static->client) print " / "; $thirdparty_static->name=$langs->trans("Supplier"); diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index f4a221fb098..3c26f9af46d 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -544,7 +544,7 @@ else if (GETPOST("type")!='f') { $object->client=3; } if (GETPOST("type")=='c') { $object->client=1; } if (GETPOST("type")=='p') { $object->client=2; } - if ($conf->fournisseur->enabled && (GETPOST("type")=='f' || GETPOST("type")=='')) { $object->fournisseur=1; } + if (! empty($conf->fournisseur->enabled) && (GETPOST("type")=='f' || GETPOST("type")=='')) { $object->fournisseur=1; } if (GETPOST("private")==1) { $object->particulier=1; } $object->name = GETPOST('nom'); @@ -1169,7 +1169,7 @@ else print ''; // Supplier - if ($conf->fournisseur->enabled && ! empty($user->rights->fournisseur->lire)) + if (! empty($conf->fournisseur->enabled) && ! empty($user->rights->fournisseur->lire)) { print ''; print ''; // Category - if ($conf->categorie->enabled && $object->fournisseur) + if (! empty($conf->categorie->enabled) && $object->fournisseur) { $load = $object->LoadSupplierCateg(); if ( $load == 0) diff --git a/htdocs/societe/societe.php b/htdocs/societe/societe.php index 9002814e0b3..ab8bbef42c5 100644 --- a/htdocs/societe/societe.php +++ b/htdocs/societe/societe.php @@ -401,7 +401,7 @@ if ($resql) $companystatic->name=$langs->trans("Prospect"); $s.=$companystatic->getNomUrl(0,'prospect'); } - if ($conf->fournisseur->enabled && $obj->fournisseur) + if (! empty($conf->fournisseur->enabled) && $obj->fournisseur) { if ($s) $s.=" / "; $companystatic->name=$langs->trans("Supplier"); diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index c8b6556a374..9ca8c07907d 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -1823,13 +1823,13 @@ class User extends CommonObject $this->fullname=$this->getFullName($langs); // Champs - if ($this->fullname && $conf->global->LDAP_FIELD_FULLNAME) $info[$conf->global->LDAP_FIELD_FULLNAME] = $this->fullname; - if ($this->lastname && $conf->global->LDAP_FIELD_NAME) $info[$conf->global->LDAP_FIELD_NAME] = $this->lastname; - if ($this->firstname && $conf->global->LDAP_FIELD_FIRSTNAME) $info[$conf->global->LDAP_FIELD_FIRSTNAME] = $this->firstname; - if ($this->login && $conf->global->LDAP_FIELD_LOGIN) $info[$conf->global->LDAP_FIELD_LOGIN] = $this->login; - if ($this->login && $conf->global->LDAP_FIELD_LOGIN_SAMBA) $info[$conf->global->LDAP_FIELD_LOGIN_SAMBA] = $this->login; - if ($this->pass && $conf->global->LDAP_FIELD_PASSWORD) $info[$conf->global->LDAP_FIELD_PASSWORD] = $this->pass; // this->pass = mot de passe non crypte - if ($this->ldap_sid && $conf->global->LDAP_FIELD_SID) $info[$conf->global->LDAP_FIELD_SID] = $this->ldap_sid; + if ($this->fullname && ! empty($conf->global->LDAP_FIELD_FULLNAME)) $info[$conf->global->LDAP_FIELD_FULLNAME] = $this->fullname; + if ($this->lastname && ! empty($conf->global->LDAP_FIELD_NAME)) $info[$conf->global->LDAP_FIELD_NAME] = $this->lastname; + if ($this->firstname && ! empty($conf->global->LDAP_FIELD_FIRSTNAME)) $info[$conf->global->LDAP_FIELD_FIRSTNAME] = $this->firstname; + if ($this->login && ! empty($conf->global->LDAP_FIELD_LOGIN)) $info[$conf->global->LDAP_FIELD_LOGIN] = $this->login; + if ($this->login && ! empty($conf->global->LDAP_FIELD_LOGIN_SAMBA)) $info[$conf->global->LDAP_FIELD_LOGIN_SAMBA] = $this->login; + if ($this->pass && ! empty($conf->global->LDAP_FIELD_PASSWORD)) $info[$conf->global->LDAP_FIELD_PASSWORD] = $this->pass; // this->pass = mot de passe non crypte + if ($this->ldap_sid && ! empty($conf->global->LDAP_FIELD_SID)) $info[$conf->global->LDAP_FIELD_SID] = $this->ldap_sid; if ($this->societe_id > 0) { $soc = new Societe($this->db); @@ -1840,14 +1840,14 @@ class User extends CommonObject if ($soc->client == 2) $info["businessCategory"] = "Prospects"; if ($soc->fournisseur == 1) $info["businessCategory"] = "Suppliers"; } - if ($this->address && $conf->global->LDAP_FIELD_ADDRESS) $info[$conf->global->LDAP_FIELD_ADDRESS] = $this->address; - if ($this->zip && $conf->global->LDAP_FIELD_ZIP) $info[$conf->global->LDAP_FIELD_ZIP] = $this->zip; - if ($this->town && $conf->global->LDAP_FIELD_TOWN) $info[$conf->global->LDAP_FIELD_TOWN] = $this->town; - if ($this->office_phone && $conf->global->LDAP_FIELD_PHONE) $info[$conf->global->LDAP_FIELD_PHONE] = $this->office_phone; - if ($this->user_mobile && $conf->global->LDAP_FIELD_MOBILE) $info[$conf->global->LDAP_FIELD_MOBILE] = $this->user_mobile; - if ($this->office_fax && $conf->global->LDAP_FIELD_FAX) $info[$conf->global->LDAP_FIELD_FAX] = $this->office_fax; - if ($this->note && $conf->global->LDAP_FIELD_DESCRIPTION) $info[$conf->global->LDAP_FIELD_DESCRIPTION] = $this->note; - if ($this->email && $conf->global->LDAP_FIELD_MAIL) $info[$conf->global->LDAP_FIELD_MAIL] = $this->email; + if ($this->address && ! empty($conf->global->LDAP_FIELD_ADDRESS)) $info[$conf->global->LDAP_FIELD_ADDRESS] = $this->address; + if ($this->zip && ! empty($conf->global->LDAP_FIELD_ZIP)) $info[$conf->global->LDAP_FIELD_ZIP] = $this->zip; + if ($this->town && ! empty($conf->global->LDAP_FIELD_TOWN)) $info[$conf->global->LDAP_FIELD_TOWN] = $this->town; + if ($this->office_phone && ! empty($conf->global->LDAP_FIELD_PHONE)) $info[$conf->global->LDAP_FIELD_PHONE] = $this->office_phone; + if ($this->user_mobile && ! empty($conf->global->LDAP_FIELD_MOBILE)) $info[$conf->global->LDAP_FIELD_MOBILE] = $this->user_mobile; + if ($this->office_fax && ! empty($conf->global->LDAP_FIELD_FAX)) $info[$conf->global->LDAP_FIELD_FAX] = $this->office_fax; + if ($this->note && ! empty($conf->global->LDAP_FIELD_DESCRIPTION)) $info[$conf->global->LDAP_FIELD_DESCRIPTION] = $this->note; + if ($this->email && ! empty($conf->global->LDAP_FIELD_MAIL)) $info[$conf->global->LDAP_FIELD_MAIL] = $this->email; if ($conf->global->LDAP_SERVER_TYPE == 'egroupware') { diff --git a/htdocs/user/class/usergroup.class.php b/htdocs/user/class/usergroup.class.php index f49cdde8a78..bef8f6e5577 100644 --- a/htdocs/user/class/usergroup.class.php +++ b/htdocs/user/class/usergroup.class.php @@ -687,9 +687,9 @@ class UserGroup extends CommonObject $info["objectclass"]=explode(',',$conf->global->LDAP_GROUP_OBJECT_CLASS); // Champs - if ($this->nom && $conf->global->LDAP_GROUP_FIELD_FULLNAME) $info[$conf->global->LDAP_GROUP_FIELD_FULLNAME] = $this->nom; - //if ($this->nom && $conf->global->LDAP_GROUP_FIELD_NAME) $info[$conf->global->LDAP_GROUP_FIELD_NAME] = $this->nom; - if ($this->note && $conf->global->LDAP_GROUP_FIELD_DESCRIPTION) $info[$conf->global->LDAP_GROUP_FIELD_DESCRIPTION] = $this->note; + if ($this->nom && ! empty($conf->global->LDAP_GROUP_FIELD_FULLNAME)) $info[$conf->global->LDAP_GROUP_FIELD_FULLNAME] = $this->nom; + //if ($this->nom && ! empty($conf->global->LDAP_GROUP_FIELD_NAME)) $info[$conf->global->LDAP_GROUP_FIELD_NAME] = $this->nom; + if ($this->note && ! empty($conf->global->LDAP_GROUP_FIELD_DESCRIPTION)) $info[$conf->global->LDAP_GROUP_FIELD_DESCRIPTION] = $this->note; if (! empty($conf->global->LDAP_GROUP_FIELD_GROUPMEMBERS)) { $valueofldapfield=array(); diff --git a/htdocs/user/group/fiche.php b/htdocs/user/group/fiche.php index 81ca81b717c..a815906ac02 100644 --- a/htdocs/user/group/fiche.php +++ b/htdocs/user/group/fiche.php @@ -97,7 +97,7 @@ if ($action == 'add') $object->nom = trim($_POST["nom"]); $object->note = trim($_POST["note"]); - if ($conf->multicompany->enabled && ! empty($conf->multicompany->transverse_mode)) $object->entity = 0; + if (! empty($conf->multicompany->enabled) && ! empty($conf->multicompany->transverse_mode)) $object->entity = 0; else $object->entity = $_POST["entity"]; $db->begin(); diff --git a/htdocs/webservices/admin/webservices.php b/htdocs/webservices/admin/webservices.php index 163b0fb024a..85fc5023455 100644 --- a/htdocs/webservices/admin/webservices.php +++ b/htdocs/webservices/admin/webservices.php @@ -101,7 +101,7 @@ print '

'; print ''.$langs->trans("WSDLCanBeDownloadedHere").':
'; $url=DOL_MAIN_URL_ROOT.'/webservices/server_other.php?wsdl'; print img_picto('','object_globe.png').' '.$url."
\n"; -if ($conf->product->enabled || $conf->service->enabled) +if (! empty($conf->product->enabled) || ! empty($conf->service->enabled)) { $url=DOL_MAIN_URL_ROOT.'/webservices/server_productorservice.php?wsdl'; print img_picto('','object_globe.png').' '.$url."
\n"; @@ -128,7 +128,7 @@ print '
'; print ''.$langs->trans("EndPointIs").':
'; $url=DOL_MAIN_URL_ROOT.'/webservices/server_other.php'; print img_picto('','object_globe.png').' '.$url."
\n"; -if ($conf->product->enabled || $conf->service->enabled) +if (! empty($conf->product->enabled) || ! empty($conf->service->enabled)) { $url=DOL_MAIN_URL_ROOT.'/webservices/server_productorservice.php'; print img_picto('','object_globe.png').' '.$url."
\n";
'.$langs->trans("Warehouse").''; @@ -502,7 +502,7 @@ else print "
'.$langs->trans("RefOrder").'
'.$delivery->getLibStatut(4)."
'.$langs->trans("StockLimit").''; print ''; @@ -963,7 +963,7 @@ else print '
'.$langs->trans("StockLimit").''; print ''; @@ -1099,7 +1099,7 @@ else print '
'; $dataseries=array(); - if ($conf->societe->enabled && empty($conf->global->SOCIETE_DISABLE_PROSPECTS_STATS)) $dataseries[]=array('label'=>$langs->trans("Prospects"),'data'=>round($third['prospect'])); - if ($conf->societe->enabled && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS_STATS)) $dataseries[]=array('label'=>$langs->trans("Customers"),'data'=>round($third['customer'])); - if ($conf->fournisseur->enabled && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS)) $dataseries[]=array('label'=>$langs->trans("Suppliers"),'data'=>round($third['supplier'])); + if (! empty($conf->societe->enabled) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS_STATS)) $dataseries[]=array('label'=>$langs->trans("Prospects"),'data'=>round($third['prospect'])); + if (! empty($conf->societe->enabled) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS_STATS)) $dataseries[]=array('label'=>$langs->trans("Customers"),'data'=>round($third['customer'])); + if (! empty($conf->fournisseur->enabled) && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS)) $dataseries[]=array('label'=>$langs->trans("Suppliers"),'data'=>round($third['supplier'])); if (! empty($conf->societe->enabled)) $dataseries[]=array('label'=>$langs->trans("Others"),'data'=>round($third['other'])); $data=array('series'=>$dataseries); dol_print_graph('stats',300,180,$data,1,'pie',0); @@ -122,19 +122,19 @@ if (! empty($conf->use_javascript_ajax) && ((round($third['prospect'])?1:0)+(rou } else { - if ($conf->societe->enabled && empty($conf->global->SOCIETE_DISABLE_PROSPECTS_STATS)) + if (! empty($conf->societe->enabled) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS_STATS)) { $statstring = "
'.$langs->trans("Prospects").''.round($third['prospect']).'
'.$langs->trans("Customers").''.round($third['customer']).'
'.$langs->trans("Suppliers").''.round($third['supplier']).'
'.$langs->trans('Supplier').''; @@ -1201,7 +1201,7 @@ else print '