Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into

develop

Conflicts:
	htdocs/core/tpl/freeproductline_create.tpl.php
	htdocs/core/tpl/predefinedproductline_create.tpl.php
This commit is contained in:
Laurent Destailleur 2012-09-15 13:53:19 +02:00
commit 9147911ae4
242 changed files with 1090 additions and 1081 deletions

View File

@ -178,7 +178,7 @@ print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="update">'; print '<input type="hidden" name="action" value="update">';
print '<input type="hidden" name="constname" value="ADHERENT_BANK_USE">'; print '<input type="hidden" name="constname" value="ADHERENT_BANK_USE">';
print '<tr '.$bc[$var].'><td>'.$langs->trans("AddSubscriptionIntoAccount").'</td>'; print '<tr '.$bc[$var].'><td>'.$langs->trans("AddSubscriptionIntoAccount").'</td>';
if ($conf->banque->enabled) if (! empty($conf->banque->enabled))
{ {
print '<td>'; print '<td>';
print $form->selectyesno('constvalue',$conf->global->ADHERENT_BANK_USE,1); print $form->selectyesno('constvalue',$conf->global->ADHERENT_BANK_USE,1);

View File

@ -163,7 +163,7 @@ dol_htmloutput_mesg($mesg);
* Mailman * Mailman
*/ */
$var=!$var; $var=!$var;
if ($conf->global->ADHERENT_USE_MAILMAN) if (! empty($conf->global->ADHERENT_USE_MAILMAN))
{ {
//$lien=img_picto($langs->trans("Active"),'tick').' '; //$lien=img_picto($langs->trans("Active"),'tick').' ';
$lien='<a href="'.$_SERVER["PHP_SELF"].'?action=unset&value=0&name=ADHERENT_USE_MAILMAN">'; $lien='<a href="'.$_SERVER["PHP_SELF"].'?action=unset&value=0&name=ADHERENT_USE_MAILMAN">';
@ -214,7 +214,7 @@ else
dol_fiche_end(); dol_fiche_end();
if ($conf->global->ADHERENT_USE_MAILMAN) if (! empty($conf->global->ADHERENT_USE_MAILMAN))
{ {
print '<form action="'.$_SERVER["PHP_SELF"].'">'; print '<form action="'.$_SERVER["PHP_SELF"].'">';
print '<input type="hidden" name="action" value="testsubscribe">'; print '<input type="hidden" name="action" value="testsubscribe">';

View File

@ -167,8 +167,8 @@ if (! empty($conf->paybox->enabled) || ! empty($conf->paypal->enabled))
print $langs->trans("MEMBER_NEWFORM_PAYONLINE"); print $langs->trans("MEMBER_NEWFORM_PAYONLINE");
print '</td><td width="60" align="right">'; print '</td><td width="60" align="right">';
$listofval=array(); $listofval=array();
if ($conf->paybox->enabled) $listofval['paybox']='Paybox'; if (! empty($conf->paybox->enabled)) $listofval['paybox']='Paybox';
if ($conf->paypal->enabled) $listofval['paypal']='PayPal'; if (! empty($conf->paypal->enabled)) $listofval['paypal']='PayPal';
print $form->selectarray("MEMBER_NEWFORM_PAYONLINE",$listofval,(! empty($conf->global->MEMBER_NEWFORM_PAYONLINE)?$conf->global->MEMBER_NEWFORM_PAYONLINE:''),1); print $form->selectarray("MEMBER_NEWFORM_PAYONLINE",$listofval,(! empty($conf->global->MEMBER_NEWFORM_PAYONLINE)?$conf->global->MEMBER_NEWFORM_PAYONLINE:''),1);
print "</td></tr>\n"; print "</td></tr>\n";
} }

View File

@ -123,7 +123,7 @@ dol_htmloutput_mesg($mesg);
* Spip * Spip
*/ */
$var=!$var; $var=!$var;
if ($conf->global->ADHERENT_USE_SPIP) if (! empty($conf->global->ADHERENT_USE_SPIP))
{ {
//$lien=img_picto($langs->trans("Active"),'tick').' '; //$lien=img_picto($langs->trans("Active"),'tick').' ';
$lien='<a href="'.$_SERVER["PHP_SELF"].'?action=unset&value=0&name=ADHERENT_USE_SPIP">'; $lien='<a href="'.$_SERVER["PHP_SELF"].'?action=unset&value=0&name=ADHERENT_USE_SPIP">';

View File

@ -79,7 +79,7 @@ if ($id)
llxHeader("",$langs->trans("Agenda"),''); llxHeader("",$langs->trans("Agenda"),'');
if ($conf->notification->enabled) $langs->load("mails"); if (! empty($conf->notification->enabled)) $langs->load("mails");
$head = member_prepare_head($object); $head = member_prepare_head($object);
dol_fiche_head($head, 'agenda', $langs->trans("Member"),0,'user'); dol_fiche_head($head, 'agenda', $langs->trans("Member"),0,'user');
@ -142,7 +142,7 @@ if ($id)
print '<div class="tabsAction">'; print '<div class="tabsAction">';
if ($conf->agenda->enabled) if (! empty($conf->agenda->enabled))
{ {
print '<a class="butAction" href="'.DOL_URL_ROOT.'/comm/action/fiche.php?action=create&socid='.$socid.'">'.$langs->trans("AddAction").'</a>'; print '<a class="butAction" href="'.DOL_URL_ROOT.'/comm/action/fiche.php?action=create&socid='.$socid.'">'.$langs->trans("AddAction").'</a>';
} }

View File

@ -246,7 +246,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'cotisation' && ! $
} }
else else
{ {
if ($conf->banque->enabled && $_POST["paymentsave"] != 'none') if (! empty($conf->banque->enabled) && $_POST["paymentsave"] != 'none')
{ {
if ($_POST["cotisation"]) if ($_POST["cotisation"])
{ {
@ -479,7 +479,7 @@ if ($rowid)
$rowspan=9; $rowspan=9;
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) $rowspan+=1; if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) $rowspan+=1;
if ($conf->societe->enabled) $rowspan++; if (! empty($conf->societe->enabled)) $rowspan++;
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">'; print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
@ -545,7 +545,7 @@ if ($rowid)
print '</td></tr>'; print '</td></tr>';
// Third party Dolibarr // Third party Dolibarr
if ($conf->societe->enabled) if (! empty($conf->societe->enabled))
{ {
print '<tr><td>'; print '<tr><td>';
print '<table class="nobordernopadding" width="100%"><tr><td>'; print '<table class="nobordernopadding" width="100%"><tr><td>';
@ -675,7 +675,7 @@ if ($rowid)
print '<td align="center">'.$langs->trans("DateSubscription").'</td>'; print '<td align="center">'.$langs->trans("DateSubscription").'</td>';
print '<td align="center">'.$langs->trans("DateEnd").'</td>'; print '<td align="center">'.$langs->trans("DateEnd").'</td>';
print '<td align="right">'.$langs->trans("Amount").'</td>'; print '<td align="right">'.$langs->trans("Amount").'</td>';
if ($conf->banque->enabled) if (! empty($conf->banque->enabled))
{ {
print '<td align="right">'.$langs->trans("Account").'</td>'; print '<td align="right">'.$langs->trans("Account").'</td>';
} }
@ -693,7 +693,7 @@ if ($rowid)
print '<td align="center">'.dol_print_date($db->jdate($objp->dateadh),'day')."</td>\n"; print '<td align="center">'.dol_print_date($db->jdate($objp->dateadh),'day')."</td>\n";
print '<td align="center">'.dol_print_date($db->jdate($objp->datef),'day')."</td>\n"; print '<td align="center">'.dol_print_date($db->jdate($objp->datef),'day')."</td>\n";
print '<td align="right">'.price($objp->cotisation).'</td>'; print '<td align="right">'.price($objp->cotisation).'</td>';
if ($conf->banque->enabled) if (! empty($conf->banque->enabled))
{ {
print '<td align="right">'; print '<td align="right">';
if ($objp->bid) if ($objp->bid)
@ -720,7 +720,7 @@ if ($rowid)
// Link for paypal payment // Link for paypal payment
if ($conf->paypal->enabled) if (! empty($conf->paypal->enabled))
{ {
include_once DOL_DOCUMENT_ROOT.'/paypal/lib/paypal.lib.php'; include_once DOL_DOCUMENT_ROOT.'/paypal/lib/paypal.lib.php';
print showPaypalPaymentUrl('membersubscription',$object->ref); print showPaypalPaymentUrl('membersubscription',$object->ref);
@ -740,8 +740,8 @@ if ($rowid)
$bankdirect=0; // Option to write to bank is on by default $bankdirect=0; // Option to write to bank is on by default
$bankviainvoice=0; // Option to write via invoice is on by default $bankviainvoice=0; // Option to write via invoice is on by default
$invoiceonly=0; $invoiceonly=0;
if ($conf->banque->enabled && $conf->global->ADHERENT_BANK_USE && (empty($_POST['paymentsave']) || $_POST["paymentsave"] == 'bankdirect')) $bankdirect=1; if (! empty($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) && ! empty($conf->societe->enabled) && ! empty($conf->facture->enabled) && $object->fk_soc) $bankviainvoice=1;
print "\n\n<!-- Form add subscription -->\n"; print "\n\n<!-- Form add subscription -->\n";
@ -873,7 +873,7 @@ if ($rowid)
print dol_print_date(($datefrom?$datefrom:time()),"%Y").'" ></td></tr>'; print dol_print_date(($datefrom?$datefrom:time()),"%Y").'" ></td></tr>';
// Complementary action // Complementary action
if ($conf->banque->enabled || $conf->facture->enabled) if (! empty($conf->banque->enabled) || ! empty($conf->facture->enabled))
{ {
$company=new Societe($db); $company=new Societe($db);
if ($object->fk_soc) if ($object->fk_soc)
@ -889,12 +889,12 @@ if ($rowid)
print '</td>'; print '</td>';
print '<td>'; print '<td>';
print '<input type="radio" class="moreaction" id="none" name="paymentsave" value="none"'.(!$bankdirect&&!$bankviainvoice?' checked="checked"':'').'> '.$langs->trans("None").'<br>'; print '<input type="radio" class="moreaction" id="none" name="paymentsave" value="none"'.(!$bankdirect&&!$bankviainvoice?' checked="checked"':'').'> '.$langs->trans("None").'<br>';
if ($conf->banque->enabled) if (! empty($conf->banque->enabled))
{ {
print '<input type="radio" class="moreaction" id="bankdirect" name="paymentsave" value="bankdirect"'.($bankdirect?' checked="checked"':''); print '<input type="radio" class="moreaction" id="bankdirect" name="paymentsave" value="bankdirect"'.($bankdirect?' checked="checked"':'');
print '> '.$langs->trans("MoreActionBankDirect").'<br>'; 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"':''); 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"'; if (empty($object->fk_soc) || empty($bankviainvoice)) print ' disabled="disabled"';
@ -909,7 +909,7 @@ if ($rowid)
} }
print '<br>'; 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"':''); 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"'; if (empty($object->fk_soc) || empty($bankviainvoice)) print ' disabled="disabled"';

View File

@ -160,7 +160,7 @@ class Adherent extends CommonObject
// Envoi mail confirmation // Envoi mail confirmation
$from=$conf->email_from; $from=$conf->email_from;
if ($conf->global->ADHERENT_MAIL_FROM) $from=$conf->global->ADHERENT_MAIL_FROM; if (! empty($conf->global->ADHERENT_MAIL_FROM)) $from=$conf->global->ADHERENT_MAIL_FROM;
include_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; include_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
$mailfile = new CMailFile($subjecttosend, $this->email, $from, $texttosend, $filename_list, $mimetype_list, $mimefilename_list, $addr_cc, $addr_bcc, $deliveryreceipt, $msgishtml); $mailfile = new CMailFile($subjecttosend, $this->email, $from, $texttosend, $filename_list, $mimetype_list, $mimefilename_list, $addr_cc, $addr_bcc, $deliveryreceipt, $msgishtml);
@ -1382,7 +1382,7 @@ class Adherent extends CommonObject
} }
// spip // 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); $result=$mailmanspip->add_to_spip($this);
if ($result < 0) 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); $result=$mailmanspip->del_to_spip($this);
if ($result < 0) if ($result < 0)
@ -1787,31 +1787,31 @@ class Adherent extends CommonObject
$this->fullname=$this->getFullName($langs); $this->fullname=$this->getFullName($langs);
// Member // Member
if ($this->fullname && $conf->global->LDAP_MEMBER_FIELD_FULLNAME) $info[$conf->global->LDAP_MEMBER_FIELD_FULLNAME] = $this->fullname; if ($this->fullname && ! empty($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->nom && ! empty($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->prenom && ! empty($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->login && ! empty($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->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 && $conf->global->LDAP_MEMBER_FIELD_TITLE) $info[$conf->global->LDAP_MEMBER_FIELD_TITLE] = $this->poste; if ($this->poste && ! empty($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->adresse && ! empty($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->cp && ! empty($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->ville && ! empty($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->country_code && ! empty($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->email && ! empty($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 && ! empty($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_perso && ! empty($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->phone_mobile && ! empty($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->fax && ! empty($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->note && ! empty($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 ($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) && $conf->global->LDAP_FIELD_MEMBER_STATUS) $info[$conf->global->LDAP_FIELD_MEMBER_STATUS] = $this->statut; if (isset($this->statut) && ! empty($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->datefin && ! empty($conf->global->LDAP_FIELD_MEMBER_END_LASTSUBSCRIPTION)) $info[$conf->global->LDAP_FIELD_MEMBER_END_LASTSUBSCRIPTION] = dol_print_date($this->datefin,'dayhourldap');
// Subscriptions // 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 ($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) && $conf->global->LDAP_FIELD_MEMBER_FIRSTSUBSCRIPTION_AMOUNT) $info[$conf->global->LDAP_FIELD_MEMBER_FIRSTSUBSCRIPTION_AMOUNT] = $this->first_subscription_amount; 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 && $conf->global->LDAP_FIELD_MEMBER_LASTSUBSCRIPTION_DATE) $info[$conf->global->LDAP_FIELD_MEMBER_LASTSUBSCRIPTION_DATE] = dol_print_date($this->last_subscription_date,'dayhourldap'); 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) && $conf->global->LDAP_FIELD_MEMBER_LASTSUBSCRIPTION_AMOUNT) $info[$conf->global->LDAP_FIELD_MEMBER_LASTSUBSCRIPTION_AMOUNT] = $this->last_subscription_amount; 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; return $info;
} }

View File

@ -99,7 +99,7 @@ if ($result)
print_liste_field_titre($langs->trans("Name"),"cotisations.php","d.nom",$param,"","",$sortfield,$sortorder); print_liste_field_titre($langs->trans("Name"),"cotisations.php","d.nom",$param,"","",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Login"),"cotisations.php","d.login",$param,"","",$sortfield,$sortorder); print_liste_field_titre($langs->trans("Login"),"cotisations.php","d.login",$param,"","",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Label"),"cotisations.php","c.note",$param,"",'align="left"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Label"),"cotisations.php","c.note",$param,"",'align="left"',$sortfield,$sortorder);
if ($conf->banque->enabled) if (! empty($conf->banque->enabled))
{ {
print_liste_field_titre($langs->trans("Account"),"cotisations.php","b.fk_account",$pram,"","",$sortfield,$sortorder); print_liste_field_titre($langs->trans("Account"),"cotisations.php","b.fk_account",$pram,"","",$sortfield,$sortorder);
} }
@ -131,7 +131,7 @@ if ($result)
$var=!$var; $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 "<form method=\"post\" action=\"cotisations.php\">";
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
@ -153,7 +153,7 @@ if ($result)
print '</td>'; print '</td>';
// Banque // Banque
if ($conf->banque->enabled) if (! empty($conf->banque->enabled))
{ {
if ($objp->fk_account) if ($objp->fk_account)
{ {
@ -193,7 +193,7 @@ if ($result)
print '<td align="right">'.price($objp->cotisation).'</td>'; print '<td align="right">'.price($objp->cotisation).'</td>';
print "</tr>"; 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"; print "</form>\n";
} }
@ -207,7 +207,7 @@ if ($result)
print "<td align=\"right\">&nbsp;</td>\n"; print "<td align=\"right\">&nbsp;</td>\n";
print "<td align=\"right\">&nbsp;</td>\n"; print "<td align=\"right\">&nbsp;</td>\n";
print "<td align=\"right\">&nbsp;</td>\n"; print "<td align=\"right\">&nbsp;</td>\n";
if ($conf->banque->enabled) if (! empty($conf->banque->enabled))
{ {
print '<td>&nbsp;</td>'; print '<td>&nbsp;</td>';
} }

View File

@ -54,7 +54,7 @@ $socid=GETPOST('socid','int');
// Security check // Security check
$result=restrictedArea($user,'adherent',$rowid); $result=restrictedArea($user,'adherent',$rowid);
if ($conf->mailmanspip->enabled) if (! empty($conf->mailmanspip->enabled))
{ {
include_once DOL_DOCUMENT_ROOT.'/mailmanspip/class/mailmanspip.class.php'; include_once DOL_DOCUMENT_ROOT.'/mailmanspip/class/mailmanspip.class.php';
@ -212,7 +212,7 @@ if ($action == 'confirm_sendinfo' && $confirm == 'yes')
if ($object->email) if ($object->email)
{ {
$from=$conf->email_from; $from=$conf->email_from;
if ($conf->global->ADHERENT_MAIL_FROM) $from=$conf->global->ADHERENT_MAIL_FROM; if (! empty($conf->global->ADHERENT_MAIL_FROM)) $from=$conf->global->ADHERENT_MAIL_FROM;
$result=$object->send_an_email($langs->transnoentitiesnoconv("ThisIsContentOfYourCard")."\n\n%INFOS%\n\n",$langs->transnoentitiesnoconv("CardContent")); $result=$object->send_an_email($langs->transnoentitiesnoconv("ThisIsContentOfYourCard")."\n\n%INFOS%\n\n",$langs->transnoentitiesnoconv("CardContent"));
@ -844,7 +844,7 @@ if ($action == 'create')
/* /*
// Third party Dolibarr // Third party Dolibarr
if ($conf->societe->enabled) if (! empty($conf->societe->enabled))
{ {
print '<tr><td>'.$langs->trans("LinkedToDolibarrThirdParty").'</td><td class="valeur">'; print '<tr><td>'.$langs->trans("LinkedToDolibarrThirdParty").'</td><td class="valeur">';
print $form->select_company($object->fk_soc,'socid','',1); print $form->select_company($object->fk_soc,'socid','',1);
@ -924,7 +924,7 @@ if ($action == 'edit')
$rowspan=15; $rowspan=15;
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) $rowspan++; if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) $rowspan++;
if ($conf->societe->enabled) $rowspan++; if (! empty($conf->societe->enabled)) $rowspan++;
print '<form name="formsoc" action="'.$_SERVER["PHP_SELF"].'" method="post" enctype="multipart/form-data">'; print '<form name="formsoc" action="'.$_SERVER["PHP_SELF"].'" method="post" enctype="multipart/form-data">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'" />'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'" />';
@ -1064,7 +1064,7 @@ if ($action == 'edit')
} }
// Third party Dolibarr // Third party Dolibarr
if ($conf->societe->enabled) if (! empty($conf->societe->enabled))
{ {
print '<tr><td>'.$langs->trans("LinkedToDolibarrThirdParty").'</td><td colspan="2" class="valeur">'; print '<tr><td>'.$langs->trans("LinkedToDolibarrThirdParty").'</td><td colspan="2" class="valeur">';
if ($object->fk_soc) if ($object->fk_soc)
@ -1148,7 +1148,7 @@ if ($rowid && $action != 'edit')
array('label' => $langs->trans("LoginToCreate"), 'type' => 'text', 'name' => 'login', 'value' => $login) array('label' => $langs->trans("LoginToCreate"), 'type' => 'text', 'name' => 'login', 'value' => $login)
); );
$text=$langs->trans("ConfirmCreateLogin").'<br>'; $text=$langs->trans("ConfirmCreateLogin").'<br>';
if ($conf->societe->enabled) if (! empty($conf->societe->enabled))
{ {
if ($object->fk_soc > 0) $text.=$langs->trans("UserWillBeExternalUser"); if ($object->fk_soc > 0) $text.=$langs->trans("UserWillBeExternalUser");
else $text.=$langs->trans("UserWillBeInternalUser"); else $text.=$langs->trans("UserWillBeInternalUser");
@ -1204,8 +1204,8 @@ if ($rowid && $action != 'edit')
// Cree un tableau formulaire // Cree un tableau formulaire
$formquestion=array(); $formquestion=array();
if ($object->email) $formquestion[]=array('type' => 'checkbox', 'name' => 'send_mail', 'label' => $label, 'value' => ($conf->global->ADHERENT_DEFAULT_SENDINFOBYMAIL?true:false)); if ($object->email) $formquestion[]=array('type' => 'checkbox', 'name' => 'send_mail', 'label' => $label, 'value' => ($conf->global->ADHERENT_DEFAULT_SENDINFOBYMAIL?true:false));
if ($conf->global->ADHERENT_USE_MAILMAN) { $formquestion[]=array('type'=>'other','label'=>$langs->transnoentitiesnoconv("SynchroMailManEnabled"),'value'=>''); } if (! empty($conf->global->ADHERENT_USE_MAILMAN)) { $formquestion[]=array('type'=>'other','label'=>$langs->transnoentitiesnoconv("SynchroMailManEnabled"),'value'=>''); }
if ($conf->global->ADHERENT_USE_SPIP) { $formquestion[]=array('type'=>'other','label'=>$langs->transnoentitiesnoconv("SynchroSpipEnabled"),'value'=>''); } if (! empty($conf->global->ADHERENT_USE_SPIP)) { $formquestion[]=array('type'=>'other','label'=>$langs->transnoentitiesnoconv("SynchroSpipEnabled"),'value'=>''); }
print $form->formconfirm("fiche.php?rowid=".$rowid,$langs->trans("ValidateMember"),$langs->trans("ConfirmValidateMember"),"confirm_valid",$formquestion,1); print $form->formconfirm("fiche.php?rowid=".$rowid,$langs->trans("ValidateMember"),$langs->trans("ConfirmValidateMember"),"confirm_valid",$formquestion,1);
} }
@ -1276,7 +1276,7 @@ if ($rowid && $action != 'edit')
$rowspan=17; $rowspan=17;
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) $rowspan++; if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) $rowspan++;
if ($conf->societe->enabled) $rowspan++; if (! empty($conf->societe->enabled)) $rowspan++;
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
@ -1382,7 +1382,7 @@ if ($rowid && $action != 'edit')
} }
// Third party Dolibarr // Third party Dolibarr
if ($conf->societe->enabled) if (! empty($conf->societe->enabled))
{ {
print '<tr><td>'; print '<tr><td>';
print '<table class="nobordernopadding" width="100%"><tr><td>'; print '<table class="nobordernopadding" width="100%"><tr><td>';
@ -1532,7 +1532,7 @@ if ($rowid && $action != 'edit')
} }
// Create third party // Create third party
if ($conf->societe->enabled && ! $object->fk_soc) if (! empty($conf->societe->enabled) && ! $object->fk_soc)
{ {
if ($user->rights->societe->creer) if ($user->rights->societe->creer)
{ {
@ -1570,7 +1570,7 @@ if ($rowid && $action != 'edit')
} }
// Action SPIP // 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); $isinspip = $mailmanspip->is_in_spip($object);

View File

@ -66,7 +66,7 @@ if ($user->rights->adherent->cotisation->creer && $_REQUEST["action"] == 'update
// If transaction consolidated // If transaction consolidated
if ($accountline->rappro) if ($accountline->rappro)
{ {
$errmsg=$langs->trans("SubscriptionLinkedToConciliatedTrnasaction"); $errmsg=$langs->trans("SubscriptionLinkedToConciliatedTransaction");
} }
else else
{ {
@ -220,7 +220,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'edit')
print '<input type="text" class="flat" size="60" name="note" value="'.$subscription->note.'"></td></tr>'; print '<input type="text" class="flat" size="60" name="note" value="'.$subscription->note.'"></td></tr>';
// Bank line // Bank line
if ($conf->banque->enabled) if (! empty($conf->banque->enabled))
{ {
if ($conf->global->ADHERENT_BANK_USE || $subscription->fk_bank) if ($conf->global->ADHERENT_BANK_USE || $subscription->fk_bank)
{ {
@ -290,7 +290,7 @@ if ($rowid && $action != 'edit')
//$formquestion=array(); //$formquestion=array();
//$formquestion['text']='<b>'.$langs->trans("ThisWillAlsoDeleteBankRecord").'</b>'; //$formquestion['text']='<b>'.$langs->trans("ThisWillAlsoDeleteBankRecord").'</b>';
$text=$langs->trans("ConfirmDeleteSubscription"); $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); $ret=$form->form_confirm($_SERVER["PHP_SELF"]."?rowid=".$subscription->id,$langs->trans("DeleteSubscription"),$text,"confirm_delete",$formquestion,0,1);
if ($ret == 'html') print '<br>'; if ($ret == 'html') print '<br>';
} }
@ -335,7 +335,7 @@ if ($rowid && $action != 'edit')
print '<tr><td>'.$langs->trans("Label").'</td><td class="valeur" colspan="3">'.$subscription->note.'</td></tr>'; print '<tr><td>'.$langs->trans("Label").'</td><td class="valeur" colspan="3">'.$subscription->note.'</td></tr>';
// Bank line // Bank line
if ($conf->banque->enabled) if (! empty($conf->banque->enabled))
{ {
if ($conf->global->ADHERENT_BANK_USE || $subscription->fk_bank) if ($conf->global->ADHERENT_BANK_USE || $subscription->fk_bank)
{ {

View File

@ -120,7 +120,7 @@ print '</tr>';
print '<tr><td>'.$langs->trans("Login").'</td><td class="valeur">'.$adh->login.'&nbsp;</td></tr>'; print '<tr><td>'.$langs->trans("Login").'</td><td class="valeur">'.$adh->login.'&nbsp;</td></tr>';
// Password not crypted // Password not crypted
if ($conf->global->LDAP_MEMBER_FIELD_PASSWORD) if (! empty($conf->global->LDAP_MEMBER_FIELD_PASSWORD))
{ {
print '<tr><td>'.$langs->trans("LDAPFieldPasswordNotCrypted").'</td>'; print '<tr><td>'.$langs->trans("LDAPFieldPasswordNotCrypted").'</td>';
print '<td class="valeur">'.$adh->pass.'</td>'; print '<td class="valeur">'.$adh->pass.'</td>';
@ -128,7 +128,7 @@ if ($conf->global->LDAP_MEMBER_FIELD_PASSWORD)
} }
// Password crypted // Password crypted
if ($conf->global->LDAP_MEMBER_FIELD_PASSWORD_CRYPTED) if (! empty($conf->global->LDAP_MEMBER_FIELD_PASSWORD_CRYPTED))
{ {
print '<tr><td>'.$langs->trans("LDAPFieldPasswordCrypted").'</td>'; print '<tr><td>'.$langs->trans("LDAPFieldPasswordCrypted").'</td>';
print '<td class="valeur">'.$adh->pass_crypted.'</td>'; print '<td class="valeur">'.$adh->pass_crypted.'</td>';

View File

@ -198,7 +198,7 @@ if ($resql)
// Filter on categories // Filter on categories
$moreforfilter=''; $moreforfilter='';
if ($conf->categorie->enabled) if (! empty($conf->categorie->enabled))
{ {
$moreforfilter.=$langs->trans('Categories'). ': '; $moreforfilter.=$langs->trans('Categories'). ': ';
$moreforfilter.=$formother->select_categories(3,$search_categ,'search_categ',1); $moreforfilter.=$formother->select_categories(3,$search_categ,'search_categ',1);

View File

@ -290,7 +290,7 @@ if (! isset($_SERVER['WINDIR']))
} }
// Module produits // Module produits
if ($conf->societe->enabled) if (! empty($conf->societe->enabled))
{ {
$var=!$var; $var=!$var;
print "<form method=\"post\" action=\"".$_SERVER["PHP_SELF"]."\">"; print "<form method=\"post\" action=\"".$_SERVER["PHP_SELF"]."\">";
@ -308,7 +308,7 @@ if ($conf->societe->enabled)
} }
// Module produits // Module produits
if ($conf->product->enabled) if (! empty($conf->product->enabled))
{ {
$var=!$var; $var=!$var;
print "<form method=\"post\" action=\"".$_SERVER["PHP_SELF"]."\">"; print "<form method=\"post\" action=\"".$_SERVER["PHP_SELF"]."\">";

View File

@ -661,7 +661,7 @@ else
$var=!$var; $var=!$var;
print '<tr '.$bc[$var].'><td>'.$langs->trans("State").'</td><td>'; print '<tr '.$bc[$var].'><td>'.$langs->trans("State").'</td><td>';
if ($conf->global->MAIN_INFO_SOCIETE_DEPARTEMENT) print getState($conf->global->MAIN_INFO_SOCIETE_DEPARTEMENT); if (! empty($conf->global->MAIN_INFO_SOCIETE_DEPARTEMENT)) print getState($conf->global->MAIN_INFO_SOCIETE_DEPARTEMENT);
else print '&nbsp;'; else print '&nbsp;';
print '</td></tr>'; print '</td></tr>';

View File

@ -113,7 +113,7 @@ print "</tr>\n";
print '<tr '.$bc[false].'><td width="200"><input type="radio" name="compta_mode" value="RECETTES-DEPENSES"'.($compta_mode != 'CREANCES-DETTES' ? ' checked' : '').'> '.$langs->trans('OptionModeTrue').'</td>'; print '<tr '.$bc[false].'><td width="200"><input type="radio" name="compta_mode" value="RECETTES-DEPENSES"'.($compta_mode != 'CREANCES-DETTES' ? ' checked' : '').'> '.$langs->trans('OptionModeTrue').'</td>';
print '<td colspan="2">'.nl2br($langs->trans('OptionModeTrueDesc')); print '<td colspan="2">'.nl2br($langs->trans('OptionModeTrueDesc'));
// Write info on way to count VAT // Write info on way to count VAT
if ($conf->global->MAIN_MODULE_COMPTABILITE) if (! empty($conf->global->MAIN_MODULE_COMPTABILITE))
{ {
// print "<br>\n"; // print "<br>\n";
// print nl2br($langs->trans('OptionModeTrueInfoModuleComptabilite')); // print nl2br($langs->trans('OptionModeTrueInfoModuleComptabilite'));

View File

@ -84,14 +84,14 @@ $head[$h][1] = $langs->trans("Setup");
$hselected=$h; $hselected=$h;
$h++; $h++;
if ($conf->global->MAIN_SUBMODULE_EXPEDITION) if (! empty($conf->global->MAIN_SUBMODULE_EXPEDITION))
{ {
$head[$h][0] = DOL_URL_ROOT."/admin/expedition.php"; $head[$h][0] = DOL_URL_ROOT."/admin/expedition.php";
$head[$h][1] = $langs->trans("Sending"); $head[$h][1] = $langs->trans("Sending");
$h++; $h++;
} }
if ($conf->global->MAIN_SUBMODULE_LIVRAISON) if (! empty($conf->global->MAIN_SUBMODULE_LIVRAISON))
{ {
$head[$h][0] = DOL_URL_ROOT."/admin/livraison.php"; $head[$h][0] = DOL_URL_ROOT."/admin/livraison.php";
$head[$h][1] = $langs->trans("Receivings"); $head[$h][1] = $langs->trans("Receivings");

View File

@ -206,7 +206,7 @@ $head[$h][1] = $langs->trans("Sending");
$hselected=$h; $hselected=$h;
$h++; $h++;
if ($conf->global->MAIN_SUBMODULE_LIVRAISON) if (! empty($conf->global->MAIN_SUBMODULE_LIVRAISON))
{ {
$head[$h][0] = DOL_URL_ROOT."/admin/livraison.php"; $head[$h][0] = DOL_URL_ROOT."/admin/livraison.php";
$head[$h][1] = $langs->trans("Receivings"); $head[$h][1] = $langs->trans("Receivings");

View File

@ -628,7 +628,7 @@ $var=!$var;
print '<tr '.$bc[$var].'>'; print '<tr '.$bc[$var].'>';
print "<td>".$langs->trans("SuggestPaymentByRIBOnAccount")."</td>"; print "<td>".$langs->trans("SuggestPaymentByRIBOnAccount")."</td>";
print "<td>"; print "<td>";
if ($conf->banque->enabled) if (! empty($conf->banque->enabled))
{ {
$sql = "SELECT rowid, label"; $sql = "SELECT rowid, label";
$sql.= " FROM ".MAIN_DB_PREFIX."bank_account"; $sql.= " FROM ".MAIN_DB_PREFIX."bank_account";

View File

@ -69,7 +69,7 @@ foreach($modules as $const => $desc)
{ {
dolibarr_set_const($db, "FCKEDITOR_ENABLE_".$const, "1",'chaine',0,'',$conf->entity); 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 // 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); dolibarr_set_const($db, "FCKEDITOR_ENABLE_DETAILS", "1",'chaine',0,'',$conf->entity);
} }

View File

@ -124,7 +124,7 @@ if ($conf->global->LDAP_SYNCHRO_ACTIVE && ! $conf->global->LDAP_USER_DN)
print '</td></tr>'; print '</td></tr>';
// Synchro contact active // Synchro contact active
if ($conf->societe->enabled) if (! empty($conf->societe->enabled))
{ {
$var=!$var; $var=!$var;
print '<tr '.$bc[$var].'><td>'.$langs->trans("LDAPDnContactActive").'</td><td>'; print '<tr '.$bc[$var].'><td>'.$langs->trans("LDAPDnContactActive").'</td><td>';
@ -136,7 +136,7 @@ if ($conf->societe->enabled)
} }
// Synchro adherentt active // Synchro adherentt active
if ($conf->adherent->enabled) if (! empty($conf->adherent->enabled))
{ {
$var=!$var; $var=!$var;
print '<tr '.$bc[$var].'><td>'.$langs->trans("LDAPDnMemberActive").'</td><td>'; print '<tr '.$bc[$var].'><td>'.$langs->trans("LDAPDnMemberActive").'</td><td>';
@ -189,7 +189,7 @@ print '</td><td>'.$langs->trans("LDAPServerExample").'</td></tr>';
// Port // Port
$var=!$var; $var=!$var;
print '<tr '.$bc[$var].'><td>'.$langs->trans("LDAPServerPort").'</td><td>'; print '<tr '.$bc[$var].'><td>'.$langs->trans("LDAPServerPort").'</td><td>';
if ($conf->global->LDAP_SERVER_PORT) if (! empty($conf->global->LDAP_SERVER_PORT))
{ {
print '<input size="25" type="text" name="port" value="'.$conf->global->LDAP_SERVER_PORT.'">'; print '<input size="25" type="text" name="port" value="'.$conf->global->LDAP_SERVER_PORT.'">';
} }
@ -227,7 +227,7 @@ print '</td><td>'.$langs->trans("LDAPAdminDnExample").'</td></tr>';
// Pass // Pass
$var=!$var; $var=!$var;
print '<tr '.$bc[$var].'><td>'.$langs->trans("LDAPPassword").'</td><td>'; print '<tr '.$bc[$var].'><td>'.$langs->trans("LDAPPassword").'</td><td>';
if ($conf->global->LDAP_ADMIN_PASS) if (! empty($conf->global->LDAP_ADMIN_PASS))
{ {
print '<input size="25" type="password" name="pass" value="'.$conf->global->LDAP_ADMIN_PASS.'">';// je le met en visible pour test print '<input size="25" type="password" name="pass" value="'.$conf->global->LDAP_ADMIN_PASS.'">';// je le met en visible pour test
} }
@ -252,7 +252,7 @@ print '</div>';
*/ */
if (function_exists("ldap_connect")) if (function_exists("ldap_connect"))
{ {
if ($conf->global->LDAP_SERVER_HOST) if (! empty($conf->global->LDAP_SERVER_HOST))
{ {
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=test">'.$langs->trans("LDAPTestConnect").'</a><br><br>'; print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=test">'.$langs->trans("LDAPTestConnect").'</a><br><br>';
} }
@ -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 '<font class="ok">'.$langs->trans("LDAPTCPConnectOK",$conf->global->LDAP_SERVER_HOST,$conf->global->LDAP_SERVER_PORT).'</font>';
print '<br>'; 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) if ($result == 2)
{ {

View File

@ -373,7 +373,7 @@ print info_admin($langs->trans("LDAPDescValues"));
/* /*
* Test de la connexion * Test de la connexion
*/ */
if ($conf->global->LDAP_MEMBER_ACTIVE) if (! empty($conf->global->LDAP_MEMBER_ACTIVE))
{ {
$butlabel=$langs->trans("LDAPTestSynchroMember"); $butlabel=$langs->trans("LDAPTestSynchroMember");
$testlabel='testmember'; $testlabel='testmember';

View File

@ -189,7 +189,7 @@ $head[$h][0] = DOL_URL_ROOT."/admin/confexped.php";
$head[$h][1] = $langs->trans("Setup"); $head[$h][1] = $langs->trans("Setup");
$h++; $h++;
if ($conf->global->MAIN_SUBMODULE_EXPEDITION) if (! empty($conf->global->MAIN_SUBMODULE_EXPEDITION))
{ {
$head[$h][0] = DOL_URL_ROOT."/admin/expedition.php"; $head[$h][0] = DOL_URL_ROOT."/admin/expedition.php";
$head[$h][1] = $langs->trans("Sending"); $head[$h][1] = $langs->trans("Sending");

View File

@ -627,7 +627,7 @@ else
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=test&amp;mode=init">'.$langs->trans("DoTestSend").'</a>'; print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=test&amp;mode=init">'.$langs->trans("DoTestSend").'</a>';
if ($conf->fckeditor->enabled) if (! empty($conf->fckeditor->enabled))
{ {
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=testhtml&amp;mode=init">'.$langs->trans("DoTestSendHTML").'</a>'; print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=testhtml&amp;mode=init">'.$langs->trans("DoTestSendHTML").'</a>';
} }

View File

@ -160,7 +160,7 @@ print '<br>';
* Notifications * Notifications
*/ */
if ($conf->global->MAIN_MODULE_NOTIFICATION) if (! empty($conf->global->MAIN_MODULE_NOTIFICATION))
{ {
$langs->load("mails"); $langs->load("mails");
print_titre($langs->trans("Notifications")); print_titre($langs->trans("Notifications"));

View File

@ -301,7 +301,7 @@ $var=!$var;
print "<tr ".$bc[$var].">"; print "<tr ".$bc[$var].">";
print '<td colspan="3">'.$langs->trans("DoNotStoreClearPassword").'</td>'; print '<td colspan="3">'.$langs->trans("DoNotStoreClearPassword").'</td>';
print '<td align="center" width="60">'; print '<td align="center" width="60">';
if ($conf->global->DATABASE_PWD_ENCRYPTED) if (! empty($conf->global->DATABASE_PWD_ENCRYPTED))
{ {
print img_picto($langs->trans("Active"),'tick'); print img_picto($langs->trans("Active"),'tick');
} }
@ -312,7 +312,7 @@ if (! $conf->global->DATABASE_PWD_ENCRYPTED)
print '<a href="security.php?action=activate_encrypt">'.$langs->trans("Activate").'</a>'; print '<a href="security.php?action=activate_encrypt">'.$langs->trans("Activate").'</a>';
print "</td>"; print "</td>";
} }
if($conf->global->DATABASE_PWD_ENCRYPTED) if (! empty($conf->global->DATABASE_PWD_ENCRYPTED))
{ {
print '<td align="center" width="100">'; print '<td align="center" width="100">';
if ($allow_disable_encryption) if ($allow_disable_encryption)

View File

@ -133,7 +133,7 @@ print " <td align=\"right\" width=\"160\">&nbsp;</td>\n";
print '</tr>'."\n"; print '</tr>'."\n";
$var=true; $var=true;
if ($conf->facture->enabled) if (! empty($conf->facture->enabled))
{ {
$var=!$var; $var=!$var;
print "<tr ".$bc[$var].">"; print "<tr ".$bc[$var].">";
@ -147,7 +147,7 @@ if ($conf->facture->enabled)
print "</form>\n</td>\n</tr>\n"; print "</form>\n</td>\n</tr>\n";
} }
if ($conf->commande->enabled) if (! empty($conf->commande->enabled))
{ {
$var=!$var; $var=!$var;
print "<tr ".$bc[$var].">"; print "<tr ".$bc[$var].">";
@ -161,7 +161,7 @@ if ($conf->commande->enabled)
print "</form>\n</td>\n</tr>\n"; print "</form>\n</td>\n</tr>\n";
} }
if ($conf->expedition->enabled) if (! empty($conf->expedition->enabled))
{ {
$var=!$var; $var=!$var;
print "<tr ".$bc[$var].">"; print "<tr ".$bc[$var].">";
@ -183,7 +183,7 @@ print " <td align=\"right\" width=\"160\">&nbsp;</td>\n";
print '</tr>'."\n"; print '</tr>'."\n";
$var=true; $var=true;
if ($conf->fournisseur->enabled) if (! empty($conf->fournisseur->enabled))
{ {
$var=!$var; $var=!$var;
print "<tr ".$bc[$var].">"; print "<tr ".$bc[$var].">";
@ -197,7 +197,7 @@ if ($conf->fournisseur->enabled)
print "</form>\n</td>\n</tr>\n"; print "</form>\n</td>\n</tr>\n";
} }
if ($conf->fournisseur->enabled) if (! empty($conf->fournisseur->enabled))
{ {
$var=!$var; $var=!$var;
print "<tr ".$bc[$var].">"; print "<tr ".$bc[$var].">";
@ -210,7 +210,7 @@ if ($conf->fournisseur->enabled)
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">'; print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
print "</form>\n</td>\n</tr>\n"; print "</form>\n</td>\n</tr>\n";
} }
if ($conf->fournisseur->enabled) if (! empty($conf->fournisseur->enabled))
{ {
$var=!$var; $var=!$var;
print "<tr ".$bc[$var].">"; print "<tr ".$bc[$var].">";

View File

@ -36,7 +36,7 @@ $choice=GETPOST('choice');
// Define filelog to discard it from purge // Define filelog to discard it from purge
$filelog=''; $filelog='';
if ($conf->syslog->enabled) if (! empty($conf->syslog->enabled))
{ {
$filelog=SYSLOG_FILE; $filelog=SYSLOG_FILE;
$filelog=preg_replace('/DOL_DATA_ROOT/i',DOL_DATA_ROOT,$filelog); $filelog=preg_replace('/DOL_DATA_ROOT/i',DOL_DATA_ROOT,$filelog);
@ -131,7 +131,7 @@ print '<table class="border" width="100%">';
print '<tr class="border"><td style="padding: 4px">'; print '<tr class="border"><td style="padding: 4px">';
if ($conf->syslog->enabled) if (! empty($conf->syslog->enabled))
{ {
print '<input type="radio" name="choice" value="logfile"'; print '<input type="radio" name="choice" value="logfile"';
print ($choice && $choice=='logfile') ? ' checked="checked"' : ''; print ($choice && $choice=='logfile') ? ' checked="checked"' : '';

View File

@ -66,7 +66,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
// Security check // Security check
if (! $conf->clicktodial->enabled) if (empty($conf->clicktodial->enabled))
{ {
accessforbidden(); accessforbidden();
exit; exit;

View File

@ -105,7 +105,7 @@ print '<tr '.$bc[$var].'><td width=\"50%\">'.$langs->trans("CashDeskThirdPartyFo
print '<td colspan="2">'; print '<td colspan="2">';
print $form->select_company($conf->global->CASHDESK_ID_THIRDPARTY,'socid','s.client in (1,3)',1,1); print $form->select_company($conf->global->CASHDESK_ID_THIRDPARTY,'socid','s.client in (1,3)',1,1);
print '</td></tr>'; print '</td></tr>';
if ($conf->banque->enabled) if (! empty($conf->banque->enabled))
{ {
$var=!$var; $var=!$var;
print '<tr '.$bc[$var].'><td>'.$langs->trans("CashDeskBankAccountForSell").'</td>'; print '<tr '.$bc[$var].'><td>'.$langs->trans("CashDeskBankAccountForSell").'</td>';
@ -126,7 +126,7 @@ if ($conf->banque->enabled)
print '</td></tr>'; print '</td></tr>';
} }
if ($conf->stock->enabled) if (! empty($conf->stock->enabled))
{ {
$var=!$var; $var=!$var;
print '<tr '.$bc[$var].'><td>'.$langs->trans("CashDeskIdWareHouse").'</td>'; print '<tr '.$bc[$var].'><td>'.$langs->trans("CashDeskIdWareHouse").'</td>';
@ -135,7 +135,7 @@ if ($conf->stock->enabled)
print '</td></tr>'; print '</td></tr>';
} }
if ($conf->service->enabled) if (! empty($conf->service->enabled))
{ {
$var=! $var; $var=! $var;
print '<tr '.$bc[$var].'><td>'; print '<tr '.$bc[$var].'><td>';

View File

@ -144,7 +144,7 @@ class Facturation
$newcartarray[$i]['price']=$product->price; $newcartarray[$i]['price']=$product->price;
$newcartarray[$i]['price_ttc']=$product->price_ttc; $newcartarray[$i]['price_ttc']=$product->price_ttc;
if ($conf->global->PRODUIT_MULTIPRICES) if (! empty($conf->global->PRODUIT_MULTIPRICES))
{ {
if (isset($product->multiprices[$societe->price_level])) if (isset($product->multiprices[$societe->price_level]))
{ {

View File

@ -30,14 +30,14 @@ if ( $_GET['filtre'] ) {
$ret=array(); $i=0; $ret=array(); $i=0;
$sql = "SELECT p.rowid, p.ref, p.label, p.tva_tx, p.fk_product_type"; $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"; $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.= " WHERE p.entity IN (".getEntity('product', 1).")";
$sql.= " AND p.tosell = 1"; $sql.= " AND p.tosell = 1";
if(!$conf->global->CASHDESK_SERVICES) $sql.= " AND p.fk_product_type = 0"; if(!$conf->global->CASHDESK_SERVICES) $sql.= " AND p.fk_product_type = 0";
$sql.= " AND (p.ref LIKE '%".$_GET['filtre']."%' OR p.label LIKE '%".$_GET['filtre']."%' "; $sql.= " AND (p.ref LIKE '%".$_GET['filtre']."%' OR p.label LIKE '%".$_GET['filtre']."%' ";
if ($conf->barcode->enabled) $sql.= " OR p.barcode LIKE '%".$_GET['filtre']."%')"; if (! empty($conf->barcode->enabled)) $sql.= " OR p.barcode LIKE '%".$_GET['filtre']."%')";
else $sql.= ")"; else $sql.= ")";
$sql.= " ORDER BY label"; $sql.= " ORDER BY label";
@ -67,9 +67,9 @@ if ( $_GET['filtre'] ) {
$i=0; $i=0;
$sql = "SELECT p.rowid, ref, label, tva_tx, p.fk_product_type"; $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"; $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.= " WHERE p.entity IN (".getEntity('product', 1).")";
$sql.= " AND p.tosell = 1"; $sql.= " AND p.tosell = 1";
if(!$conf->global->CASHDESK_SERVICES) $sql.= " AND p.fk_product_type = 0"; if(!$conf->global->CASHDESK_SERVICES) $sql.= " AND p.fk_product_type = 0";

View File

@ -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 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"; $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"; $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.= " WHERE p.entity IN (".getEntity('product', 1).")";
$sql.= " AND p.tosell = 1"; $sql.= " AND p.tosell = 1";
$sql.= " AND p.fk_product_type = 0"; $sql.= " AND p.fk_product_type = 0";

View File

@ -32,9 +32,9 @@ switch ( $_GET['action'] )
if ( $_POST['hdnSource'] != 'NULL' ) if ( $_POST['hdnSource'] != 'NULL' )
{ {
$sql = "SELECT p.rowid, p.ref, p.price, p.tva_tx"; $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"; $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.= " WHERE p.entity IN (".getEntity('product', 1).")";
// Recuperation des donnees en fonction de la source (liste deroulante ou champ texte) ... // Recuperation des donnees en fonction de la source (liste deroulante ou champ texte) ...
@ -62,7 +62,7 @@ switch ( $_GET['action'] )
} }
/** add Ditto for MultiPrix*/ /** add Ditto for MultiPrix*/
if ($conf->global->PRODUIT_MULTIPRICES) if (! empty($conf->global->PRODUIT_MULTIPRICES))
{ {
$thirdpartyid = $_SESSION['CASHDESK_ID_THIRDPARTY']; $thirdpartyid = $_SESSION['CASHDESK_ID_THIRDPARTY'];
$productid = $ret['rowid']; $productid = $ret['rowid'];

View File

@ -98,7 +98,7 @@ print $form->select_company(GETPOST('socid','int')?GETPOST('socid','int'):$conf-
print '</td>'; print '</td>';
print "</tr>\n"; print "</tr>\n";
if ($conf->stock->enabled) if (! empty($conf->stock->enabled))
{ {
$langs->load("stocks"); $langs->load("stocks");
print "<tr>"; print "<tr>";

View File

@ -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 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"); $retour=$langs->trans("CashDeskSetupStock");
header('Location: '.DOL_URL_ROOT.'/cashdesk/index.php?err='.urlencode($retour).'&user='.$username.'&socid='.$thirdpartyid.'&warehouseid='.$warehouseid); header('Location: '.DOL_URL_ROOT.'/cashdesk/index.php?err='.urlencode($retour).'&user='.$username.'&socid='.$thirdpartyid.'&warehouseid='.$warehouseid);
exit; 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"); $langs->load("errors");
$retour=$langs->trans("ErrorModuleSetupNotComplete"); $retour=$langs->trans("ErrorModuleSetupNotComplete");

View File

@ -74,7 +74,7 @@ $langs->load("cashdesk");
$label = $tab_designations[$i]['label']; $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'); 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 "; print '</option>'."\n ";
} }
@ -92,7 +92,7 @@ $langs->load("cashdesk");
$label = $tab_designations[$i]['label']; $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'); 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 "; print '</option>'."\n ";
} }

View File

@ -48,7 +48,7 @@ if (!empty($conf->global->CASHDESK_ID_BANKACCOUNT_CHEQUE))
$bankcheque->fetch($conf->global->CASHDESK_ID_BANKACCOUNT_CHEQUE); $bankcheque->fetch($conf->global->CASHDESK_ID_BANKACCOUNT_CHEQUE);
$bankchequeLink = $bankcheque->getNomUrl(1); $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=new Entrepot($db);
$warehouse->fetch($_SESSION["CASHDESK_ID_WAREHOUSE"]); $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("CashDeskBankCash").': '.$bankcashLink.'<br>';
print $langs->trans("CashDeskBankCB").': '.$bankcbLink.'<br>'; print $langs->trans("CashDeskBankCB").': '.$bankcbLink.'<br>';
print $langs->trans("CashDeskBankCheque").': '.$bankchequeLink.'<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; print $langs->trans("CashDeskWarehouse").': '.$warehouseLink;
} }

View File

@ -161,7 +161,7 @@ switch ($action)
$product->fetch($tab_liste[$i]['fk_article']); $product->fetch($tab_liste[$i]['fk_article']);
$ret=array('label'=>$product->label,'tva_tx'=>$product->tva_tx,'price'=>$product->price); $ret=array('label'=>$product->label,'tva_tx'=>$product->tva_tx,'price'=>$product->price);
if ($conf->global->PRODUIT_MULTIPRICES) if (! empty($conf->global->PRODUIT_MULTIPRICES))
{ {
if (isset($product->multiprices[$societe->price_level])) if (isset($product->multiprices[$societe->price_level]))
{ {

View File

@ -182,7 +182,7 @@ if ($socid)
require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
$langs->load("companies"); $langs->load("companies");
if ($conf->notification->enabled) $langs->load("mails"); if (! empty($conf->notification->enabled)) $langs->load("mails");
$soc = new Societe($db); $soc = new Societe($db);
$result = $soc->fetch($socid); $result = $soc->fetch($socid);
@ -363,7 +363,7 @@ else if ($id || $ref)
$rowspan=5; $rowspan=5;
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) $rowspan+=1; if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) $rowspan+=1;
if ($conf->societe->enabled) $rowspan++; if (! empty($conf->societe->enabled)) $rowspan++;
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';

View File

@ -147,7 +147,7 @@ class Categorie
dol_syslog(get_class($this).'::create sql='.$sql); dol_syslog(get_class($this).'::create sql='.$sql);
$sql = "INSERT INTO ".MAIN_DB_PREFIX."categorie (label, description,"; $sql = "INSERT INTO ".MAIN_DB_PREFIX."categorie (label, description,";
if ($conf->global->CATEGORY_ASSIGNED_TO_A_CUSTOMER) if (! empty($conf->global->CATEGORY_ASSIGNED_TO_A_CUSTOMER))
{ {
$sql.= "fk_soc,"; $sql.= "fk_soc,";
} }
@ -157,7 +157,7 @@ class Categorie
//$sql.= ", fk_parent_id"; //$sql.= ", fk_parent_id";
$sql.= ")"; $sql.= ")";
$sql.= " VALUES ('".$this->db->escape($this->label)."', '".$this->db->escape($this->description)."',"; $sql.= " VALUES ('".$this->db->escape($this->label)."', '".$this->db->escape($this->description)."',";
if ($conf->global->CATEGORY_ASSIGNED_TO_A_CUSTOMER) if (! empty($conf->global->CATEGORY_ASSIGNED_TO_A_CUSTOMER))
{ {
$sql.= ($this->socid != -1 ? $this->socid : 'null').","; $sql.= ($this->socid != -1 ? $this->socid : 'null').",";
} }
@ -269,7 +269,7 @@ class Categorie
{ {
$sql .= ", description = '".$this->db->escape($this->description)."'"; $sql .= ", description = '".$this->db->escape($this->description)."'";
} }
if ($conf->global->CATEGORY_ASSIGNED_TO_A_CUSTOMER) if (! empty($conf->global->CATEGORY_ASSIGNED_TO_A_CUSTOMER))
{ {
$sql .= ", fk_soc = ".($this->socid != -1 ? $this->socid : 'null'); $sql .= ", fk_soc = ".($this->socid != -1 ? $this->socid : 'null');
} }

View File

@ -129,7 +129,7 @@ if ($object->id)
print '</td></tr>'; print '</td></tr>';
// Visibility // 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) if ($object->socid)
{ {

View File

@ -33,7 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
if ($conf->projet->enabled) require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; if (! empty($conf->projet->enabled)) require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
$langs->load("companies"); $langs->load("companies");
$langs->load("commercial"); $langs->load("commercial");
@ -222,7 +222,7 @@ if ($objectid > 0)
print '</td></tr>'; print '</td></tr>';
// Project // Project
if ($conf->projet->enabled) if (! empty($conf->projet->enabled))
{ {
print '<tr><td valign="top">'.$langs->trans("Project").'</td><td colspan="3">'; print '<tr><td valign="top">'.$langs->trans("Project").'</td><td colspan="3">';
if ($act->fk_project) if ($act->fk_project)

View File

@ -760,7 +760,7 @@ if ($id)
print '</td></tr>'; print '</td></tr>';
// Project // Project
if ($conf->projet->enabled) if (! empty($conf->projet->enabled))
{ {
// Projet associe // Projet associe
$langs->load("project"); $langs->load("project");
@ -927,7 +927,7 @@ if ($id)
print '</td></tr>'; print '</td></tr>';
// Project // Project
if ($conf->projet->enabled) if (! empty($conf->projet->enabled))
{ {
print '<tr><td valign="top">'.$langs->trans("Project").'</td><td colspan="3">'; print '<tr><td valign="top">'.$langs->trans("Project").'</td><td colspan="3">';
if ($act->fk_project) if ($act->fk_project)

View File

@ -31,7 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/agenda.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/agenda.lib.php';
if ($conf->projet->enabled) require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; if (! empty($conf->projet->enabled)) require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php';
if (! isset($conf->global->AGENDA_MAX_EVENTS_DAY_VIEW)) $conf->global->AGENDA_MAX_EVENTS_DAY_VIEW=3; if (! isset($conf->global->AGENDA_MAX_EVENTS_DAY_VIEW)) $conf->global->AGENDA_MAX_EVENTS_DAY_VIEW=3;

View File

@ -212,7 +212,7 @@ if ($action == 'create')
print "</td></tr>"; print "</td></tr>";
// Project // Project
if ($conf->projet->enabled) if (! empty($conf->projet->enabled))
{ {
$projectid = 0; $projectid = 0;
if ($origin == 'project') $projectid = ($originid?$originid:0); if ($origin == 'project') $projectid = ($originid?$originid:0);
@ -294,7 +294,7 @@ if ($action == 'create')
} }
print '</td></tr>'; print '</td></tr>';
if ($conf->global->PRODUCT_SHOW_WHEN_CREATE) print '<tr><td colspan="3">&nbsp;</td></tr>'; if (! empty($conf->global->PRODUCT_SHOW_WHEN_CREATE)) print '<tr><td colspan="3">&nbsp;</td></tr>';
print '<tr><td valign="top"><input type="radio" name="createmode" value="empty" checked="checked"></td>'; print '<tr><td valign="top"><input type="radio" name="createmode" value="empty" checked="checked"></td>';
print '<td valign="top" colspan="2">'.$langs->trans("CreateEmptyPropal").'</td></tr>'; print '<td valign="top" colspan="2">'.$langs->trans("CreateEmptyPropal").'</td></tr>';
@ -303,7 +303,7 @@ if ($action == 'create')
if (! empty($conf->global->PRODUCT_SHOW_WHEN_CREATE)) if (! empty($conf->global->PRODUCT_SHOW_WHEN_CREATE))
{ {
print '<tr><td colspan="3">'; 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"); $lib=$langs->trans("ProductsAndServices");

View File

@ -31,20 +31,20 @@ require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
if ($conf->facture->enabled) require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; if (! empty($conf->facture->enabled)) require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
if ($conf->propal->enabled) require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; if (! empty($conf->propal->enabled)) require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
if ($conf->commande->enabled) require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; if (! empty($conf->commande->enabled)) require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
if ($conf->contrat->enabled) require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; if (! empty($conf->contrat->enabled)) require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
if ($conf->adherent->enabled) require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; if (! empty($conf->adherent->enabled)) require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
if ($conf->ficheinter->enabled) require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php'; if (! empty($conf->ficheinter->enabled)) require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php';
$langs->load("companies"); $langs->load("companies");
if ($conf->contrat->enabled) $langs->load("contracts"); if (! empty($conf->contrat->enabled)) $langs->load("contracts");
if ($conf->commande->enabled) $langs->load("orders"); if (! empty($conf->commande->enabled)) $langs->load("orders");
if ($conf->facture->enabled) $langs->load("bills"); if (! empty($conf->facture->enabled)) $langs->load("bills");
if ($conf->projet->enabled) $langs->load("projects"); if (! empty($conf->projet->enabled)) $langs->load("projects");
if ($conf->ficheinter->enabled) $langs->load("interventions"); if (! empty($conf->ficheinter->enabled)) $langs->load("interventions");
if ($conf->notification->enabled) $langs->load("mails"); if (! empty($conf->notification->enabled)) $langs->load("mails");
// Security check // Security check
$id = (GETPOST('socid','int') ? GETPOST('socid','int') : GETPOST('id','int')); $id = (GETPOST('socid','int') ? GETPOST('socid','int') : GETPOST('id','int'));
@ -345,7 +345,7 @@ if ($id > 0)
print '</tr>'; print '</tr>';
// Multiprice level // Multiprice level
if ($conf->global->PRODUIT_MULTIPRICES) if (! empty($conf->global->PRODUIT_MULTIPRICES))
{ {
print '<tr><td nowrap>'; print '<tr><td nowrap>';
print '<table width="100%" class="nobordernopadding"><tr><td nowrap>'; print '<table width="100%" class="nobordernopadding"><tr><td nowrap>';
@ -364,7 +364,7 @@ if ($id > 0)
include DOL_DOCUMENT_ROOT.'/societe/tpl/linesalesrepresentative.tpl.php'; include DOL_DOCUMENT_ROOT.'/societe/tpl/linesalesrepresentative.tpl.php';
// Module Adherent // Module Adherent
if ($conf->adherent->enabled) if (! empty($conf->adherent->enabled))
{ {
$langs->load("members"); $langs->load("members");
$langs->load("users"); $langs->load("users");
@ -410,7 +410,7 @@ if ($id > 0)
/* /*
* Last proposals * Last proposals
*/ */
if ($conf->propal->enabled && $user->rights->propal->lire) if (! empty($conf->propal->enabled) && $user->rights->propal->lire)
{ {
$propal_static = new Propal($db); $propal_static = new Propal($db);
@ -472,7 +472,7 @@ if ($id > 0)
/* /*
* Last orders * Last orders
*/ */
if ($conf->commande->enabled && $user->rights->commande->lire) if (! empty($conf->commande->enabled) && $user->rights->commande->lire)
{ {
$commande_static=new Commande($db); $commande_static=new Commande($db);
@ -527,7 +527,7 @@ if ($id > 0)
/* /*
* Last linked contracts * Last linked contracts
*/ */
if ($conf->contrat->enabled && $user->rights->contrat->lire) if (! empty($conf->contrat->enabled) && $user->rights->contrat->lire)
{ {
$contratstatic=new Contrat($db); $contratstatic=new Contrat($db);
@ -587,7 +587,7 @@ if ($id > 0)
/* /*
* Last interventions * 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 = "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"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."fichinter as f";
@ -642,7 +642,7 @@ if ($id > 0)
/* /*
* Last invoices * Last invoices
*/ */
if ($conf->facture->enabled && $user->rights->facture->lire) if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
{ {
$facturestatic = new Facture($db); $facturestatic = new Facture($db);
@ -723,13 +723,13 @@ if ($id > 0)
*/ */
print '<div class="tabsAction">'; print '<div class="tabsAction">';
if ($conf->propal->enabled && $user->rights->propal->creer) if (! empty($conf->propal->enabled) && $user->rights->propal->creer)
{ {
$langs->load("propal"); $langs->load("propal");
print '<a class="butAction" href="'.DOL_URL_ROOT.'/comm/addpropal.php?socid='.$object->id.'&amp;action=create">'.$langs->trans("AddProp").'</a>'; print '<a class="butAction" href="'.DOL_URL_ROOT.'/comm/addpropal.php?socid='.$object->id.'&amp;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"); $langs->load("orders");
print '<a class="butAction" href="'.DOL_URL_ROOT.'/commande/fiche.php?socid='.$object->id.'&amp;action=create">'.$langs->trans("AddOrder").'</a>'; print '<a class="butAction" href="'.DOL_URL_ROOT.'/commande/fiche.php?socid='.$object->id.'&amp;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.'&amp;action=create">'.$langs->trans("AddContract").'</a>'; print '<a class="butAction" href="'.DOL_URL_ROOT.'/contrat/fiche.php?socid='.$object->id.'&amp;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"); $langs->load("fichinter");
print '<a class="butAction" href="'.DOL_URL_ROOT.'/fichinter/fiche.php?socid='.$object->id.'&amp;action=create">'.$langs->trans("AddIntervention").'</a>'; print '<a class="butAction" href="'.DOL_URL_ROOT.'/fichinter/fiche.php?socid='.$object->id.'&amp;action=create">'.$langs->trans("AddIntervention").'</a>';
@ -750,13 +750,13 @@ if ($id > 0)
// Add invoice // Add invoice
if ($user->societe_id == 0) if ($user->societe_id == 0)
{ {
if ($conf->deplacement->enabled) if (! empty($conf->deplacement->enabled))
{ {
$langs->load("trips"); $langs->load("trips");
print '<a class="butAction" href="'.DOL_URL_ROOT.'/compta/deplacement/fiche.php?socid='.$object->id.'&amp;action=create">'.$langs->trans("AddTrip").'</a>'; print '<a class="butAction" href="'.DOL_URL_ROOT.'/compta/deplacement/fiche.php?socid='.$object->id.'&amp;action=create">'.$langs->trans("AddTrip").'</a>';
} }
if ($conf->facture->enabled) if (! empty($conf->facture->enabled))
{ {
if ($user->rights->facture->creer) if ($user->rights->facture->creer)
{ {
@ -772,7 +772,7 @@ if ($id > 0)
} }
// Add action // 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) if ($user->rights->agenda->myactions->create)
{ {

View File

@ -28,8 +28,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
require_once DOL_DOCUMENT_ROOT.'/societe/class/client.class.php'; require_once DOL_DOCUMENT_ROOT.'/societe/class/client.class.php';
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/agenda.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/agenda.lib.php';
if ($conf->contrat->enabled) require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; if (! empty($conf->contrat->enabled)) require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
if ($conf->propal->enabled) require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; if (! empty($conf->propal->enabled)) require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
if (! $user->rights->societe->lire) accessforbidden(); if (! $user->rights->societe->lire) accessforbidden();
@ -80,7 +80,7 @@ $now=dol_now();
$form = new Form($db); $form = new Form($db);
$formfile = new FormFile($db); $formfile = new FormFile($db);
$companystatic=new Societe($db); $companystatic=new Societe($db);
if ($conf->propal->enabled) $propalstatic=new Propal($db); if (! empty($conf->propal->enabled)) $propalstatic=new Propal($db);
llxHeader(); llxHeader();
@ -89,15 +89,15 @@ print_fiche_titre($langs->trans("CustomerArea"));
print '<table border="0" width="100%" class="notopnoleftnoright">'; print '<table border="0" width="100%" class="notopnoleftnoright">';
print '<tr>'; print '<tr>';
if (($conf->propal->enabled && $user->rights->propale->lire) || if ((! empty($conf->propal->enabled) && $user->rights->propale->lire) ||
($conf->contrat->enabled && $user->rights->contrat->lire) || (! empty($conf->contrat->enabled) && $user->rights->contrat->lire) ||
($conf->commande->enabled && $user->rights->commande->lire)) (! empty($conf->commande->enabled) && $user->rights->commande->lire))
{ {
print '<td valign="top" width="30%" class="notopnoleft">'; print '<td valign="top" width="30%" class="notopnoleft">';
} }
// Recherche Propal // Recherche Propal
if ($conf->propal->enabled && $user->rights->propal->lire) if (! empty($conf->propal->enabled) && $user->rights->propal->lire)
{ {
$var=false; $var=false;
print '<form method="post" action="'.DOL_URL_ROOT.'/comm/propal/list.php">'; 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 * Recherche Contrat
*/ */
if ($conf->contrat->enabled && $user->rights->contrat->lire) if (! empty($conf->contrat->enabled) && $user->rights->contrat->lire)
{ {
$var=false; $var=false;
print '<form method="post" action="'.DOL_URL_ROOT.'/contrat/liste.php">'; 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 * 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 = "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"; $sql.= " FROM ".MAIN_DB_PREFIX."propal as p";
@ -200,7 +200,7 @@ if ($conf->propal->enabled && $user->rights->propal->lire)
/* /*
* Draft orders * Draft orders
*/ */
if ($conf->commande->enabled && $user->rights->commande->lire) if (! empty($conf->commande->enabled) && $user->rights->commande->lire)
{ {
$langs->load("orders"); $langs->load("orders");
@ -255,9 +255,9 @@ if ($conf->commande->enabled && $user->rights->commande->lire)
} }
} }
if (($conf->propal->enabled && $user->rights->propale->lire) || if ((! empty($conf->propal->enabled) && $user->rights->propale->lire) ||
($conf->contrat->enabled && $user->rights->contrat->lire) || (! empty($conf->contrat->enabled) && $user->rights->contrat->lire) ||
($conf->commande->enabled && $user->rights->commande->lire)) (! empty($conf->commande->enabled) && $user->rights->commande->lire))
{ {
print '</td>'; print '</td>';
print '<td valign="top" width="70%" class="notopnoleftnoright">'; print '<td valign="top" width="70%" class="notopnoleftnoright">';
@ -276,7 +276,7 @@ $max=3;
/* /*
* Last modified customers or prospects * 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"); $langs->load("boxes");
@ -336,7 +336,7 @@ if ($conf->societe->enabled && $user->rights->societe->lire)
} }
// Last suppliers // Last suppliers
if ($conf->fournisseur->enabled && $user->rights->societe->lire) if (! empty($conf->fournisseur->enabled) && $user->rights->societe->lire)
{ {
$langs->load("boxes"); $langs->load("boxes");
@ -408,7 +408,7 @@ if ($user->rights->agenda->myactions->read)
/* /*
* Last contracts * 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"); $langs->load("contracts");
@ -466,7 +466,7 @@ if ($conf->contrat->enabled && $user->rights->contrat->lire && 0) // TODO A REFA
/* /*
* Opened proposals * Opened proposals
*/ */
if ($conf->propal->enabled && $user->rights->propal->lire) if (! empty($conf->propal->enabled) && $user->rights->propal->lire)
{ {
$langs->load("propal"); $langs->load("propal");
@ -516,7 +516,7 @@ if ($conf->propal->enabled && $user->rights->propal->lire)
$filename=dol_sanitizeFileName($obj->ref); $filename=dol_sanitizeFileName($obj->ref);
$filedir=$conf->propal->dir_output . '/' . dol_sanitizeFileName($obj->ref); $filedir=$conf->propal->dir_output . '/' . dol_sanitizeFileName($obj->ref);
$urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->propalid; $urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->propalid;
$formfile->show_documents('propal',$filename,$filedir,$urlsource,'','','',1,'',1); print $formfile->getDocumentsLink($propalstatic->element, $filename, $filedir);
print '</td></tr></table>'; print '</td></tr></table>';
print "</td>"; print "</td>";

View File

@ -145,7 +145,7 @@ if ($result)
// Filter on categories // Filter on categories
$moreforfilter=''; $moreforfilter='';
if ($conf->categorie->enabled) if (! empty($conf->categorie->enabled))
{ {
$moreforfilter.=$langs->trans('Categories'). ': '; $moreforfilter.=$langs->trans('Categories'). ': ';
$moreforfilter.=$formother->select_categories(2,$search_categ,'search_categ',1); $moreforfilter.=$formother->select_categories(2,$search_categ,'search_categ',1);

View File

@ -1231,7 +1231,7 @@ else if ($action == 'validate')
} }
$text=$langs->trans('ConfirmValidateProp',$numref); $text=$langs->trans('ConfirmValidateProp',$numref);
if ($conf->notification->enabled) if (! empty($conf->notification->enabled))
{ {
require_once DOL_DOCUMENT_ROOT .'/core/class/notify.class.php'; require_once DOL_DOCUMENT_ROOT .'/core/class/notify.class.php';
$notify=new Notify($db); $notify=new Notify($db);
@ -1640,7 +1640,7 @@ if ($object->statut == 0 && $user->rights->propal->creer)
$object->formAddFreeProduct(0,$mysoc,$soc,$hookmanager); $object->formAddFreeProduct(0,$mysoc,$soc,$hookmanager);
// Add predefined products/services // Add predefined products/services
if ($conf->product->enabled || $conf->service->enabled) if (! empty($conf->product->enabled) || ! empty($conf->service->enabled))
{ {
$var=!$var; $var=!$var;
$object->formAddPredefinedProduct(0,$mysoc,$soc,$hookmanager); $object->formAddPredefinedProduct(0,$mysoc,$soc,$hookmanager);
@ -1738,7 +1738,7 @@ if ($action != 'presend')
// Create an invoice and classify billed // Create an invoice and classify billed
if ($object->statut == 2 && $user->societe_id == 0) 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&amp;origin='.$object->element.'&amp;originid='.$object->id.'&amp;socid='.$object->socid.'">'.$langs->trans("AddBill").'</a>'; print '<a class="butAction" href="'.DOL_URL_ROOT.'/compta/facture.php?action=create&amp;origin='.$object->element.'&amp;originid='.$object->id.'&amp;socid='.$object->socid.'">'.$langs->trans("AddBill").'</a>';
} }

View File

@ -29,7 +29,7 @@ require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/propal.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/propal.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
if ($conf->projet->enabled) require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; if (! empty($conf->projet->enabled)) require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
$langs->load('propal'); $langs->load('propal');
$langs->load("bills"); $langs->load("bills");

View File

@ -151,7 +151,7 @@ else
/* /*
* Draft proposals * Draft proposals
*/ */
if ($conf->propal->enabled) if (! empty($conf->propal->enabled))
{ {
$sql = "SELECT c.rowid, c.ref, s.nom as socname, s.rowid as socid, s.canvas, s.client"; $sql = "SELECT c.rowid, c.ref, s.nom as socname, s.rowid as socid, s.canvas, s.client";
$sql.= " FROM ".MAIN_DB_PREFIX."propal as c"; $sql.= " FROM ".MAIN_DB_PREFIX."propal as c";
@ -257,7 +257,7 @@ if ($resql)
$filename=dol_sanitizeFileName($obj->ref); $filename=dol_sanitizeFileName($obj->ref);
$filedir=$conf->propal->dir_output . '/' . dol_sanitizeFileName($obj->ref); $filedir=$conf->propal->dir_output . '/' . dol_sanitizeFileName($obj->ref);
$urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid; $urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid;
$formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','',1,'',1); print $formfile->getDocumentsLink($propalstatic->element, $filename, $filedir);
print '</td></tr></table>'; print '</td></tr></table>';
print '</td>'; print '</td>';
@ -334,7 +334,7 @@ if (! empty($conf->propal->enabled) && $user->rights->propale->lire)
$filename=dol_sanitizeFileName($obj->ref); $filename=dol_sanitizeFileName($obj->ref);
$filedir=$conf->propal->dir_output . '/' . dol_sanitizeFileName($obj->ref); $filedir=$conf->propal->dir_output . '/' . dol_sanitizeFileName($obj->ref);
$urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->propalid; $urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->propalid;
$formfile->show_documents('propal',$filename,$filedir,$urlsource,'','','',1,'',1); print $formfile->getDocumentsLink($propalstatic->element, $filename, $filedir);
print '</td></tr></table>'; print '</td></tr></table>';
print "</td>"; print "</td>";
@ -369,7 +369,7 @@ if (! empty($conf->propal->enabled) && $user->rights->propale->lire)
* Proposals to process * Proposals to process
*/ */
/* /*
if ($conf->propal->enabled) if (! empty($conf->propal->enabled))
{ {
$sql = "SELECT c.rowid, c.ref, c.fk_statut, s.nom, s.rowid as socid"; $sql = "SELECT c.rowid, c.ref, c.fk_statut, s.nom, s.rowid as socid";
$sql.=" FROM ".MAIN_DB_PREFIX."propal as c"; $sql.=" FROM ".MAIN_DB_PREFIX."propal as c";
@ -418,7 +418,7 @@ if ($conf->propal->enabled)
$filename=dol_sanitizeFileName($obj->ref); $filename=dol_sanitizeFileName($obj->ref);
$filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref); $filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref);
$urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid; $urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid;
$formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','',1,'',1); print $formfile->getDocumentsLink($propalstatic->element, $filename, $filedir);
print '</td></tr></table>'; print '</td></tr></table>';
print '</td>'; print '</td>';
@ -441,7 +441,7 @@ if ($conf->propal->enabled)
/* /*
* Proposal that are in a shipping process * Proposal that are in a shipping process
*/ */
/*if ($conf->propal->enabled) /*if (! empty($conf->propal->enabled))
{ {
$sql = "SELECT c.rowid, c.ref, c.fk_statut, c.facture, s.nom, s.rowid as socid"; $sql = "SELECT c.rowid, c.ref, c.fk_statut, c.facture, s.nom, s.rowid as socid";
$sql.= " FROM ".MAIN_DB_PREFIX."commande as c"; $sql.= " FROM ".MAIN_DB_PREFIX."commande as c";
@ -490,7 +490,7 @@ if ($conf->propal->enabled)
$filename=dol_sanitizeFileName($obj->ref); $filename=dol_sanitizeFileName($obj->ref);
$filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref); $filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref);
$urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid; $urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid;
$formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','',1,'',1); print $formfile->getDocumentsLink($propalstatic->element, $filename, $filedir);
print '</td></tr></table>'; print '</td></tr></table>';
print '</td>'; print '</td>';

View File

@ -320,8 +320,7 @@ if ($result)
$filename=dol_sanitizeFileName($objp->ref); $filename=dol_sanitizeFileName($objp->ref);
$filedir=$conf->propal->dir_output . '/' . dol_sanitizeFileName($objp->ref); $filedir=$conf->propal->dir_output . '/' . dol_sanitizeFileName($objp->ref);
$urlsource=$_SERVER['PHP_SELF'].'?id='.$objp->propalid; $urlsource=$_SERVER['PHP_SELF'].'?id='.$objp->propalid;
//$formfile->show_documents('propal',$filename,$filedir,$urlsource,'','','',1,'',1); print $formfile->getDocumentsLink($objectstatic->element, $filename, $filedir);
print $formfile->getDocumentsLink('propal', $filename, $filedir);
print '</td></tr></table>'; print '</td></tr></table>';
if ($objp->client == 1) if ($objp->client == 1)

View File

@ -29,8 +29,8 @@ require_once DOL_DOCUMENT_ROOT.'/comm/prospect/class/prospect.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
if ($conf->adherent->enabled) require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; if (! empty($conf->adherent->enabled)) require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
if ($conf->propal->enabled) require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; if (! empty($conf->propal->enabled)) require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
$langs->load('companies'); $langs->load('companies');
$langs->load('projects'); $langs->load('projects');
@ -152,7 +152,7 @@ if ($socid > 0)
print '</tr>'; print '</tr>';
// Multiprice level // Multiprice level
if ($conf->global->PRODUIT_MULTIPRICES) if (! empty($conf->global->PRODUIT_MULTIPRICES))
{ {
print '<tr><td nowrap>'; print '<tr><td nowrap>';
print '<table width="100%" class="nobordernopadding"><tr><td nowrap>'; print '<table width="100%" class="nobordernopadding"><tr><td nowrap>';
@ -181,7 +181,7 @@ if ($socid > 0)
include DOL_DOCUMENT_ROOT.'/societe/tpl/linesalesrepresentative.tpl.php'; include DOL_DOCUMENT_ROOT.'/societe/tpl/linesalesrepresentative.tpl.php';
// Module Adherent // Module Adherent
if ($conf->adherent->enabled) if (! empty($conf->adherent->enabled))
{ {
$langs->load("members"); $langs->load("members");
$langs->load("users"); $langs->load("users");
@ -225,7 +225,7 @@ if ($socid > 0)
/* /*
* Last proposals * Last proposals
*/ */
if ($conf->propal->enabled && $user->rights->propale->lire) if (! empty($conf->propal->enabled) && $user->rights->propale->lire)
{ {
$propal_static=new Propal($db); $propal_static=new Propal($db);
@ -297,13 +297,13 @@ if ($socid > 0)
print '<div class="tabsAction">'; 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.'&amp;action=create">'.$langs->trans("AddProp").'</a>'; print '<a class="butAction" href="'.DOL_URL_ROOT.'/comm/addpropal.php?socid='.$object->id.'&amp;action=create">'.$langs->trans("AddProp").'</a>';
} }
// Add action // 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) if ($user->rights->agenda->myactions->create)
{ {

View File

@ -50,7 +50,7 @@ print '<table border="0" width="100%" class="notopnoleftnoright">';
print '<tr><td valign="top" width="30%" class="notopnoleft">'; print '<tr><td valign="top" width="30%" class="notopnoleft">';
if ($conf->propal->enabled) if (! empty($conf->propal->enabled))
{ {
$var=false; $var=false;
print '<table class="noborder nohover" width="100%">'; print '<table class="noborder nohover" width="100%">';
@ -111,7 +111,7 @@ if ($resql)
/* /*
* Liste des propal brouillons * 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 = "SELECT p.rowid, p.ref, p.price, s.nom as sname";
$sql.= " FROM ".MAIN_DB_PREFIX."propal as p"; $sql.= " FROM ".MAIN_DB_PREFIX."propal as p";
@ -164,13 +164,13 @@ if ($conf->propal->enabled && $user->rights->propale->lire)
*/ */
print '</td><td valign="top" width="70%" class="notopnoleftnoright">'; print '</td><td valign="top" width="70%" class="notopnoleftnoright">';
if ($conf->agenda->enabled) show_array_actions_to_do(10); if (! empty($conf->agenda->enabled)) show_array_actions_to_do(10);
/* /*
* Dernieres propales ouvertes * 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 = "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"; $sql.= " p.rowid as propalid, p.total as total_ttc, p.ref, p.datep as dp, c.label as statut, c.id as statutid";

View File

@ -261,7 +261,7 @@ if ($resql)
// Filter on categories // Filter on categories
$moreforfilter=''; $moreforfilter='';
if ($conf->categorie->enabled) if (! empty($conf->categorie->enabled))
{ {
$moreforfilter.=$langs->trans('Categories'). ': '; $moreforfilter.=$langs->trans('Categories'). ': ';
$moreforfilter.=$formother->select_categories(2,$search_categ,'search_categ',1); $moreforfilter.=$formother->select_categories(2,$search_categ,'search_categ',1);

View File

@ -28,7 +28,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
$langs->load("companies"); $langs->load("companies");
$langs->load('other'); $langs->load('other');
if ($conf->facture->enabled) $langs->load("bills"); if (! empty($conf->facture->enabled)) $langs->load("bills");
// Security check // Security check
$socid = $_GET["socid"]; $socid = $_GET["socid"];

View File

@ -27,7 +27,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
$langs->load("companies"); $langs->load("companies");
if ($conf->facture->enabled) $langs->load("bills"); if (! empty($conf->facture->enabled)) $langs->load("bills");
// Security check // Security check
$socid = $_GET["socid"]; $socid = $_GET["socid"];

View File

@ -29,8 +29,8 @@ require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/order.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/order.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
if ($conf->propal->enabled) require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; if (! empty($conf->propal->enabled)) require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
if ($conf->projet->enabled) require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; if (! empty($conf->projet->enabled)) require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
$langs->load('orders'); $langs->load('orders');
$langs->load('propal'); $langs->load('propal');

View File

@ -237,7 +237,7 @@ class Commande extends CommonOrder
if (! $error) if (! $error)
{ {
// If stock is incremented on validate order, we must increment it // 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'; require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php';
$langs->load("agenda"); $langs->load("agenda");
@ -351,7 +351,7 @@ class Commande extends CommonOrder
if ($this->db->query($sql)) if ($this->db->query($sql))
{ {
// If stock is decremented on validate order, we must reincrement it // 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'; require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php';
$langs->load("agenda"); $langs->load("agenda");
@ -534,7 +534,7 @@ class Commande extends CommonOrder
if ($this->db->query($sql)) if ($this->db->query($sql))
{ {
// If stock is decremented on validate order, we must reincrement it // 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'; require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php';
$langs->load("agenda"); $langs->load("agenda");
@ -2538,7 +2538,7 @@ class Commande extends CommonOrder
$result=''; $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; else $url = DOL_URL_ROOT.'/commande/fiche.php?id='.$this->id;
if ($short) return $url; if ($short) return $url;

View File

@ -178,7 +178,7 @@ if ($id > 0 || ! empty($ref))
print '<td colspan="3">'.$object->client->getNomUrl(1).'</td></tr>'; print '<td colspan="3">'.$object->client->getNomUrl(1).'</td></tr>';
// Delivery address // Delivery address
if ($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) if (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT))
{ {
print '<tr><td>'; print '<tr><td>';
print '<table class="nobordernopadding" width="100%"><tr><td>'; print '<table class="nobordernopadding" width="100%"><tr><td>';

View File

@ -1462,7 +1462,7 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G
// Date de livraison // Date de livraison
print "<tr><td>".$langs->trans("DeliveryDate").'</td><td colspan="2">'; print "<tr><td>".$langs->trans("DeliveryDate").'</td><td colspan="2">';
if ($conf->global->DATE_LIVRAISON_WEEK_DELAY) if (! empty($conf->global->DATE_LIVRAISON_WEEK_DELAY))
{ {
$datedelivery = time() + ((7*$conf->global->DATE_LIVRAISON_WEEK_DELAY) * 24 * 60 * 60); $datedelivery = time() + ((7*$conf->global->DATE_LIVRAISON_WEEK_DELAY) * 24 * 60 * 60);
} }
@ -1699,7 +1699,7 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G
} }
$text=$langs->trans('ConfirmValidateOrder',$numref); $text=$langs->trans('ConfirmValidateOrder',$numref);
if ($conf->notification->enabled) if (! empty($conf->notification->enabled))
{ {
require_once DOL_DOCUMENT_ROOT .'/core/class/notify.class.php'; require_once DOL_DOCUMENT_ROOT .'/core/class/notify.class.php';
$notify=new Notify($db); $notify=new Notify($db);
@ -1808,7 +1808,7 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G
* Commande * Commande
*/ */
$nbrow=9; $nbrow=9;
if ($conf->projet->enabled) $nbrow++; if (! empty($conf->projet->enabled)) $nbrow++;
//Local taxes //Local taxes
if ($mysoc->country_code=='ES') if ($mysoc->country_code=='ES')
@ -2153,7 +2153,7 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G
$object->formAddFreeProduct(1,$mysoc,$soc,$hookmanager); $object->formAddFreeProduct(1,$mysoc,$soc,$hookmanager);
// Add predefined products/services // Add predefined products/services
if ($conf->product->enabled || $conf->service->enabled) if (! empty($conf->product->enabled) || ! empty($conf->service->enabled))
{ {
$var=!$var; $var=!$var;
$object->formAddPredefinedProduct(1,$mysoc,$soc,$hookmanager); $object->formAddPredefinedProduct(1,$mysoc,$soc,$hookmanager);
@ -2201,7 +2201,7 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G
// Ship // Ship
$numshipping=0; $numshipping=0;
if ($conf->expedition->enabled) if (! empty($conf->expedition->enabled))
{ {
$numshipping = $object->nb_expedition(); $numshipping = $object->nb_expedition();
@ -2235,7 +2235,7 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G
// Create bill and Classify billed // 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)) if ($user->rights->facture->creer && empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER))
{ {

View File

@ -165,7 +165,7 @@ else
/* /*
* Draft orders * Draft orders
*/ */
if ($conf->commande->enabled) if (! empty($conf->commande->enabled))
{ {
$sql = "SELECT c.rowid, c.ref, s.nom, s.rowid as socid"; $sql = "SELECT c.rowid, c.ref, s.nom, s.rowid as socid";
$sql.= " FROM ".MAIN_DB_PREFIX."commande as c"; $sql.= " FROM ".MAIN_DB_PREFIX."commande as c";
@ -262,7 +262,7 @@ if ($resql)
$filename=dol_sanitizeFileName($obj->ref); $filename=dol_sanitizeFileName($obj->ref);
$filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref); $filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref);
$urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid; $urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid;
$formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','',1,'',1); print $formfile->getDocumentsLink($commandestatic->element, $filename, $filedir);
print '</td></tr></table>'; print '</td></tr></table>';
print '</td>'; print '</td>';
@ -282,7 +282,7 @@ else dol_print_error($db);
/* /*
* Orders to process * Orders to process
*/ */
if ($conf->commande->enabled) if (! empty($conf->commande->enabled))
{ {
$sql = "SELECT c.rowid, c.ref, c.fk_statut, c.facture, s.nom, s.rowid as socid"; $sql = "SELECT c.rowid, c.ref, c.fk_statut, c.facture, s.nom, s.rowid as socid";
$sql.=" FROM ".MAIN_DB_PREFIX."commande as c"; $sql.=" FROM ".MAIN_DB_PREFIX."commande as c";
@ -331,7 +331,7 @@ if ($conf->commande->enabled)
$filename=dol_sanitizeFileName($obj->ref); $filename=dol_sanitizeFileName($obj->ref);
$filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref); $filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref);
$urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid; $urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid;
$formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','',1,'',1); print $formfile->getDocumentsLink($commandestatic->element, $filename, $filedir);
print '</td></tr></table>'; print '</td></tr></table>';
print '</td>'; print '</td>';
@ -353,7 +353,7 @@ if ($conf->commande->enabled)
/* /*
* Orders thar are in a shipping process * Orders thar are in a shipping process
*/ */
if ($conf->commande->enabled) if (! empty($conf->commande->enabled))
{ {
$sql = "SELECT c.rowid, c.ref, c.fk_statut, c.facture, s.nom, s.rowid as socid"; $sql = "SELECT c.rowid, c.ref, c.fk_statut, c.facture, s.nom, s.rowid as socid";
$sql.= " FROM ".MAIN_DB_PREFIX."commande as c"; $sql.= " FROM ".MAIN_DB_PREFIX."commande as c";
@ -402,7 +402,7 @@ if ($conf->commande->enabled)
$filename=dol_sanitizeFileName($obj->ref); $filename=dol_sanitizeFileName($obj->ref);
$filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref); $filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref);
$urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid; $urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid;
$formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','',1,'',1); print $formfile->getDocumentsLink($commandestatic->element, $filename, $filedir);
print '</td></tr></table>'; print '</td></tr></table>';
print '</td>'; print '</td>';

View File

@ -308,7 +308,7 @@ if ($resql)
$filename=dol_sanitizeFileName($objp->ref); $filename=dol_sanitizeFileName($objp->ref);
$filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($objp->ref); $filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($objp->ref);
$urlsource=$_SERVER['PHP_SELF'].'?id='.$objp->rowid; $urlsource=$_SERVER['PHP_SELF'].'?id='.$objp->rowid;
$formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','',1,'',1); print $formfile->getDocumentsLink($generic_commande->element, $filename, $filedir);
print '</td></tr></table>'; print '</td></tr></table>';
print '</td>'; print '</td>';

View File

@ -34,7 +34,7 @@ require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/report.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/report.lib.php';
if ($conf->projet->enabled) require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; if (! empty($conf->projet->enabled)) require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php';
$langs->load('orders'); $langs->load('orders');
$langs->load('deliveries'); $langs->load('deliveries');
@ -416,7 +416,7 @@ if ($action == 'create')
$html->select_types_paiements(isset($_POST['mode_reglement_id'])?$_POST['mode_reglement_id']:$mode_reglement_id,'mode_reglement_id'); $html->select_types_paiements(isset($_POST['mode_reglement_id'])?$_POST['mode_reglement_id']:$mode_reglement_id,'mode_reglement_id');
print '</td></tr>'; print '</td></tr>';
// Project // Project
if ($conf->projet->enabled) if (! empty($conf->projet->enabled))
{ {
$langs->load('projects'); $langs->load('projects');
print '<tr><td>'.$langs->trans('Project').'</td><td colspan="2">'; print '<tr><td>'.$langs->trans('Project').'</td><td colspan="2">';
@ -643,7 +643,7 @@ if (($action != 'create' && $action != 'add') || ! empty($mesgs))
$filename=dol_sanitizeFileName($objp->ref); $filename=dol_sanitizeFileName($objp->ref);
$filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($objp->ref); $filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($objp->ref);
$urlsource=$_SERVER['PHP_SELF'].'?id='.$objp->rowid; $urlsource=$_SERVER['PHP_SELF'].'?id='.$objp->rowid;
$formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','',1,'',1); print $formfile->getDocumentsLink($generic_commande->element, $filename, $filedir);
print '</td></tr></table>'; print '</td></tr></table>';
print '</td>'; print '</td>';

View File

@ -429,11 +429,11 @@ if ($id > 0 || ! empty($ref))
$sql.= ", s.rowid as socid, s.nom as thirdparty"; $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."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"; $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."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"; $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 // 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'"; //$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank_url as bu3 ON bu3.fk_bank = b.rowid AND bu3.type='company'";

View File

@ -281,7 +281,7 @@ if ($action == 'create')
print '</td></tr>'; print '</td></tr>';
// Accountancy code // Accountancy code
if ($conf->global->MAIN_BANK_ACCOUNTANCY_CODE_ALWAYS_REQUIRED) if (! empty($conf->global->MAIN_BANK_ACCOUNTANCY_CODE_ALWAYS_REQUIRED))
{ {
print '<tr><td valign="top" class="fieldrequired">'.$langs->trans("AccountancyCode").'</td>'; print '<tr><td valign="top" class="fieldrequired">'.$langs->trans("AccountancyCode").'</td>';
print '<td colspan="3"><input type="text" name="account_number" value="'.$account->account_number.'"></td></tr>'; print '<td colspan="3"><input type="text" name="account_number" value="'.$account->account_number.'"></td></tr>';
@ -563,7 +563,7 @@ else
print '</td></tr>'; print '</td></tr>';
// Accountancy code // Accountancy code
if ($conf->global->MAIN_BANK_ACCOUNTANCY_CODE_ALWAYS_REQUIRED) if (! empty($conf->global->MAIN_BANK_ACCOUNTANCY_CODE_ALWAYS_REQUIRED))
{ {
print '<tr><td valign="top" class="fieldrequired">'.$langs->trans("AccountancyCode").'</td>'; print '<tr><td valign="top" class="fieldrequired">'.$langs->trans("AccountancyCode").'</td>';
print '<td colspan="3"><input type="text" name="account_number" value="'.(isset($_POST["account_number"])?$_POST["account_number"]:$account->account_number).'"></td></tr>'; print '<td colspan="3"><input type="text" name="account_number" value="'.(isset($_POST["account_number"])?$_POST["account_number"]:$account->account_number).'"></td></tr>';

View File

@ -32,7 +32,7 @@ $langs->load("banks");
$langs->load("compta"); $langs->load("compta");
$langs->load("bills"); $langs->load("bills");
$langs->load("categories"); $langs->load("categories");
if ($conf->adherent->enabled) $langs->load("members"); if (! empty($conf->adherent->enabled)) $langs->load("members");
$id = (GETPOST('id','int') ? GETPOST('id','int') : GETPOST('account','int')); $id = (GETPOST('id','int') ? GETPOST('id','int') : GETPOST('account','int'));

View File

@ -27,7 +27,7 @@ require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/trip.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/trip.lib.php';
require_once DOL_DOCUMENT_ROOT.'/compta/deplacement/class/deplacement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/deplacement/class/deplacement.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
if ($conf->projet->enabled) if (! empty($conf->projet->enabled))
{ {
require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php';
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
@ -489,7 +489,7 @@ else if ($id)
print '</td></tr>'; print '</td></tr>';
// Project // Project
if ($conf->projet->enabled) if (! empty($conf->projet->enabled))
{ {
$langs->load('projects'); $langs->load('projects');
print '<tr>'; print '<tr>';

View File

@ -29,7 +29,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/dons/class/don.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/dons/class/don.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php';
if ($conf->projet->enabled) require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; if (! empty($conf->projet->enabled)) require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php';
$langs->load("companies"); $langs->load("companies");
$langs->load("donations"); $langs->load("donations");
@ -280,7 +280,7 @@ if ($action == 'create')
print '<input type="hidden" name="action" value="add">'; print '<input type="hidden" name="action" value="add">';
$nbrows=11; $nbrows=11;
if ($conf->projet->enabled) $nbrows++; if (! empty($conf->projet->enabled)) $nbrows++;
// Date // Date
print '<tr><td class="fieldrequired">'.$langs->trans("Date").'</td><td>'; print '<tr><td class="fieldrequired">'.$langs->trans("Date").'</td><td>';
@ -318,7 +318,7 @@ if ($action == 'create')
$form->select_types_paiements('', 'modepaiement', 'CRDT', 0, 1); $form->select_types_paiements('', 'modepaiement', 'CRDT', 0, 1);
print "</td></tr>\n"; print "</td></tr>\n";
if ($conf->projet->enabled) if (! empty($conf->projet->enabled))
{ {
// Si module projet actif // Si module projet actif
print "<tr><td>".$langs->trans("Project")."</td><td>"; print "<tr><td>".$langs->trans("Project")."</td><td>";
@ -368,7 +368,7 @@ if (! empty($id) && $action == 'edit')
print '</tr>'; print '</tr>';
$nbrows=12; $nbrows=12;
if ($conf->projet->enabled) $nbrows++; if (! empty($conf->projet->enabled)) $nbrows++;
// Date // Date
print "<tr>".'<td width="25%" class="fieldrequired">'.$langs->trans("Date").'</td><td>'; print "<tr>".'<td width="25%" class="fieldrequired">'.$langs->trans("Date").'</td><td>';
@ -458,7 +458,7 @@ if (! empty($id) && $action != 'edit')
$linkback = '<a href="'.DOL_URL_ROOT.'/compta/dons/liste.php'.(! empty($socid)?'?socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>'; $linkback = '<a href="'.DOL_URL_ROOT.'/compta/dons/liste.php'.(! empty($socid)?'?socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
$nbrows=12; $nbrows=12;
if ($conf->projet->enabled) $nbrows++; if (! empty($conf->projet->enabled)) $nbrows++;
// Ref // Ref
print "<tr>".'<td>'.$langs->trans("Ref").'</td><td colspan="2">'; print "<tr>".'<td>'.$langs->trans("Ref").'</td><td colspan="2">';
@ -502,7 +502,7 @@ if (! empty($id) && $action != 'edit')
print "<tr>".'<td>'.$langs->trans("Status").'</td><td>'.$don->getLibStatut(4).'</td></tr>'; print "<tr>".'<td>'.$langs->trans("Status").'</td><td>'.$don->getLibStatut(4).'</td></tr>';
// Project // Project
if ($conf->projet->enabled) if (! empty($conf->projet->enabled))
{ {
print "<tr>".'<td>'.$langs->trans("Project").'</td><td>'.$don->projet.'</td></tr>'; print "<tr>".'<td>'.$langs->trans("Project").'</td><td>'.$don->projet.'</td></tr>';
} }

View File

@ -53,7 +53,7 @@ if (!$user->rights->don->lire) accessforbidden();
* View * View
*/ */
if ($conf->projet->enabled) $projectstatic=new Project($db); if (! empty($conf->projet->enabled)) $projectstatic=new Project($db);
llxHeader('',$langs->trans("Donations"),'EN:Module_Donations|FR:Module_Dons|ES:M&oacute;dulo_Donaciones'); llxHeader('',$langs->trans("Donations"),'EN:Module_Donations|FR:Module_Dons|ES:M&oacute;dulo_Donaciones');
@ -160,7 +160,7 @@ if ($resql)
print "<td>".$objp->societe."</td>\n"; print "<td>".$objp->societe."</td>\n";
print "<td>".$donationstatic->getFullName($langs)."</td>\n"; print "<td>".$donationstatic->getFullName($langs)."</td>\n";
print '<td align="center">'.dol_print_date($db->jdate($objp->datedon),'day').'</td>'; print '<td align="center">'.dol_print_date($db->jdate($objp->datedon),'day').'</td>';
if ($conf->projet->enabled) if (! empty($conf->projet->enabled))
{ {
print "<td>"; print "<td>";
if ($objp->pid) if ($objp->pid)

View File

@ -1882,7 +1882,7 @@ if ($action == 'create')
print '</td></tr>'."\n"; print '</td></tr>'."\n";
// Proforma // Proforma
if ($conf->global->FACTURE_USE_PROFORMAT) if (! empty($conf->global->FACTURE_USE_PROFORMAT))
{ {
print '<tr height="18"><td width="16px" valign="middle">'; print '<tr height="18"><td width="16px" valign="middle">';
print '<input type="radio" name="type" value="4"'.(GETPOST('type')==4?' checked="checked"':'').'>'; print '<input type="radio" name="type" value="4"'.(GETPOST('type')==4?' checked="checked"':'').'>';
@ -1973,7 +1973,7 @@ if ($action == 'create')
print '</td></tr>'; print '</td></tr>';
// Project // Project
if ($conf->projet->enabled) if (! empty($conf->projet->enabled))
{ {
$langs->load('projects'); $langs->load('projects');
print '<tr><td>'.$langs->trans('Project').'</td><td colspan="2">'; print '<tr><td>'.$langs->trans('Project').'</td><td colspan="2">';
@ -2080,7 +2080,7 @@ if ($action == 'create')
print '<td>'.$langs->trans('Qty').'</td>'; print '<td>'.$langs->trans('Qty').'</td>';
print '<td>'.$langs->trans('ReductionShort').'</td>'; print '<td>'.$langs->trans('ReductionShort').'</td>';
print '<td> &nbsp; &nbsp; </td>'; print '<td> &nbsp; &nbsp; </td>';
if ($conf->service->enabled) if (! empty($conf->service->enabled))
{ {
print '<td>'.$langs->trans('ServiceLimitedDuration').'</td>'; print '<td>'.$langs->trans('ServiceLimitedDuration').'</td>';
} }
@ -2090,7 +2090,7 @@ if ($action == 'create')
print '<tr>'; print '<tr>';
print '<td>'; print '<td>';
// multiprix // multiprix
if($conf->global->PRODUIT_MULTIPRICES) if (! empty($conf->global->PRODUIT_MULTIPRICES))
$form->select_produits('','idprod'.$i,'',$conf->product->limit_size,$soc->price_level); $form->select_produits('','idprod'.$i,'',$conf->product->limit_size,$soc->price_level);
else else
$form->select_produits('','idprod'.$i,'',$conf->product->limit_size); $form->select_produits('','idprod'.$i,'',$conf->product->limit_size);
@ -2099,7 +2099,7 @@ if ($action == 'create')
print '<td nowrap="nowrap"><input type="text" size="1" name="remise_percent'.$i.'" value="'.$soc->remise_client.'">%</td>'; print '<td nowrap="nowrap"><input type="text" size="1" name="remise_percent'.$i.'" value="'.$soc->remise_client.'">%</td>';
print '<td>&nbsp;</td>'; print '<td>&nbsp;</td>';
// Si le module service est actif, on propose des dates de debut et fin a la ligne // Si le module service est actif, on propose des dates de debut et fin a la ligne
if ($conf->service->enabled) if (! empty($conf->service->enabled))
{ {
print '<td nowrap="nowrap">'; print '<td nowrap="nowrap">';
print '<table class="nobordernopadding"><tr class="nocellnopadd">'; print '<table class="nobordernopadding"><tr class="nocellnopadd">';
@ -2243,7 +2243,7 @@ else if ($id > 0 || ! empty($ref))
} }
$text=$langs->trans('ConfirmValidateBill',$numref); $text=$langs->trans('ConfirmValidateBill',$numref);
if ($conf->notification->enabled) if (! empty($conf->notification->enabled))
{ {
require_once DOL_DOCUMENT_ROOT .'/core/class/notify.class.php'; require_once DOL_DOCUMENT_ROOT .'/core/class/notify.class.php';
$notify=new Notify($db); $notify=new Notify($db);
@ -2624,8 +2624,8 @@ else if ($id > 0 || ! empty($ref))
*/ */
$nbrows=8; $nbcols=2; $nbrows=8; $nbcols=2;
if ($conf->projet->enabled) $nbrows++; if (! empty($conf->projet->enabled)) $nbrows++;
if ($conf->banque->enabled) $nbcols++; if (! empty($conf->banque->enabled)) $nbcols++;
//Local taxes //Local taxes
if ($mysoc->pays_code=='ES') if ($mysoc->pays_code=='ES')
@ -2642,7 +2642,7 @@ else if ($id > 0 || ! empty($ref))
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td>'.($object->type == 2 ? $langs->trans("PaymentsBack") : $langs->trans('Payments')).'</td>'; print '<td>'.($object->type == 2 ? $langs->trans("PaymentsBack") : $langs->trans('Payments')).'</td>';
print '<td>'.$langs->trans('Type').'</td>'; print '<td>'.$langs->trans('Type').'</td>';
if ($conf->banque->enabled) print '<td align="right">'.$langs->trans('BankAccount').'</td>'; if (! empty($conf->banque->enabled)) print '<td align="right">'.$langs->trans('BankAccount').'</td>';
print '<td align="right">'.$langs->trans('Amount').'</td>'; print '<td align="right">'.$langs->trans('Amount').'</td>';
print '<td width="18">&nbsp;</td>'; print '<td width="18">&nbsp;</td>';
print '</tr>'; print '</tr>';
@ -2679,7 +2679,7 @@ else if ($id > 0 || ! empty($ref))
print dol_print_date($db->jdate($objp->dp),'day').'</a></td>'; print dol_print_date($db->jdate($objp->dp),'day').'</a></td>';
$label=($langs->trans("PaymentType".$objp->payment_code)!=("PaymentType".$objp->payment_code))?$langs->trans("PaymentType".$objp->payment_code):$objp->payment_label; $label=($langs->trans("PaymentType".$objp->payment_code)!=("PaymentType".$objp->payment_code))?$langs->trans("PaymentType".$objp->payment_code):$objp->payment_label;
print '<td>'.$label.' '.$objp->num_paiement.'</td>'; print '<td>'.$label.' '.$objp->num_paiement.'</td>';
if ($conf->banque->enabled) if (! empty($conf->banque->enabled))
{ {
$bankaccountstatic->id=$objp->baid; $bankaccountstatic->id=$objp->baid;
$bankaccountstatic->ref=$objp->ref; $bankaccountstatic->ref=$objp->ref;
@ -3016,7 +3016,7 @@ else if ($id > 0 || ! empty($ref))
$object->formAddFreeProduct(1,$mysoc,$soc,$hookmanager); $object->formAddFreeProduct(1,$mysoc,$soc,$hookmanager);
// Add predefined products/services // Add predefined products/services
if ($conf->product->enabled || $conf->service->enabled) if (! empty($conf->product->enabled) || ! empty($conf->service->enabled))
{ {
$var=!$var; $var=!$var;
$object->formAddPredefinedProduct(1,$mysoc,$soc,$hookmanager); $object->formAddPredefinedProduct(1,$mysoc,$soc,$hookmanager);
@ -3268,7 +3268,7 @@ else if ($id > 0 || ! empty($ref))
$somethingshown=$object->showLinkedObjectBlock(); $somethingshown=$object->showLinkedObjectBlock();
// Link for paypal payment // 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'; include_once DOL_DOCUMENT_ROOT.'/paypal/lib/paypal.lib.php';
print showPaypalPaymentUrl('invoice',$object->ref); print showPaypalPaymentUrl('invoice',$object->ref);

View File

@ -30,7 +30,7 @@ require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/invoice.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/invoice.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
if ($conf->projet->enabled) require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; if (! empty($conf->projet->enabled)) require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
$langs->load("bills"); $langs->load("bills");
@ -288,7 +288,7 @@ if ($id > 0 || ! empty($ref))
print '</td>'; print '</td>';
$nbrows=5; $nbrows=5;
if ($conf->projet->enabled) $nbrows++; if (! empty($conf->projet->enabled)) $nbrows++;
print '<td rowspan="'.$nbrows.'" colspan="2" valign="top">'; print '<td rowspan="'.$nbrows.'" colspan="2" valign="top">';
/* /*
@ -366,7 +366,7 @@ if ($id > 0 || ! empty($ref))
print '<tr><td>'.$langs->trans('Status').'</td><td align="left" colspan="3">'.($object->getLibStatut(4,$totalpaye)).'</td></tr>'; print '<tr><td>'.$langs->trans('Status').'</td><td align="left" colspan="3">'.($object->getLibStatut(4,$totalpaye)).'</td></tr>';
// Projet // Projet
if ($conf->projet->enabled) if (! empty($conf->projet->enabled))
{ {
$langs->load("projects"); $langs->load("projects");
print '<tr>'; print '<tr>';

View File

@ -1809,7 +1809,7 @@ class Facture extends CommonInvoice
if ($result) if ($result)
{ {
// Si on decremente le produit principal et ses composants a la validation de facture, on réincrement // 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'; require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php';
$langs->load("agenda"); $langs->load("agenda");

View File

@ -88,7 +88,7 @@ if ($action == "builddoc" && $user->rights->facture->lire)
} }
$pdf->SetFont(pdf_getPDFFont($outputlangs)); $pdf->SetFont(pdf_getPDFFont($outputlangs));
if ($conf->global->MAIN_DISABLE_PDF_COMPRESSION) $pdf->SetCompression(false); if (! empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) $pdf->SetCompression(false);
// Add all others // Add all others
foreach($files as $file) foreach($files as $file)
@ -340,7 +340,7 @@ if ($resql)
print '<td width="16" align="right" class="nobordernopadding">'; print '<td width="16" align="right" class="nobordernopadding">';
$filename=dol_sanitizeFileName($objp->facnumber); $filename=dol_sanitizeFileName($objp->facnumber);
$filedir=$conf->facture->dir_output . '/' . dol_sanitizeFileName($objp->facnumber); $filedir=$conf->facture->dir_output . '/' . dol_sanitizeFileName($objp->facnumber);
$foundpdf=$formfile->show_documents('facture',$filename,$filedir,$urlsource,'','','',1,'',1,$param); print $formfile->getDocumentsLink($facturestatic->element, $filename, $filedir);
print '</td>'; print '</td>';
print '</tr></table>'; print '</tr></table>';
@ -365,8 +365,10 @@ if ($resql)
// Checkbox // Checkbox
print '<td align="center">'; print '<td align="center">';
if ($foundpdf) print '<input id="cb'.$objp->facid.'" class="flat checkformerge" type="checkbox" name="toGenerate[]" value="'.$objp->facnumber.'">'; if (! empty($formfile->numoffiles))
else print '&nbsp;'; print '<input id="cb'.$objp->facid.'" class="flat checkformerge" type="checkbox" name="toGenerate[]" value="'.$objp->facnumber.'">';
else
print '&nbsp;';
print '</td>' ; print '</td>' ;
print "</tr>\n"; print "</tr>\n";

View File

@ -341,7 +341,7 @@ if ($resql)
$filename=dol_sanitizeFileName($objp->facnumber); $filename=dol_sanitizeFileName($objp->facnumber);
$filedir=$conf->facture->dir_output . '/' . dol_sanitizeFileName($objp->facnumber); $filedir=$conf->facture->dir_output . '/' . dol_sanitizeFileName($objp->facnumber);
$urlsource=$_SERVER['PHP_SELF'].'?id='.$objp->facid; $urlsource=$_SERVER['PHP_SELF'].'?id='.$objp->facid;
$formfile->show_documents('facture',$filename,$filedir,$urlsource,'','','',1,'',1); print $formfile->getDocumentsLink($facturestatic->element, $filename, $filedir);
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
print '</table>'; print '</table>';

View File

@ -27,9 +27,9 @@ require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
if ($conf->commande->enabled) require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; if (! empty($conf->commande->enabled)) require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
if ($conf->commande->enabled) require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; if (! empty($conf->commande->enabled)) require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php';
if ($conf->tax->enabled) require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php'; if (! empty($conf->tax->enabled)) require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php';
// L'espace compta/treso doit toujours etre actif car c'est un espace partage // L'espace compta/treso doit toujours etre actif car c'est un espace partage
// par de nombreux modules (banque, facture, commande a facturer, etc...) independamment // par de nombreux modules (banque, facture, commande a facturer, etc...) independamment
@ -40,7 +40,7 @@ if ($conf->tax->enabled) require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/
$langs->load("compta"); $langs->load("compta");
$langs->load("bills"); $langs->load("bills");
if ($conf->commande->enabled) $langs->load("orders"); if (! empty($conf->commande->enabled)) $langs->load("orders");
// Security check // Security check
$socid=''; $socid='';
@ -108,7 +108,7 @@ $max=3;
/* /*
* Search invoices * 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 '<form method="post" action="'.DOL_URL_ROOT.'/compta/facture/list.php">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
@ -125,7 +125,7 @@ if ($conf->facture->enabled && $user->rights->facture->lire)
/* /*
* Search supplier invoices * 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 '<form method="post" action="'.DOL_URL_ROOT.'/fourn/facture/index.php">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
@ -142,7 +142,7 @@ if ($conf->fournisseur->enabled && $user->rights->fournisseur->lire)
/* /*
* Search donations * 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 '<form method="post" action="'.DOL_URL_ROOT.'/compta/dons/liste.php">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
@ -159,7 +159,7 @@ if ($conf->don->enabled && $user->rights->don->lire)
/* /*
* Search expenses * 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 '<form method="post" action="'.DOL_URL_ROOT.'/compta/deplacement/list.php">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
@ -176,7 +176,7 @@ if ($conf->deplacement->enabled && $user->rights->deplacement->lire)
/** /**
* Draft customers invoices * 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 = "SELECT f.facnumber, f.rowid, f.total_ttc, f.type,";
$sql.= " s.nom, s.rowid as socid"; $sql.= " s.nom, s.rowid as socid";
@ -250,7 +250,7 @@ if ($conf->facture->enabled && $user->rights->facture->lire)
/** /**
* Draft suppliers invoices * 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 = "SELECT f.facnumber, f.rowid, f.total_ttc, f.type,";
$sql.= " s.nom, s.rowid as socid"; $sql.= " s.nom, s.rowid as socid";
@ -320,7 +320,7 @@ print '</td>';
print '<td valign="top" width="70%" class="notopnoleftnoright">'; print '<td valign="top" width="70%" class="notopnoleftnoright">';
// Last modified customer invoices // Last modified customer invoices
if ($conf->facture->enabled && $user->rights->facture->lire) if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
{ {
$langs->load("boxes"); $langs->load("boxes");
$facstatic=new Facture($db); $facstatic=new Facture($db);
@ -349,7 +349,7 @@ if ($conf->facture->enabled && $user->rights->facture->lire)
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("BoxTitleLastCustomerBills",$max).'</td>'; print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("BoxTitleLastCustomerBills",$max).'</td>';
if ($conf->global->MAIN_SHOW_HT_ON_SUMMARY) print '<td align="right">'.$langs->trans("AmountHT").'</td>'; if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td align="right">'.$langs->trans("AmountHT").'</td>';
print '<td align="right">'.$langs->trans("AmountTTC").'</td>'; print '<td align="right">'.$langs->trans("AmountTTC").'</td>';
print '<td align="right">'.$langs->trans("DateModificationShort").'</td>'; print '<td align="right">'.$langs->trans("DateModificationShort").'</td>';
print '<td width="16">&nbsp;</td>'; print '<td width="16">&nbsp;</td>';
@ -378,7 +378,7 @@ if ($conf->facture->enabled && $user->rights->facture->lire)
$filename=dol_sanitizeFileName($obj->facnumber); $filename=dol_sanitizeFileName($obj->facnumber);
$filedir=$conf->facture->dir_output . '/' . dol_sanitizeFileName($obj->facnumber); $filedir=$conf->facture->dir_output . '/' . dol_sanitizeFileName($obj->facnumber);
$urlsource=$_SERVER['PHP_SELF'].'?facid='.$obj->rowid; $urlsource=$_SERVER['PHP_SELF'].'?facid='.$obj->rowid;
$formfile->show_documents('facture',$filename,$filedir,$urlsource,'','','',1,'',1); print $formfile->getDocumentsLink($facturestatic->element, $filename, $filedir);
print '</td></tr></table>'; print '</td></tr></table>';
print '</td>'; print '</td>';
@ -388,7 +388,7 @@ if ($conf->facture->enabled && $user->rights->facture->lire)
$thirdpartystatic->client=1; $thirdpartystatic->client=1;
print $thirdpartystatic->getNomUrl(1,'customer',44); print $thirdpartystatic->getNomUrl(1,'customer',44);
print '</td>'; print '</td>';
if ($conf->global->MAIN_SHOW_HT_ON_SUMMARY) print '<td align="right">'.price($obj->total).'</td>'; if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td align="right">'.price($obj->total).'</td>';
print '<td align="right">'.price($obj->total_ttc).'</td>'; print '<td align="right">'.price($obj->total_ttc).'</td>';
print '<td align="right">'.dol_print_date($db->jdate($obj->tms),'day').'</td>'; print '<td align="right">'.dol_print_date($db->jdate($obj->tms),'day').'</td>';
print '<td>'.$facstatic->LibStatut($obj->paye,$obj->fk_statut,3,$obj->am).'</td>'; print '<td>'.$facstatic->LibStatut($obj->paye,$obj->fk_statut,3,$obj->am).'</td>';
@ -404,7 +404,7 @@ if ($conf->facture->enabled && $user->rights->facture->lire)
else else
{ {
$colspan=5; $colspan=5;
if ($conf->global->MAIN_SHOW_HT_ON_SUMMARY) $colspan++; if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) $colspan++;
print '<tr '.$bc[$var].'><td colspan="'.$colspan.'">'.$langs->trans("NoInvoice").'</td></tr>'; print '<tr '.$bc[$var].'><td colspan="'.$colspan.'">'.$langs->trans("NoInvoice").'</td></tr>';
} }
print '</table><br>'; print '</table><br>';
@ -419,7 +419,7 @@ if ($conf->facture->enabled && $user->rights->facture->lire)
// Last modified supplier invoices // 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"); $langs->load("boxes");
$facstatic=new FactureFournisseur($db); $facstatic=new FactureFournisseur($db);
@ -446,7 +446,7 @@ if ($conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire)
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("BoxTitleLastSupplierBills",$max).'</td>'; print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("BoxTitleLastSupplierBills",$max).'</td>';
if ($conf->global->MAIN_SHOW_HT_ON_SUMMARY) print '<td align="right">'.$langs->trans("AmountHT").'</td>'; if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td align="right">'.$langs->trans("AmountHT").'</td>';
print '<td align="right">'.$langs->trans("AmountTTC").'</td>'; print '<td align="right">'.$langs->trans("AmountTTC").'</td>';
print '<td align="right">'.$langs->trans("DateModificationShort").'</td>'; print '<td align="right">'.$langs->trans("DateModificationShort").'</td>';
print '<td width="16">&nbsp;</td>'; print '<td width="16">&nbsp;</td>';
@ -469,7 +469,7 @@ if ($conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire)
$thirdpartystatic->fournisseur=1; $thirdpartystatic->fournisseur=1;
print $thirdpartystatic->getNomUrl(1,'supplier',44); print $thirdpartystatic->getNomUrl(1,'supplier',44);
print '</td>'; print '</td>';
if ($conf->global->MAIN_SHOW_HT_ON_SUMMARY) print '<td align="right">'.price($obj->total_ht).'</td>'; if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td align="right">'.price($obj->total_ht).'</td>';
print '<td align="right">'.price($obj->total_ttc).'</td>'; print '<td align="right">'.price($obj->total_ttc).'</td>';
print '<td align="right">'.dol_print_date($db->jdate($obj->tms),'day').'</td>'; print '<td align="right">'.dol_print_date($db->jdate($obj->tms),'day').'</td>';
print '<td>'.$facstatic->LibStatut($obj->paye,$obj->fk_statut,3).'</td>'; print '<td>'.$facstatic->LibStatut($obj->paye,$obj->fk_statut,3).'</td>';
@ -484,7 +484,7 @@ if ($conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire)
else else
{ {
$colspan=5; $colspan=5;
if ($conf->global->MAIN_SHOW_HT_ON_SUMMARY) $colspan++; if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) $colspan++;
print '<tr '.$bc[$var].'><td colspan="'.$colspan.'">'.$langs->trans("NoInvoice").'</td></tr>'; print '<tr '.$bc[$var].'><td colspan="'.$colspan.'">'.$langs->trans("NoInvoice").'</td></tr>';
} }
print '</table><br>'; print '</table><br>';
@ -498,7 +498,7 @@ if ($conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire)
// Last donations // 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'; 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 * 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) if (!$socid)
{ {
@ -709,7 +709,7 @@ if ($conf->tax->enabled && $user->rights->tax->charges->lire)
/* /*
* Customers orders to be billed * Customers orders to be billed
*/ */
if ($conf->facture->enabled && $conf->commande->enabled && $user->rights->commande->lire) if (! empty($conf->facture->enabled) && ! empty($conf->commande->enabled) && $user->rights->commande->lire)
{ {
$commandestatic=new Commande($db); $commandestatic=new Commande($db);
$langs->load("orders"); $langs->load("orders");
@ -742,7 +742,7 @@ if ($conf->facture->enabled && $conf->commande->enabled && $user->rights->comman
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print "<tr class=\"liste_titre\">"; print "<tr class=\"liste_titre\">";
print '<td colspan="2">'.$langs->trans("OrdersToBill").' <a href="'.DOL_URL_ROOT.'/commande/liste.php?status=3&afacturer=1">('.$num.')</a></td>'; print '<td colspan="2">'.$langs->trans("OrdersToBill").' <a href="'.DOL_URL_ROOT.'/commande/liste.php?status=3&afacturer=1">('.$num.')</a></td>';
if ($conf->global->MAIN_SHOW_HT_ON_SUMMARY) print '<td align="right">'.$langs->trans("AmountHT").'</td>'; if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td align="right">'.$langs->trans("AmountHT").'</td>';
print '<td align="right">'.$langs->trans("AmountTTC").'</td>'; print '<td align="right">'.$langs->trans("AmountTTC").'</td>';
print '<td align="right">'.$langs->trans("ToBill").'</td>'; print '<td align="right">'.$langs->trans("ToBill").'</td>';
print '<td align="center" width="16">&nbsp;</td>'; print '<td align="center" width="16">&nbsp;</td>';
@ -770,7 +770,7 @@ if ($conf->facture->enabled && $conf->commande->enabled && $user->rights->comman
$filename=dol_sanitizeFileName($obj->ref); $filename=dol_sanitizeFileName($obj->ref);
$filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref); $filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref);
$urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid; $urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid;
$formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','',1,'',1); print $formfile->getDocumentsLink($commandestatic->element, $filename, $filedir);
print '</td></tr></table>'; print '</td></tr></table>';
print '</td>'; print '</td>';
@ -781,7 +781,7 @@ if ($conf->facture->enabled && $conf->commande->enabled && $user->rights->comman
$societestatic->client=1; $societestatic->client=1;
print $societestatic->getNomUrl(1,'customer',44); print $societestatic->getNomUrl(1,'customer',44);
print '</a></td>'; print '</a></td>';
if ($conf->global->MAIN_SHOW_HT_ON_SUMMARY) print '<td align="right">'.price($obj->total_ht).'</td>'; if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td align="right">'.price($obj->total_ht).'</td>';
print '<td align="right">'.price($obj->total_ttc).'</td>'; print '<td align="right">'.price($obj->total_ttc).'</td>';
print '<td align="right">'.price($obj->total_ttc-$obj->tot_fttc).'</td>'; print '<td align="right">'.price($obj->total_ttc-$obj->tot_fttc).'</td>';
print '<td>'.$commandestatic->LibStatut($obj->fk_statut,$obj->facture,3).'</td>'; print '<td>'.$commandestatic->LibStatut($obj->fk_statut,$obj->facture,3).'</td>';
@ -795,7 +795,7 @@ if ($conf->facture->enabled && $conf->commande->enabled && $user->rights->comman
} }
print '<tr class="liste_total"><td colspan="2">'.$langs->trans("Total").' &nbsp; <font style="font-weight: normal">('.$langs->trans("RemainderToBill").': '.price($tot_tobill).')</font> </td>'; print '<tr class="liste_total"><td colspan="2">'.$langs->trans("Total").' &nbsp; <font style="font-weight: normal">('.$langs->trans("RemainderToBill").': '.price($tot_tobill).')</font> </td>';
if ($conf->global->MAIN_SHOW_HT_ON_SUMMARY) print '<td align="right">'.price($tot_ht).'</td>'; if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td align="right">'.price($tot_ht).'</td>';
print '<td align="right">'.price($tot_ttc).'</td>'; print '<td align="right">'.price($tot_ttc).'</td>';
print '<td align="right">'.price($tot_tobill).'</td>'; print '<td align="right">'.price($tot_tobill).'</td>';
print '<td>&nbsp;</td>'; print '<td>&nbsp;</td>';
@ -813,7 +813,7 @@ if ($conf->facture->enabled && $conf->commande->enabled && $user->rights->comman
/* /*
* Unpaid customers invoices * Unpaid customers invoices
*/ */
if ($conf->facture->enabled && $user->rights->facture->lire) if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
{ {
$facstatic=new Facture($db); $facstatic=new Facture($db);
@ -840,7 +840,7 @@ if ($conf->facture->enabled && $user->rights->facture->lire)
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("BillsCustomersUnpaid",$num).' <a href="'.DOL_URL_ROOT.'/compta/facture/impayees.php">('.$num.')</a></td>'; print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("BillsCustomersUnpaid",$num).' <a href="'.DOL_URL_ROOT.'/compta/facture/impayees.php">('.$num.')</a></td>';
if ($conf->global->MAIN_SHOW_HT_ON_SUMMARY) print '<td align="right">'.$langs->trans("AmountHT").'</td>'; if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td align="right">'.$langs->trans("AmountHT").'</td>';
print '<td align="right">'.$langs->trans("AmountTTC").'</td>'; print '<td align="right">'.$langs->trans("AmountTTC").'</td>';
print '<td align="right">'.$langs->trans("Received").'</td>'; print '<td align="right">'.$langs->trans("Received").'</td>';
print '<td width="16">&nbsp;</td>'; print '<td width="16">&nbsp;</td>';
@ -853,7 +853,6 @@ if ($conf->facture->enabled && $user->rights->facture->lire)
{ {
$obj = $db->fetch_object($resql); $obj = $db->fetch_object($resql);
print '<tr '.$bc[$var].'>'; print '<tr '.$bc[$var].'>';
print '<td nowrap="nowrap">'; print '<td nowrap="nowrap">';
@ -871,7 +870,7 @@ if ($conf->facture->enabled && $user->rights->facture->lire)
$filename=dol_sanitizeFileName($obj->facnumber); $filename=dol_sanitizeFileName($obj->facnumber);
$filedir=$conf->facture->dir_output . '/' . dol_sanitizeFileName($obj->facnumber); $filedir=$conf->facture->dir_output . '/' . dol_sanitizeFileName($obj->facnumber);
$urlsource=$_SERVER['PHP_SELF'].'?facid='.$obj->rowid; $urlsource=$_SERVER['PHP_SELF'].'?facid='.$obj->rowid;
$formfile->show_documents('facture',$filename,$filedir,$urlsource,'','','',1,'',1); print $formfile->getDocumentsLink($facturestatic->element, $filename, $filedir);
print '</td></tr></table>'; print '</td></tr></table>';
print '</td>'; print '</td>';
@ -881,7 +880,7 @@ if ($conf->facture->enabled && $user->rights->facture->lire)
$societestatic->client=1; $societestatic->client=1;
print $societestatic->getNomUrl(1,'customer',44); print $societestatic->getNomUrl(1,'customer',44);
print '</a></td>'; print '</a></td>';
if ($conf->global->MAIN_SHOW_HT_ON_SUMMARY) print '<td align="right">'.price($obj->total).'</td>'; if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td align="right">'.price($obj->total).'</td>';
print '<td align="right">'.price($obj->total_ttc).'</td>'; print '<td align="right">'.price($obj->total_ttc).'</td>';
print '<td align="right">'.price($obj->am).'</td>'; print '<td align="right">'.price($obj->am).'</td>';
print '<td>'.$facstatic->LibStatut($obj->paye,$obj->fk_statut,3,$obj->am).'</td>'; print '<td>'.$facstatic->LibStatut($obj->paye,$obj->fk_statut,3,$obj->am).'</td>';
@ -895,7 +894,7 @@ if ($conf->facture->enabled && $user->rights->facture->lire)
} }
print '<tr class="liste_total"><td colspan="2">'.$langs->trans("Total").' &nbsp; <font style="font-weight: normal">('.$langs->trans("RemainderToTake").': '.price($total_ttc-$totalam).')</font> </td>'; print '<tr class="liste_total"><td colspan="2">'.$langs->trans("Total").' &nbsp; <font style="font-weight: normal">('.$langs->trans("RemainderToTake").': '.price($total_ttc-$totalam).')</font> </td>';
if ($conf->global->MAIN_SHOW_HT_ON_SUMMARY) print '<td align="right">'.price($total).'</td>'; if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td align="right">'.price($total).'</td>';
print '<td align="right">'.price($total_ttc).'</td>'; print '<td align="right">'.price($total_ttc).'</td>';
print '<td align="right">'.price($totalam).'</td>'; print '<td align="right">'.price($totalam).'</td>';
print '<td>&nbsp;</td>'; print '<td>&nbsp;</td>';
@ -904,7 +903,7 @@ if ($conf->facture->enabled && $user->rights->facture->lire)
else else
{ {
$colspan=5; $colspan=5;
if ($conf->global->MAIN_SHOW_HT_ON_SUMMARY) $colspan++; if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) $colspan++;
print '<tr '.$bc[$var].'><td colspan="'.$colspan.'">'.$langs->trans("NoInvoice").'</td></tr>'; print '<tr '.$bc[$var].'><td colspan="'.$colspan.'">'.$langs->trans("NoInvoice").'</td></tr>';
} }
print '</table><br>'; print '</table><br>';
@ -919,7 +918,7 @@ if ($conf->facture->enabled && $user->rights->facture->lire)
/* /*
* Unpayed supplier invoices * 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); $facstatic=new FactureFournisseur($db);
@ -945,7 +944,7 @@ if ($conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire)
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("BillsSuppliersUnpaid",$num).' <a href="'.DOL_URL_ROOT.'/fourn/facture/impayees.php">('.$num.')</a></td>'; print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("BillsSuppliersUnpaid",$num).' <a href="'.DOL_URL_ROOT.'/fourn/facture/impayees.php">('.$num.')</a></td>';
if ($conf->global->MAIN_SHOW_HT_ON_SUMMARY) print '<td align="right">'.$langs->trans("AmountHT").'</td>'; if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td align="right">'.$langs->trans("AmountHT").'</td>';
print '<td align="right">'.$langs->trans("AmountTTC").'</td>'; print '<td align="right">'.$langs->trans("AmountTTC").'</td>';
print '<td align="right">'.$langs->trans("Paid").'</td>'; print '<td align="right">'.$langs->trans("Paid").'</td>';
print '<td width="16">&nbsp;</td>'; print '<td width="16">&nbsp;</td>';
@ -968,7 +967,7 @@ if ($conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire)
$societestatic->nom=$obj->nom; $societestatic->nom=$obj->nom;
$societestatic->client=0; $societestatic->client=0;
print '<td>'.$societestatic->getNomUrl(1, 'supplier', 44).'</td>'; print '<td>'.$societestatic->getNomUrl(1, 'supplier', 44).'</td>';
if ($conf->global->MAIN_SHOW_HT_ON_SUMMARY) print '<td align="right">'.price($obj->total_ht).'</td>'; if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td align="right">'.price($obj->total_ht).'</td>';
print '<td align="right">'.price($obj->total_ttc).'</td>'; print '<td align="right">'.price($obj->total_ttc).'</td>';
print '<td align="right">'.price($obj->am).'</td>'; print '<td align="right">'.price($obj->am).'</td>';
print '<td>'.$facstatic->LibStatut($obj->paye,$obj->fk_statut,3).'</td>'; print '<td>'.$facstatic->LibStatut($obj->paye,$obj->fk_statut,3).'</td>';
@ -981,7 +980,7 @@ if ($conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire)
} }
print '<tr class="liste_total"><td colspan="2">'.$langs->trans("Total").' &nbsp; <font style="font-weight: normal">('.$langs->trans("RemainderToPay").': '.price($total_ttc-$totalam).')</font> </td>'; print '<tr class="liste_total"><td colspan="2">'.$langs->trans("Total").' &nbsp; <font style="font-weight: normal">('.$langs->trans("RemainderToPay").': '.price($total_ttc-$totalam).')</font> </td>';
if ($conf->global->MAIN_SHOW_HT_ON_SUMMARY) print '<td align="right">'.price($total).'</td>'; if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td align="right">'.price($total).'</td>';
print '<td align="right">'.price($total_ttc).'</td>'; print '<td align="right">'.price($total_ttc).'</td>';
print '<td align="right">'.price($totalam).'</td>'; print '<td align="right">'.price($totalam).'</td>';
print '<td>&nbsp;</td>'; print '<td>&nbsp;</td>';
@ -990,7 +989,7 @@ if ($conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire)
else else
{ {
$colspan=5; $colspan=5;
if ($conf->global->MAIN_SHOW_HT_ON_SUMMARY) $colspan++; if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) $colspan++;
print '<tr '.$bc[$var].'><td colspan="'.$colspan.'">'.$langs->trans("NoInvoice").'</td></tr>'; print '<tr '.$bc[$var].'><td colspan="'.$colspan.'">'.$langs->trans("NoInvoice").'</td></tr>';
} }
print '</table><br>'; print '</table><br>';

View File

@ -464,12 +464,12 @@ class Localtax extends CommonObject
$this->error=$langs->trans("ErrorFieldRequired",$langs->transnoentities("Amount")); $this->error=$langs->trans("ErrorFieldRequired",$langs->transnoentities("Amount"));
return -4; 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")); $this->error=$langs->trans("ErrorFieldRequired",$langs->transnoentities("Account"));
return -5; 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")); $this->error=$langs->trans("ErrorFieldRequired",$langs->transnoentities("PaymentMode"));
return -5; return -5;
@ -496,7 +496,7 @@ class Localtax extends CommonObject
if ($this->id > 0) if ($this->id > 0)
{ {
$ok=1; $ok=1;
if ($conf->banque->enabled) if (! empty($conf->banque->enabled))
{ {
// Insertion dans llx_bank // Insertion dans llx_bank
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';

View File

@ -107,7 +107,7 @@ if ($modetax==1) // Calculate on invoice for goods and services
$nom=$langs->transcountry("LT2ReportByCustomersInInputOutputMode",$mysoc->country_code); $nom=$langs->transcountry("LT2ReportByCustomersInInputOutputMode",$mysoc->country_code);
$period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1); $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1);
$description=$langs->trans("RulesVATDue"); $description=$langs->trans("RulesVATDue");
if ($conf->global->MAIN_MODULE_COMPTABILITE) $description.='<br>'.$langs->trans("WarningDepositsNotIncluded"); if (! empty($conf->global->MAIN_MODULE_COMPTABILITE)) $description.='<br>'.$langs->trans("WarningDepositsNotIncluded");
$description.=$fsearch; $description.=$fsearch;
$description.='<br>('.$langs->trans("TaxModuleSetupToModifyRules",DOL_URL_ROOT.'/admin/taxes.php').')'; $description.='<br>('.$langs->trans("TaxModuleSetupToModifyRules",DOL_URL_ROOT.'/admin/taxes.php').')';
$builddate=time(); $builddate=time();
@ -124,7 +124,7 @@ if ($modetax==0) // Invoice for goods, payment for services
$nom=$langs->transcountry("LT2ReportByCustomersInInputOutputMode",$mysoc->country_code); $nom=$langs->transcountry("LT2ReportByCustomersInInputOutputMode",$mysoc->country_code);
$period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1); $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1);
$description=$langs->trans("RulesVATIn"); $description=$langs->trans("RulesVATIn");
if ($conf->global->MAIN_MODULE_COMPTABILITE) $description.='<br>'.$langs->trans("WarningDepositsNotIncluded"); if (! empty($conf->global->MAIN_MODULE_COMPTABILITE)) $description.='<br>'.$langs->trans("WarningDepositsNotIncluded");
$description.=$fsearch; $description.=$fsearch;
$description.='<br>('.$langs->trans("TaxModuleSetupToModifyRules",DOL_URL_ROOT.'/admin/taxes.php').')'; $description.='<br>('.$langs->trans("TaxModuleSetupToModifyRules",DOL_URL_ROOT.'/admin/taxes.php').')';
$builddate=time(); $builddate=time();

View File

@ -168,7 +168,7 @@ if ($_GET["action"] == 'create')
// Amount // Amount
print '<tr><td class="fieldrequired">'.$langs->trans("Amount").'</td><td><input name="amount" size="10" value="'.$_POST["amount"].'"></td></tr>'; print '<tr><td class="fieldrequired">'.$langs->trans("Amount").'</td><td><input name="amount" size="10" value="'.$_POST["amount"].'"></td></tr>';
if ($conf->banque->enabled) if (! empty($conf->banque->enabled))
{ {
print '<tr><td class="fieldrequired">'.$langs->trans("Account").'</td><td>'; print '<tr><td class="fieldrequired">'.$langs->trans("Account").'</td><td>';
$form->select_comptes($_POST["accountid"],"accountid",0,"courant=1",1); // Affiche liste des comptes courant $form->select_comptes($_POST["accountid"],"accountid",0,"courant=1",1); // Affiche liste des comptes courant
@ -227,7 +227,7 @@ if ($id)
print '<tr><td>'.$langs->trans("Amount").'</td><td colspan="3">'.price($vatpayment->amount).'</td></tr>'; print '<tr><td>'.$langs->trans("Amount").'</td><td colspan="3">'.price($vatpayment->amount).'</td></tr>';
if ($conf->banque->enabled) if (! empty($conf->banque->enabled))
{ {
if ($vatpayment->fk_account > 0) if ($vatpayment->fk_account > 0)
{ {

View File

@ -97,7 +97,7 @@ if ($action == 'add_paiement' || ($action == 'confirm_paiement' && $confirm=='ye
$error++; $error++;
} }
if ($conf->banque->enabled) if (! empty($conf->banque->enabled))
{ {
// Si module bank actif, un compte est obligatoire lors de la saisie // Si module bank actif, un compte est obligatoire lors de la saisie
// d'un paiement // d'un paiement
@ -245,7 +245,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
// Invoice with Paypal transaction // Invoice with Paypal transaction
// TODO add hook possibility (regis) // 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; if (! empty($conf->global->PAYPAL_BANK_ACCOUNT)) $accountid=$conf->global->PAYPAL_BANK_ACCOUNT;
$paymentnum=$facture->ref_int; $paymentnum=$facture->ref_int;
@ -385,7 +385,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
// Bank account // Bank account
print '<tr>'; print '<tr>';
if ($conf->banque->enabled) if (! empty($conf->banque->enabled))
{ {
if ($facture->type != 2) print '<td><span class="fieldrequired">'.$langs->trans('AccountToCredit').'</span></td>'; if ($facture->type != 2) print '<td><span class="fieldrequired">'.$langs->trans('AccountToCredit').'</span></td>';
if ($facture->type == 2) print '<td><span class="fieldrequired">'.$langs->trans('AccountToDebit').'</span></td>'; if ($facture->type == 2) print '<td><span class="fieldrequired">'.$langs->trans('AccountToDebit').'</span></td>';
@ -589,10 +589,10 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
{ {
// print '<tr><td colspan="3" align="center">'; // print '<tr><td colspan="3" align="center">';
print '<center><br><input type="checkbox" checked="checked" name="closepaidinvoices"> '.$langs->trans("ClosePaidInvoicesAutomatically"); print '<center><br><input type="checkbox" checked="checked" name="closepaidinvoices"> '.$langs->trans("ClosePaidInvoicesAutomatically");
/*if ($conf->prelevement->enabled) /*if (! empty($conf->prelevement->enabled))
{ {
$langs->load("withdrawals"); $langs->load("withdrawals");
if ($conf->global->WITHDRAW_DISABLE_AUTOCREATE_ONPAYMENTS) print '<br>'.$langs->trans("IfInvoiceNeedOnWithdrawPaymentWontBeClosed"); if (! empty($conf->global->WITHDRAW_DISABLE_AUTOCREATE_ONPAYMENTS)) print '<br>'.$langs->trans("IfInvoiceNeedOnWithdrawPaymentWontBeClosed");
}*/ }*/
print '<br><input type="submit" class="button" value="'.$langs->trans('Save').'"><br><br></center>'; print '<br><input type="submit" class="button" value="'.$langs->trans('Save').'"><br><br></center>';
// print '</td></tr>'; // print '</td></tr>';

View File

@ -192,7 +192,7 @@ class Paiement extends CommonObject
// This payment might be this one or a previous one // This payment might be this one or a previous one
if ($paym['type']=='PRE') if ($paym['type']=='PRE')
{ {
if ($conf->prelevement->enabled) if (! empty($conf->prelevement->enabled))
{ {
// TODO Check if this payment has a withdraw request // TODO Check if this payment has a withdraw request
// if not, $mustwait++; // This will disable automatic close on invoice to allow to process // if not, $mustwait++; // This will disable automatic close on invoice to allow to process
@ -377,7 +377,7 @@ class Paiement extends CommonObject
$bank_line_id=0; $bank_line_id=0;
$this->fk_account=$accountid; $this->fk_account=$accountid;
if ($conf->banque->enabled) if (! empty($conf->banque->enabled))
{ {
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';

View File

@ -29,7 +29,7 @@ require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
require_once DOL_DOCUMENT_ROOT .'/core/modules/facture/modules_facture.php'; require_once DOL_DOCUMENT_ROOT .'/core/modules/facture/modules_facture.php';
if ($conf->banque->enabled) require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; if (! empty($conf->banque->enabled)) require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
$langs->load('bills'); $langs->load('bills');
$langs->load('banks'); $langs->load('banks');
@ -238,7 +238,7 @@ print $form->editfieldval("Note",'note',$object->note,$object,$user->rights->fac
print '</td></tr>'; print '</td></tr>';
// Bank account // Bank account
if ($conf->banque->enabled) if (! empty($conf->banque->enabled))
{ {
if ($object->bank_account) if ($object->bank_account)
{ {
@ -355,7 +355,7 @@ print '</div>';
print '<div class="tabsAction">'; print '<div class="tabsAction">';
if ($conf->global->BILL_ADD_PAYMENT_VALIDATION) if (! empty($conf->global->BILL_ADD_PAYMENT_VALIDATION))
{ {
if ($user->societe_id == 0 && $object->statut == 0 && $_GET['action'] == '') if ($user->societe_id == 0 && $object->statut == 0 && $_GET['action'] == '')
{ {

View File

@ -143,7 +143,7 @@ if ($resql)
print_liste_field_titre($langs->trans("Account"),$_SERVER["PHP_SELF"],"ba.label","",$paramlist,"",$sortfield,$sortorder); print_liste_field_titre($langs->trans("Account"),$_SERVER["PHP_SELF"],"ba.label","",$paramlist,"",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Amount"),$_SERVER["PHP_SELF"],"p.amount","",$paramlist,'align="right"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Amount"),$_SERVER["PHP_SELF"],"p.amount","",$paramlist,'align="right"',$sortfield,$sortorder);
//print_liste_field_titre($langs->trans("Invoices"),"","","",$paramlist,'align="left"',$sortfield,$sortorder); //print_liste_field_titre($langs->trans("Invoices"),"","","",$paramlist,'align="left"',$sortfield,$sortorder);
if ($conf->global->BILL_ADD_PAYMENT_VALIDATION) if (! empty($conf->global->BILL_ADD_PAYMENT_VALIDATION))
{ {
print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"p.statut","",$paramlist,'align="right"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"p.statut","",$paramlist,'align="right"',$sortfield,$sortorder);
} }
@ -168,7 +168,7 @@ if ($resql)
print '<input class="fat" type="text" size="4" name="search_amount" value="'.$_REQUEST["search_amount"].'">'; print '<input class="fat" type="text" size="4" name="search_amount" value="'.$_REQUEST["search_amount"].'">';
print '<input type="image" class="liste_titre" name="button_search" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/search.png" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">'; print '<input type="image" class="liste_titre" name="button_search" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/search.png" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
print '</td>'; print '</td>';
if ($conf->global->BILL_ADD_PAYMENT_VALIDATION) if (! empty($conf->global->BILL_ADD_PAYMENT_VALIDATION))
{ {
print '<td align="right">'; print '<td align="right">';
print '</td>'; print '</td>';
@ -213,7 +213,7 @@ if ($resql)
print '</td>'; print '</td>';
print '<td align="right">'.price($objp->amount).'</td>'; print '<td align="right">'.price($objp->amount).'</td>';
if ($conf->global->BILL_ADD_PAYMENT_VALIDATION) if (! empty($conf->global->BILL_ADD_PAYMENT_VALIDATION))
{ {
print '<td align="right">'; print '<td align="right">';
if ($objp->statut == 0) print '<a href="fiche.php?id='.$objp->rowid.'&amp;action=valide">'; if ($objp->statut == 0) print '<a href="fiche.php?id='.$objp->rowid.'&amp;action=valide">';

View File

@ -66,7 +66,7 @@ if ($_POST["action"] == 'add_payment')
$mesg = $langs->trans("ErrorFieldRequired",$langs->transnoentities("Date")); $mesg = $langs->trans("ErrorFieldRequired",$langs->transnoentities("Date"));
$error++; $error++;
} }
if ($conf->banque->enabled && ! $_POST["accountid"] > 0) if (! empty($conf->banque->enabled) && ! $_POST["accountid"] > 0)
{ {
$mesg = $langs->trans("ErrorFieldRequired",$langs->transnoentities("AccountToCredit")); $mesg = $langs->trans("ErrorFieldRequired",$langs->transnoentities("AccountToCredit"));
$error++; $error++;

View File

@ -30,7 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php'
require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/paymentsocialcontribution.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/paymentsocialcontribution.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/modules/facture/modules_facture.php'; require_once DOL_DOCUMENT_ROOT.'/core/modules/facture/modules_facture.php';
if ($conf->banque->enabled) require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; if (! empty($conf->banque->enabled)) require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
$langs->load('bills'); $langs->load('bills');
$langs->load('banks'); $langs->load('banks');
@ -189,7 +189,7 @@ print '<tr><td valign="top">'.$langs->trans('Amount').'</td><td colspan="3">'.pr
print '<tr><td valign="top">'.$langs->trans('Note').'</td><td colspan="3">'.nl2br($paiement->note).'</td></tr>'; print '<tr><td valign="top">'.$langs->trans('Note').'</td><td colspan="3">'.nl2br($paiement->note).'</td></tr>';
// Bank account // Bank account
if ($conf->banque->enabled) if (! empty($conf->banque->enabled))
{ {
if ($paiement->bank_account) if ($paiement->bank_account)
{ {
@ -293,7 +293,7 @@ print '</div>';
print '<div class="tabsAction">'; print '<div class="tabsAction">';
/* /*
if ($conf->global->BILL_ADD_PAYMENT_VALIDATION) if (! empty($conf->global->BILL_ADD_PAYMENT_VALIDATION))
{ {
if ($user->societe_id == 0 && $paiement->statut == 0 && $_GET['action'] == '') if ($user->societe_id == 0 && $paiement->statut == 0 && $_GET['action'] == '')
{ {

View File

@ -1185,7 +1185,7 @@ class BonPrelevement extends CommonObject
if ($mysoc->country_code=='ES') if ($mysoc->country_code=='ES')
{ {
// TODO replace by a hook (external modules) // TODO replace by a hook (external modules)
if ($conf->esaeb->enabled) if (! empty($conf->esaeb->enabled))
{ {
//Head //Head
$esaeb19 = new AEB19DocWritter; $esaeb19 = new AEB19DocWritter;

View File

@ -27,7 +27,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
$langs->load("companies"); $langs->load("companies");
if ($conf->facture->enabled) $langs->load("bills"); if (! empty($conf->facture->enabled)) $langs->load("bills");
// Security check // Security check
$socid = $_GET["socid"]; $socid = $_GET["socid"];
@ -79,7 +79,7 @@ if ($socid > 0)
print '</div>'; print '</div>';
if ($conf->facture->enabled && $user->rights->facture->lire) if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
{ {
// Factures // Factures
print_fiche_titre($langs->trans("CustomerPreview")); print_fiche_titre($langs->trans("CustomerPreview"));

View File

@ -472,7 +472,7 @@ class PaymentSocialContribution extends CommonObject
$error=0; $error=0;
if ($conf->banque->enabled) if (! empty($conf->banque->enabled))
{ {
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';

View File

@ -282,9 +282,9 @@ if (count($amount))
// Other stats // Other stats
print '<td align="center">'; print '<td align="center">';
if ($conf->propal->enabled && $key>0) print '&nbsp;<a href="'.DOL_URL_ROOT.'/comm/propal/stats/index.php?userid='.$key.'">'.img_picto($langs->trans("ProposalStats"),"stats").'</a>&nbsp;'; if (! empty($conf->propal->enabled) && $key>0) print '&nbsp;<a href="'.DOL_URL_ROOT.'/comm/propal/stats/index.php?userid='.$key.'">'.img_picto($langs->trans("ProposalStats"),"stats").'</a>&nbsp;';
if ($conf->commande->enabled && $key>0) print '&nbsp;<a href="'.DOL_URL_ROOT.'/commande/stats/index.php?userid='.$key.'">'.img_picto($langs->trans("OrderStats"),"stats").'</a>&nbsp;'; if (! empty($conf->commande->enabled) && $key>0) print '&nbsp;<a href="'.DOL_URL_ROOT.'/commande/stats/index.php?userid='.$key.'">'.img_picto($langs->trans("OrderStats"),"stats").'</a>&nbsp;';
if ($conf->facture->enabled && $key>0) print '&nbsp;<a href="'.DOL_URL_ROOT.'/compta/facture/stats/index.php?userid='.$key.'">'.img_picto($langs->trans("InvoiceStats"),"stats").'</a>&nbsp;'; if (! empty($conf->facture->enabled) && $key>0) print '&nbsp;<a href="'.DOL_URL_ROOT.'/compta/facture/stats/index.php?userid='.$key.'">'.img_picto($langs->trans("InvoiceStats"),"stats").'</a>&nbsp;';
print '</td>'; print '</td>';
print "</tr>\n"; print "</tr>\n";

View File

@ -292,9 +292,9 @@ if (count($amount))
// Other stats // Other stats
print '<td align="center">'; print '<td align="center">';
if ($conf->propal->enabled && $key>0) print '&nbsp;<a href="'.DOL_URL_ROOT.'/comm/propal/stats/index.php?socid='.$key.'">'.img_picto($langs->trans("ProposalStats"),"stats").'</a>&nbsp;'; if (! empty($conf->propal->enabled) && $key>0) print '&nbsp;<a href="'.DOL_URL_ROOT.'/comm/propal/stats/index.php?socid='.$key.'">'.img_picto($langs->trans("ProposalStats"),"stats").'</a>&nbsp;';
if ($conf->commande->enabled && $key>0) print '&nbsp;<a href="'.DOL_URL_ROOT.'/commande/stats/index.php?socid='.$key.'">'.img_picto($langs->trans("OrderStats"),"stats").'</a>&nbsp;'; if (! empty($conf->commande->enabled) && $key>0) print '&nbsp;<a href="'.DOL_URL_ROOT.'/commande/stats/index.php?socid='.$key.'">'.img_picto($langs->trans("OrderStats"),"stats").'</a>&nbsp;';
if ($conf->facture->enabled && $key>0) print '&nbsp;<a href="'.DOL_URL_ROOT.'/compta/facture/stats/index.php?socid='.$key.'">'.img_picto($langs->trans("InvoiceStats"),"stats").'</a>&nbsp;'; if (! empty($conf->facture->enabled) && $key>0) print '&nbsp;<a href="'.DOL_URL_ROOT.'/compta/facture/stats/index.php?socid='.$key.'">'.img_picto($langs->trans("InvoiceStats"),"stats").'</a>&nbsp;';
print '</td>'; print '</td>';
print "</tr>\n"; print "</tr>\n";

View File

@ -485,12 +485,12 @@ class Tva extends CommonObject
$this->error=$langs->trans("ErrorFieldRequired",$langs->transnoentities("Amount")); $this->error=$langs->trans("ErrorFieldRequired",$langs->transnoentities("Amount"));
return -4; 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")); $this->error=$langs->trans("ErrorFieldRequired",$langs->transnoentities("Account"));
return -5; 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")); $this->error=$langs->trans("ErrorFieldRequired",$langs->transnoentities("PaymentMode"));
return -5; return -5;
@ -525,7 +525,7 @@ class Tva extends CommonObject
if ($this->id > 0) if ($this->id > 0)
{ {
$ok=1; $ok=1;
if ($conf->banque->enabled) if (! empty($conf->banque->enabled))
{ {
// Insertion dans llx_bank // Insertion dans llx_bank
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';

View File

@ -117,7 +117,7 @@ if ($modetax==1) // Calculate on invoice for goods and services
$description.='<br>'; $description.='<br>';
$description.=$langs->trans("RulesVATDueProducts"); $description.=$langs->trans("RulesVATDueProducts");
//if ($conf->global->MAIN_MODULE_COMPTABILITE || $conf->global->MAIN_MODULE_ACCOUNTING) $description.='<br>'.img_warning().' '.$langs->trans('OptionVatInfoModuleComptabilite'); //if ($conf->global->MAIN_MODULE_COMPTABILITE || $conf->global->MAIN_MODULE_ACCOUNTING) $description.='<br>'.img_warning().' '.$langs->trans('OptionVatInfoModuleComptabilite');
//if ($conf->global->MAIN_MODULE_COMPTABILITE) $description.='<br>'.$langs->trans("WarningDepositsNotIncluded"); //if (! empty($conf->global->MAIN_MODULE_COMPTABILITE)) $description.='<br>'.$langs->trans("WarningDepositsNotIncluded");
if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $description.='<br>'.$langs->trans("DepositsAreNotIncluded"); if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $description.='<br>'.$langs->trans("DepositsAreNotIncluded");
else $description.='<br>'.$langs->trans("DepositsAreIncluded"); else $description.='<br>'.$langs->trans("DepositsAreIncluded");
$description.=$fsearch; $description.=$fsearch;
@ -147,7 +147,7 @@ if ($modetax==0) // Invoice for goods, payment for services
if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $description.=' '.$langs->trans("DepositsAreNotIncluded"); if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $description.=' '.$langs->trans("DepositsAreNotIncluded");
else $description.=' '.$langs->trans("DepositsAreIncluded"); else $description.=' '.$langs->trans("DepositsAreIncluded");
//if ($conf->global->MAIN_MODULE_COMPTABILITE || $conf->global->MAIN_MODULE_ACCOUNTING) $description.='<br>'.img_warning().' '.$langs->trans('OptionVatInfoModuleComptabilite'); //if ($conf->global->MAIN_MODULE_COMPTABILITE || $conf->global->MAIN_MODULE_ACCOUNTING) $description.='<br>'.img_warning().' '.$langs->trans('OptionVatInfoModuleComptabilite');
//if ($conf->global->MAIN_MODULE_COMPTABILITE) $description.='<br>'.$langs->trans("WarningDepositsNotIncluded"); //if (! empty($conf->global->MAIN_MODULE_COMPTABILITE)) $description.='<br>'.$langs->trans("WarningDepositsNotIncluded");
$description.=$fsearch; $description.=$fsearch;
$description.='<br>('.$langs->trans("TaxModuleSetupToModifyRules",DOL_URL_ROOT.'/admin/taxes.php').')'; $description.='<br>('.$langs->trans("TaxModuleSetupToModifyRules",DOL_URL_ROOT.'/admin/taxes.php').')';
$builddate=time(); $builddate=time();

View File

@ -172,7 +172,7 @@ if ($_GET["action"] == 'create')
// Amount // Amount
print '<tr><td class="fieldrequired">'.$langs->trans("Amount").'</td><td><input name="amount" size="10" value="'.$_POST["amount"].'"></td></tr>'; print '<tr><td class="fieldrequired">'.$langs->trans("Amount").'</td><td><input name="amount" size="10" value="'.$_POST["amount"].'"></td></tr>';
if ($conf->banque->enabled) if (! empty($conf->banque->enabled))
{ {
print '<tr><td class="fieldrequired">'.$langs->trans("Account").'</td><td>'; print '<tr><td class="fieldrequired">'.$langs->trans("Account").'</td><td>';
$form->select_comptes($_POST["accountid"],"accountid",0,"courant=1",1); // Affiche liste des comptes courant $form->select_comptes($_POST["accountid"],"accountid",0,"courant=1",1); // Affiche liste des comptes courant
@ -236,7 +236,7 @@ if ($id)
print '<tr><td>'.$langs->trans("Amount").'</td><td colspan="3">'.price($vatpayment->amount).'</td></tr>'; print '<tr><td>'.$langs->trans("Amount").'</td><td colspan="3">'.price($vatpayment->amount).'</td></tr>';
if ($conf->banque->enabled) if (! empty($conf->banque->enabled))
{ {
if ($vatpayment->fk_account > 0) if ($vatpayment->fk_account > 0)
{ {

View File

@ -137,7 +137,7 @@ if ($modetax==1) // Calculate on invoice for goods and services
$description.='<br>'; $description.='<br>';
$description.=$langs->trans("RulesVATDueProducts"); $description.=$langs->trans("RulesVATDueProducts");
//if ($conf->global->MAIN_MODULE_COMPTABILITE || $conf->global->MAIN_MODULE_ACCOUNTING) $description.='<br>'.img_warning().' '.$langs->trans('OptionVatInfoModuleComptabilite'); //if ($conf->global->MAIN_MODULE_COMPTABILITE || $conf->global->MAIN_MODULE_ACCOUNTING) $description.='<br>'.img_warning().' '.$langs->trans('OptionVatInfoModuleComptabilite');
//if ($conf->global->MAIN_MODULE_COMPTABILITE) $description.='<br>'.$langs->trans("WarningDepositsNotIncluded"); //if (! empty($conf->global->MAIN_MODULE_COMPTABILITE)) $description.='<br>'.$langs->trans("WarningDepositsNotIncluded");
if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $description.='<br>'.$langs->trans("DepositsAreNotIncluded"); if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $description.='<br>'.$langs->trans("DepositsAreNotIncluded");
else $description.='<br>'.$langs->trans("DepositsAreIncluded"); else $description.='<br>'.$langs->trans("DepositsAreIncluded");
$description.='<br>('.$langs->trans("TaxModuleSetupToModifyRules",DOL_URL_ROOT.'/admin/taxes.php').')'; $description.='<br>('.$langs->trans("TaxModuleSetupToModifyRules",DOL_URL_ROOT.'/admin/taxes.php').')';
@ -174,7 +174,7 @@ if ($modetax==0) // Invoice for goods, payment for services
if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $description.=' '.$langs->trans("DepositsAreNotIncluded"); if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $description.=' '.$langs->trans("DepositsAreNotIncluded");
else $description.=' '.$langs->trans("DepositsAreIncluded"); else $description.=' '.$langs->trans("DepositsAreIncluded");
//if ($conf->global->MAIN_MODULE_COMPTABILITE || $conf->global->MAIN_MODULE_ACCOUNTING) $description.='<br>'.img_warning().' '.$langs->trans('OptionVatInfoModuleComptabilite'); //if ($conf->global->MAIN_MODULE_COMPTABILITE || $conf->global->MAIN_MODULE_ACCOUNTING) $description.='<br>'.img_warning().' '.$langs->trans('OptionVatInfoModuleComptabilite');
//if ($conf->global->MAIN_MODULE_COMPTABILITE) $description.='<br>'.$langs->trans("WarningDepositsNotIncluded"); //if (! empty($conf->global->MAIN_MODULE_COMPTABILITE)) $description.='<br>'.$langs->trans("WarningDepositsNotIncluded");
$description.=$fsearch; $description.=$fsearch;
$description.='<br>('.$langs->trans("TaxModuleSetupToModifyRules",DOL_URL_ROOT.'/admin/taxes.php').')'; $description.='<br>('.$langs->trans("TaxModuleSetupToModifyRules",DOL_URL_ROOT.'/admin/taxes.php').')';
$builddate=time(); $builddate=time();

View File

@ -310,7 +310,7 @@ abstract class ActionsContactCardCommon
if ($action == 'view' || $action == 'edit' || $action == 'delete') if ($action == 'view' || $action == 'edit' || $action == 'delete')
{ {
// Emailing // Emailing
if ($conf->mailing->enabled) if (! empty($conf->mailing->enabled))
{ {
$langs->load("mails"); $langs->load("mails");
$this->tpl['nb_emailing'] = $this->object->getNbOfEMailings(); $this->tpl['nb_emailing'] = $this->object->getNbOfEMailings();
@ -322,25 +322,25 @@ abstract class ActionsContactCardCommon
$this->object->load_ref_elements(); $this->object->load_ref_elements();
if ($conf->commande->enabled) if (! empty($conf->commande->enabled))
{ {
$this->tpl['contact_element'][$i]['linked_element_label'] = $langs->trans("ContactForOrders"); $this->tpl['contact_element'][$i]['linked_element_label'] = $langs->trans("ContactForOrders");
$this->tpl['contact_element'][$i]['linked_element_value'] = $this->object->ref_commande?$this->object->ref_commande:$langs->trans("NoContactForAnyOrder"); $this->tpl['contact_element'][$i]['linked_element_value'] = $this->object->ref_commande?$this->object->ref_commande:$langs->trans("NoContactForAnyOrder");
$i++; $i++;
} }
if ($conf->propal->enabled) if (! empty($conf->propal->enabled))
{ {
$this->tpl['contact_element'][$i]['linked_element_label'] = $langs->trans("ContactForProposals"); $this->tpl['contact_element'][$i]['linked_element_label'] = $langs->trans("ContactForProposals");
$this->tpl['contact_element'][$i]['linked_element_value'] = $this->object->ref_propal?$this->object->ref_propal:$langs->trans("NoContactForAnyProposal"); $this->tpl['contact_element'][$i]['linked_element_value'] = $this->object->ref_propal?$this->object->ref_propal:$langs->trans("NoContactForAnyProposal");
$i++; $i++;
} }
if ($conf->contrat->enabled) if (! empty($conf->contrat->enabled))
{ {
$this->tpl['contact_element'][$i]['linked_element_label'] = $langs->trans("ContactForContracts"); $this->tpl['contact_element'][$i]['linked_element_label'] = $langs->trans("ContactForContracts");
$this->tpl['contact_element'][$i]['linked_element_value'] = $this->object->ref_contrat?$this->object->ref_contrat:$langs->trans("NoContactForAnyContract"); $this->tpl['contact_element'][$i]['linked_element_value'] = $this->object->ref_contrat?$this->object->ref_contrat:$langs->trans("NoContactForAnyContract");
$i++; $i++;
} }
if ($conf->facture->enabled) if (! empty($conf->facture->enabled))
{ {
$this->tpl['contact_element'][$i]['linked_element_label'] = $langs->trans("ContactForInvoices"); $this->tpl['contact_element'][$i]['linked_element_label'] = $langs->trans("ContactForInvoices");
$this->tpl['contact_element'][$i]['linked_element_value'] = $this->object->ref_facturation?$this->object->ref_facturation:$langs->trans("NoContactForAnyInvoice"); $this->tpl['contact_element'][$i]['linked_element_value'] = $this->object->ref_facturation?$this->object->ref_facturation:$langs->trans("NoContactForAnyInvoice");

View File

@ -331,9 +331,9 @@ class Contact extends CommonObject
$this->fullname=$this->getFullName($langs); $this->fullname=$this->getFullName($langs);
// Fields // Fields
if ($this->fullname && $conf->global->LDAP_CONTACT_FIELD_FULLNAME) $info[$conf->global->LDAP_CONTACT_FIELD_FULLNAME] = $this->fullname; if ($this->fullname && ! empty($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->lastname && ! empty($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->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->poste) $info["title"] = $this->poste;
if ($this->socid > 0) if ($this->socid > 0)
@ -346,16 +346,16 @@ class Contact extends CommonObject
if ($soc->client == 2) $info["businessCategory"] = "Prospects"; if ($soc->client == 2) $info["businessCategory"] = "Prospects";
if ($soc->fournisseur == 1) $info["businessCategory"] = "Suppliers"; 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->address && ! empty($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->cp && ! empty($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->ville && ! empty($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->country_code && ! empty($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_pro && ! empty($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_perso && ! empty($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->phone_mobile && ! empty($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->fax && ! empty($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->note && ! empty($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->email && ! empty($conf->global->LDAP_CONTACT_FIELD_MAIL)) $info[$conf->global->LDAP_CONTACT_FIELD_MAIL] = $this->email;
if ($conf->global->LDAP_SERVER_TYPE == 'egroupware') if ($conf->global->LDAP_SERVER_TYPE == 'egroupware')
{ {

View File

@ -658,28 +658,28 @@ else
$object->load_ref_elements(); $object->load_ref_elements();
if ($conf->commande->enabled) if (! empty($conf->commande->enabled))
{ {
print '<tr><td>'.$langs->trans("ContactForOrders").'</td><td colspan="3">'; print '<tr><td>'.$langs->trans("ContactForOrders").'</td><td colspan="3">';
print $object->ref_commande?$object->ref_commande:$langs->trans("NoContactForAnyOrder"); print $object->ref_commande?$object->ref_commande:$langs->trans("NoContactForAnyOrder");
print '</td></tr>'; print '</td></tr>';
} }
if ($conf->propal->enabled) if (! empty($conf->propal->enabled))
{ {
print '<tr><td>'.$langs->trans("ContactForProposals").'</td><td colspan="3">'; print '<tr><td>'.$langs->trans("ContactForProposals").'</td><td colspan="3">';
print $object->ref_propal?$object->ref_propal:$langs->trans("NoContactForAnyProposal"); print $object->ref_propal?$object->ref_propal:$langs->trans("NoContactForAnyProposal");
print '</td></tr>'; print '</td></tr>';
} }
if ($conf->contrat->enabled) if (! empty($conf->contrat->enabled))
{ {
print '<tr><td>'.$langs->trans("ContactForContracts").'</td><td colspan="3">'; print '<tr><td>'.$langs->trans("ContactForContracts").'</td><td colspan="3">';
print $object->ref_contrat?$object->ref_contrat:$langs->trans("NoContactForAnyContract"); print $object->ref_contrat?$object->ref_contrat:$langs->trans("NoContactForAnyContract");
print '</td></tr>'; print '</td></tr>';
} }
if ($conf->facture->enabled) if (! empty($conf->facture->enabled))
{ {
print '<tr><td>'.$langs->trans("ContactForInvoices").'</td><td colspan="3">'; print '<tr><td>'.$langs->trans("ContactForInvoices").'</td><td colspan="3">';
print $object->ref_facturation?$object->ref_facturation:$langs->trans("NoContactForAnyInvoice"); print $object->ref_facturation?$object->ref_facturation:$langs->trans("NoContactForAnyInvoice");
@ -744,7 +744,7 @@ else
//array('label' => $form->textwithpicto($langs->trans("Type"),$langs->trans("InternalExternalDesc")), 'type' => 'select', 'name' => 'intern', 'default' => 1, 'values' => array(0=>$langs->trans('Internal'),1=>$langs->trans('External'))) //array('label' => $form->textwithpicto($langs->trans("Type"),$langs->trans("InternalExternalDesc")), 'type' => 'select', 'name' => 'intern', 'default' => 1, 'values' => array(0=>$langs->trans('Internal'),1=>$langs->trans('External')))
); );
$text=$langs->trans("ConfirmCreateContact").'<br>'; $text=$langs->trans("ConfirmCreateContact").'<br>';
if ($conf->societe->enabled) if (! empty($conf->societe->enabled))
{ {
if ($object->socid > 0) $text.=$langs->trans("UserWillBeExternalUser"); if ($object->socid > 0) $text.=$langs->trans("UserWillBeExternalUser");
else $text.=$langs->trans("UserWillBeInternalUser"); else $text.=$langs->trans("UserWillBeInternalUser");
@ -823,7 +823,7 @@ else
// Email // Email
print '<tr><td>'.$langs->trans("EMail").'</td><td>'.dol_print_email($object->email,$object->id,$object->socid,'AC_EMAIL').'</td>'; print '<tr><td>'.$langs->trans("EMail").'</td><td>'.dol_print_email($object->email,$object->id,$object->socid,'AC_EMAIL').'</td>';
if ($conf->mailing->enabled) if (! empty($conf->mailing->enabled))
{ {
$langs->load("mails"); $langs->load("mails");
print '<td nowrap>'.$langs->trans("NbOfEMailingsReceived").'</td>'; print '<td nowrap>'.$langs->trans("NbOfEMailingsReceived").'</td>';
@ -857,28 +857,28 @@ else
$object->load_ref_elements(); $object->load_ref_elements();
if ($conf->commande->enabled) if (! empty($conf->commande->enabled))
{ {
print '<tr><td>'.$langs->trans("ContactForOrders").'</td><td colspan="3">'; print '<tr><td>'.$langs->trans("ContactForOrders").'</td><td colspan="3">';
print $object->ref_commande?$object->ref_commande:$langs->trans("NoContactForAnyOrder"); print $object->ref_commande?$object->ref_commande:$langs->trans("NoContactForAnyOrder");
print '</td></tr>'; print '</td></tr>';
} }
if ($conf->propal->enabled) if (! empty($conf->propal->enabled))
{ {
print '<tr><td>'.$langs->trans("ContactForProposals").'</td><td colspan="3">'; print '<tr><td>'.$langs->trans("ContactForProposals").'</td><td colspan="3">';
print $object->ref_propal?$object->ref_propal:$langs->trans("NoContactForAnyProposal"); print $object->ref_propal?$object->ref_propal:$langs->trans("NoContactForAnyProposal");
print '</td></tr>'; print '</td></tr>';
} }
if ($conf->contrat->enabled) if (! empty($conf->contrat->enabled))
{ {
print '<tr><td>'.$langs->trans("ContactForContracts").'</td><td colspan="3">'; print '<tr><td>'.$langs->trans("ContactForContracts").'</td><td colspan="3">';
print $object->ref_contrat?$object->ref_contrat:$langs->trans("NoContactForAnyContract"); print $object->ref_contrat?$object->ref_contrat:$langs->trans("NoContactForAnyContract");
print '</td></tr>'; print '</td></tr>';
} }
if ($conf->facture->enabled) if (! empty($conf->facture->enabled))
{ {
print '<tr><td>'.$langs->trans("ContactForInvoices").'</td><td colspan="3">'; print '<tr><td>'.$langs->trans("ContactForInvoices").'</td><td colspan="3">';
print $object->ref_facturation?$object->ref_facturation:$langs->trans("NoContactForAnyInvoice"); print $object->ref_facturation?$object->ref_facturation:$langs->trans("NoContactForAnyInvoice");

View File

@ -33,7 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/modules/contract/modules_contract.php'; require_once DOL_DOCUMENT_ROOT.'/core/modules/contract/modules_contract.php';
if (! empty($conf->produit->enabled) || ! empty($conf->service->enabled)) require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; if (! empty($conf->produit->enabled) || ! empty($conf->service->enabled)) require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
if (! empty($conf->propal->enabled)) require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; if (! empty($conf->propal->enabled)) require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
if ($conf->projet->enabled) { if (! empty($conf->projet->enabled)) {
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php';
} }
@ -618,7 +618,7 @@ if ($action == 'create')
$form->select_date($datecontrat,'',0,0,'',"contrat"); $form->select_date($datecontrat,'',0,0,'',"contrat");
print "</td></tr>"; print "</td></tr>";
if ($conf->projet->enabled) if (! empty($conf->projet->enabled))
{ {
print '<tr><td>'.$langs->trans("Project").'</td><td>'; print '<tr><td>'.$langs->trans("Project").'</td><td>';
select_projects($soc->id,GETPOST("projectid"),"projectid"); select_projects($soc->id,GETPOST("projectid"),"projectid");
@ -767,7 +767,7 @@ else
print '<td colspan="3">'.dol_print_date($object->date_contrat,"dayhour")."</td></tr>\n"; print '<td colspan="3">'.dol_print_date($object->date_contrat,"dayhour")."</td></tr>\n";
// Projet // Projet
if ($conf->projet->enabled) if (! empty($conf->projet->enabled))
{ {
$langs->load("projects"); $langs->load("projects");
print '<tr><td>'; print '<tr><td>';
@ -1276,7 +1276,7 @@ else
print "<tr ".$bc[$var].">"; print "<tr ".$bc[$var].">";
print '<td colspan="3">'; print '<td colspan="3">';
// multiprix // multiprix
if($conf->global->PRODUIT_MULTIPRICES) if (! empty($conf->global->PRODUIT_MULTIPRICES))
$form->select_produits('','idprod',1,$conf->product->limit_size,$object->thirdparty->price_level); $form->select_produits('','idprod',1,$conf->product->limit_size,$object->thirdparty->price_level);
else else
$form->select_produits('','idprod',1,$conf->product->limit_size); $form->select_produits('','idprod',1,$conf->product->limit_size);
@ -1359,7 +1359,7 @@ else
else print '<a class="butActionRefused" href="#" title="'.$langs->trans("NotEnoughPermissions").'">'.$langs->trans("Validate").'</a>'; 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"); $langs->load("bills");
if ($user->rights->facture->creer) print '<a class="butAction" href="'.DOL_URL_ROOT.'/compta/facture.php?action=create&amp;origin='.$object->element.'&amp;originid='.$object->id.'&amp;socid='.$object->thirdparty->id.'">'.$langs->trans("CreateBill").'</a>'; if ($user->rights->facture->creer) print '<a class="butAction" href="'.DOL_URL_ROOT.'/compta/facture.php?action=create&amp;origin='.$object->element.'&amp;originid='.$object->id.'&amp;socid='.$object->thirdparty->id.'">'.$langs->trans("CreateBill").'</a>';

View File

@ -60,7 +60,7 @@ if (! empty($_GET['zipcode']) || ! empty($_GET['town']))
$zipcode = $_GET['zipcode']?$_GET['zipcode']:''; $zipcode = $_GET['zipcode']?$_GET['zipcode']:'';
$town = $_GET['town']?$_GET['town']:''; $town = $_GET['town']?$_GET['town']:'';
if ($conf->global->MAIN_USE_ZIPTOWN_DICTIONNARY) // Use zip-town table if (! empty($conf->global->MAIN_USE_ZIPTOWN_DICTIONNARY)) // Use zip-town table
{ {
$sql = "SELECT z.rowid, z.zip, z.town, z.fk_county, z.fk_pays as fk_country"; $sql = "SELECT z.rowid, z.zip, z.town, z.fk_county, z.fk_pays as fk_country";
$sql.= ", p.rowid as fk_country, p.code as country_code, p.libelle as country"; $sql.= ", p.rowid as fk_country, p.code as country_code, p.libelle as country";

View File

@ -77,7 +77,7 @@ class box_activity extends ModeleBoxes
$this->info_box_head = array('text' => $textHead, 'limit'=> dol_strlen($textHead)); $this->info_box_head = array('text' => $textHead, 'limit'=> dol_strlen($textHead));
// list the summary of the bills // 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 = "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"; $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 // 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 = "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"; $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 // 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 = "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"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."propal as p";

Some files were not shown because too many files have changed in this diff Show More