Fix: strict mode tornado
This commit is contained in:
parent
e19f8c54f1
commit
43c0a03758
@ -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<!-- Form add subscription -->\n";
|
||||
|
||||
@ -873,7 +873,7 @@ if ($rowid)
|
||||
print dol_print_date(($datefrom?$datefrom:time()),"%Y").'" ></td></tr>';
|
||||
|
||||
// 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 '<input type="radio" class="moreaction" id="bankdirect" name="paymentsave" value="bankdirect"'.($bankdirect?' checked="checked"':'');
|
||||
print '> '.$langs->trans("MoreActionBankDirect").'<br>';
|
||||
}
|
||||
if ($conf->societe->enabled && $conf->facture->enabled)
|
||||
if (! empty($conf->societe->enabled) && ! empty($conf->facture->enabled))
|
||||
{
|
||||
print '<input type="radio" class="moreaction" id="invoiceonly" name="paymentsave" value="invoiceonly"'.($invoiceonly?' checked="checked"':'');
|
||||
if (empty($object->fk_soc) || empty($bankviainvoice)) print ' disabled="disabled"';
|
||||
@ -909,7 +909,7 @@ if ($rowid)
|
||||
}
|
||||
print '<br>';
|
||||
}
|
||||
if ($conf->banque->enabled && $conf->societe->enabled && $conf->facture->enabled)
|
||||
if (! empty($conf->banque->enabled) && ! empty($conf->societe->enabled) && ! empty($conf->facture->enabled))
|
||||
{
|
||||
print '<input type="radio" class="moreaction" id="bankviainvoice" name="paymentsave" value="bankviainvoice"'.($bankviainvoice?' checked="checked"':'');
|
||||
if (empty($object->fk_soc) || empty($bankviainvoice)) print ' disabled="disabled"';
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
@ -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 "<form method=\"post\" action=\"cotisations.php\">";
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
@ -193,7 +193,7 @@ if ($result)
|
||||
print '<td align="right">'.price($objp->cotisation).'</td>';
|
||||
|
||||
print "</tr>";
|
||||
if ($allowinsertbankafter && ! $objp->fk_account && $conf->banque->enabled && $objp->cotisation)
|
||||
if ($allowinsertbankafter && ! $objp->fk_account && ! empty($conf->banque->enabled) && $objp->cotisation)
|
||||
{
|
||||
print "</form>\n";
|
||||
}
|
||||
|
||||
@ -1532,7 +1532,7 @@ if ($rowid && $action != 'edit')
|
||||
}
|
||||
|
||||
// Create third party
|
||||
if ($conf->societe->enabled && ! $object->fk_soc)
|
||||
if (! empty($conf->societe->enabled) && ! $object->fk_soc)
|
||||
{
|
||||
if ($user->rights->societe->creer)
|
||||
{
|
||||
@ -1570,7 +1570,7 @@ if ($rowid && $action != 'edit')
|
||||
}
|
||||
|
||||
// Action SPIP
|
||||
if ($conf->mailmanspip->enabled && $conf->global->ADHERENT_USE_SPIP)
|
||||
if (! empty($conf->mailmanspip->enabled) && ! empty($conf->global->ADHERENT_USE_SPIP))
|
||||
{
|
||||
$isinspip = $mailmanspip->is_in_spip($object);
|
||||
|
||||
|
||||
@ -290,7 +290,7 @@ if ($rowid && $action != 'edit')
|
||||
//$formquestion=array();
|
||||
//$formquestion['text']='<b>'.$langs->trans("ThisWillAlsoDeleteBankRecord").'</b>';
|
||||
$text=$langs->trans("ConfirmDeleteSubscription");
|
||||
if ($conf->banque->enabled && $conf->global->ADHERENT_BANK_USE) $text.='<br>'.img_warning().' '.$langs->trans("ThisWillAlsoDeleteBankRecord");
|
||||
if (! empty($conf->banque->enabled) && ! empty($conf->global->ADHERENT_BANK_USE)) $text.='<br>'.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 '<br>';
|
||||
}
|
||||
|
||||
@ -69,7 +69,7 @@ foreach($modules as $const => $desc)
|
||||
{
|
||||
dolibarr_set_const($db, "FCKEDITOR_ENABLE_".$const, "1",'chaine',0,'',$conf->entity);
|
||||
// Si fckeditor est active dans la description produit/service, on l'active dans les formulaires
|
||||
if ($const == 'PRODUCTDESC' && $conf->global->PRODUIT_DESC_IN_FORM)
|
||||
if ($const == 'PRODUCTDESC' && ! empty($conf->global->PRODUIT_DESC_IN_FORM))
|
||||
{
|
||||
dolibarr_set_const($db, "FCKEDITOR_ENABLE_DETAILS", "1",'chaine',0,'',$conf->entity);
|
||||
}
|
||||
|
||||
@ -269,7 +269,7 @@ if (function_exists("ldap_connect"))
|
||||
print '<font class="ok">'.$langs->trans("LDAPTCPConnectOK",$conf->global->LDAP_SERVER_HOST,$conf->global->LDAP_SERVER_PORT).'</font>';
|
||||
print '<br>';
|
||||
|
||||
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)
|
||||
{
|
||||
|
||||
@ -66,7 +66,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
|
||||
|
||||
// Security check
|
||||
if (! $conf->clicktodial->enabled)
|
||||
if (empty($conf->clicktodial->enabled))
|
||||
{
|
||||
accessforbidden();
|
||||
exit;
|
||||
|
||||
@ -30,9 +30,9 @@ if ( $_GET['filtre'] ) {
|
||||
$ret=array(); $i=0;
|
||||
|
||||
$sql = "SELECT p.rowid, p.ref, p.label, p.tva_tx, p.fk_product_type";
|
||||
if ($conf->stock->enabled && !empty($conf_fkentrepot)) $sql.= ", ps.reel";
|
||||
if (! empty($conf->stock->enabled) && !empty($conf_fkentrepot)) $sql.= ", ps.reel";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."product as p";
|
||||
if ($conf->stock->enabled && !empty($conf_fkentrepot)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_stock as ps ON p.rowid = ps.fk_product AND ps.fk_entrepot = '".$conf_fkentrepot."'";
|
||||
if (! empty($conf->stock->enabled) && !empty($conf_fkentrepot)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_stock as ps ON p.rowid = ps.fk_product AND ps.fk_entrepot = '".$conf_fkentrepot."'";
|
||||
$sql.= " WHERE p.entity IN (".getEntity('product', 1).")";
|
||||
$sql.= " AND p.tosell = 1";
|
||||
if(!$conf->global->CASHDESK_SERVICES) $sql.= " AND p.fk_product_type = 0";
|
||||
@ -67,9 +67,9 @@ if ( $_GET['filtre'] ) {
|
||||
$i=0;
|
||||
|
||||
$sql = "SELECT p.rowid, ref, label, tva_tx, p.fk_product_type";
|
||||
if ($conf->stock->enabled && !empty($conf_fkentrepot)) $sql.= ", ps.reel";
|
||||
if (! empty($conf->stock->enabled) && !empty($conf_fkentrepot)) $sql.= ", ps.reel";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."product as p";
|
||||
if ($conf->stock->enabled && !empty($conf_fkentrepot)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_stock as ps ON p.rowid = ps.fk_product AND ps.fk_entrepot = '".$conf_fkentrepot."'";
|
||||
if (! empty($conf->stock->enabled) && !empty($conf_fkentrepot)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_stock as ps ON p.rowid = ps.fk_product AND ps.fk_entrepot = '".$conf_fkentrepot."'";
|
||||
$sql.= " WHERE p.entity IN (".getEntity('product', 1).")";
|
||||
$sql.= " AND p.tosell = 1";
|
||||
if(!$conf->global->CASHDESK_SERVICES) $sql.= " AND p.fk_product_type = 0";
|
||||
|
||||
@ -44,9 +44,9 @@ header("Content-type: text/html; charset=".$conf->file->character_set_client);
|
||||
if (dol_strlen($_GET["code"]) >= 0) // If search criteria is on char length at least
|
||||
{
|
||||
$sql = "SELECT p.rowid, p.ref, p.label, p.tva_tx";
|
||||
if ($conf->stock->enabled && !empty($conf_fkentrepot)) $sql.= ", ps.reel";
|
||||
if (! empty($conf->stock->enabled) && !empty($conf_fkentrepot)) $sql.= ", ps.reel";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."product as p";
|
||||
if ($conf->stock->enabled && !empty($conf_fkentrepot)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_stock as ps ON p.rowid = ps.fk_product AND ps.fk_entrepot = '".$conf_fkentrepot."'";
|
||||
if (! empty($conf->stock->enabled) && !empty($conf_fkentrepot)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_stock as ps ON p.rowid = ps.fk_product AND ps.fk_entrepot = '".$conf_fkentrepot."'";
|
||||
$sql.= " WHERE p.entity IN (".getEntity('product', 1).")";
|
||||
$sql.= " AND p.tosell = 1";
|
||||
$sql.= " AND p.fk_product_type = 0";
|
||||
|
||||
@ -32,9 +32,9 @@ switch ( $_GET['action'] )
|
||||
if ( $_POST['hdnSource'] != 'NULL' )
|
||||
{
|
||||
$sql = "SELECT p.rowid, p.ref, p.price, p.tva_tx";
|
||||
if ($conf->stock->enabled && !empty($conf_fkentrepot)) $sql.= ", ps.reel";
|
||||
if (! empty($conf->stock->enabled) && !empty($conf_fkentrepot)) $sql.= ", ps.reel";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."product as p";
|
||||
if ($conf->stock->enabled && !empty($conf_fkentrepot)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_stock as ps ON p.rowid = ps.fk_product AND ps.fk_entrepot = ".$conf_fkentrepot;
|
||||
if (! empty($conf->stock->enabled) && !empty($conf_fkentrepot)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_stock as ps ON p.rowid = ps.fk_product AND ps.fk_entrepot = ".$conf_fkentrepot;
|
||||
$sql.= " WHERE p.entity IN (".getEntity('product', 1).")";
|
||||
|
||||
// Recuperation des donnees en fonction de la source (liste deroulante ou champ texte) ...
|
||||
|
||||
@ -49,14 +49,14 @@ if (! ($thirdpartyid > 0))
|
||||
}
|
||||
|
||||
// If we setup stock module to ask movement on invoices, we must not allow access if required setup not finished.
|
||||
if ($conf->stock->enabled && $conf->global->STOCK_CALCULATE_ON_BILL && ! ($warehouseid > 0))
|
||||
if (! empty($conf->stock->enabled) && $conf->global->STOCK_CALCULATE_ON_BILL && ! ($warehouseid > 0))
|
||||
{
|
||||
$retour=$langs->trans("CashDeskSetupStock");
|
||||
header('Location: '.DOL_URL_ROOT.'/cashdesk/index.php?err='.urlencode($retour).'&user='.$username.'&socid='.$thirdpartyid.'&warehouseid='.$warehouseid);
|
||||
exit;
|
||||
}
|
||||
|
||||
if (! empty($_POST['txtUsername']) && $conf->banque->enabled && (empty($conf_fkaccount_cash) || empty($conf_fkaccount_cheque) || empty($conf_fkaccount_cb)))
|
||||
if (! empty($_POST['txtUsername']) && ! empty($conf->banque->enabled) && (empty($conf_fkaccount_cash) || empty($conf_fkaccount_cheque) || empty($conf_fkaccount_cb)))
|
||||
{
|
||||
$langs->load("errors");
|
||||
$retour=$langs->trans("ErrorModuleSetupNotComplete");
|
||||
|
||||
@ -74,7 +74,7 @@ $langs->load("cashdesk");
|
||||
$label = $tab_designations[$i]['label'];
|
||||
|
||||
print '<option '.$selected.' value="'.$tab_designations[$i]['rowid'].'">'.dol_trunc($tab_designations[$i]['ref'],7).' - '.dol_trunc($label,35,'middle');
|
||||
if ($conf->stock->enabled && !empty($conf_fkentrepot) && $tab_designations[$i]['fk_product_type']==0) print ' ('.$langs->trans("CashDeskStock").': '.$tab_designations[$i]['reel'].')';
|
||||
if (! empty($conf->stock->enabled) && !empty($conf_fkentrepot) && $tab_designations[$i]['fk_product_type']==0) print ' ('.$langs->trans("CashDeskStock").': '.$tab_designations[$i]['reel'].')';
|
||||
print '</option>'."\n ";
|
||||
|
||||
}
|
||||
@ -92,7 +92,7 @@ $langs->load("cashdesk");
|
||||
$label = $tab_designations[$i]['label'];
|
||||
|
||||
print '<option '.$selected.' value="'.$tab_designations[$i]['rowid'].'">'.dol_trunc($tab_designations[$i]['ref'],7).' - '.dol_trunc($label,35,'middle');
|
||||
if ($conf->stock->enabled && !empty($conf_fkentrepot) && $tab_designations[$i]['fk_product_type']==0) print ' ('.$langs->trans("CashDeskStock").': '.(empty($tab_designations[$i]['reel'])?0:$tab_designations[$i]['reel']).')';
|
||||
if (! empty($conf->stock->enabled) && !empty($conf_fkentrepot) && $tab_designations[$i]['fk_product_type']==0) print ' ('.$langs->trans("CashDeskStock").': '.(empty($tab_designations[$i]['reel'])?0:$tab_designations[$i]['reel']).')';
|
||||
print '</option>'."\n ";
|
||||
|
||||
}
|
||||
|
||||
@ -48,7 +48,7 @@ if (!empty($conf->global->CASHDESK_ID_BANKACCOUNT_CHEQUE))
|
||||
$bankcheque->fetch($conf->global->CASHDESK_ID_BANKACCOUNT_CHEQUE);
|
||||
$bankchequeLink = $bankcheque->getNomUrl(1);
|
||||
}
|
||||
if (!empty($_SESSION["CASHDESK_ID_WAREHOUSE"]) && $conf->stock->enabled)
|
||||
if (!empty($_SESSION["CASHDESK_ID_WAREHOUSE"]) && ! empty($conf->stock->enabled))
|
||||
{
|
||||
$warehouse=new Entrepot($db);
|
||||
$warehouse->fetch($_SESSION["CASHDESK_ID_WAREHOUSE"]);
|
||||
@ -72,7 +72,7 @@ print $langs->trans("CashDeskThirdParty").': '.$companyLink.'<br>';
|
||||
/*print $langs->trans("CashDeskBankCash").': '.$bankcashLink.'<br>';
|
||||
print $langs->trans("CashDeskBankCB").': '.$bankcbLink.'<br>';
|
||||
print $langs->trans("CashDeskBankCheque").': '.$bankchequeLink.'<br>';*/
|
||||
if (!empty($_SESSION["CASHDESK_ID_WAREHOUSE"]) && $conf->stock->enabled)
|
||||
if (!empty($_SESSION["CASHDESK_ID_WAREHOUSE"]) && ! empty($conf->stock->enabled))
|
||||
{
|
||||
print $langs->trans("CashDeskWarehouse").': '.$warehouseLink;
|
||||
}
|
||||
|
||||
@ -129,7 +129,7 @@ if ($object->id)
|
||||
print '</td></tr>';
|
||||
|
||||
// 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)
|
||||
{
|
||||
|
||||
@ -303,7 +303,7 @@ if ($action == 'create')
|
||||
if (! empty($conf->global->PRODUCT_SHOW_WHEN_CREATE))
|
||||
{
|
||||
print '<tr><td colspan="3">';
|
||||
if ($conf->product->enabled || $conf->service->enabled)
|
||||
if (! empty($conf->product->enabled) || ! empty($conf->service->enabled))
|
||||
{
|
||||
$lib=$langs->trans("ProductsAndServices");
|
||||
|
||||
|
||||
@ -410,7 +410,7 @@ if ($id > 0)
|
||||
/*
|
||||
* Last proposals
|
||||
*/
|
||||
if ($conf->propal->enabled && $user->rights->propal->lire)
|
||||
if (! empty($conf->propal->enabled) && $user->rights->propal->lire)
|
||||
{
|
||||
$propal_static = new Propal($db);
|
||||
|
||||
@ -472,7 +472,7 @@ if ($id > 0)
|
||||
/*
|
||||
* Last orders
|
||||
*/
|
||||
if ($conf->commande->enabled && $user->rights->commande->lire)
|
||||
if (! empty($conf->commande->enabled) && $user->rights->commande->lire)
|
||||
{
|
||||
$commande_static=new Commande($db);
|
||||
|
||||
@ -527,7 +527,7 @@ if ($id > 0)
|
||||
/*
|
||||
* Last linked contracts
|
||||
*/
|
||||
if ($conf->contrat->enabled && $user->rights->contrat->lire)
|
||||
if (! empty($conf->contrat->enabled) && $user->rights->contrat->lire)
|
||||
{
|
||||
$contratstatic=new Contrat($db);
|
||||
|
||||
@ -587,7 +587,7 @@ if ($id > 0)
|
||||
/*
|
||||
* Last interventions
|
||||
*/
|
||||
if ($conf->ficheinter->enabled && $user->rights->ficheinter->lire)
|
||||
if (! empty($conf->ficheinter->enabled) && $user->rights->ficheinter->lire)
|
||||
{
|
||||
$sql = "SELECT s.nom, s.rowid, f.rowid as id, f.ref, f.fk_statut, f.duree as duration, f.datei as startdate";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."fichinter as f";
|
||||
@ -642,7 +642,7 @@ if ($id > 0)
|
||||
/*
|
||||
* Last invoices
|
||||
*/
|
||||
if ($conf->facture->enabled && $user->rights->facture->lire)
|
||||
if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
|
||||
{
|
||||
$facturestatic = new Facture($db);
|
||||
|
||||
@ -723,13 +723,13 @@ if ($id > 0)
|
||||
*/
|
||||
print '<div class="tabsAction">';
|
||||
|
||||
if ($conf->propal->enabled && $user->rights->propal->creer)
|
||||
if (! empty($conf->propal->enabled) && $user->rights->propal->creer)
|
||||
{
|
||||
$langs->load("propal");
|
||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/comm/addpropal.php?socid='.$object->id.'&action=create">'.$langs->trans("AddProp").'</a>';
|
||||
}
|
||||
|
||||
if ($conf->commande->enabled && $user->rights->commande->creer)
|
||||
if (! empty($conf->commande->enabled) && $user->rights->commande->creer)
|
||||
{
|
||||
$langs->load("orders");
|
||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/commande/fiche.php?socid='.$object->id.'&action=create">'.$langs->trans("AddOrder").'</a>';
|
||||
@ -741,7 +741,7 @@ if ($id > 0)
|
||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/contrat/fiche.php?socid='.$object->id.'&action=create">'.$langs->trans("AddContract").'</a>';
|
||||
}
|
||||
|
||||
if ($conf->ficheinter->enabled && $user->rights->ficheinter->creer)
|
||||
if (! empty($conf->ficheinter->enabled) && $user->rights->ficheinter->creer)
|
||||
{
|
||||
$langs->load("fichinter");
|
||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/fichinter/fiche.php?socid='.$object->id.'&action=create">'.$langs->trans("AddIntervention").'</a>';
|
||||
@ -772,7 +772,7 @@ if ($id > 0)
|
||||
}
|
||||
|
||||
// Add action
|
||||
if ($conf->agenda->enabled && ! empty($conf->global->MAIN_REPEATTASKONEACHTAB))
|
||||
if (! empty($conf->agenda->enabled) && ! empty($conf->global->MAIN_REPEATTASKONEACHTAB))
|
||||
{
|
||||
if ($user->rights->agenda->myactions->create)
|
||||
{
|
||||
|
||||
@ -89,15 +89,15 @@ print_fiche_titre($langs->trans("CustomerArea"));
|
||||
print '<table border="0" width="100%" class="notopnoleftnoright">';
|
||||
|
||||
print '<tr>';
|
||||
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 '<td valign="top" width="30%" class="notopnoleft">';
|
||||
}
|
||||
|
||||
// Recherche Propal
|
||||
if ($conf->propal->enabled && $user->rights->propal->lire)
|
||||
if (! empty($conf->propal->enabled) && $user->rights->propal->lire)
|
||||
{
|
||||
$var=false;
|
||||
print '<form method="post" action="'.DOL_URL_ROOT.'/comm/propal/list.php">';
|
||||
@ -116,7 +116,7 @@ if ($conf->propal->enabled && $user->rights->propal->lire)
|
||||
/*
|
||||
* Recherche Contrat
|
||||
*/
|
||||
if ($conf->contrat->enabled && $user->rights->contrat->lire)
|
||||
if (! empty($conf->contrat->enabled) && $user->rights->contrat->lire)
|
||||
{
|
||||
$var=false;
|
||||
print '<form method="post" action="'.DOL_URL_ROOT.'/contrat/liste.php">';
|
||||
@ -135,7 +135,7 @@ if ($conf->contrat->enabled && $user->rights->contrat->lire)
|
||||
/*
|
||||
* Draft proposals
|
||||
*/
|
||||
if ($conf->propal->enabled && $user->rights->propal->lire)
|
||||
if (! empty($conf->propal->enabled) && $user->rights->propal->lire)
|
||||
{
|
||||
$sql = "SELECT p.rowid, p.ref, p.total_ht, s.rowid as socid, s.nom as name, s.client, s.canvas";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."propal as p";
|
||||
@ -200,7 +200,7 @@ if ($conf->propal->enabled && $user->rights->propal->lire)
|
||||
/*
|
||||
* Draft orders
|
||||
*/
|
||||
if ($conf->commande->enabled && $user->rights->commande->lire)
|
||||
if (! empty($conf->commande->enabled) && $user->rights->commande->lire)
|
||||
{
|
||||
$langs->load("orders");
|
||||
|
||||
@ -255,9 +255,9 @@ if ($conf->commande->enabled && $user->rights->commande->lire)
|
||||
}
|
||||
}
|
||||
|
||||
if (($conf->propal->enabled && $user->rights->propale->lire) ||
|
||||
($conf->contrat->enabled && $user->rights->contrat->lire) ||
|
||||
($conf->commande->enabled && $user->rights->commande->lire))
|
||||
if ((! empty($conf->propal->enabled) && $user->rights->propale->lire) ||
|
||||
(! empty($conf->contrat->enabled) && $user->rights->contrat->lire) ||
|
||||
(! empty($conf->commande->enabled) && $user->rights->commande->lire))
|
||||
{
|
||||
print '</td>';
|
||||
print '<td valign="top" width="70%" class="notopnoleftnoright">';
|
||||
@ -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");
|
||||
|
||||
|
||||
@ -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 '<a class="butAction" href="'.DOL_URL_ROOT.'/compta/facture.php?action=create&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->socid.'">'.$langs->trans("AddBill").'</a>';
|
||||
}
|
||||
|
||||
@ -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 '<div class="tabsAction">';
|
||||
|
||||
if ($conf->propal->enabled && $user->rights->propale->creer)
|
||||
if (! empty($conf->propal->enabled) && $user->rights->propale->creer)
|
||||
{
|
||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/comm/addpropal.php?socid='.$object->id.'&action=create">'.$langs->trans("AddProp").'</a>';
|
||||
}
|
||||
|
||||
// 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)
|
||||
{
|
||||
|
||||
@ -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";
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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))
|
||||
{
|
||||
|
||||
@ -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'";
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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");
|
||||
|
||||
@ -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 '<form method="post" action="'.DOL_URL_ROOT.'/compta/facture/list.php">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
@ -125,7 +125,7 @@ if ($conf->facture->enabled && $user->rights->facture->lire)
|
||||
/*
|
||||
* Search supplier invoices
|
||||
*/
|
||||
if ($conf->fournisseur->enabled && $user->rights->fournisseur->lire)
|
||||
if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->lire)
|
||||
{
|
||||
print '<form method="post" action="'.DOL_URL_ROOT.'/fourn/facture/index.php">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
@ -142,7 +142,7 @@ if ($conf->fournisseur->enabled && $user->rights->fournisseur->lire)
|
||||
/*
|
||||
* Search donations
|
||||
*/
|
||||
if ($conf->don->enabled && $user->rights->don->lire)
|
||||
if (! empty($conf->don->enabled) && $user->rights->don->lire)
|
||||
{
|
||||
print '<form method="post" action="'.DOL_URL_ROOT.'/compta/dons/liste.php">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
@ -159,7 +159,7 @@ if ($conf->don->enabled && $user->rights->don->lire)
|
||||
/*
|
||||
* Search expenses
|
||||
*/
|
||||
if ($conf->deplacement->enabled && $user->rights->deplacement->lire)
|
||||
if (! empty($conf->deplacement->enabled) && $user->rights->deplacement->lire)
|
||||
{
|
||||
print '<form method="post" action="'.DOL_URL_ROOT.'/compta/deplacement/list.php">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
@ -176,7 +176,7 @@ if ($conf->deplacement->enabled && $user->rights->deplacement->lire)
|
||||
/**
|
||||
* Draft customers invoices
|
||||
*/
|
||||
if ($conf->facture->enabled && $user->rights->facture->lire)
|
||||
if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
|
||||
{
|
||||
$sql = "SELECT f.facnumber, f.rowid, f.total_ttc, f.type,";
|
||||
$sql.= " s.nom, s.rowid as socid";
|
||||
@ -250,7 +250,7 @@ if ($conf->facture->enabled && $user->rights->facture->lire)
|
||||
/**
|
||||
* Draft suppliers invoices
|
||||
*/
|
||||
if ($conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire)
|
||||
if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture->lire)
|
||||
{
|
||||
$sql = "SELECT f.facnumber, f.rowid, f.total_ttc, f.type,";
|
||||
$sql.= " s.nom, s.rowid as socid";
|
||||
@ -419,7 +419,7 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
|
||||
|
||||
|
||||
// Last modified supplier invoices
|
||||
if ($conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire)
|
||||
if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture->lire)
|
||||
{
|
||||
$langs->load("boxes");
|
||||
$facstatic=new FactureFournisseur($db);
|
||||
@ -498,7 +498,7 @@ if ($conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire)
|
||||
|
||||
|
||||
// Last donations
|
||||
if ($conf->don->enabled && $user->rights->societe->lire)
|
||||
if (! empty($conf->don->enabled) && $user->rights->societe->lire)
|
||||
{
|
||||
include_once DOL_DOCUMENT_ROOT.'/compta/dons/class/don.class.php';
|
||||
|
||||
@ -633,7 +633,7 @@ if (! empty($conf->deplacement->enabled) && $user->rights->deplacement->lire)
|
||||
/**
|
||||
* Social contributions to pay
|
||||
*/
|
||||
if ($conf->tax->enabled && $user->rights->tax->charges->lire)
|
||||
if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire)
|
||||
{
|
||||
if (!$socid)
|
||||
{
|
||||
@ -918,7 +918,7 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
|
||||
/*
|
||||
* Unpayed supplier invoices
|
||||
*/
|
||||
if ($conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire)
|
||||
if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture->lire)
|
||||
{
|
||||
$facstatic=new FactureFournisseur($db);
|
||||
|
||||
|
||||
@ -464,12 +464,12 @@ class Localtax extends CommonObject
|
||||
$this->error=$langs->trans("ErrorFieldRequired",$langs->transnoentities("Amount"));
|
||||
return -4;
|
||||
}
|
||||
if ($conf->banque->enabled && (empty($this->accountid) || $this->accountid <= 0))
|
||||
if (! empty($conf->banque->enabled) && (empty($this->accountid) || $this->accountid <= 0))
|
||||
{
|
||||
$this->error=$langs->trans("ErrorFieldRequired",$langs->transnoentities("Account"));
|
||||
return -5;
|
||||
}
|
||||
if ($conf->banque->enabled && (empty($this->paymenttype) || $this->paymenttype <= 0))
|
||||
if (! empty($conf->banque->enabled) && (empty($this->paymenttype) || $this->paymenttype <= 0))
|
||||
{
|
||||
$this->error=$langs->trans("ErrorFieldRequired",$langs->transnoentities("PaymentMode"));
|
||||
return -5;
|
||||
|
||||
@ -245,7 +245,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
|
||||
|
||||
// Invoice with Paypal transaction
|
||||
// TODO add hook possibility (regis)
|
||||
if ($conf->paypalplus->enabled && $conf->global->PAYPAL_ENABLE_TRANSACTION_MANAGEMENT && ! empty($facture->ref_int))
|
||||
if (! empty($conf->paypalplus->enabled) && $conf->global->PAYPAL_ENABLE_TRANSACTION_MANAGEMENT && ! empty($facture->ref_int))
|
||||
{
|
||||
if (! empty($conf->global->PAYPAL_BANK_ACCOUNT)) $accountid=$conf->global->PAYPAL_BANK_ACCOUNT;
|
||||
$paymentnum=$facture->ref_int;
|
||||
|
||||
@ -66,7 +66,7 @@ if ($_POST["action"] == 'add_payment')
|
||||
$mesg = $langs->trans("ErrorFieldRequired",$langs->transnoentities("Date"));
|
||||
$error++;
|
||||
}
|
||||
if ($conf->banque->enabled && ! $_POST["accountid"] > 0)
|
||||
if (! empty($conf->banque->enabled) && ! $_POST["accountid"] > 0)
|
||||
{
|
||||
$mesg = $langs->trans("ErrorFieldRequired",$langs->transnoentities("AccountToCredit"));
|
||||
$error++;
|
||||
|
||||
@ -79,7 +79,7 @@ if ($socid > 0)
|
||||
|
||||
print '</div>';
|
||||
|
||||
if ($conf->facture->enabled && $user->rights->facture->lire)
|
||||
if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
|
||||
{
|
||||
// Factures
|
||||
print_fiche_titre($langs->trans("CustomerPreview"));
|
||||
|
||||
@ -282,9 +282,9 @@ if (count($amount))
|
||||
|
||||
// Other stats
|
||||
print '<td align="center">';
|
||||
if ($conf->propal->enabled && $key>0) print ' <a href="'.DOL_URL_ROOT.'/comm/propal/stats/index.php?userid='.$key.'">'.img_picto($langs->trans("ProposalStats"),"stats").'</a> ';
|
||||
if ($conf->commande->enabled && $key>0) print ' <a href="'.DOL_URL_ROOT.'/commande/stats/index.php?userid='.$key.'">'.img_picto($langs->trans("OrderStats"),"stats").'</a> ';
|
||||
if ($conf->facture->enabled && $key>0) print ' <a href="'.DOL_URL_ROOT.'/compta/facture/stats/index.php?userid='.$key.'">'.img_picto($langs->trans("InvoiceStats"),"stats").'</a> ';
|
||||
if (! empty($conf->propal->enabled) && $key>0) print ' <a href="'.DOL_URL_ROOT.'/comm/propal/stats/index.php?userid='.$key.'">'.img_picto($langs->trans("ProposalStats"),"stats").'</a> ';
|
||||
if (! empty($conf->commande->enabled) && $key>0) print ' <a href="'.DOL_URL_ROOT.'/commande/stats/index.php?userid='.$key.'">'.img_picto($langs->trans("OrderStats"),"stats").'</a> ';
|
||||
if (! empty($conf->facture->enabled) && $key>0) print ' <a href="'.DOL_URL_ROOT.'/compta/facture/stats/index.php?userid='.$key.'">'.img_picto($langs->trans("InvoiceStats"),"stats").'</a> ';
|
||||
print '</td>';
|
||||
|
||||
print "</tr>\n";
|
||||
|
||||
@ -292,9 +292,9 @@ if (count($amount))
|
||||
|
||||
// Other stats
|
||||
print '<td align="center">';
|
||||
if ($conf->propal->enabled && $key>0) print ' <a href="'.DOL_URL_ROOT.'/comm/propal/stats/index.php?socid='.$key.'">'.img_picto($langs->trans("ProposalStats"),"stats").'</a> ';
|
||||
if ($conf->commande->enabled && $key>0) print ' <a href="'.DOL_URL_ROOT.'/commande/stats/index.php?socid='.$key.'">'.img_picto($langs->trans("OrderStats"),"stats").'</a> ';
|
||||
if ($conf->facture->enabled && $key>0) print ' <a href="'.DOL_URL_ROOT.'/compta/facture/stats/index.php?socid='.$key.'">'.img_picto($langs->trans("InvoiceStats"),"stats").'</a> ';
|
||||
if (! empty($conf->propal->enabled) && $key>0) print ' <a href="'.DOL_URL_ROOT.'/comm/propal/stats/index.php?socid='.$key.'">'.img_picto($langs->trans("ProposalStats"),"stats").'</a> ';
|
||||
if (! empty($conf->commande->enabled) && $key>0) print ' <a href="'.DOL_URL_ROOT.'/commande/stats/index.php?socid='.$key.'">'.img_picto($langs->trans("OrderStats"),"stats").'</a> ';
|
||||
if (! empty($conf->facture->enabled) && $key>0) print ' <a href="'.DOL_URL_ROOT.'/compta/facture/stats/index.php?socid='.$key.'">'.img_picto($langs->trans("InvoiceStats"),"stats").'</a> ';
|
||||
print '</td>';
|
||||
|
||||
print "</tr>\n";
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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')
|
||||
{
|
||||
|
||||
@ -1359,7 +1359,7 @@ else
|
||||
else print '<a class="butActionRefused" href="#" title="'.$langs->trans("NotEnoughPermissions").'">'.$langs->trans("Validate").'</a>';
|
||||
}
|
||||
|
||||
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 '<a class="butAction" href="'.DOL_URL_ROOT.'/compta/facture.php?action=create&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->thirdparty->id.'">'.$langs->trans("CreateBill").'</a>';
|
||||
|
||||
@ -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";
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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"';
|
||||
}
|
||||
|
||||
@ -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);
|
||||
|
||||
|
||||
@ -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';
|
||||
|
||||
|
||||
@ -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 '<form name="listactionsfilter" class="listactionsfilter" action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
@ -57,7 +57,7 @@ function print_actions_filter($form,$canedit,$status,$year,$month,$day,$showbirt
|
||||
print '<input type="hidden" name="day" value="'.$day.'">';
|
||||
print '<input type="hidden" name="showbirthday" value="'.$showbirthday.'">';
|
||||
print '<table class="nobordernopadding" width="100%">';
|
||||
if ($canedit || $conf->projet->enabled)
|
||||
if ($canedit || ! empty($conf->projet->enabled))
|
||||
{
|
||||
print '<tr><td nowrap="nowrap">';
|
||||
|
||||
|
||||
@ -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='<a class="butAction" href="'.DOL_URL_ROOT.'/projet/fiche.php?socid='.$object->id.'&action=create&backtopage='.urlencode($backtopage).'">'.$langs->trans("AddProject").'</a>';
|
||||
$buttoncreate='<a class="addnewrecord" href="'.DOL_URL_ROOT.'/projet/fiche.php?socid='.$object->id.'&action=create&backtopage='.urlencode($backtopage).'">'.$langs->trans("AddProject").' '.img_picto($langs->trans("AddProject"),'filenew').'</a>'."\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 '</td>';
|
||||
|
||||
if ($conf->agenda->enabled && $user->rights->agenda->myactions->create)
|
||||
if (! empty($conf->agenda->enabled) && $user->rights->agenda->myactions->create)
|
||||
{
|
||||
print '<td align="center"><a href="'.DOL_URL_ROOT.'/comm/action/fiche.php?action=create&actioncode=AC_RDV&contactid='.$obj->rowid.'&socid='.$object->id.'&backtopage='.urlencode($backtopage).'">';
|
||||
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';
|
||||
|
||||
@ -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='<a href="'.DOL_URL_ROOT.'/comm/action/fiche.php?action=create&backtopage=1&actioncode='.$type.'&contactid='.$cid.'&socid='.$socid.'">'.img_object($langs->trans("AddAction"),"calendar").'</a>';
|
||||
@ -1236,7 +1236,7 @@ function dol_print_phone($phone,$country="FR",$cid=0,$socid=0,$addlink=0,$separ=
|
||||
$newphone.='>'.$newphonesav.'</a>';
|
||||
}
|
||||
|
||||
//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='';
|
||||
|
||||
@ -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");
|
||||
|
||||
@ -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");
|
||||
|
||||
@ -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 '</tr>';
|
||||
|
||||
// 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 '</tr>';
|
||||
}
|
||||
// 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 '</tr>';
|
||||
}
|
||||
// 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 '</tr>';
|
||||
}
|
||||
// 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 '</tr>';
|
||||
}
|
||||
// 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 '</tr>';
|
||||
}
|
||||
// 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);
|
||||
|
||||
@ -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");
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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."<br>\n";
|
||||
|
||||
@ -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);
|
||||
|
||||
|
||||
@ -70,7 +70,7 @@ $userstatic=new User($db);
|
||||
|
||||
<tr <?php echo $bc[$var]; ?>>
|
||||
<td nowrap="nowrap"><?php echo img_object('','contact').' '.$langs->trans("ThirdPartyContacts"); ?></td>
|
||||
<?php if ($conf->use_javascript_ajax && $conf->global->COMPANY_USE_SEARCH_TO_SELECT) { ?>
|
||||
<?php if ($conf->use_javascript_ajax && ! empty($conf->global->COMPANY_USE_SEARCH_TO_SELECT)) { ?>
|
||||
<td>
|
||||
<?php
|
||||
$events=array();
|
||||
|
||||
@ -57,7 +57,7 @@ if (! empty($conf->margin->enabled)) {
|
||||
<td<?php echo (! empty($conf->global->MAIN_VIEW_LINE_NUMBER) ? ' colspan="2"' : ''); ?>>
|
||||
<?php
|
||||
echo $form->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 '<br>';
|
||||
if ((! empty($conf->product->enabled) && ! empty($conf->service->enabled)) || (empty($conf->product->enabled) && empty($conf->service->enabled))) echo '<br>';
|
||||
|
||||
if (is_object($hookmanager))
|
||||
{
|
||||
@ -99,7 +99,7 @@ if (! empty($conf->margin->enabled)) {
|
||||
</tr>
|
||||
|
||||
|
||||
<?php if ($conf->service->enabled && $dateSelector) {
|
||||
<?php if (! empty($conf->service->enabled) && $dateSelector) {
|
||||
if(! empty($conf->global->MAIN_VIEW_LINE_NUMBER))
|
||||
$colspan = 10;
|
||||
else
|
||||
|
||||
@ -133,7 +133,7 @@
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php if ($conf->service->enabled && $line->product_type == 1 && $dateSelector) { ?>
|
||||
<?php if (! empty($conf->service->enabled) && $line->product_type == 1 && $dateSelector) { ?>
|
||||
<tr id="service_duration_area" <?php echo $bc[$var]; ?>>
|
||||
<td colspan="11"><?php echo $langs->trans('ServiceLimitedDuration').' '.$langs->trans('From').' '; ?>
|
||||
<?php
|
||||
|
||||
@ -110,7 +110,7 @@ class InterfaceLdapsynchro
|
||||
if ($action == 'USER_CREATE')
|
||||
{
|
||||
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();
|
||||
@ -129,7 +129,7 @@ class InterfaceLdapsynchro
|
||||
elseif ($action == 'USER_MODIFY')
|
||||
{
|
||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
||||
if ($conf->ldap->enabled && $conf->global->LDAP_SYNCHRO_ACTIVE == 'dolibarr2ldap')
|
||||
if (! empty($conf->ldap->enabled) && $conf->global->LDAP_SYNCHRO_ACTIVE == 'dolibarr2ldap')
|
||||
{
|
||||
$ldap=new Ldap();
|
||||
$ldap->connect_bind();
|
||||
@ -160,7 +160,7 @@ class InterfaceLdapsynchro
|
||||
elseif ($action == 'USER_NEW_PASSWORD')
|
||||
{
|
||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
||||
if ($conf->ldap->enabled && $conf->global->LDAP_SYNCHRO_ACTIVE == 'dolibarr2ldap')
|
||||
if (! empty($conf->ldap->enabled) && $conf->global->LDAP_SYNCHRO_ACTIVE == 'dolibarr2ldap')
|
||||
{
|
||||
$ldap=new Ldap();
|
||||
$ldap->connect_bind();
|
||||
@ -195,7 +195,7 @@ class InterfaceLdapsynchro
|
||||
elseif ($action == 'USER_DELETE')
|
||||
{
|
||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
||||
if ($conf->ldap->enabled && $conf->global->LDAP_SYNCHRO_ACTIVE == 'dolibarr2ldap')
|
||||
if (! empty($conf->ldap->enabled) && $conf->global->LDAP_SYNCHRO_ACTIVE == 'dolibarr2ldap')
|
||||
{
|
||||
$ldap=new Ldap();
|
||||
$ldap->connect_bind();
|
||||
@ -214,7 +214,7 @@ class InterfaceLdapsynchro
|
||||
elseif ($action == 'USER_SETINGROUP')
|
||||
{
|
||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
||||
if ($conf->ldap->enabled && $conf->global->LDAP_SYNCHRO_ACTIVE == 'dolibarr2ldap')
|
||||
if (! empty($conf->ldap->enabled) && $conf->global->LDAP_SYNCHRO_ACTIVE == 'dolibarr2ldap')
|
||||
{
|
||||
$ldap=new Ldap();
|
||||
$ldap->connect_bind();
|
||||
@ -252,7 +252,7 @@ class InterfaceLdapsynchro
|
||||
elseif ($action == 'USER_REMOVEFROMGROUP')
|
||||
{
|
||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
||||
if ($conf->ldap->enabled && $conf->global->LDAP_SYNCHRO_ACTIVE == 'dolibarr2ldap')
|
||||
if (! empty($conf->ldap->enabled) && $conf->global->LDAP_SYNCHRO_ACTIVE == 'dolibarr2ldap')
|
||||
{
|
||||
$ldap=new Ldap();
|
||||
$ldap->connect_bind();
|
||||
@ -291,7 +291,7 @@ class InterfaceLdapsynchro
|
||||
// Groupes
|
||||
elseif ($action == 'GROUP_CREATE')
|
||||
{
|
||||
if ($conf->ldap->enabled && $conf->global->LDAP_SYNCHRO_ACTIVE == 'dolibarr2ldap')
|
||||
if (! empty($conf->ldap->enabled) && $conf->global->LDAP_SYNCHRO_ACTIVE == 'dolibarr2ldap')
|
||||
{
|
||||
$ldap=new Ldap();
|
||||
$ldap->connect_bind();
|
||||
@ -313,7 +313,7 @@ class InterfaceLdapsynchro
|
||||
}
|
||||
elseif ($action == 'GROUP_MODIFY')
|
||||
{
|
||||
if ($conf->ldap->enabled && $conf->global->LDAP_SYNCHRO_ACTIVE == 'dolibarr2ldap')
|
||||
if (! empty($conf->ldap->enabled) && $conf->global->LDAP_SYNCHRO_ACTIVE == 'dolibarr2ldap')
|
||||
{
|
||||
$ldap=new Ldap();
|
||||
$ldap->connect_bind();
|
||||
@ -343,7 +343,7 @@ class InterfaceLdapsynchro
|
||||
}
|
||||
elseif ($action == 'GROUP_DELETE')
|
||||
{
|
||||
if ($conf->ldap->enabled && $conf->global->LDAP_SYNCHRO_ACTIVE == 'dolibarr2ldap')
|
||||
if (! empty($conf->ldap->enabled) && $conf->global->LDAP_SYNCHRO_ACTIVE == 'dolibarr2ldap')
|
||||
{
|
||||
$ldap=new Ldap();
|
||||
$ldap->connect_bind();
|
||||
@ -364,7 +364,7 @@ class InterfaceLdapsynchro
|
||||
elseif ($action == 'CONTACT_CREATE')
|
||||
{
|
||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
||||
if ($conf->ldap->enabled && $conf->global->LDAP_CONTACT_ACTIVE)
|
||||
if (! empty($conf->ldap->enabled) && ! empty($conf->global->LDAP_CONTACT_ACTIVE))
|
||||
{
|
||||
$ldap=new Ldap();
|
||||
$ldap->connect_bind();
|
||||
@ -383,7 +383,7 @@ class InterfaceLdapsynchro
|
||||
elseif ($action == 'CONTACT_MODIFY')
|
||||
{
|
||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
||||
if ($conf->ldap->enabled && $conf->global->LDAP_CONTACT_ACTIVE)
|
||||
if (! empty($conf->ldap->enabled) && ! empty($conf->global->LDAP_CONTACT_ACTIVE))
|
||||
{
|
||||
$ldap=new Ldap();
|
||||
$ldap->connect_bind();
|
||||
@ -414,7 +414,7 @@ class InterfaceLdapsynchro
|
||||
elseif ($action == 'CONTACT_DELETE')
|
||||
{
|
||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
||||
if ($conf->ldap->enabled && $conf->global->LDAP_CONTACT_ACTIVE)
|
||||
if (! empty($conf->ldap->enabled) && ! empty($conf->global->LDAP_CONTACT_ACTIVE))
|
||||
{
|
||||
$ldap=new Ldap();
|
||||
$ldap->connect_bind();
|
||||
@ -435,7 +435,7 @@ class InterfaceLdapsynchro
|
||||
elseif ($action == 'MEMBER_CREATE')
|
||||
{
|
||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
||||
if ($conf->ldap->enabled && $conf->global->LDAP_MEMBER_ACTIVE)
|
||||
if (! empty($conf->ldap->enabled) && ! empty($conf->global->LDAP_MEMBER_ACTIVE))
|
||||
{
|
||||
$ldap=new Ldap();
|
||||
$ldap->connect_bind();
|
||||
@ -454,7 +454,7 @@ class InterfaceLdapsynchro
|
||||
elseif ($action == 'MEMBER_VALIDATE')
|
||||
{
|
||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
||||
if ($conf->ldap->enabled && $conf->global->LDAP_MEMBER_ACTIVE)
|
||||
if (! empty($conf->ldap->enabled) && ! empty($conf->global->LDAP_MEMBER_ACTIVE))
|
||||
{
|
||||
// If status field is setup to be synchronized
|
||||
if (! empty($conf->global->LDAP_FIELD_MEMBER_STATUS))
|
||||
@ -478,7 +478,7 @@ class InterfaceLdapsynchro
|
||||
elseif ($action == 'MEMBER_SUBSCRIPTION')
|
||||
{
|
||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
||||
if ($conf->ldap->enabled && $conf->global->LDAP_MEMBER_ACTIVE)
|
||||
if (! empty($conf->ldap->enabled) && ! empty($conf->global->LDAP_MEMBER_ACTIVE))
|
||||
{
|
||||
// If subscriptions fields are setup to be synchronized
|
||||
if ($conf->global->LDAP_FIELD_MEMBER_FIRSTSUBSCRIPTION_DATE
|
||||
@ -506,7 +506,7 @@ class InterfaceLdapsynchro
|
||||
elseif ($action == 'MEMBER_MODIFY')
|
||||
{
|
||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
||||
if ($conf->ldap->enabled && $conf->global->LDAP_MEMBER_ACTIVE)
|
||||
if (! empty($conf->ldap->enabled) && ! empty($conf->global->LDAP_MEMBER_ACTIVE))
|
||||
{
|
||||
$ldap=new Ldap();
|
||||
$ldap->connect_bind();
|
||||
@ -537,7 +537,7 @@ class InterfaceLdapsynchro
|
||||
elseif ($action == 'MEMBER_NEW_PASSWORD')
|
||||
{
|
||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
||||
if ($conf->ldap->enabled && $conf->global->LDAP_MEMBER_ACTIVE)
|
||||
if (! empty($conf->ldap->enabled) && ! empty($conf->global->LDAP_MEMBER_ACTIVE))
|
||||
{
|
||||
// If password field is setup to be synchronized
|
||||
if ($conf->global->LDAP_FIELD_PASSWORD || $conf->global->LDAP_FIELD_PASSWORD_CRYPTED)
|
||||
@ -561,7 +561,7 @@ class InterfaceLdapsynchro
|
||||
elseif ($action == 'MEMBER_RESILIATE')
|
||||
{
|
||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
||||
if ($conf->ldap->enabled && $conf->global->LDAP_MEMBER_ACTIVE)
|
||||
if (! empty($conf->ldap->enabled) && ! empty($conf->global->LDAP_MEMBER_ACTIVE))
|
||||
{
|
||||
// If status field is setup to be synchronized
|
||||
if (! empty($conf->global->LDAP_FIELD_MEMBER_STATUS))
|
||||
@ -585,7 +585,7 @@ class InterfaceLdapsynchro
|
||||
elseif ($action == 'MEMBER_DELETE')
|
||||
{
|
||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
||||
if ($conf->ldap->enabled && $conf->global->LDAP_MEMBER_ACTIVE)
|
||||
if (! empty($conf->ldap->enabled) && ! empty($conf->global->LDAP_MEMBER_ACTIVE))
|
||||
{
|
||||
$ldap=new Ldap();
|
||||
$ldap->connect_bind();
|
||||
|
||||
@ -380,7 +380,7 @@ llxHeader($moreheadcss.$moreheadjs,$langs->trans("ECMArea"),'','','','',$morejs,
|
||||
// Add sections to manage
|
||||
$rowspan=0;
|
||||
$sectionauto=array();
|
||||
if ($conf->product->enabled || $conf->service->enabled) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'product', 'test'=>($conf->product->enabled || $conf->service->enabled), 'label'=>$langs->trans("ProductsAndServices"), 'desc'=>$langs->trans("ECMDocsByProducts")); }
|
||||
if (! empty($conf->product->enabled) || ! empty($conf->service->enabled)) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'product', 'test'=>(! empty($conf->product->enabled) || ! empty($conf->service->enabled)), 'label'=>$langs->trans("ProductsAndServices"), 'desc'=>$langs->trans("ECMDocsByProducts")); }
|
||||
if (! empty($conf->societe->enabled)) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'company', 'test'=>$conf->societe->enabled, 'label'=>$langs->trans("ThirdParties"), 'desc'=>$langs->trans("ECMDocsByThirdParties")); }
|
||||
if (! empty($conf->propal->enabled)) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'propal', 'test'=>$conf->propal->enabled, 'label'=>$langs->trans("Prop"), 'desc'=>$langs->trans("ECMDocsByProposals")); }
|
||||
if (! empty($conf->contrat->enabled)) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'contract','test'=>$conf->contrat->enabled, 'label'=>$langs->trans("Contracts"), 'desc'=>$langs->trans("ECMDocsByContracts")); }
|
||||
|
||||
@ -103,7 +103,7 @@ $userstatic = new User($db);
|
||||
// Ajout rubriques automatiques
|
||||
$rowspan=0;
|
||||
$sectionauto=array();
|
||||
if ($conf->product->enabled || $conf->service->enabled) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'product', 'test'=>$conf->product->enabled, 'label'=>$langs->trans("ProductsAndServices"), 'desc'=>$langs->trans("ECMDocsByProducts")); }
|
||||
if (! empty($conf->product->enabled) || ! empty($conf->service->enabled)) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'product', 'test'=>$conf->product->enabled, 'label'=>$langs->trans("ProductsAndServices"), 'desc'=>$langs->trans("ECMDocsByProducts")); }
|
||||
if (! empty($conf->societe->enabled)) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'company', 'test'=>$conf->societe->enabled, 'label'=>$langs->trans("ThirdParties"), 'desc'=>$langs->trans("ECMDocsByThirdParties")); }
|
||||
if (! empty($conf->propal->enabled)) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'propal', 'test'=>$conf->propal->enabled, 'label'=>$langs->trans("Prop"), 'desc'=>$langs->trans("ECMDocsByProposals")); }
|
||||
if (! empty($conf->contrat->enabled)) { $rowspan++; $sectionauto[]=array('level'=>1, 'module'=>'contract','test'=>$conf->contrat->enabled, 'label'=>$langs->trans("Contracts"), 'desc'=>$langs->trans("ECMDocsByContracts")); }
|
||||
|
||||
@ -496,7 +496,7 @@ class Expedition extends CommonObject
|
||||
}
|
||||
|
||||
// If stock increment is done on sending (recommanded choice)
|
||||
if (! $error && $conf->stock->enabled && $conf->global->STOCK_CALCULATE_ON_SHIPMENT)
|
||||
if (! $error && ! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT))
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php';
|
||||
|
||||
|
||||
@ -55,12 +55,12 @@ if ($id > 0 || ! empty($ref))
|
||||
}
|
||||
|
||||
// Linked documents
|
||||
if ($typeobject == 'commande' && $object->$typeobject->id && $conf->commande->enabled)
|
||||
if ($typeobject == 'commande' && $object->$typeobject->id && ! empty($conf->commande->enabled))
|
||||
{
|
||||
$objectsrc=new Commande($db);
|
||||
$objectsrc->fetch($object->$typeobject->id);
|
||||
}
|
||||
if ($typeobject == 'propal' && $object->$typeobject->id && $conf->propal->enabled)
|
||||
if ($typeobject == 'propal' && $object->$typeobject->id && ! empty($conf->propal->enabled))
|
||||
{
|
||||
$objectsrc=new Propal($db);
|
||||
$objectsrc->fetch($object->$typeobject->id);
|
||||
@ -178,7 +178,7 @@ if ($id > 0 || ! empty($ref))
|
||||
print "</tr>";
|
||||
|
||||
// Linked documents
|
||||
if ($typeobject == 'commande' && $object->$typeobject->id && $conf->commande->enabled)
|
||||
if ($typeobject == 'commande' && $object->$typeobject->id && ! empty($conf->commande->enabled))
|
||||
{
|
||||
print '<tr><td>';
|
||||
$objectsrc=new Commande($db);
|
||||
@ -189,7 +189,7 @@ if ($id > 0 || ! empty($ref))
|
||||
print "</td>\n";
|
||||
print '</tr>';
|
||||
}
|
||||
if ($typeobject == 'propal' && $object->$typeobject->id && $conf->propal->enabled)
|
||||
if ($typeobject == 'propal' && $object->$typeobject->id && ! empty($conf->propal->enabled))
|
||||
{
|
||||
print '<tr><td>';
|
||||
$objectsrc=new Propal($db);
|
||||
|
||||
@ -32,7 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/sendings.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/modules/expedition/modules_expedition.php';
|
||||
if ($conf->product->enabled || $conf->service->enabled) require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
||||
if (! empty($conf->product->enabled) || ! empty($conf->service->enabled)) require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
||||
if (! empty($conf->propal->enabled)) require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
|
||||
if (! empty($conf->commande->enabled)) require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
|
||||
if (! empty($conf->stock->enabled)) require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php';
|
||||
@ -601,11 +601,11 @@ if ($action == 'create')
|
||||
|
||||
// Ref
|
||||
print '<tr><td width="30%" class="fieldrequired">';
|
||||
if ($origin == 'commande' && $conf->commande->enabled)
|
||||
if ($origin == 'commande' && ! empty($conf->commande->enabled))
|
||||
{
|
||||
print $langs->trans("RefOrder").'</td><td colspan="3"><a href="'.DOL_URL_ROOT.'/commande/fiche.php?id='.$object->id.'">'.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").'</td><td colspan="3"><a href="'.DOL_URL_ROOT.'/comm/fiche.php?id='.$object->id.'">'.img_object($langs->trans("ShowProposal"),'propal').' '.$object->ref;
|
||||
}
|
||||
@ -991,7 +991,7 @@ else
|
||||
print "</tr>";
|
||||
|
||||
// Linked documents
|
||||
if ($typeobject == 'commande' && $object->$typeobject->id && $conf->commande->enabled)
|
||||
if ($typeobject == 'commande' && $object->$typeobject->id && ! empty($conf->commande->enabled))
|
||||
{
|
||||
print '<tr><td>';
|
||||
$objectsrc=new Commande($db);
|
||||
@ -1002,7 +1002,7 @@ else
|
||||
print "</td>\n";
|
||||
print '</tr>';
|
||||
}
|
||||
if ($typeobject == 'propal' && $object->$typeobject->id && $conf->propal->enabled)
|
||||
if ($typeobject == 'propal' && $object->$typeobject->id && ! empty($conf->propal->enabled))
|
||||
{
|
||||
print '<tr><td>';
|
||||
$objectsrc=new Propal($db);
|
||||
@ -1326,7 +1326,7 @@ else
|
||||
}
|
||||
|
||||
// Create bill and Close shipment
|
||||
if ($conf->facture->enabled && $object->statut > 0)
|
||||
if (! empty($conf->facture->enabled) && $object->statut > 0)
|
||||
{
|
||||
if ($user->rights->facture->creer)
|
||||
{
|
||||
|
||||
@ -511,7 +511,7 @@ if ($id > 0 || ! empty($ref))
|
||||
$product->fetch($objp->fk_product);
|
||||
}
|
||||
|
||||
if ($objp->fk_product > 0 && $type == 0 && $conf->stock->enabled)
|
||||
if ($objp->fk_product > 0 && $type == 0 && ! empty($conf->stock->enabled))
|
||||
{
|
||||
print '<td align="center">';
|
||||
print $product->stock_reel;
|
||||
@ -582,12 +582,12 @@ if ($id > 0 || ! empty($ref))
|
||||
* Boutons Actions
|
||||
*/
|
||||
|
||||
if ($user->societe_id == 0)
|
||||
if (empty($user->societe_id))
|
||||
{
|
||||
print '<div class="tabsAction">';
|
||||
|
||||
// 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)
|
||||
{
|
||||
|
||||
@ -1200,7 +1200,7 @@ else if ($id > 0 || ! empty($ref))
|
||||
}
|
||||
|
||||
// Invoicing
|
||||
if ($conf->facture->enabled && $object->statut > 0)
|
||||
if (! empty($conf->facture->enabled) && $object->statut > 0)
|
||||
{
|
||||
$langs->load("bills");
|
||||
if ($object->statut < 2)
|
||||
|
||||
@ -449,7 +449,7 @@ class CommandeFournisseur extends CommonOrder
|
||||
if ($this->db->query($sql))
|
||||
{
|
||||
// If stock is incremented on validate order, we must redecrement it
|
||||
if ($conf->stock->enabled && $conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER)
|
||||
if (! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER))
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php';
|
||||
|
||||
@ -700,7 +700,7 @@ class CommandeFournisseur extends CommonOrder
|
||||
$this->log($user, 2, time()); // Statut 2
|
||||
|
||||
// If stock is incremented on validate order, we must increment it
|
||||
if (! $error && $conf->stock->enabled && $conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER)
|
||||
if (! $error && ! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER))
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php';
|
||||
$langs->load("agenda");
|
||||
@ -1213,7 +1213,7 @@ class CommandeFournisseur extends CommonOrder
|
||||
}
|
||||
|
||||
// Si module stock gere et que incrementation faite depuis un dispatching en stock
|
||||
if (!$error && $entrepot > 0 && $conf->stock->enabled && $conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER)
|
||||
if (!$error && $entrepot > 0 && ! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER))
|
||||
{
|
||||
$mouv = new MouvementStock($this->db);
|
||||
if ($product > 0)
|
||||
|
||||
@ -837,7 +837,7 @@ class FactureFournisseur extends CommonInvoice
|
||||
if ($resql)
|
||||
{
|
||||
// Si on incrémente le produit principal et ses composants à la validation de facture fournisseur
|
||||
if (! $error && $conf->stock->enabled && $conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL)
|
||||
if (! $error && ! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL))
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php';
|
||||
$langs->load("agenda");
|
||||
@ -915,7 +915,7 @@ class FactureFournisseur extends CommonInvoice
|
||||
if ($result)
|
||||
{
|
||||
// Si on incremente le produit principal et ses composants a la validation de facture fournisseur, on decremente
|
||||
if ($result >= 0 && $conf->stock->enabled && $conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL)
|
||||
if ($result >= 0 && ! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL))
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php';
|
||||
$langs->load("agenda");
|
||||
|
||||
@ -1399,7 +1399,7 @@ if ($id > 0 || ! empty($ref))
|
||||
print '<tr '.$bc[$var].'>';
|
||||
print '<td>';
|
||||
print '<a name="'.$line->id.'"></a>'; // ancre pour retourner sur la ligne
|
||||
if (($conf->product->enabled || $conf->service->enabled) && $line->fk_product > 0)
|
||||
if ((! empty($conf->product->enabled) || ! empty($conf->service->enabled)) && $line->fk_product > 0)
|
||||
{
|
||||
$product_static=new ProductFournisseur($db);
|
||||
$product_static->fetch($line->fk_product);
|
||||
@ -1415,7 +1415,7 @@ if ($id > 0 || ! empty($ref))
|
||||
else
|
||||
{
|
||||
print $form->select_type_of_lines($line->product_type,'type',1);
|
||||
if ($conf->product->enabled && $conf->service->enabled) print '<br>';
|
||||
if (! empty($conf->product->enabled) && ! empty($conf->service->enabled)) print '<br>';
|
||||
}
|
||||
|
||||
if (is_object($hookmanager))
|
||||
@ -1619,7 +1619,7 @@ if ($id > 0 || ! empty($ref))
|
||||
}
|
||||
|
||||
// Create bill
|
||||
if ($conf->fournisseur->enabled && $object->statut >= 2) // 2 means accepted
|
||||
if (! empty($conf->fournisseur->enabled) && $object->statut >= 2) // 2 means accepted
|
||||
{
|
||||
if ($user->rights->fournisseur->facture->creer)
|
||||
{
|
||||
|
||||
@ -1144,7 +1144,7 @@ if ($action == 'create')
|
||||
else
|
||||
{
|
||||
// TODO more bugs
|
||||
if (1==2 && $conf->global->PRODUCT_SHOW_WHEN_CREATE)
|
||||
if (1==2 && ! empty($conf->global->PRODUCT_SHOW_WHEN_CREATE))
|
||||
{
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td> </td><td>'.$langs->trans('Label').'</td>';
|
||||
@ -1593,7 +1593,7 @@ else
|
||||
|
||||
// Show product and description
|
||||
print '<td>';
|
||||
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 '<input type="hidden" name="idprod" value="'.$object->lines[$i]->fk_product.'">';
|
||||
$product_static=new ProductFournisseur($db);
|
||||
@ -1607,7 +1607,7 @@ else
|
||||
{
|
||||
$forceall=1; // For suppliers, we always show all types
|
||||
print $form->select_type_of_lines($object->lines[$i]->product_type,'type',1);
|
||||
if ($forceall || ($conf->product->enabled && $conf->service->enabled)
|
||||
if ($forceall || (! empty($conf->product->enabled) && ! empty($conf->service->enabled))
|
||||
|| (empty($conf->product->enabled) && empty($conf->service->enabled))) print '<br>';
|
||||
}
|
||||
|
||||
@ -1744,7 +1744,7 @@ else
|
||||
|
||||
$forceall=1; // For suppliers, we always show all types
|
||||
print $form->select_type_of_lines(isset($_POST["type"])?$_POST["type"]:-1,'type',1,0,$forceall);
|
||||
if ($forceall || ($conf->product->enabled && $conf->service->enabled)
|
||||
if ($forceall || (! empty($conf->product->enabled) && ! empty($conf->service->enabled))
|
||||
|| (empty($conf->product->enabled) && empty($conf->service->enabled))) print '<br>';
|
||||
|
||||
if (is_object($hookmanager))
|
||||
|
||||
@ -223,7 +223,7 @@ if ($object->fetch($id))
|
||||
/*
|
||||
* List of products
|
||||
*/
|
||||
if ($conf->product->enabled || $conf->service->enabled)
|
||||
if (! empty($conf->product->enabled) || ! empty($conf->service->enabled))
|
||||
{
|
||||
$langs->load("products");
|
||||
print '<table class="noborder" width="100%">';
|
||||
@ -382,7 +382,7 @@ if ($object->fetch($id))
|
||||
}
|
||||
|
||||
// Add action
|
||||
if ($conf->agenda->enabled && ! empty($conf->global->MAIN_REPEATTASKONEACHTAB))
|
||||
if (! empty($conf->agenda->enabled) && ! empty($conf->global->MAIN_REPEATTASKONEACHTAB))
|
||||
{
|
||||
if ($user->rights->agenda->myactions->create)
|
||||
{
|
||||
|
||||
@ -158,7 +158,7 @@ if (! empty($conf->fournisseur->enabled))
|
||||
}
|
||||
|
||||
// Draft invoices
|
||||
if ($conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire)
|
||||
if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture->lire)
|
||||
{
|
||||
$sql = "SELECT ff.facnumber, ff.rowid, ff.total_ttc, ff.type";
|
||||
$sql.= ", s.nom, s.rowid as socid";
|
||||
|
||||
@ -83,7 +83,7 @@ if ($socid > 0)
|
||||
|
||||
|
||||
|
||||
if ($conf->fournisseur->enabled && $user->rights->facture->lire)
|
||||
if (! empty($conf->fournisseur->enabled) && $user->rights->facture->lire)
|
||||
{
|
||||
// Invoices list
|
||||
print_fiche_titre($langs->trans("SupplierPreview"));
|
||||
|
||||
@ -45,7 +45,7 @@ if (! $user->admin) accessforbidden();
|
||||
*/
|
||||
|
||||
// Vérification si module activé
|
||||
if (! $conf->holiday->enabled) print $langs->trans('NotActiveModCP');
|
||||
if (empty($conf->holiday->enabled)) print $langs->trans('NotActiveModCP');
|
||||
|
||||
llxheader('',$langs->trans('TitleAdminCP'));
|
||||
|
||||
|
||||
@ -287,7 +287,7 @@ print '</tr>';
|
||||
//
|
||||
|
||||
// Number of actions to do (late)
|
||||
if ($conf->agenda->enabled && $user->rights->agenda->myactions->read)
|
||||
if (! empty($conf->agenda->enabled) && $user->rights->agenda->myactions->read)
|
||||
{
|
||||
include_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
|
||||
$board=new ActionComm($db);
|
||||
@ -301,7 +301,7 @@ if ($conf->agenda->enabled && $user->rights->agenda->myactions->read)
|
||||
}
|
||||
|
||||
// Number of customer orders a deal
|
||||
if ($conf->commande->enabled && $user->rights->commande->lire)
|
||||
if (! empty($conf->commande->enabled) && $user->rights->commande->lire)
|
||||
{
|
||||
include_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
|
||||
$board=new Commande($db);
|
||||
@ -315,7 +315,7 @@ if ($conf->commande->enabled && $user->rights->commande->lire)
|
||||
}
|
||||
|
||||
// Number of suppliers orders a deal
|
||||
if ($conf->fournisseur->enabled && $user->rights->fournisseur->commande->lire)
|
||||
if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->commande->lire)
|
||||
{
|
||||
include_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php';
|
||||
$board=new CommandeFournisseur($db);
|
||||
@ -329,7 +329,7 @@ if ($conf->fournisseur->enabled && $user->rights->fournisseur->commande->lire)
|
||||
}
|
||||
|
||||
// Number of commercial proposals opened (expired)
|
||||
if ($conf->propal->enabled && $user->rights->propale->lire)
|
||||
if (! empty($conf->propal->enabled) && $user->rights->propale->lire)
|
||||
{
|
||||
$langs->load("propal");
|
||||
|
||||
@ -345,7 +345,7 @@ if ($conf->propal->enabled && $user->rights->propale->lire)
|
||||
}
|
||||
|
||||
// Number of commercial proposals CLOSED signed (billed)
|
||||
if ($conf->propal->enabled && $user->rights->propale->lire)
|
||||
if (! empty($conf->propal->enabled) && $user->rights->propale->lire)
|
||||
{
|
||||
$langs->load("propal");
|
||||
|
||||
@ -361,7 +361,7 @@ if ($conf->propal->enabled && $user->rights->propale->lire)
|
||||
}
|
||||
|
||||
// Number of services enabled (delayed)
|
||||
if ($conf->contrat->enabled && $user->rights->contrat->lire)
|
||||
if (! empty($conf->contrat->enabled) && $user->rights->contrat->lire)
|
||||
{
|
||||
$langs->load("contracts");
|
||||
|
||||
@ -377,7 +377,7 @@ if ($conf->contrat->enabled && $user->rights->contrat->lire)
|
||||
}
|
||||
|
||||
// Number of active services (expired)
|
||||
if ($conf->contrat->enabled && $user->rights->contrat->lire)
|
||||
if (! empty($conf->contrat->enabled) && $user->rights->contrat->lire)
|
||||
{
|
||||
$langs->load("contracts");
|
||||
|
||||
@ -392,7 +392,7 @@ if ($conf->contrat->enabled && $user->rights->contrat->lire)
|
||||
$dashboardlines[]=$board;
|
||||
}
|
||||
// Number of invoices customers (has paid)
|
||||
if ($conf->facture->enabled && $user->rights->facture->lire)
|
||||
if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
|
||||
{
|
||||
$langs->load("bills");
|
||||
|
||||
@ -408,7 +408,7 @@ if ($conf->facture->enabled && $user->rights->facture->lire)
|
||||
}
|
||||
|
||||
// Number of supplier invoices (has paid)
|
||||
if ($conf->fournisseur->enabled && $conf->facture->enabled && $user->rights->facture->lire)
|
||||
if (! empty($conf->fournisseur->enabled) && ! empty($conf->facture->enabled) && $user->rights->facture->lire)
|
||||
{
|
||||
$langs->load("bills");
|
||||
|
||||
@ -424,7 +424,7 @@ if ($conf->fournisseur->enabled && $conf->facture->enabled && $user->rights->fac
|
||||
}
|
||||
|
||||
// Number of transactions to conciliate
|
||||
if ($conf->banque->enabled && $user->rights->banque->lire && ! $user->societe_id)
|
||||
if (! empty($conf->banque->enabled) && $user->rights->banque->lire && ! $user->societe_id)
|
||||
{
|
||||
$langs->load("banks");
|
||||
|
||||
@ -443,7 +443,7 @@ if ($conf->banque->enabled && $user->rights->banque->lire && ! $user->societe_id
|
||||
}
|
||||
|
||||
// Number of cheque to send
|
||||
if ($conf->banque->enabled && $user->rights->banque->lire && ! $user->societe_id)
|
||||
if (! empty($conf->banque->enabled) && $user->rights->banque->lire && ! $user->societe_id)
|
||||
{
|
||||
$langs->load("banks");
|
||||
|
||||
@ -459,7 +459,7 @@ if ($conf->banque->enabled && $user->rights->banque->lire && ! $user->societe_id
|
||||
}
|
||||
|
||||
// Number of foundation members
|
||||
if ($conf->adherent->enabled && $user->rights->adherent->lire && ! $user->societe_id)
|
||||
if (! empty($conf->adherent->enabled) && $user->rights->adherent->lire && ! $user->societe_id)
|
||||
{
|
||||
$langs->load("members");
|
||||
|
||||
|
||||
@ -67,7 +67,7 @@ if ($action == 'add')
|
||||
$delivery->note = $_POST["note"];
|
||||
$delivery->commande_id = $_POST["commande_id"];
|
||||
|
||||
if (!$conf->expedition_bon->enabled && $conf->stock->enabled)
|
||||
if (!$conf->expedition_bon->enabled && ! empty($conf->stock->enabled))
|
||||
{
|
||||
$expedition->entrepot_id = $_POST["entrepot_id"];
|
||||
}
|
||||
@ -244,7 +244,7 @@ if ($action == 'create')
|
||||
$author = new User($db);
|
||||
$author->fetch($commande->user_author_id);
|
||||
|
||||
if (!$conf->expedition_bon->enabled && $conf->stock->enabled)
|
||||
if (!$conf->expedition_bon->enabled && ! empty($conf->stock->enabled))
|
||||
{
|
||||
$entrepot = new Entrepot($db);
|
||||
}
|
||||
@ -256,7 +256,7 @@ if ($action == 'create')
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="add">';
|
||||
print '<input type="hidden" name="commande_id" value="'.$commande->id.'">';
|
||||
if (!$conf->expedition_bon->enabled && $conf->stock->enabled)
|
||||
if (!$conf->expedition_bon->enabled && ! empty($conf->stock->enabled))
|
||||
{
|
||||
print '<input type="hidden" name="entrepot_id" value="'.$_GET["entrepot_id"].'">';
|
||||
}
|
||||
@ -276,7 +276,7 @@ if ($action == 'create')
|
||||
|
||||
print '<tr>';
|
||||
|
||||
if (!$conf->expedition_bon->enabled && $conf->stock->enabled)
|
||||
if (!$conf->expedition_bon->enabled && ! empty($conf->stock->enabled))
|
||||
{
|
||||
print '<td>'.$langs->trans("Warehouse").'</td>';
|
||||
print '<td>';
|
||||
@ -502,7 +502,7 @@ else
|
||||
print "</tr>";
|
||||
|
||||
// Document origine
|
||||
if ($typeobject == 'commande' && $expedition->origin_id && $conf->commande->enabled)
|
||||
if ($typeobject == 'commande' && $expedition->origin_id && ! empty($conf->commande->enabled))
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("RefOrder").'</td>';
|
||||
$order=new Commande($db);
|
||||
@ -512,7 +512,7 @@ else
|
||||
print "</td>\n";
|
||||
print '</tr>';
|
||||
}
|
||||
if ($typeobject == 'propal' && $expedition->origin_id && $conf->propal->enabled)
|
||||
if ($typeobject == 'propal' && $expedition->origin_id && ! empty($conf->propal->enabled))
|
||||
{
|
||||
$propal=new Propal($db);
|
||||
$propal->fetch($expedition->origin_id);
|
||||
@ -544,7 +544,7 @@ else
|
||||
print '<td colspan="3">'.$delivery->getLibStatut(4)."</td>\n";
|
||||
print '</tr>';
|
||||
|
||||
if (!$conf->expedition_bon->enabled && $conf->stock->enabled)
|
||||
if (!$conf->expedition_bon->enabled && ! empty($conf->stock->enabled))
|
||||
{
|
||||
// Entrepot
|
||||
$entrepot = new Entrepot($db);
|
||||
|
||||
@ -144,7 +144,7 @@ if ($action == 'search')
|
||||
$sql.= " OR p.label LIKE '%".$key."%')";
|
||||
}
|
||||
}
|
||||
if ($conf->categorie->enabled && $catMere != -1 and $catMere)
|
||||
if (! empty($conf->categorie->enabled) && $catMere != -1 and $catMere)
|
||||
{
|
||||
$sql.= " AND cp.fk_categorie ='".$db->escape($catMere)."'";
|
||||
}
|
||||
@ -185,7 +185,7 @@ if ($id || $ref)
|
||||
print "<tr>";
|
||||
|
||||
$nblignes=6;
|
||||
if ($product->isproduct() && $conf->stock->enabled) $nblignes++;
|
||||
if ($product->isproduct() && ! empty($conf->stock->enabled)) $nblignes++;
|
||||
if ($product->isservice()) $nblignes++;
|
||||
|
||||
// Reference
|
||||
@ -269,7 +269,7 @@ if ($id || $ref)
|
||||
print "<tr>";
|
||||
|
||||
$nblignes=6;
|
||||
if ($product->isproduct() && $conf->stock->enabled) $nblignes++;
|
||||
if ($product->isproduct() && ! empty($conf->stock->enabled)) $nblignes++;
|
||||
if ($product->isservice()) $nblignes++;
|
||||
|
||||
// Reference
|
||||
|
||||
@ -744,7 +744,7 @@ else
|
||||
print '</td></tr>';
|
||||
|
||||
// Stock min level
|
||||
if ($type != 1 && $conf->stock->enabled)
|
||||
if ($type != 1 && ! empty($conf->stock->enabled))
|
||||
{
|
||||
print '<tr><td>'.$langs->trans("StockLimit").'</td><td>';
|
||||
print '<input name="seuil_stock_alerte" size="4" value="'.GETPOST('seuil_stock_alerte').'">';
|
||||
@ -963,7 +963,7 @@ else
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
if ($object->isproduct() && $conf->stock->enabled)
|
||||
if ($object->isproduct() && ! empty($conf->stock->enabled))
|
||||
{
|
||||
print "<tr>".'<td>'.$langs->trans("StockLimit").'</td><td colspan="2">';
|
||||
print '<input name="seuil_stock_alerte" size="4" value="'.$object->seuil_stock_alerte.'">';
|
||||
@ -1099,7 +1099,7 @@ else
|
||||
print '</tr>';
|
||||
|
||||
// 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");
|
||||
|
||||
@ -407,7 +407,7 @@ else
|
||||
if ($product_fourn->product_fourn_price_id > 0)
|
||||
{
|
||||
$htmltext=$product_fourn->display_price_product_fournisseur();
|
||||
if ($conf->fournisseur->enabled && $user->rights->fournisseur->lire) print $form->textwithpicto(price($product_fourn->fourn_unitprice).' '.$langs->trans("HT"),$htmltext);
|
||||
if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->lire) print $form->textwithpicto(price($product_fourn->fourn_unitprice).' '.$langs->trans("HT"),$htmltext);
|
||||
else print price($product_fourn->fourn_unitprice).' '.$langs->trans("HT");
|
||||
}
|
||||
}
|
||||
|
||||
@ -240,7 +240,7 @@ if ($resql)
|
||||
print "<tr class=\"liste_titre\">";
|
||||
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
|
||||
|
||||
@ -208,14 +208,14 @@ class MouvementStock
|
||||
}
|
||||
|
||||
// Add movement for sub products (recursive call)
|
||||
if (! $error && $conf->global->PRODUIT_SOUSPRODUITS)
|
||||
if (! $error && ! empty($conf->global->PRODUIT_SOUSPRODUITS))
|
||||
{
|
||||
$error = $this->_createSubProduct($user, $fk_product, $entrepot_id, $qty, $type, 0, $label); // pmp is not change for subproduct
|
||||
}
|
||||
|
||||
// Composition module (this is an external module)
|
||||
/* Removed. This code must be provided by module on trigger STOCK_MOVEMENT
|
||||
if (! $error && $qty < 0 && $conf->global->MAIN_MODULE_COMPOSITION)
|
||||
if (! $error && $qty < 0 && ! empty($conf->global->MAIN_MODULE_COMPOSITION))
|
||||
{
|
||||
$error = $this->_createProductComposition($user, $fk_product, $entrepot_id, $qty, $type, 0, $label); // pmp is not change for subproduct
|
||||
}*/
|
||||
|
||||
@ -263,26 +263,26 @@ foreach ($listofreferent as $key => $value)
|
||||
{
|
||||
if ($project->societe->prospect || $project->societe->client)
|
||||
{
|
||||
if ($key == 'propal' && $conf->propal->enabled && $user->rights->propale->creer)
|
||||
if ($key == 'propal' && ! empty($conf->propal->enabled) && $user->rights->propale->creer)
|
||||
{
|
||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/comm/addpropal.php?socid='.$project->societe->id.'&action=create&origin='.$project->element.'&originid='.$project->id.'">'.$langs->trans("AddProp").'</a>';
|
||||
}
|
||||
if ($key == 'order' && $conf->commande->enabled && $user->rights->commande->creer)
|
||||
if ($key == 'order' && ! empty($conf->commande->enabled) && $user->rights->commande->creer)
|
||||
{
|
||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/commande/fiche.php?socid='.$project->societe->id.'&action=create&origin='.$project->element.'&originid='.$project->id.'">'.$langs->trans("AddCustomerOrder").'</a>';
|
||||
}
|
||||
if ($key == 'invoice' && $conf->facture->enabled && $user->rights->facture->creer)
|
||||
if ($key == 'invoice' && ! empty($conf->facture->enabled) && $user->rights->facture->creer)
|
||||
{
|
||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/compta/facture/list.php?socid='.$project->societe->id.'&action=create&origin='.$project->element.'&originid='.$project->id.'">'.$langs->trans("AddCustomerInvoice").'</a>';
|
||||
}
|
||||
}
|
||||
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 '<a class="butAction" href="'.DOL_URL_ROOT.'/fourn/facture/fiche.php?socid='.$project->societe->id.'&action=create&origin='.$project->element.'&originid='.$project->id.'">'.$langs->trans("AddSupplierInvoice").'</a>';
|
||||
}
|
||||
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 '<a class="butAction" href="'.DOL_URL_ROOT.'/fourn/commande/fiche.php?socid='.$project->societe->id.'&action=create&origin='.$project->element.'&originid='.$project->id.'">'.$langs->trans("AddSupplierOrder").'</a>';
|
||||
}
|
||||
|
||||
@ -53,7 +53,7 @@ require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
|
||||
|
||||
// Security check
|
||||
if (! $conf->agenda->enabled) accessforbidden('',1,1,1);
|
||||
if (empty($conf->agenda->enabled)) accessforbidden('',1,1,1);
|
||||
|
||||
// Define format, type and filter
|
||||
$format='ical';
|
||||
|
||||
@ -112,9 +112,9 @@ if (! empty($conf->use_javascript_ajax) && ((round($third['prospect'])?1:0)+(rou
|
||||
{
|
||||
print '<tr><td align="center">';
|
||||
$dataseries=array();
|
||||
if ($conf->societe->enabled && empty($conf->global->SOCIETE_DISABLE_PROSPECTS_STATS)) $dataseries[]=array('label'=>$langs->trans("Prospects"),'data'=>round($third['prospect']));
|
||||
if ($conf->societe->enabled && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS_STATS)) $dataseries[]=array('label'=>$langs->trans("Customers"),'data'=>round($third['customer']));
|
||||
if ($conf->fournisseur->enabled && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS)) $dataseries[]=array('label'=>$langs->trans("Suppliers"),'data'=>round($third['supplier']));
|
||||
if (! empty($conf->societe->enabled) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS_STATS)) $dataseries[]=array('label'=>$langs->trans("Prospects"),'data'=>round($third['prospect']));
|
||||
if (! empty($conf->societe->enabled) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS_STATS)) $dataseries[]=array('label'=>$langs->trans("Customers"),'data'=>round($third['customer']));
|
||||
if (! empty($conf->fournisseur->enabled) && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS)) $dataseries[]=array('label'=>$langs->trans("Suppliers"),'data'=>round($third['supplier']));
|
||||
if (! empty($conf->societe->enabled)) $dataseries[]=array('label'=>$langs->trans("Others"),'data'=>round($third['other']));
|
||||
$data=array('series'=>$dataseries);
|
||||
dol_print_graph('stats',300,180,$data,1,'pie',0);
|
||||
@ -122,19 +122,19 @@ if (! empty($conf->use_javascript_ajax) && ((round($third['prospect'])?1:0)+(rou
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($conf->societe->enabled && empty($conf->global->SOCIETE_DISABLE_PROSPECTS_STATS))
|
||||
if (! empty($conf->societe->enabled) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS_STATS))
|
||||
{
|
||||
$statstring = "<tr $bc[0]>";
|
||||
$statstring.= '<td><a href="'.DOL_URL_ROOT.'/comm/prospect/list.php">'.$langs->trans("Prospects").'</a></td><td align="right">'.round($third['prospect']).'</td>';
|
||||
$statstring.= "</tr>";
|
||||
}
|
||||
if ($conf->societe->enabled && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS_STATS))
|
||||
if (! empty($conf->societe->enabled) && empty($conf->global->SOCIETE_DISABLE_CUSTOMERS_STATS))
|
||||
{
|
||||
$statstring.= "<tr $bc[1]>";
|
||||
$statstring.= '<td><a href="'.DOL_URL_ROOT.'/comm/list.php">'.$langs->trans("Customers").'</a></td><td align="right">'.round($third['customer']).'</td>';
|
||||
$statstring.= "</tr>";
|
||||
}
|
||||
if ($conf->fournisseur->enabled && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS))
|
||||
if (! empty($conf->fournisseur->enabled) && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS))
|
||||
{
|
||||
$statstring2 = "<tr $bc[0]>";
|
||||
$statstring2.= '<td><a href="'.DOL_URL_ROOT.'/fourn/liste.php">'.$langs->trans("Suppliers").'</a></td><td align="right">'.round($third['supplier']).'</td>';
|
||||
@ -215,7 +215,7 @@ if ($result)
|
||||
$thirdparty_static->name=$langs->trans("Prospect");
|
||||
print $thirdparty_static->getNomUrl(0,'prospect');
|
||||
}
|
||||
if ($conf->fournisseur->enabled && $thirdparty_static->fournisseur)
|
||||
if (! empty($conf->fournisseur->enabled) && $thirdparty_static->fournisseur)
|
||||
{
|
||||
if ($thirdparty_static->client) print " / ";
|
||||
$thirdparty_static->name=$langs->trans("Supplier");
|
||||
|
||||
@ -544,7 +544,7 @@ else
|
||||
if (GETPOST("type")!='f') { $object->client=3; }
|
||||
if (GETPOST("type")=='c') { $object->client=1; }
|
||||
if (GETPOST("type")=='p') { $object->client=2; }
|
||||
if ($conf->fournisseur->enabled && (GETPOST("type")=='f' || GETPOST("type")=='')) { $object->fournisseur=1; }
|
||||
if (! empty($conf->fournisseur->enabled) && (GETPOST("type")=='f' || GETPOST("type")=='')) { $object->fournisseur=1; }
|
||||
if (GETPOST("private")==1) { $object->particulier=1; }
|
||||
|
||||
$object->name = GETPOST('nom');
|
||||
@ -1169,7 +1169,7 @@ else
|
||||
print '</td></tr>';
|
||||
|
||||
// Supplier
|
||||
if ($conf->fournisseur->enabled && ! empty($user->rights->fournisseur->lire))
|
||||
if (! empty($conf->fournisseur->enabled) && ! empty($user->rights->fournisseur->lire))
|
||||
{
|
||||
print '<tr>';
|
||||
print '<td><span class="fieldrequired">'.$langs->trans('Supplier').'</span></td><td>';
|
||||
@ -1201,7 +1201,7 @@ else
|
||||
print '</td></tr>';
|
||||
|
||||
// Category
|
||||
if ($conf->categorie->enabled && $object->fournisseur)
|
||||
if (! empty($conf->categorie->enabled) && $object->fournisseur)
|
||||
{
|
||||
$load = $object->LoadSupplierCateg();
|
||||
if ( $load == 0)
|
||||
|
||||
@ -401,7 +401,7 @@ if ($resql)
|
||||
$companystatic->name=$langs->trans("Prospect");
|
||||
$s.=$companystatic->getNomUrl(0,'prospect');
|
||||
}
|
||||
if ($conf->fournisseur->enabled && $obj->fournisseur)
|
||||
if (! empty($conf->fournisseur->enabled) && $obj->fournisseur)
|
||||
{
|
||||
if ($s) $s.=" / ";
|
||||
$companystatic->name=$langs->trans("Supplier");
|
||||
|
||||
@ -1823,13 +1823,13 @@ class User extends CommonObject
|
||||
$this->fullname=$this->getFullName($langs);
|
||||
|
||||
// Champs
|
||||
if ($this->fullname && $conf->global->LDAP_FIELD_FULLNAME) $info[$conf->global->LDAP_FIELD_FULLNAME] = $this->fullname;
|
||||
if ($this->lastname && $conf->global->LDAP_FIELD_NAME) $info[$conf->global->LDAP_FIELD_NAME] = $this->lastname;
|
||||
if ($this->firstname && $conf->global->LDAP_FIELD_FIRSTNAME) $info[$conf->global->LDAP_FIELD_FIRSTNAME] = $this->firstname;
|
||||
if ($this->login && $conf->global->LDAP_FIELD_LOGIN) $info[$conf->global->LDAP_FIELD_LOGIN] = $this->login;
|
||||
if ($this->login && $conf->global->LDAP_FIELD_LOGIN_SAMBA) $info[$conf->global->LDAP_FIELD_LOGIN_SAMBA] = $this->login;
|
||||
if ($this->pass && $conf->global->LDAP_FIELD_PASSWORD) $info[$conf->global->LDAP_FIELD_PASSWORD] = $this->pass; // this->pass = mot de passe non crypte
|
||||
if ($this->ldap_sid && $conf->global->LDAP_FIELD_SID) $info[$conf->global->LDAP_FIELD_SID] = $this->ldap_sid;
|
||||
if ($this->fullname && ! empty($conf->global->LDAP_FIELD_FULLNAME)) $info[$conf->global->LDAP_FIELD_FULLNAME] = $this->fullname;
|
||||
if ($this->lastname && ! empty($conf->global->LDAP_FIELD_NAME)) $info[$conf->global->LDAP_FIELD_NAME] = $this->lastname;
|
||||
if ($this->firstname && ! empty($conf->global->LDAP_FIELD_FIRSTNAME)) $info[$conf->global->LDAP_FIELD_FIRSTNAME] = $this->firstname;
|
||||
if ($this->login && ! empty($conf->global->LDAP_FIELD_LOGIN)) $info[$conf->global->LDAP_FIELD_LOGIN] = $this->login;
|
||||
if ($this->login && ! empty($conf->global->LDAP_FIELD_LOGIN_SAMBA)) $info[$conf->global->LDAP_FIELD_LOGIN_SAMBA] = $this->login;
|
||||
if ($this->pass && ! empty($conf->global->LDAP_FIELD_PASSWORD)) $info[$conf->global->LDAP_FIELD_PASSWORD] = $this->pass; // this->pass = mot de passe non crypte
|
||||
if ($this->ldap_sid && ! empty($conf->global->LDAP_FIELD_SID)) $info[$conf->global->LDAP_FIELD_SID] = $this->ldap_sid;
|
||||
if ($this->societe_id > 0)
|
||||
{
|
||||
$soc = new Societe($this->db);
|
||||
@ -1840,14 +1840,14 @@ class User extends CommonObject
|
||||
if ($soc->client == 2) $info["businessCategory"] = "Prospects";
|
||||
if ($soc->fournisseur == 1) $info["businessCategory"] = "Suppliers";
|
||||
}
|
||||
if ($this->address && $conf->global->LDAP_FIELD_ADDRESS) $info[$conf->global->LDAP_FIELD_ADDRESS] = $this->address;
|
||||
if ($this->zip && $conf->global->LDAP_FIELD_ZIP) $info[$conf->global->LDAP_FIELD_ZIP] = $this->zip;
|
||||
if ($this->town && $conf->global->LDAP_FIELD_TOWN) $info[$conf->global->LDAP_FIELD_TOWN] = $this->town;
|
||||
if ($this->office_phone && $conf->global->LDAP_FIELD_PHONE) $info[$conf->global->LDAP_FIELD_PHONE] = $this->office_phone;
|
||||
if ($this->user_mobile && $conf->global->LDAP_FIELD_MOBILE) $info[$conf->global->LDAP_FIELD_MOBILE] = $this->user_mobile;
|
||||
if ($this->office_fax && $conf->global->LDAP_FIELD_FAX) $info[$conf->global->LDAP_FIELD_FAX] = $this->office_fax;
|
||||
if ($this->note && $conf->global->LDAP_FIELD_DESCRIPTION) $info[$conf->global->LDAP_FIELD_DESCRIPTION] = $this->note;
|
||||
if ($this->email && $conf->global->LDAP_FIELD_MAIL) $info[$conf->global->LDAP_FIELD_MAIL] = $this->email;
|
||||
if ($this->address && ! empty($conf->global->LDAP_FIELD_ADDRESS)) $info[$conf->global->LDAP_FIELD_ADDRESS] = $this->address;
|
||||
if ($this->zip && ! empty($conf->global->LDAP_FIELD_ZIP)) $info[$conf->global->LDAP_FIELD_ZIP] = $this->zip;
|
||||
if ($this->town && ! empty($conf->global->LDAP_FIELD_TOWN)) $info[$conf->global->LDAP_FIELD_TOWN] = $this->town;
|
||||
if ($this->office_phone && ! empty($conf->global->LDAP_FIELD_PHONE)) $info[$conf->global->LDAP_FIELD_PHONE] = $this->office_phone;
|
||||
if ($this->user_mobile && ! empty($conf->global->LDAP_FIELD_MOBILE)) $info[$conf->global->LDAP_FIELD_MOBILE] = $this->user_mobile;
|
||||
if ($this->office_fax && ! empty($conf->global->LDAP_FIELD_FAX)) $info[$conf->global->LDAP_FIELD_FAX] = $this->office_fax;
|
||||
if ($this->note && ! empty($conf->global->LDAP_FIELD_DESCRIPTION)) $info[$conf->global->LDAP_FIELD_DESCRIPTION] = $this->note;
|
||||
if ($this->email && ! empty($conf->global->LDAP_FIELD_MAIL)) $info[$conf->global->LDAP_FIELD_MAIL] = $this->email;
|
||||
|
||||
if ($conf->global->LDAP_SERVER_TYPE == 'egroupware')
|
||||
{
|
||||
|
||||
@ -687,9 +687,9 @@ class UserGroup extends CommonObject
|
||||
$info["objectclass"]=explode(',',$conf->global->LDAP_GROUP_OBJECT_CLASS);
|
||||
|
||||
// Champs
|
||||
if ($this->nom && $conf->global->LDAP_GROUP_FIELD_FULLNAME) $info[$conf->global->LDAP_GROUP_FIELD_FULLNAME] = $this->nom;
|
||||
//if ($this->nom && $conf->global->LDAP_GROUP_FIELD_NAME) $info[$conf->global->LDAP_GROUP_FIELD_NAME] = $this->nom;
|
||||
if ($this->note && $conf->global->LDAP_GROUP_FIELD_DESCRIPTION) $info[$conf->global->LDAP_GROUP_FIELD_DESCRIPTION] = $this->note;
|
||||
if ($this->nom && ! empty($conf->global->LDAP_GROUP_FIELD_FULLNAME)) $info[$conf->global->LDAP_GROUP_FIELD_FULLNAME] = $this->nom;
|
||||
//if ($this->nom && ! empty($conf->global->LDAP_GROUP_FIELD_NAME)) $info[$conf->global->LDAP_GROUP_FIELD_NAME] = $this->nom;
|
||||
if ($this->note && ! empty($conf->global->LDAP_GROUP_FIELD_DESCRIPTION)) $info[$conf->global->LDAP_GROUP_FIELD_DESCRIPTION] = $this->note;
|
||||
if (! empty($conf->global->LDAP_GROUP_FIELD_GROUPMEMBERS))
|
||||
{
|
||||
$valueofldapfield=array();
|
||||
|
||||
@ -97,7 +97,7 @@ if ($action == 'add')
|
||||
$object->nom = trim($_POST["nom"]);
|
||||
$object->note = trim($_POST["note"]);
|
||||
|
||||
if ($conf->multicompany->enabled && ! empty($conf->multicompany->transverse_mode)) $object->entity = 0;
|
||||
if (! empty($conf->multicompany->enabled) && ! empty($conf->multicompany->transverse_mode)) $object->entity = 0;
|
||||
else $object->entity = $_POST["entity"];
|
||||
|
||||
$db->begin();
|
||||
|
||||
@ -101,7 +101,7 @@ print '<br><br>';
|
||||
print '<u>'.$langs->trans("WSDLCanBeDownloadedHere").':</u><br>';
|
||||
$url=DOL_MAIN_URL_ROOT.'/webservices/server_other.php?wsdl';
|
||||
print img_picto('','object_globe.png').' <a href="'.$url.'" target="_blank">'.$url."</a><br>\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').' <a href="'.$url.'" target="_blank">'.$url."</a><br>\n";
|
||||
@ -128,7 +128,7 @@ print '<br>';
|
||||
print '<u>'.$langs->trans("EndPointIs").':</u><br>';
|
||||
$url=DOL_MAIN_URL_ROOT.'/webservices/server_other.php';
|
||||
print img_picto('','object_globe.png').' <a href="'.$url.'" target="_blank">'.$url."</a><br>\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').' <a href="'.$url.'" target="_blank">'.$url."</a><br>\n";
|
||||
|
||||
Loading…
Reference in New Issue
Block a user