diff --git a/htdocs/adherents/card_subscriptions.php b/htdocs/adherents/card_subscriptions.php
index 77814af9620..400e386ef8e 100644
--- a/htdocs/adherents/card_subscriptions.php
+++ b/htdocs/adherents/card_subscriptions.php
@@ -246,7 +246,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'cotisation' && ! $
}
else
{
- if ($conf->banque->enabled && $_POST["paymentsave"] != 'none')
+ if (! empty($conf->banque->enabled) && $_POST["paymentsave"] != 'none')
{
if ($_POST["cotisation"])
{
@@ -740,8 +740,8 @@ if ($rowid)
$bankdirect=0; // Option to write to bank is on by default
$bankviainvoice=0; // Option to write via invoice is on by default
$invoiceonly=0;
- if ($conf->banque->enabled && $conf->global->ADHERENT_BANK_USE && (empty($_POST['paymentsave']) || $_POST["paymentsave"] == 'bankdirect')) $bankdirect=1;
- if ($conf->banque->enabled && $conf->societe->enabled && $conf->facture->enabled && $object->fk_soc) $bankviainvoice=1;
+ if (! empty($conf->banque->enabled) && $conf->global->ADHERENT_BANK_USE && (empty($_POST['paymentsave']) || $_POST["paymentsave"] == 'bankdirect')) $bankdirect=1;
+ if (! empty($conf->banque->enabled) && ! empty($conf->societe->enabled) && ! empty($conf->facture->enabled) && $object->fk_soc) $bankviainvoice=1;
print "\n\n\n";
@@ -873,7 +873,7 @@ if ($rowid)
print dol_print_date(($datefrom?$datefrom:time()),"%Y").'" >';
// Complementary action
- if ($conf->banque->enabled || $conf->facture->enabled)
+ if (! empty($conf->banque->enabled) || ! empty($conf->facture->enabled))
{
$company=new Societe($db);
if ($object->fk_soc)
@@ -894,7 +894,7 @@ if ($rowid)
print ' '.$langs->trans("MoreActionBankDirect").'
';
}
- if ($conf->societe->enabled && $conf->facture->enabled)
+ if (! empty($conf->societe->enabled) && ! empty($conf->facture->enabled))
{
print 'fk_soc) || empty($bankviainvoice)) print ' disabled="disabled"';
@@ -909,7 +909,7 @@ if ($rowid)
}
print '
';
}
- if ($conf->banque->enabled && $conf->societe->enabled && $conf->facture->enabled)
+ if (! empty($conf->banque->enabled) && ! empty($conf->societe->enabled) && ! empty($conf->facture->enabled))
{
print 'fk_soc) || empty($bankviainvoice)) print ' disabled="disabled"';
diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php
index ebdb9f824cc..c9f4a3de738 100644
--- a/htdocs/adherents/class/adherent.class.php
+++ b/htdocs/adherents/class/adherent.class.php
@@ -1382,7 +1382,7 @@ class Adherent extends CommonObject
}
// spip
- if ($conf->global->ADHERENT_USE_SPIP && $conf->mailmanspip->enabled)
+ if ($conf->global->ADHERENT_USE_SPIP && ! empty($conf->mailmanspip->enabled))
{
$result=$mailmanspip->add_to_spip($this);
if ($result < 0)
@@ -1427,7 +1427,7 @@ class Adherent extends CommonObject
}
}
- if ($conf->global->ADHERENT_USE_SPIP && $conf->mailmanspip->enabled)
+ if ($conf->global->ADHERENT_USE_SPIP && ! empty($conf->mailmanspip->enabled))
{
$result=$mailmanspip->del_to_spip($this);
if ($result < 0)
@@ -1787,31 +1787,31 @@ class Adherent extends CommonObject
$this->fullname=$this->getFullName($langs);
// Member
- if ($this->fullname && $conf->global->LDAP_MEMBER_FIELD_FULLNAME) $info[$conf->global->LDAP_MEMBER_FIELD_FULLNAME] = $this->fullname;
- if ($this->nom && $conf->global->LDAP_MEMBER_FIELD_NAME) $info[$conf->global->LDAP_MEMBER_FIELD_NAME] = $this->nom;
- if ($this->prenom && $conf->global->LDAP_MEMBER_FIELD_FIRSTNAME) $info[$conf->global->LDAP_MEMBER_FIELD_FIRSTNAME] = $this->prenom;
- if ($this->login && $conf->global->LDAP_MEMBER_FIELD_LOGIN) $info[$conf->global->LDAP_MEMBER_FIELD_LOGIN] = $this->login;
- if ($this->pass && $conf->global->LDAP_MEMBER_FIELD_PASSWORD) $info[$conf->global->LDAP_MEMBER_FIELD_PASSWORD] = $this->pass; // this->pass = mot de passe non crypte
- if ($this->poste && $conf->global->LDAP_MEMBER_FIELD_TITLE) $info[$conf->global->LDAP_MEMBER_FIELD_TITLE] = $this->poste;
- if ($this->adresse && $conf->global->LDAP_MEMBER_FIELD_ADDRESS) $info[$conf->global->LDAP_MEMBER_FIELD_ADDRESS] = $this->adresse;
- if ($this->cp && $conf->global->LDAP_MEMBER_FIELD_ZIP) $info[$conf->global->LDAP_MEMBER_FIELD_ZIP] = $this->cp;
- if ($this->ville && $conf->global->LDAP_MEMBER_FIELD_TOWN) $info[$conf->global->LDAP_MEMBER_FIELD_TOWN] = $this->ville;
- if ($this->country_code && $conf->global->LDAP_MEMBER_FIELD_COUNTRY) $info[$conf->global->LDAP_MEMBER_FIELD_COUNTRY] = $this->country_code;
- if ($this->email && $conf->global->LDAP_MEMBER_FIELD_MAIL) $info[$conf->global->LDAP_MEMBER_FIELD_MAIL] = $this->email;
- if ($this->phone && $conf->global->LDAP_MEMBER_FIELD_PHONE) $info[$conf->global->LDAP_MEMBER_FIELD_PHONE] = $this->phone;
- if ($this->phone_perso && $conf->global->LDAP_MEMBER_FIELD_PHONE_PERSO) $info[$conf->global->LDAP_MEMBER_FIELD_PHONE_PERSO] = $this->phone_perso;
- if ($this->phone_mobile && $conf->global->LDAP_MEMBER_FIELD_MOBILE) $info[$conf->global->LDAP_MEMBER_FIELD_MOBILE] = $this->phone_mobile;
- if ($this->fax && $conf->global->LDAP_MEMBER_FIELD_FAX) $info[$conf->global->LDAP_MEMBER_FIELD_FAX] = $this->fax;
- if ($this->note && $conf->global->LDAP_MEMBER_FIELD_DESCRIPTION) $info[$conf->global->LDAP_MEMBER_FIELD_DESCRIPTION] = $this->note;
- if ($this->naiss && $conf->global->LDAP_MEMBER_FIELD_BIRTHDATE) $info[$conf->global->LDAP_MEMBER_FIELD_BIRTHDATE] = dol_print_date($this->naiss,'dayhourldap');
- if (isset($this->statut) && $conf->global->LDAP_FIELD_MEMBER_STATUS) $info[$conf->global->LDAP_FIELD_MEMBER_STATUS] = $this->statut;
- if ($this->datefin && $conf->global->LDAP_FIELD_MEMBER_END_LASTSUBSCRIPTION) $info[$conf->global->LDAP_FIELD_MEMBER_END_LASTSUBSCRIPTION] = dol_print_date($this->datefin,'dayhourldap');
+ if ($this->fullname && ! empty($conf->global->LDAP_MEMBER_FIELD_FULLNAME)) $info[$conf->global->LDAP_MEMBER_FIELD_FULLNAME] = $this->fullname;
+ if ($this->nom && ! empty($conf->global->LDAP_MEMBER_FIELD_NAME)) $info[$conf->global->LDAP_MEMBER_FIELD_NAME] = $this->nom;
+ if ($this->prenom && ! empty($conf->global->LDAP_MEMBER_FIELD_FIRSTNAME)) $info[$conf->global->LDAP_MEMBER_FIELD_FIRSTNAME] = $this->prenom;
+ if ($this->login && ! empty($conf->global->LDAP_MEMBER_FIELD_LOGIN)) $info[$conf->global->LDAP_MEMBER_FIELD_LOGIN] = $this->login;
+ if ($this->pass && ! empty($conf->global->LDAP_MEMBER_FIELD_PASSWORD)) $info[$conf->global->LDAP_MEMBER_FIELD_PASSWORD] = $this->pass; // this->pass = mot de passe non crypte
+ if ($this->poste && ! empty($conf->global->LDAP_MEMBER_FIELD_TITLE)) $info[$conf->global->LDAP_MEMBER_FIELD_TITLE] = $this->poste;
+ if ($this->adresse && ! empty($conf->global->LDAP_MEMBER_FIELD_ADDRESS)) $info[$conf->global->LDAP_MEMBER_FIELD_ADDRESS] = $this->adresse;
+ if ($this->cp && ! empty($conf->global->LDAP_MEMBER_FIELD_ZIP)) $info[$conf->global->LDAP_MEMBER_FIELD_ZIP] = $this->cp;
+ if ($this->ville && ! empty($conf->global->LDAP_MEMBER_FIELD_TOWN)) $info[$conf->global->LDAP_MEMBER_FIELD_TOWN] = $this->ville;
+ if ($this->country_code && ! empty($conf->global->LDAP_MEMBER_FIELD_COUNTRY)) $info[$conf->global->LDAP_MEMBER_FIELD_COUNTRY] = $this->country_code;
+ if ($this->email && ! empty($conf->global->LDAP_MEMBER_FIELD_MAIL)) $info[$conf->global->LDAP_MEMBER_FIELD_MAIL] = $this->email;
+ if ($this->phone && ! empty($conf->global->LDAP_MEMBER_FIELD_PHONE)) $info[$conf->global->LDAP_MEMBER_FIELD_PHONE] = $this->phone;
+ if ($this->phone_perso && ! empty($conf->global->LDAP_MEMBER_FIELD_PHONE_PERSO)) $info[$conf->global->LDAP_MEMBER_FIELD_PHONE_PERSO] = $this->phone_perso;
+ if ($this->phone_mobile && ! empty($conf->global->LDAP_MEMBER_FIELD_MOBILE)) $info[$conf->global->LDAP_MEMBER_FIELD_MOBILE] = $this->phone_mobile;
+ if ($this->fax && ! empty($conf->global->LDAP_MEMBER_FIELD_FAX)) $info[$conf->global->LDAP_MEMBER_FIELD_FAX] = $this->fax;
+ if ($this->note && ! empty($conf->global->LDAP_MEMBER_FIELD_DESCRIPTION)) $info[$conf->global->LDAP_MEMBER_FIELD_DESCRIPTION] = $this->note;
+ if ($this->naiss && ! empty($conf->global->LDAP_MEMBER_FIELD_BIRTHDATE)) $info[$conf->global->LDAP_MEMBER_FIELD_BIRTHDATE] = dol_print_date($this->naiss,'dayhourldap');
+ if (isset($this->statut) && ! empty($conf->global->LDAP_FIELD_MEMBER_STATUS)) $info[$conf->global->LDAP_FIELD_MEMBER_STATUS] = $this->statut;
+ if ($this->datefin && ! empty($conf->global->LDAP_FIELD_MEMBER_END_LASTSUBSCRIPTION)) $info[$conf->global->LDAP_FIELD_MEMBER_END_LASTSUBSCRIPTION] = dol_print_date($this->datefin,'dayhourldap');
// Subscriptions
- if ($this->first_subscription_date && $conf->global->LDAP_FIELD_MEMBER_FIRSTSUBSCRIPTION_DATE) $info[$conf->global->LDAP_FIELD_MEMBER_FIRSTSUBSCRIPTION_DATE] = dol_print_date($this->first_subscription_date,'dayhourldap');
- if (isset($this->first_subscription_amount) && $conf->global->LDAP_FIELD_MEMBER_FIRSTSUBSCRIPTION_AMOUNT) $info[$conf->global->LDAP_FIELD_MEMBER_FIRSTSUBSCRIPTION_AMOUNT] = $this->first_subscription_amount;
- if ($this->last_subscription_date && $conf->global->LDAP_FIELD_MEMBER_LASTSUBSCRIPTION_DATE) $info[$conf->global->LDAP_FIELD_MEMBER_LASTSUBSCRIPTION_DATE] = dol_print_date($this->last_subscription_date,'dayhourldap');
- if (isset($this->last_subscription_amount) && $conf->global->LDAP_FIELD_MEMBER_LASTSUBSCRIPTION_AMOUNT) $info[$conf->global->LDAP_FIELD_MEMBER_LASTSUBSCRIPTION_AMOUNT] = $this->last_subscription_amount;
+ if ($this->first_subscription_date && ! empty($conf->global->LDAP_FIELD_MEMBER_FIRSTSUBSCRIPTION_DATE)) $info[$conf->global->LDAP_FIELD_MEMBER_FIRSTSUBSCRIPTION_DATE] = dol_print_date($this->first_subscription_date,'dayhourldap');
+ if (isset($this->first_subscription_amount) && ! empty($conf->global->LDAP_FIELD_MEMBER_FIRSTSUBSCRIPTION_AMOUNT)) $info[$conf->global->LDAP_FIELD_MEMBER_FIRSTSUBSCRIPTION_AMOUNT] = $this->first_subscription_amount;
+ if ($this->last_subscription_date && ! empty($conf->global->LDAP_FIELD_MEMBER_LASTSUBSCRIPTION_DATE)) $info[$conf->global->LDAP_FIELD_MEMBER_LASTSUBSCRIPTION_DATE] = dol_print_date($this->last_subscription_date,'dayhourldap');
+ if (isset($this->last_subscription_amount) && ! empty($conf->global->LDAP_FIELD_MEMBER_LASTSUBSCRIPTION_AMOUNT)) $info[$conf->global->LDAP_FIELD_MEMBER_LASTSUBSCRIPTION_AMOUNT] = $this->last_subscription_amount;
return $info;
}
diff --git a/htdocs/adherents/cotisations.php b/htdocs/adherents/cotisations.php
index e7b898ffd1e..1b4fabaf47e 100644
--- a/htdocs/adherents/cotisations.php
+++ b/htdocs/adherents/cotisations.php
@@ -131,7 +131,7 @@ if ($result)
$var=!$var;
- if ($allowinsertbankafter && ! $objp->fk_account && $conf->banque->enabled && $objp->cotisation)
+ if ($allowinsertbankafter && ! $objp->fk_account && ! empty($conf->banque->enabled) && $objp->cotisation)
{
print "
| '; } // Recherche Propal -if ($conf->propal->enabled && $user->rights->propal->lire) +if (! empty($conf->propal->enabled) && $user->rights->propal->lire) { $var=false; print ' | '; print '';
@@ -276,7 +276,7 @@ $max=3;
/*
* Last modified customers or prospects
*/
-if ($conf->societe->enabled && $user->rights->societe->lire)
+if (! empty($conf->societe->enabled) && $user->rights->societe->lire)
{
$langs->load("boxes");
@@ -336,7 +336,7 @@ if ($conf->societe->enabled && $user->rights->societe->lire)
}
// Last suppliers
-if ($conf->fournisseur->enabled && $user->rights->societe->lire)
+if (! empty($conf->fournisseur->enabled) && $user->rights->societe->lire)
{
$langs->load("boxes");
@@ -408,7 +408,7 @@ if ($user->rights->agenda->myactions->read)
/*
* Last contracts
*/
-if ($conf->contrat->enabled && $user->rights->contrat->lire && 0) // TODO A REFAIRE DEPUIS NOUVEAU CONTRAT
+if (! empty($conf->contrat->enabled) && $user->rights->contrat->lire && 0) // TODO A REFAIRE DEPUIS NOUVEAU CONTRAT
{
$langs->load("contracts");
@@ -466,7 +466,7 @@ if ($conf->contrat->enabled && $user->rights->contrat->lire && 0) // TODO A REFA
/*
* Opened proposals
*/
-if ($conf->propal->enabled && $user->rights->propal->lire)
+if (! empty($conf->propal->enabled) && $user->rights->propal->lire)
{
$langs->load("propal");
diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php
index 10d126a62dd..d30f466df27 100644
--- a/htdocs/comm/propal.php
+++ b/htdocs/comm/propal.php
@@ -1640,7 +1640,7 @@ if ($object->statut == 0 && $user->rights->propal->creer)
$object->formAddFreeProduct(0,$mysoc,$soc,$hookmanager);
// Add predefined products/services
- if ($conf->product->enabled || $conf->service->enabled)
+ if (! empty($conf->product->enabled) || ! empty($conf->service->enabled))
{
$var=!$var;
$object->formAddPredefinedProduct(0,$mysoc,$soc,$hookmanager);
@@ -1738,7 +1738,7 @@ if ($action != 'presend')
// Create an invoice and classify billed
if ($object->statut == 2 && $user->societe_id == 0)
{
- if ($conf->facture->enabled && $user->rights->facture->creer)
+ if (! empty($conf->facture->enabled) && $user->rights->facture->creer)
{
print ''.$langs->trans("AddBill").'';
}
diff --git a/htdocs/comm/prospect/fiche.php b/htdocs/comm/prospect/fiche.php
index 0abde58fc86..14264358cfa 100644
--- a/htdocs/comm/prospect/fiche.php
+++ b/htdocs/comm/prospect/fiche.php
@@ -225,7 +225,7 @@ if ($socid > 0)
/*
* Last proposals
*/
- if ($conf->propal->enabled && $user->rights->propale->lire)
+ if (! empty($conf->propal->enabled) && $user->rights->propale->lire)
{
$propal_static=new Propal($db);
@@ -297,13 +297,13 @@ if ($socid > 0)
print ' ';
- if ($conf->propal->enabled && $user->rights->propale->creer)
+ if (! empty($conf->propal->enabled) && $user->rights->propale->creer)
{
print ''.$langs->trans("AddProp").'';
}
// Add action
- if ($conf->agenda->enabled && ! empty($conf->global->MAIN_REPEATTASKONEACHTAB))
+ if (! empty($conf->agenda->enabled) && ! empty($conf->global->MAIN_REPEATTASKONEACHTAB))
{
if ($user->rights->agenda->myactions->create)
{
diff --git a/htdocs/comm/prospect/index.php b/htdocs/comm/prospect/index.php
index f72cae173d3..f4f603fb45b 100644
--- a/htdocs/comm/prospect/index.php
+++ b/htdocs/comm/prospect/index.php
@@ -111,7 +111,7 @@ if ($resql)
/*
* Liste des propal brouillons
*/
-if ($conf->propal->enabled && $user->rights->propale->lire)
+if (! empty($conf->propal->enabled) && $user->rights->propale->lire)
{
$sql = "SELECT p.rowid, p.ref, p.price, s.nom as sname";
$sql.= " FROM ".MAIN_DB_PREFIX."propal as p";
@@ -170,7 +170,7 @@ if (! empty($conf->agenda->enabled)) show_array_actions_to_do(10);
* Dernieres propales ouvertes
*
*/
-if ($conf->propal->enabled && $user->rights->propale->lire)
+if (! empty($conf->propal->enabled) && $user->rights->propale->lire)
{
$sql = "SELECT s.nom as name, s.rowid as socid, s.client, s.canvas,";
$sql.= " p.rowid as propalid, p.total as total_ttc, p.ref, p.datep as dp, c.label as statut, c.id as statutid";
diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php
index 091701aeeac..6d6181ad75c 100644
--- a/htdocs/commande/class/commande.class.php
+++ b/htdocs/commande/class/commande.class.php
@@ -237,7 +237,7 @@ class Commande extends CommonOrder
if (! $error)
{
// If stock is incremented on validate order, we must increment it
- if ($result >= 0 && $conf->stock->enabled && $conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER == 1)
+ if ($result >= 0 && ! empty($conf->stock->enabled) && $conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER == 1)
{
require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php';
$langs->load("agenda");
@@ -351,7 +351,7 @@ class Commande extends CommonOrder
if ($this->db->query($sql))
{
// If stock is decremented on validate order, we must reincrement it
- if ($conf->stock->enabled && $conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER == 1)
+ if (! empty($conf->stock->enabled) && $conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER == 1)
{
require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php';
$langs->load("agenda");
@@ -534,7 +534,7 @@ class Commande extends CommonOrder
if ($this->db->query($sql))
{
// If stock is decremented on validate order, we must reincrement it
- if ($conf->stock->enabled && $conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER == 1)
+ if (! empty($conf->stock->enabled) && $conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER == 1)
{
require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php';
$langs->load("agenda");
@@ -2538,7 +2538,7 @@ class Commande extends CommonOrder
$result='';
- if ($conf->expedition->enabled && ($option == 1 || $option == 2)) $url = DOL_URL_ROOT.'/expedition/shipment.php?id='.$this->id;
+ if (! empty($conf->expedition->enabled) && ($option == 1 || $option == 2)) $url = DOL_URL_ROOT.'/expedition/shipment.php?id='.$this->id;
else $url = DOL_URL_ROOT.'/commande/fiche.php?id='.$this->id;
if ($short) return $url;
diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php
index 8d8a1354dd4..c186f05df5a 100644
--- a/htdocs/commande/fiche.php
+++ b/htdocs/commande/fiche.php
@@ -2153,7 +2153,7 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G
$object->formAddFreeProduct(1,$mysoc,$soc,$hookmanager);
// Add predefined products/services
- if ($conf->product->enabled || $conf->service->enabled)
+ if (! empty($conf->product->enabled) || ! empty($conf->service->enabled))
{
$var=!$var;
$object->formAddPredefinedProduct(1,$mysoc,$soc,$hookmanager);
@@ -2235,7 +2235,7 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G
// Create bill and Classify billed
- if ($conf->facture->enabled && $object->statut > 0 && ! $object->billed)
+ if (! empty($conf->facture->enabled) && $object->statut > 0 && ! $object->billed)
{
if ($user->rights->facture->creer && empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER))
{
diff --git a/htdocs/compta/bank/account.php b/htdocs/compta/bank/account.php
index e215dbdcca2..e6c5cb4f580 100644
--- a/htdocs/compta/bank/account.php
+++ b/htdocs/compta/bank/account.php
@@ -429,11 +429,11 @@ if ($id > 0 || ! empty($ref))
$sql.= ", s.rowid as socid, s.nom as thirdparty";
}
/*
- if ($mode_search && $conf->adherent->enabled)
+ if ($mode_search && ! empty($conf->adherent->enabled))
{
}
- if ($mode_search && $conf->tax->enabled)
+ if ($mode_search && ! empty($conf->tax->enabled))
{
}
@@ -445,12 +445,12 @@ if ($id > 0 || ! empty($ref))
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank_url as bu1 ON bu1.fk_bank = b.rowid AND bu1.type='company'";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON bu1.url_id = s.rowid";
}
- if ($mode_search && $conf->tax->enabled)
+ if ($mode_search && ! empty($conf->tax->enabled))
{
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank_url as bu2 ON bu2.fk_bank = b.rowid AND bu2.type='payment_vat'";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."tva as t ON bu2.url_id = t.rowid";
}
- if ($mode_search && $conf->adherent->enabled)
+ if ($mode_search && ! empty($conf->adherent->enabled))
{
// TODO Mettre jointure sur adherent pour recherche sur un adherent
//$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank_url as bu3 ON bu3.fk_bank = b.rowid AND bu3.type='company'";
diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php
index dbb6b43703c..0c6e0e6c9b9 100644
--- a/htdocs/compta/facture.php
+++ b/htdocs/compta/facture.php
@@ -3016,7 +3016,7 @@ else if ($id > 0 || ! empty($ref))
$object->formAddFreeProduct(1,$mysoc,$soc,$hookmanager);
// Add predefined products/services
- if ($conf->product->enabled || $conf->service->enabled)
+ if (! empty($conf->product->enabled) || ! empty($conf->service->enabled))
{
$var=!$var;
$object->formAddPredefinedProduct(1,$mysoc,$soc,$hookmanager);
@@ -3268,7 +3268,7 @@ else if ($id > 0 || ! empty($ref))
$somethingshown=$object->showLinkedObjectBlock();
// Link for paypal payment
- if ($conf->paypal->enabled && $object->statut != 0)
+ if (! empty($conf->paypal->enabled) && $object->statut != 0)
{
include_once DOL_DOCUMENT_ROOT.'/paypal/lib/paypal.lib.php';
print showPaypalPaymentUrl('invoice',$object->ref);
diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php
index 054b2a13760..6f6c85abd59 100644
--- a/htdocs/compta/facture/class/facture.class.php
+++ b/htdocs/compta/facture/class/facture.class.php
@@ -1809,7 +1809,7 @@ class Facture extends CommonInvoice
if ($result)
{
// Si on decremente le produit principal et ses composants a la validation de facture, on réincrement
- if ($this->type != 3 && $result >= 0 && $conf->stock->enabled && $conf->global->STOCK_CALCULATE_ON_BILL)
+ if ($this->type != 3 && $result >= 0 && ! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_BILL))
{
require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php';
$langs->load("agenda");
diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php
index 3fea5bcd1c1..7cbbbb8e5da 100644
--- a/htdocs/compta/index.php
+++ b/htdocs/compta/index.php
@@ -108,7 +108,7 @@ $max=3;
/*
* Search invoices
*/
-if ($conf->facture->enabled && $user->rights->facture->lire)
+if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
{
print ' ';
- if ($conf->facture->enabled && $user->rights->facture->lire)
+ if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
{
// Factures
print_fiche_titre($langs->trans("CustomerPreview"));
diff --git a/htdocs/compta/stats/cabyuser.php b/htdocs/compta/stats/cabyuser.php
index 31a86e475df..7087653459c 100644
--- a/htdocs/compta/stats/cabyuser.php
+++ b/htdocs/compta/stats/cabyuser.php
@@ -282,9 +282,9 @@ if (count($amount))
// Other stats
print ' | '; - if ($conf->propal->enabled && $key>0) print ' '.img_picto($langs->trans("ProposalStats"),"stats").' '; - if ($conf->commande->enabled && $key>0) print ' '.img_picto($langs->trans("OrderStats"),"stats").' '; - if ($conf->facture->enabled && $key>0) print ' '.img_picto($langs->trans("InvoiceStats"),"stats").' '; + if (! empty($conf->propal->enabled) && $key>0) print ' '.img_picto($langs->trans("ProposalStats"),"stats").' '; + if (! empty($conf->commande->enabled) && $key>0) print ' '.img_picto($langs->trans("OrderStats"),"stats").' '; + if (! empty($conf->facture->enabled) && $key>0) print ' '.img_picto($langs->trans("InvoiceStats"),"stats").' '; print ' | '; 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 ' | '; print "\n"; diff --git a/htdocs/compta/tva/class/tva.class.php b/htdocs/compta/tva/class/tva.class.php index d7d14938a6f..7e2eeeebc0d 100644 --- a/htdocs/compta/tva/class/tva.class.php +++ b/htdocs/compta/tva/class/tva.class.php @@ -485,12 +485,12 @@ class Tva extends CommonObject $this->error=$langs->trans("ErrorFieldRequired",$langs->transnoentities("Amount")); return -4; } - if ($conf->banque->enabled && (empty($this->accountid) || $this->accountid <= 0)) + if (! empty($conf->banque->enabled) && (empty($this->accountid) || $this->accountid <= 0)) { $this->error=$langs->trans("ErrorFieldRequired",$langs->transnoentities("Account")); return -5; } - if ($conf->banque->enabled && (empty($this->paymenttype) || $this->paymenttype <= 0)) + if (! empty($conf->banque->enabled) && (empty($this->paymenttype) || $this->paymenttype <= 0)) { $this->error=$langs->trans("ErrorFieldRequired",$langs->transnoentities("PaymentMode")); return -5; diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index 93ee8e61692..7e09f688d2a 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -331,9 +331,9 @@ class Contact extends CommonObject $this->fullname=$this->getFullName($langs); // Fields - if ($this->fullname && $conf->global->LDAP_CONTACT_FIELD_FULLNAME) $info[$conf->global->LDAP_CONTACT_FIELD_FULLNAME] = $this->fullname; - if ($this->lastname && $conf->global->LDAP_CONTACT_FIELD_NAME) $info[$conf->global->LDAP_CONTACT_FIELD_NAME] = $this->lastname; - if ($this->firstname && $conf->global->LDAP_CONTACT_FIELD_FIRSTNAME) $info[$conf->global->LDAP_CONTACT_FIELD_FIRSTNAME] = $this->firstname; + if ($this->fullname && ! empty($conf->global->LDAP_CONTACT_FIELD_FULLNAME)) $info[$conf->global->LDAP_CONTACT_FIELD_FULLNAME] = $this->fullname; + if ($this->lastname && ! empty($conf->global->LDAP_CONTACT_FIELD_NAME)) $info[$conf->global->LDAP_CONTACT_FIELD_NAME] = $this->lastname; + if ($this->firstname && ! empty($conf->global->LDAP_CONTACT_FIELD_FIRSTNAME)) $info[$conf->global->LDAP_CONTACT_FIELD_FIRSTNAME] = $this->firstname; if ($this->poste) $info["title"] = $this->poste; if ($this->socid > 0) @@ -346,16 +346,16 @@ class Contact extends CommonObject if ($soc->client == 2) $info["businessCategory"] = "Prospects"; if ($soc->fournisseur == 1) $info["businessCategory"] = "Suppliers"; } - if ($this->address && $conf->global->LDAP_CONTACT_FIELD_ADDRESS) $info[$conf->global->LDAP_CONTACT_FIELD_ADDRESS] = $this->address; - if ($this->cp && $conf->global->LDAP_CONTACT_FIELD_ZIP) $info[$conf->global->LDAP_CONTACT_FIELD_ZIP] = $this->cp; - if ($this->ville && $conf->global->LDAP_CONTACT_FIELD_TOWN) $info[$conf->global->LDAP_CONTACT_FIELD_TOWN] = $this->ville; - if ($this->country_code && $conf->global->LDAP_CONTACT_FIELD_COUNTRY) $info[$conf->global->LDAP_CONTACT_FIELD_COUNTRY] = $this->country_code; - if ($this->phone_pro && $conf->global->LDAP_CONTACT_FIELD_PHONE) $info[$conf->global->LDAP_CONTACT_FIELD_PHONE] = $this->phone_pro; - if ($this->phone_perso && $conf->global->LDAP_CONTACT_FIELD_HOMEPHONE) $info[$conf->global->LDAP_CONTACT_FIELD_HOMEPHONE] = $this->phone_perso; - if ($this->phone_mobile && $conf->global->LDAP_CONTACT_FIELD_MOBILE) $info[$conf->global->LDAP_CONTACT_FIELD_MOBILE] = $this->phone_mobile; - if ($this->fax && $conf->global->LDAP_CONTACT_FIELD_FAX) $info[$conf->global->LDAP_CONTACT_FIELD_FAX] = $this->fax; - if ($this->note && $conf->global->LDAP_CONTACT_FIELD_DESCRIPTION) $info[$conf->global->LDAP_CONTACT_FIELD_DESCRIPTION] = $this->note; - if ($this->email && $conf->global->LDAP_CONTACT_FIELD_MAIL) $info[$conf->global->LDAP_CONTACT_FIELD_MAIL] = $this->email; + if ($this->address && ! empty($conf->global->LDAP_CONTACT_FIELD_ADDRESS)) $info[$conf->global->LDAP_CONTACT_FIELD_ADDRESS] = $this->address; + if ($this->cp && ! empty($conf->global->LDAP_CONTACT_FIELD_ZIP)) $info[$conf->global->LDAP_CONTACT_FIELD_ZIP] = $this->cp; + if ($this->ville && ! empty($conf->global->LDAP_CONTACT_FIELD_TOWN)) $info[$conf->global->LDAP_CONTACT_FIELD_TOWN] = $this->ville; + if ($this->country_code && ! empty($conf->global->LDAP_CONTACT_FIELD_COUNTRY)) $info[$conf->global->LDAP_CONTACT_FIELD_COUNTRY] = $this->country_code; + if ($this->phone_pro && ! empty($conf->global->LDAP_CONTACT_FIELD_PHONE)) $info[$conf->global->LDAP_CONTACT_FIELD_PHONE] = $this->phone_pro; + if ($this->phone_perso && ! empty($conf->global->LDAP_CONTACT_FIELD_HOMEPHONE)) $info[$conf->global->LDAP_CONTACT_FIELD_HOMEPHONE] = $this->phone_perso; + if ($this->phone_mobile && ! empty($conf->global->LDAP_CONTACT_FIELD_MOBILE)) $info[$conf->global->LDAP_CONTACT_FIELD_MOBILE] = $this->phone_mobile; + if ($this->fax && ! empty($conf->global->LDAP_CONTACT_FIELD_FAX)) $info[$conf->global->LDAP_CONTACT_FIELD_FAX] = $this->fax; + if ($this->note && ! empty($conf->global->LDAP_CONTACT_FIELD_DESCRIPTION)) $info[$conf->global->LDAP_CONTACT_FIELD_DESCRIPTION] = $this->note; + if ($this->email && ! empty($conf->global->LDAP_CONTACT_FIELD_MAIL)) $info[$conf->global->LDAP_CONTACT_FIELD_MAIL] = $this->email; if ($conf->global->LDAP_SERVER_TYPE == 'egroupware') { diff --git a/htdocs/contrat/fiche.php b/htdocs/contrat/fiche.php index e49c8b3e5a3..c402c184366 100644 --- a/htdocs/contrat/fiche.php +++ b/htdocs/contrat/fiche.php @@ -1359,7 +1359,7 @@ else else print ''.$langs->trans("Validate").''; } - if ($conf->facture->enabled && $object->statut > 0 && $object->nbofservicesclosed < $nbofservices) + if (! empty($conf->facture->enabled) && $object->statut > 0 && $object->nbofservicesclosed < $nbofservices) { $langs->load("bills"); if ($user->rights->facture->creer) print ''.$langs->trans("CreateBill").''; diff --git a/htdocs/core/boxes/box_activity.php b/htdocs/core/boxes/box_activity.php index 762d79bda25..5e4267bd12c 100644 --- a/htdocs/core/boxes/box_activity.php +++ b/htdocs/core/boxes/box_activity.php @@ -77,7 +77,7 @@ class box_activity extends ModeleBoxes $this->info_box_head = array('text' => $textHead, 'limit'=> dol_strlen($textHead)); // list the summary of the bills - if ($conf->facture->enabled && $user->rights->facture->lire) + if (! empty($conf->facture->enabled) && $user->rights->facture->lire) { $sql = "SELECT f.paye, f.fk_statut, sum(f.total_ttc) as Mnttot, count(*) as nb"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f"; @@ -133,7 +133,7 @@ class box_activity extends ModeleBoxes } // list the summary of the orders - if ($conf->commande->enabled && $user->rights->commande->lire) + if (! empty($conf->commande->enabled) && $user->rights->commande->lire) { $sql = "SELECT c.fk_statut,c.facture, sum(c.total_ttc) as Mnttot, count(*) as nb"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."commande as c"; @@ -175,7 +175,7 @@ class box_activity extends ModeleBoxes } // list the summary of the propals - if ($conf->propal->enabled && $user->rights->propal->lire) + if (! empty($conf->propal->enabled) && $user->rights->propal->lire) { $sql = "SELECT p.fk_statut, sum(p.total) as Mnttot, count(*) as nb"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."propal as p"; diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index af20aaf1a03..92c38a2d408 100755 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -483,7 +483,7 @@ class ExtraFields else if ($type == 'text') { require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor=new DolEditor('options_'.$key,$value,'',200,'dolibarr_notes','In',false,false,$conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_SOCIETE,5,100); + $doleditor=new DolEditor('options_'.$key,$value,'',200,'dolibarr_notes','In',false,false,! empty($conf->fckeditor->enabled) && $conf->global->FCKEDITOR_ENABLE_SOCIETE,5,100); $out=$doleditor->Create(1); } // Add comments diff --git a/htdocs/core/class/html.formbarcode.class.php b/htdocs/core/class/html.formbarcode.class.php index 5a9ab8b6ee8..86ef77b3536 100644 --- a/htdocs/core/class/html.formbarcode.class.php +++ b/htdocs/core/class/html.formbarcode.class.php @@ -74,8 +74,8 @@ class FormBarCode } // We check if barcode is already selected by default - if ((($conf->product->enabled || $conf->service->enabled) && $conf->global->PRODUIT_DEFAULT_BARCODE_TYPE == $code_id) || - ($conf->societe->enabled && $conf->global->GENBARCODE_BARCODETYPE_THIRDPARTY == $code_id)) + if (((! empty($conf->product->enabled) || ! empty($conf->service->enabled)) && $conf->global->PRODUIT_DEFAULT_BARCODE_TYPE == $code_id) || + (! empty($conf->societe->enabled) && $conf->global->GENBARCODE_BARCODETYPE_THIRDPARTY == $code_id)) { $disable = 'disabled="disabled"'; } diff --git a/htdocs/core/class/html.formcompany.class.php b/htdocs/core/class/html.formcompany.class.php index b848d6b2759..f4eca4bc09b 100644 --- a/htdocs/core/class/html.formcompany.class.php +++ b/htdocs/core/class/html.formcompany.class.php @@ -521,7 +521,7 @@ class FormCompany $sql = "SELECT s.rowid, s.nom FROM"; $sql.= " ".MAIN_DB_PREFIX."societe as s"; $sql.= " WHERE s.entity IN (".getEntity('societe', 1).")"; - if ($selected && $conf->use_javascript_ajax && $conf->global->COMPANY_USE_SEARCH_TO_SELECT) $sql.= " AND rowid = ".$selected; + if ($selected && $conf->use_javascript_ajax && ! empty($conf->global->COMPANY_USE_SEARCH_TO_SELECT)) $sql.= " AND rowid = ".$selected; else { // For ajax search we limit here. For combo list, we limit later @@ -536,7 +536,7 @@ class FormCompany $resql = $this->db->query($sql); if ($resql) { - if ($conf->use_javascript_ajax && $conf->global->COMPANY_USE_SEARCH_TO_SELECT) + if ($conf->use_javascript_ajax && ! empty($conf->global->COMPANY_USE_SEARCH_TO_SELECT)) { $minLength = (is_numeric($conf->global->COMPANY_USE_SEARCH_TO_SELECT)?$conf->global->COMPANY_USE_SEARCH_TO_SELECT:2); diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index df775c55cd7..174b76231da 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -567,7 +567,7 @@ class FormMail elseif (! is_numeric($this->withbody)) { $defaultmessage=$this->withbody; } // Complete substitution array - if ($conf->paypal->enabled && $conf->global->PAYPAL_ADD_PAYMENT_URL) + if (! empty($conf->paypal->enabled) && ! empty($conf->global->PAYPAL_ADD_PAYMENT_URL)) { require_once DOL_DOCUMENT_ROOT.'/paypal/lib/paypal.lib.php'; diff --git a/htdocs/core/lib/agenda.lib.php b/htdocs/core/lib/agenda.lib.php index 1e8003d22fb..990fee14ae9 100644 --- a/htdocs/core/lib/agenda.lib.php +++ b/htdocs/core/lib/agenda.lib.php @@ -47,7 +47,7 @@ function print_actions_filter($form,$canedit,$status,$year,$month,$day,$showbirt global $conf,$langs,$db; // Filters - if ($canedit || $conf->projet->enabled) + if ($canedit || ! empty($conf->projet->enabled)) { print '