From 43c0a03758a6cef3acc513bdbe8f48fa757842ac Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sat, 15 Sep 2012 11:21:22 +0200 Subject: [PATCH] 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 77814af9620a4..400e386ef8eb2 100644 --- a/htdocs/adherents/card_subscriptions.php +++ b/htdocs/adherents/card_subscriptions.php @@ -246,7 +246,7 @@ } else { - if ($conf->banque->enabled && $_POST["paymentsave"] != 'none') + if (! empty($conf->banque->enabled) && $_POST["paymentsave"] != 'none') { if ($_POST["cotisation"]) { @@ -740,8 +740,8 @@ $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 @@ 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 @@ 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 @@ } 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 ebdb9f824cca8..c9f4a3de73842 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -1382,7 +1382,7 @@ function add_to_abo() } // 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 @@ function del_to_abo() } } - 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 @@ function _load_ldap_info() $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 e7b898ffd1e1a..1b4fabaf47ed1 100644 --- a/htdocs/adherents/cotisations.php +++ b/htdocs/adherents/cotisations.php @@ -131,7 +131,7 @@ $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 @@ print ''.price($objp->cotisation).''; 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 e12ec01d3a944..7ca413a0c4a0c 100644 --- a/htdocs/adherents/fiche.php +++ b/htdocs/adherents/fiche.php @@ -1532,7 +1532,7 @@ } // 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 @@ } // 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 e9fa20f7e98d6..b78e40fcb1b75 100644 --- a/htdocs/adherents/fiche_subscription.php +++ b/htdocs/adherents/fiche_subscription.php @@ -290,7 +290,7 @@ //$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 d1a4ff48f6727..17d4ddca75f4b 100644 --- a/htdocs/admin/fckeditor.php +++ b/htdocs/admin/fckeditor.php @@ -69,7 +69,7 @@ { 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 09b11f2c5cd0e..6cc42777343e4 100644 --- a/htdocs/admin/ldap.php +++ b/htdocs/admin/ldap.php @@ -269,7 +269,7 @@ 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 21aa75a4cae23..3e34217798034 100644 --- a/htdocs/asterisk/wrapper.php +++ b/htdocs/asterisk/wrapper.php @@ -66,7 +66,7 @@ function llxFooter() // 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 89a358808e4aa..09c1353e7e9c5 100644 --- a/htdocs/cashdesk/facturation.php +++ b/htdocs/cashdesk/facturation.php @@ -30,9 +30,9 @@ $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 @@ $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 d327b2af07c20..911aae6a5762f 100644 --- a/htdocs/cashdesk/facturation_dhtml.php +++ b/htdocs/cashdesk/facturation_dhtml.php @@ -44,9 +44,9 @@ 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 92ed6fc144b80..ea2700e9a228f 100644 --- a/htdocs/cashdesk/facturation_verif.php +++ b/htdocs/cashdesk/facturation_verif.php @@ -32,9 +32,9 @@ 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 d71b2cb866f61..0b42d4a78fdd3 100644 --- a/htdocs/cashdesk/index_verif.php +++ b/htdocs/cashdesk/index_verif.php @@ -49,14 +49,14 @@ } // 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 fc1a3f431c58b..ec465c4bd6ba0 100644 --- a/htdocs/cashdesk/tpl/facturation1.tpl.php +++ b/htdocs/cashdesk/tpl/facturation1.tpl.php @@ -74,7 +74,7 @@ $label = $tab_designations[$i]['label']; print ''."\n "; } @@ -92,7 +92,7 @@ $label = $tab_designations[$i]['label']; print ''."\n "; } diff --git a/htdocs/cashdesk/tpl/menu.tpl.php b/htdocs/cashdesk/tpl/menu.tpl.php index ba9767e5983f3..b1cdf424f8959 100644 --- a/htdocs/cashdesk/tpl/menu.tpl.php +++ b/htdocs/cashdesk/tpl/menu.tpl.php @@ -48,7 +48,7 @@ $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("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 36bd186c627f2..5e1598fcc4ce7 100644 --- a/htdocs/categories/photos.php +++ b/htdocs/categories/photos.php @@ -129,7 +129,7 @@ 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 19272a22e3ddf..52f63e172a7b4 100644 --- a/htdocs/comm/addpropal.php +++ b/htdocs/comm/addpropal.php @@ -303,7 +303,7 @@ if (! empty($conf->global->PRODUCT_SHOW_WHEN_CREATE)) { print ''; - 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 2b6e08bd406b9..889f13c635ea1 100644 --- a/htdocs/comm/fiche.php +++ b/htdocs/comm/fiche.php @@ -410,7 +410,7 @@ /* * 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 @@ /* * 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 @@ /* * 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 @@ /* * 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 @@ /* * 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 @@ */ 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 @@ 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 @@ } // 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 2bc4da5a11224..d124b83669253 100644 --- a/htdocs/comm/index.php +++ b/htdocs/comm/index.php @@ -89,15 +89,15 @@ 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 3bf19f189424e..1460cb185e551 100644 --- a/htdocs/compta/stats/casoc.php +++ b/htdocs/compta/stats/casoc.php @@ -292,9 +292,9 @@ // Other stats print ''; print "\n"; diff --git a/htdocs/compta/tva/class/tva.class.php b/htdocs/compta/tva/class/tva.class.php index d7d14938a6fc9..7e2eeeebc0df9 100644 --- a/htdocs/compta/tva/class/tva.class.php +++ b/htdocs/compta/tva/class/tva.class.php @@ -485,12 +485,12 @@ function addPayment($user) $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 93ee8e6169226..7e09f688d2aae 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -331,9 +331,9 @@ function _load_ldap_info() $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 @@ function _load_ldap_info() 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 e49c8b3e5a33f..c402c1843663b 100644 --- a/htdocs/contrat/fiche.php +++ b/htdocs/contrat/fiche.php @@ -1359,7 +1359,7 @@ 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 762d79bda2576..5e4267bd12c46 100644 --- a/htdocs/core/boxes/box_activity.php +++ b/htdocs/core/boxes/box_activity.php @@ -77,7 +77,7 @@ function loadBox($max=5) $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 @@ function loadBox($max=5) } // 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 @@ function loadBox($max=5) } // 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 af20aaf1a030d..92c38a2d40886 100755 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -483,7 +483,7 @@ function showInputField($key,$value,$moreparam='') 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 5a9ab8b6ee8c6..86ef77b3536a2 100644 --- a/htdocs/core/class/html.formbarcode.class.php +++ b/htdocs/core/class/html.formbarcode.class.php @@ -74,8 +74,8 @@ function setBarcodeEncoder($selected,$barcodelist,$code_id,$idForm='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 b848d6b275938..f4eca4bc09baa 100644 --- a/htdocs/core/class/html.formcompany.class.php +++ b/htdocs/core/class/html.formcompany.class.php @@ -521,7 +521,7 @@ function selectCompaniesForNewContact($object, $var_id, $selected='', $htmlname= $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 @@ function selectCompaniesForNewContact($object, $var_id, $selected='', $htmlname= $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 df775c55cd7ae..174b76231da72 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -567,7 +567,7 @@ function get_form($addfileaction='addfile',$removefileaction='removefile') 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 1e8003d22fb66..990fee14ae9d8 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 @@ /* * 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 @@ /* * 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 @@ /* * 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->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 @@ /* * 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 @@ } // 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 @@ /* * 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 @@ /* * 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 10d126a62ddd1..d30f466df27d9 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -1640,7 +1640,7 @@ $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 @@ // 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 0abde58fc8681..14264358cfa62 100644 --- a/htdocs/comm/prospect/fiche.php +++ b/htdocs/comm/prospect/fiche.php @@ -225,7 +225,7 @@ /* * 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 @@ 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 f72cae173d3fb..f4f603fb45b52 100644 --- a/htdocs/comm/prospect/index.php +++ b/htdocs/comm/prospect/index.php @@ -111,7 +111,7 @@ /* * 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 @@ * 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 091701aeeaca1..6d6181ad75c77 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -237,7 +237,7 @@ function valid($user, $idwarehouse=0) 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 @@ function set_draft($user, $idwarehouse=-1) 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 @@ function cancel($idwarehouse=-1) 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 @@ function getNomUrl($withpicto=0,$option=0,$max=0,$short=0) $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 8d8a1354dd4ad..c186f05df5a0c 100644 --- a/htdocs/commande/fiche.php +++ b/htdocs/commande/fiche.php @@ -2153,7 +2153,7 @@ $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 @@ // 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 e215dbdcca24a..e6c5cb4f5807b 100644 --- a/htdocs/compta/bank/account.php +++ b/htdocs/compta/bank/account.php @@ -429,11 +429,11 @@ $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 @@ $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 dbb6b43703c72..0c6e0e6c9b9cb 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -3016,7 +3016,7 @@ $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 @@ $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 054b2a13760a0..6f6c85abd59dd 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -1809,7 +1809,7 @@ function set_draft($user,$idwarehouse=-1) 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 3fea5bcd1c1d2..7cbbbb8e5da2d 100644 --- a/htdocs/compta/index.php +++ b/htdocs/compta/index.php @@ -108,7 +108,7 @@ /* * 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 @@ /* * 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 @@ /* * 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 @@ /* * 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 @@ /** * 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 @@ /** * 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 @@ // 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 @@ // 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 @@ /** * 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 @@ /* * 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 8dded9ae73bcc..a5afc66a9ef21 100644 --- a/htdocs/compta/localtax/class/localtax.class.php +++ b/htdocs/compta/localtax/class/localtax.class.php @@ -464,12 +464,12 @@ function addPayment($user) $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 fbf44961722ef..ed6e0c7f0aa38 100644 --- a/htdocs/compta/paiement.php +++ b/htdocs/compta/paiement.php @@ -245,7 +245,7 @@ // 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 8539e828ac56c..ff53254f4aa06 100755 --- a/htdocs/compta/paiement_charge.php +++ b/htdocs/compta/paiement_charge.php @@ -66,7 +66,7 @@ $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 8a2e3228e3726..9b3cc8b487a49 100644 --- a/htdocs/compta/recap-compta.php +++ b/htdocs/compta/recap-compta.php @@ -79,7 +79,7 @@ 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 31a86e475df00..7087653459ccc 100644 --- a/htdocs/compta/stats/cabyuser.php +++ b/htdocs/compta/stats/cabyuser.php @@ -282,9 +282,9 @@ // 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 3f8e5831d9d75..563d3b638e03f 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 ca30e8631f1eb..a0922fc4c4c86 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 e38e33e2c7978..f39ce16b629d6 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 ae95eafd3e621..e6f170cb7a4ba 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 77c882d61d30c..2625a1ef23d1f 100644 --- a/htdocs/core/tpl/contacts.tpl.php +++ b/htdocs/core/tpl/contacts.tpl.php @@ -70,7 +70,7 @@ > - 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 d0f838c6b5f45..78290f896ca83 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 @@ // Show product and description print '
'; diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 0e00f836eee7c..77b571e51c487 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 73b8541ac2aa4..4d0ec456573f2 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 981ae2f25efd5..fc8b139df1bf2 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 f344ef8681d1c..3fc1bc73f0474 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 06e421db70083..b2cbb2f55a575 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"); ?> 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 @@
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 @@ function run_trigger($action,$object,$user,$langs,$conf) 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 @@ function run_trigger($action,$object,$user,$langs,$conf) 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 @@ function run_trigger($action,$object,$user,$langs,$conf) 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 @@ function run_trigger($action,$object,$user,$langs,$conf) 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 @@ function run_trigger($action,$object,$user,$langs,$conf) 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 @@ function run_trigger($action,$object,$user,$langs,$conf) // 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 @@ function run_trigger($action,$object,$user,$langs,$conf) } 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 @@ function run_trigger($action,$object,$user,$langs,$conf) } 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 @@ function run_trigger($action,$object,$user,$langs,$conf) 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 @@ function run_trigger($action,$object,$user,$langs,$conf) 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 @@ function run_trigger($action,$object,$user,$langs,$conf) 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 @@ function run_trigger($action,$object,$user,$langs,$conf) 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 @@ function run_trigger($action,$object,$user,$langs,$conf) 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 @@ function run_trigger($action,$object,$user,$langs,$conf) 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 @@ function run_trigger($action,$object,$user,$langs,$conf) 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 @@ function run_trigger($action,$object,$user,$langs,$conf) 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 @@ function run_trigger($action,$object,$user,$langs,$conf) 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 @@ function run_trigger($action,$object,$user,$langs,$conf) 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 42f1535dfde56..af33f00406798 100644 --- a/htdocs/ecm/index.php +++ b/htdocs/ecm/index.php @@ -380,7 +380,7 @@ // 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 b3081991290ce..1585248e64cf0 100644 --- a/htdocs/ecm/search.php +++ b/htdocs/ecm/search.php @@ -103,7 +103,7 @@ // 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 06109252a2589..c9d0cb124fc2b 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -496,7 +496,7 @@ function valid($user) } // 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 340e3d6dfd70f..7f09e1e3c120a 100644 --- a/htdocs/expedition/contact.php +++ b/htdocs/expedition/contact.php @@ -55,12 +55,12 @@ } // 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 @@ print "
'; $objectsrc=new Commande($db); @@ -189,7 +189,7 @@ print "
'; $objectsrc=new Propal($db); diff --git a/htdocs/expedition/fiche.php b/htdocs/expedition/fiche.php index 0e09e08a2402a..7ee312a200a0d 100644 --- a/htdocs/expedition/fiche.php +++ b/htdocs/expedition/fiche.php @@ -32,7 +32,7 @@ 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 @@ // 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 @@ print "
'; $objectsrc=new Commande($db); @@ -1002,7 +1002,7 @@ print "
'; $objectsrc=new Propal($db); @@ -1326,7 +1326,7 @@ } // 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 cfe6d41abba36..976d6c3660add 100644 --- a/htdocs/expedition/shipment.php +++ b/htdocs/expedition/shipment.php @@ -511,7 +511,7 @@ $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 @@ * 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 5de9d2203c65d..4edf8a950914c 100644 --- a/htdocs/fichinter/fiche.php +++ b/htdocs/fichinter/fiche.php @@ -1200,7 +1200,7 @@ } // 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 1feea724fa30c..d7e0f4e9ba19e 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -449,7 +449,7 @@ function set_draft($user, $idwarehouse=-1) 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 @@ function approve($user, $idwarehouse=0) $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 @@ function DispatchProduct($user, $product, $qty, $entrepot, $price=0, $comment='' } // 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 6dbab9c0ecdc6..9121756bd3b34 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -837,7 +837,7 @@ function validate($user, $force_number='', $idwarehouse=0) 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 @@ function set_draft($user, $idwarehouse=-1) 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 e1480bd663608..ffc017d6782c1 100644 --- a/htdocs/fourn/commande/fiche.php +++ b/htdocs/fourn/commande/fiche.php @@ -1399,7 +1399,7 @@ 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 @@ 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 @@ } // 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 52509de0d4584..c050c390c25ca 100644 --- a/htdocs/fourn/facture/fiche.php +++ b/htdocs/fourn/facture/fiche.php @@ -1144,7 +1144,7 @@ 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 @@ { $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 @@ $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 d085c478710db..6d8f453357d3b 100644 --- a/htdocs/fourn/fiche.php +++ b/htdocs/fourn/fiche.php @@ -223,7 +223,7 @@ /* * 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 @@ } // 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 a6db039d2c92a..ef9b1b6762552 100644 --- a/htdocs/fourn/index.php +++ b/htdocs/fourn/index.php @@ -158,7 +158,7 @@ } // 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 48ccca8a0da10..fcd7917be474f 100644 --- a/htdocs/fourn/recap-fourn.php +++ b/htdocs/fourn/recap-fourn.php @@ -83,7 +83,7 @@ - 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 b73694e187e12..2b602118781a2 100644 --- a/htdocs/holiday/admin/holiday.php +++ b/htdocs/holiday/admin/holiday.php @@ -45,7 +45,7 @@ */ // 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 efcd24e78118d..c11e567466ceb 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -287,7 +287,7 @@ // // 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 @@ } // 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 @@ } // 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 @@ } // 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 @@ } // 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 @@ } // 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 @@ } // 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 @@ $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 @@ } // 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 @@ } // 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 @@ } // 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 @@ } // 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 d6e005ea5dd48..98ca4ce2f0e4a 100644 --- a/htdocs/livraison/fiche.php +++ b/htdocs/livraison/fiche.php @@ -67,7 +67,7 @@ $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 @@ $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 @@ 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 @@ 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 @@ 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 @@ 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 407c28692258e..f8b90a48a00d3 100644 --- a/htdocs/product/composition/fiche.php +++ b/htdocs/product/composition/fiche.php @@ -144,7 +144,7 @@ $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 @@ 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 @@ 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 d0cbdc2180f8b..2f0c4e95f6510 100644 --- a/htdocs/product/fiche.php +++ b/htdocs/product/fiche.php @@ -744,7 +744,7 @@ 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 e750faa035770..017f78c7c03d5 100644 --- a/htdocs/product/liste.php +++ b/htdocs/product/liste.php @@ -407,7 +407,7 @@ 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 3e9a71a31fc30..de5c19ee716bb 100644 --- a/htdocs/product/reassort.php +++ b/htdocs/product/reassort.php @@ -240,7 +240,7 @@ 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 85662fd1a3070..ea0a4aee05ba5 100644 --- a/htdocs/product/stock/class/mouvementstock.class.php +++ b/htdocs/product/stock/class/mouvementstock.class.php @@ -208,14 +208,14 @@ function _create($user, $fk_product, $entrepot_id, $qty, $type, $price=0, $label } // 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 186386821331b..44d4d5a4aa680 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -263,26 +263,26 @@ { 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 d2c3eb24a7180..917db6195ce6a 100644 --- a/htdocs/public/agenda/agendaexport.php +++ b/htdocs/public/agenda/agendaexport.php @@ -53,7 +53,7 @@ function llxFooterVierge() { print ''; } 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 2d3fe14b97eb3..94ec053077feb 100644 --- a/htdocs/societe/index.php +++ b/htdocs/societe/index.php @@ -112,9 +112,9 @@ { 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 @@ $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 f4a221fb09866..3c26f9af46d76 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -544,7 +544,7 @@ 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 @@ 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 9002814e0b313..ab8bbef42c5c2 100644 --- a/htdocs/societe/societe.php +++ b/htdocs/societe/societe.php @@ -401,7 +401,7 @@ $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 c8b6556a37430..9ca8c07907d8c 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -1823,13 +1823,13 @@ function _load_ldap_info() $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 @@ function _load_ldap_info() 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 f49cdde8a780e..bef8f6e5577c8 100644 --- a/htdocs/user/class/usergroup.class.php +++ b/htdocs/user/class/usergroup.class.php @@ -687,9 +687,9 @@ function _load_ldap_info() $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 81ca81b717c93..a815906ac02a0 100644 --- a/htdocs/user/group/fiche.php +++ b/htdocs/user/group/fiche.php @@ -97,7 +97,7 @@ $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 163b0fb024a68..85fc5023455f5 100644 --- a/htdocs/webservices/admin/webservices.php +++ b/htdocs/webservices/admin/webservices.php @@ -101,7 +101,7 @@ 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 ''.$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 @@ print "
'.$langs->trans("RefOrder").'
'.$delivery->getLibStatut(4)."
'.$langs->trans("StockLimit").''; print ''; @@ -963,7 +963,7 @@ print '
'.$langs->trans("StockLimit").''; print ''; @@ -1099,7 +1099,7 @@ 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 @@ } 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 @@ print '