diff --git a/htdocs/adherents/admin/adherent.php b/htdocs/adherents/admin/adherent.php index 8d0cd566a7f..4b9f5e672e8 100644 --- a/htdocs/adherents/admin/adherent.php +++ b/htdocs/adherents/admin/adherent.php @@ -178,7 +178,7 @@ print ''; print ''; print ''; print ''.$langs->trans("AddSubscriptionIntoAccount").''; -if ($conf->banque->enabled) +if (! empty($conf->banque->enabled)) { print ''; print $form->selectyesno('constvalue',$conf->global->ADHERENT_BANK_USE,1); diff --git a/htdocs/adherents/admin/mailman.php b/htdocs/adherents/admin/mailman.php index 05dba9a696c..b3169c721f2 100644 --- a/htdocs/adherents/admin/mailman.php +++ b/htdocs/adherents/admin/mailman.php @@ -163,7 +163,7 @@ dol_htmloutput_mesg($mesg); * Mailman */ $var=!$var; -if ($conf->global->ADHERENT_USE_MAILMAN) +if (! empty($conf->global->ADHERENT_USE_MAILMAN)) { //$lien=img_picto($langs->trans("Active"),'tick').' '; $lien=''; @@ -214,7 +214,7 @@ else dol_fiche_end(); -if ($conf->global->ADHERENT_USE_MAILMAN) +if (! empty($conf->global->ADHERENT_USE_MAILMAN)) { print '
'; print ''; diff --git a/htdocs/adherents/admin/public.php b/htdocs/adherents/admin/public.php index 37ae2d63c25..9dfac613f2a 100755 --- a/htdocs/adherents/admin/public.php +++ b/htdocs/adherents/admin/public.php @@ -167,8 +167,8 @@ if (! empty($conf->paybox->enabled) || ! empty($conf->paypal->enabled)) print $langs->trans("MEMBER_NEWFORM_PAYONLINE"); print ''; $listofval=array(); - if ($conf->paybox->enabled) $listofval['paybox']='Paybox'; - if ($conf->paypal->enabled) $listofval['paypal']='PayPal'; + if (! empty($conf->paybox->enabled)) $listofval['paybox']='Paybox'; + if (! empty($conf->paypal->enabled)) $listofval['paypal']='PayPal'; print $form->selectarray("MEMBER_NEWFORM_PAYONLINE",$listofval,(! empty($conf->global->MEMBER_NEWFORM_PAYONLINE)?$conf->global->MEMBER_NEWFORM_PAYONLINE:''),1); print "\n"; } diff --git a/htdocs/adherents/admin/spip.php b/htdocs/adherents/admin/spip.php index c099d0a93a3..29ae8e9e894 100644 --- a/htdocs/adherents/admin/spip.php +++ b/htdocs/adherents/admin/spip.php @@ -123,7 +123,7 @@ dol_htmloutput_mesg($mesg); * Spip */ $var=!$var; -if ($conf->global->ADHERENT_USE_SPIP) +if (! empty($conf->global->ADHERENT_USE_SPIP)) { //$lien=img_picto($langs->trans("Active"),'tick').' '; $lien=''; diff --git a/htdocs/adherents/agenda.php b/htdocs/adherents/agenda.php index db8a055e32f..487c7636445 100644 --- a/htdocs/adherents/agenda.php +++ b/htdocs/adherents/agenda.php @@ -79,7 +79,7 @@ if ($id) llxHeader("",$langs->trans("Agenda"),''); - if ($conf->notification->enabled) $langs->load("mails"); + if (! empty($conf->notification->enabled)) $langs->load("mails"); $head = member_prepare_head($object); dol_fiche_head($head, 'agenda', $langs->trans("Member"),0,'user'); @@ -142,7 +142,7 @@ if ($id) print '
'; - if ($conf->agenda->enabled) + if (! empty($conf->agenda->enabled)) { print ''.$langs->trans("AddAction").''; } diff --git a/htdocs/adherents/card_subscriptions.php b/htdocs/adherents/card_subscriptions.php index 61ef0da1314..400e386ef8e 100644 --- a/htdocs/adherents/card_subscriptions.php +++ b/htdocs/adherents/card_subscriptions.php @@ -246,7 +246,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'cotisation' && ! $ } else { - if ($conf->banque->enabled && $_POST["paymentsave"] != 'none') + if (! empty($conf->banque->enabled) && $_POST["paymentsave"] != 'none') { if ($_POST["cotisation"]) { @@ -479,7 +479,7 @@ if ($rowid) $rowspan=9; if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) $rowspan+=1; - if ($conf->societe->enabled) $rowspan++; + if (! empty($conf->societe->enabled)) $rowspan++; print ''; print ''; @@ -545,7 +545,7 @@ if ($rowid) print ''; // Third party Dolibarr - if ($conf->societe->enabled) + if (! empty($conf->societe->enabled)) { print ''; print ''; print ''; print ''; - if ($conf->banque->enabled) + if (! empty($conf->banque->enabled)) { print ''; } @@ -693,7 +693,7 @@ if ($rowid) print '\n"; print '\n"; print ''; - if ($conf->banque->enabled) + if (! empty($conf->banque->enabled)) { print ''; // Complementary action - if ($conf->banque->enabled || $conf->facture->enabled) + if (! empty($conf->banque->enabled) || ! empty($conf->facture->enabled)) { $company=new Societe($db); if ($object->fk_soc) @@ -889,12 +889,12 @@ if ($rowid) print ''; print ''; // Banque - if ($conf->banque->enabled) + if (! empty($conf->banque->enabled)) { if ($objp->fk_account) { @@ -193,7 +193,7 @@ if ($result) print ''; print ""; - if ($allowinsertbankafter && ! $objp->fk_account && $conf->banque->enabled && $objp->cotisation) + if ($allowinsertbankafter && ! $objp->fk_account && ! empty($conf->banque->enabled) && $objp->cotisation) { print "\n"; } @@ -207,7 +207,7 @@ if ($result) print "\n"; print "\n"; print "\n"; - if ($conf->banque->enabled) + if (! empty($conf->banque->enabled)) { print ''; } diff --git a/htdocs/adherents/fiche.php b/htdocs/adherents/fiche.php index 5647ae16839..7ca413a0c4a 100644 --- a/htdocs/adherents/fiche.php +++ b/htdocs/adherents/fiche.php @@ -54,7 +54,7 @@ $socid=GETPOST('socid','int'); // Security check $result=restrictedArea($user,'adherent',$rowid); -if ($conf->mailmanspip->enabled) +if (! empty($conf->mailmanspip->enabled)) { include_once DOL_DOCUMENT_ROOT.'/mailmanspip/class/mailmanspip.class.php'; @@ -212,7 +212,7 @@ if ($action == 'confirm_sendinfo' && $confirm == 'yes') if ($object->email) { $from=$conf->email_from; - if ($conf->global->ADHERENT_MAIL_FROM) $from=$conf->global->ADHERENT_MAIL_FROM; + if (! empty($conf->global->ADHERENT_MAIL_FROM)) $from=$conf->global->ADHERENT_MAIL_FROM; $result=$object->send_an_email($langs->transnoentitiesnoconv("ThisIsContentOfYourCard")."\n\n%INFOS%\n\n",$langs->transnoentitiesnoconv("CardContent")); @@ -844,7 +844,7 @@ if ($action == 'create') /* // Third party Dolibarr - if ($conf->societe->enabled) + if (! empty($conf->societe->enabled)) { print ''; @@ -441,7 +441,7 @@ if ($conf->propal->enabled) /* * Proposal that are in a shipping process */ -/*if ($conf->propal->enabled) +/*if (! empty($conf->propal->enabled)) { $sql = "SELECT c.rowid, c.ref, c.fk_statut, c.facture, s.nom, s.rowid as socid"; $sql.= " FROM ".MAIN_DB_PREFIX."commande as c"; @@ -490,7 +490,7 @@ if ($conf->propal->enabled) $filename=dol_sanitizeFileName($obj->ref); $filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref); $urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid; - $formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','',1,'',1); + print $formfile->getDocumentsLink($propalstatic->element, $filename, $filedir); print '
'; @@ -675,7 +675,7 @@ if ($rowid) print ''.$langs->trans("DateSubscription").''.$langs->trans("DateEnd").''.$langs->trans("Amount").''.$langs->trans("Account").''.dol_print_date($db->jdate($objp->dateadh),'day')."'.dol_print_date($db->jdate($objp->datef),'day')."'.price($objp->cotisation).''; if ($objp->bid) @@ -720,7 +720,7 @@ if ($rowid) // Link for paypal payment - if ($conf->paypal->enabled) + if (! empty($conf->paypal->enabled)) { include_once DOL_DOCUMENT_ROOT.'/paypal/lib/paypal.lib.php'; print showPaypalPaymentUrl('membersubscription',$object->ref); @@ -740,8 +740,8 @@ if ($rowid) $bankdirect=0; // Option to write to bank is on by default $bankviainvoice=0; // Option to write via invoice is on by default $invoiceonly=0; - if ($conf->banque->enabled && $conf->global->ADHERENT_BANK_USE && (empty($_POST['paymentsave']) || $_POST["paymentsave"] == 'bankdirect')) $bankdirect=1; - if ($conf->banque->enabled && $conf->societe->enabled && $conf->facture->enabled && $object->fk_soc) $bankviainvoice=1; + if (! empty($conf->banque->enabled) && $conf->global->ADHERENT_BANK_USE && (empty($_POST['paymentsave']) || $_POST["paymentsave"] == 'bankdirect')) $bankdirect=1; + if (! empty($conf->banque->enabled) && ! empty($conf->societe->enabled) && ! empty($conf->facture->enabled) && $object->fk_soc) $bankviainvoice=1; print "\n\n\n"; @@ -873,7 +873,7 @@ if ($rowid) print dol_print_date(($datefrom?$datefrom:time()),"%Y").'" >
'; print ' '.$langs->trans("None").'
'; - if ($conf->banque->enabled) + if (! empty($conf->banque->enabled)) { print ' '.$langs->trans("MoreActionBankDirect").'
'; } - if ($conf->societe->enabled && $conf->facture->enabled) + if (! empty($conf->societe->enabled) && ! empty($conf->facture->enabled)) { print 'fk_soc) || empty($bankviainvoice)) print ' disabled="disabled"'; @@ -909,7 +909,7 @@ if ($rowid) } print '
'; } - if ($conf->banque->enabled && $conf->societe->enabled && $conf->facture->enabled) + if (! empty($conf->banque->enabled) && ! empty($conf->societe->enabled) && ! empty($conf->facture->enabled)) { print 'fk_soc) || empty($bankviainvoice)) print ' disabled="disabled"'; diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 3c0290b4eeb..c9f4a3de738 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -160,7 +160,7 @@ class Adherent extends CommonObject // Envoi mail confirmation $from=$conf->email_from; - if ($conf->global->ADHERENT_MAIL_FROM) $from=$conf->global->ADHERENT_MAIL_FROM; + if (! empty($conf->global->ADHERENT_MAIL_FROM)) $from=$conf->global->ADHERENT_MAIL_FROM; include_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; $mailfile = new CMailFile($subjecttosend, $this->email, $from, $texttosend, $filename_list, $mimetype_list, $mimefilename_list, $addr_cc, $addr_bcc, $deliveryreceipt, $msgishtml); @@ -1382,7 +1382,7 @@ class Adherent extends CommonObject } // spip - if ($conf->global->ADHERENT_USE_SPIP && $conf->mailmanspip->enabled) + if ($conf->global->ADHERENT_USE_SPIP && ! empty($conf->mailmanspip->enabled)) { $result=$mailmanspip->add_to_spip($this); if ($result < 0) @@ -1427,7 +1427,7 @@ class Adherent extends CommonObject } } - if ($conf->global->ADHERENT_USE_SPIP && $conf->mailmanspip->enabled) + if ($conf->global->ADHERENT_USE_SPIP && ! empty($conf->mailmanspip->enabled)) { $result=$mailmanspip->del_to_spip($this); if ($result < 0) @@ -1787,31 +1787,31 @@ class Adherent extends CommonObject $this->fullname=$this->getFullName($langs); // Member - if ($this->fullname && $conf->global->LDAP_MEMBER_FIELD_FULLNAME) $info[$conf->global->LDAP_MEMBER_FIELD_FULLNAME] = $this->fullname; - if ($this->nom && $conf->global->LDAP_MEMBER_FIELD_NAME) $info[$conf->global->LDAP_MEMBER_FIELD_NAME] = $this->nom; - if ($this->prenom && $conf->global->LDAP_MEMBER_FIELD_FIRSTNAME) $info[$conf->global->LDAP_MEMBER_FIELD_FIRSTNAME] = $this->prenom; - if ($this->login && $conf->global->LDAP_MEMBER_FIELD_LOGIN) $info[$conf->global->LDAP_MEMBER_FIELD_LOGIN] = $this->login; - if ($this->pass && $conf->global->LDAP_MEMBER_FIELD_PASSWORD) $info[$conf->global->LDAP_MEMBER_FIELD_PASSWORD] = $this->pass; // this->pass = mot de passe non crypte - if ($this->poste && $conf->global->LDAP_MEMBER_FIELD_TITLE) $info[$conf->global->LDAP_MEMBER_FIELD_TITLE] = $this->poste; - if ($this->adresse && $conf->global->LDAP_MEMBER_FIELD_ADDRESS) $info[$conf->global->LDAP_MEMBER_FIELD_ADDRESS] = $this->adresse; - if ($this->cp && $conf->global->LDAP_MEMBER_FIELD_ZIP) $info[$conf->global->LDAP_MEMBER_FIELD_ZIP] = $this->cp; - if ($this->ville && $conf->global->LDAP_MEMBER_FIELD_TOWN) $info[$conf->global->LDAP_MEMBER_FIELD_TOWN] = $this->ville; - if ($this->country_code && $conf->global->LDAP_MEMBER_FIELD_COUNTRY) $info[$conf->global->LDAP_MEMBER_FIELD_COUNTRY] = $this->country_code; - if ($this->email && $conf->global->LDAP_MEMBER_FIELD_MAIL) $info[$conf->global->LDAP_MEMBER_FIELD_MAIL] = $this->email; - if ($this->phone && $conf->global->LDAP_MEMBER_FIELD_PHONE) $info[$conf->global->LDAP_MEMBER_FIELD_PHONE] = $this->phone; - if ($this->phone_perso && $conf->global->LDAP_MEMBER_FIELD_PHONE_PERSO) $info[$conf->global->LDAP_MEMBER_FIELD_PHONE_PERSO] = $this->phone_perso; - if ($this->phone_mobile && $conf->global->LDAP_MEMBER_FIELD_MOBILE) $info[$conf->global->LDAP_MEMBER_FIELD_MOBILE] = $this->phone_mobile; - if ($this->fax && $conf->global->LDAP_MEMBER_FIELD_FAX) $info[$conf->global->LDAP_MEMBER_FIELD_FAX] = $this->fax; - if ($this->note && $conf->global->LDAP_MEMBER_FIELD_DESCRIPTION) $info[$conf->global->LDAP_MEMBER_FIELD_DESCRIPTION] = $this->note; - if ($this->naiss && $conf->global->LDAP_MEMBER_FIELD_BIRTHDATE) $info[$conf->global->LDAP_MEMBER_FIELD_BIRTHDATE] = dol_print_date($this->naiss,'dayhourldap'); - if (isset($this->statut) && $conf->global->LDAP_FIELD_MEMBER_STATUS) $info[$conf->global->LDAP_FIELD_MEMBER_STATUS] = $this->statut; - if ($this->datefin && $conf->global->LDAP_FIELD_MEMBER_END_LASTSUBSCRIPTION) $info[$conf->global->LDAP_FIELD_MEMBER_END_LASTSUBSCRIPTION] = dol_print_date($this->datefin,'dayhourldap'); + if ($this->fullname && ! empty($conf->global->LDAP_MEMBER_FIELD_FULLNAME)) $info[$conf->global->LDAP_MEMBER_FIELD_FULLNAME] = $this->fullname; + if ($this->nom && ! empty($conf->global->LDAP_MEMBER_FIELD_NAME)) $info[$conf->global->LDAP_MEMBER_FIELD_NAME] = $this->nom; + if ($this->prenom && ! empty($conf->global->LDAP_MEMBER_FIELD_FIRSTNAME)) $info[$conf->global->LDAP_MEMBER_FIELD_FIRSTNAME] = $this->prenom; + if ($this->login && ! empty($conf->global->LDAP_MEMBER_FIELD_LOGIN)) $info[$conf->global->LDAP_MEMBER_FIELD_LOGIN] = $this->login; + if ($this->pass && ! empty($conf->global->LDAP_MEMBER_FIELD_PASSWORD)) $info[$conf->global->LDAP_MEMBER_FIELD_PASSWORD] = $this->pass; // this->pass = mot de passe non crypte + if ($this->poste && ! empty($conf->global->LDAP_MEMBER_FIELD_TITLE)) $info[$conf->global->LDAP_MEMBER_FIELD_TITLE] = $this->poste; + if ($this->adresse && ! empty($conf->global->LDAP_MEMBER_FIELD_ADDRESS)) $info[$conf->global->LDAP_MEMBER_FIELD_ADDRESS] = $this->adresse; + if ($this->cp && ! empty($conf->global->LDAP_MEMBER_FIELD_ZIP)) $info[$conf->global->LDAP_MEMBER_FIELD_ZIP] = $this->cp; + if ($this->ville && ! empty($conf->global->LDAP_MEMBER_FIELD_TOWN)) $info[$conf->global->LDAP_MEMBER_FIELD_TOWN] = $this->ville; + if ($this->country_code && ! empty($conf->global->LDAP_MEMBER_FIELD_COUNTRY)) $info[$conf->global->LDAP_MEMBER_FIELD_COUNTRY] = $this->country_code; + if ($this->email && ! empty($conf->global->LDAP_MEMBER_FIELD_MAIL)) $info[$conf->global->LDAP_MEMBER_FIELD_MAIL] = $this->email; + if ($this->phone && ! empty($conf->global->LDAP_MEMBER_FIELD_PHONE)) $info[$conf->global->LDAP_MEMBER_FIELD_PHONE] = $this->phone; + if ($this->phone_perso && ! empty($conf->global->LDAP_MEMBER_FIELD_PHONE_PERSO)) $info[$conf->global->LDAP_MEMBER_FIELD_PHONE_PERSO] = $this->phone_perso; + if ($this->phone_mobile && ! empty($conf->global->LDAP_MEMBER_FIELD_MOBILE)) $info[$conf->global->LDAP_MEMBER_FIELD_MOBILE] = $this->phone_mobile; + if ($this->fax && ! empty($conf->global->LDAP_MEMBER_FIELD_FAX)) $info[$conf->global->LDAP_MEMBER_FIELD_FAX] = $this->fax; + if ($this->note && ! empty($conf->global->LDAP_MEMBER_FIELD_DESCRIPTION)) $info[$conf->global->LDAP_MEMBER_FIELD_DESCRIPTION] = $this->note; + if ($this->naiss && ! empty($conf->global->LDAP_MEMBER_FIELD_BIRTHDATE)) $info[$conf->global->LDAP_MEMBER_FIELD_BIRTHDATE] = dol_print_date($this->naiss,'dayhourldap'); + if (isset($this->statut) && ! empty($conf->global->LDAP_FIELD_MEMBER_STATUS)) $info[$conf->global->LDAP_FIELD_MEMBER_STATUS] = $this->statut; + if ($this->datefin && ! empty($conf->global->LDAP_FIELD_MEMBER_END_LASTSUBSCRIPTION)) $info[$conf->global->LDAP_FIELD_MEMBER_END_LASTSUBSCRIPTION] = dol_print_date($this->datefin,'dayhourldap'); // Subscriptions - if ($this->first_subscription_date && $conf->global->LDAP_FIELD_MEMBER_FIRSTSUBSCRIPTION_DATE) $info[$conf->global->LDAP_FIELD_MEMBER_FIRSTSUBSCRIPTION_DATE] = dol_print_date($this->first_subscription_date,'dayhourldap'); - if (isset($this->first_subscription_amount) && $conf->global->LDAP_FIELD_MEMBER_FIRSTSUBSCRIPTION_AMOUNT) $info[$conf->global->LDAP_FIELD_MEMBER_FIRSTSUBSCRIPTION_AMOUNT] = $this->first_subscription_amount; - if ($this->last_subscription_date && $conf->global->LDAP_FIELD_MEMBER_LASTSUBSCRIPTION_DATE) $info[$conf->global->LDAP_FIELD_MEMBER_LASTSUBSCRIPTION_DATE] = dol_print_date($this->last_subscription_date,'dayhourldap'); - if (isset($this->last_subscription_amount) && $conf->global->LDAP_FIELD_MEMBER_LASTSUBSCRIPTION_AMOUNT) $info[$conf->global->LDAP_FIELD_MEMBER_LASTSUBSCRIPTION_AMOUNT] = $this->last_subscription_amount; + if ($this->first_subscription_date && ! empty($conf->global->LDAP_FIELD_MEMBER_FIRSTSUBSCRIPTION_DATE)) $info[$conf->global->LDAP_FIELD_MEMBER_FIRSTSUBSCRIPTION_DATE] = dol_print_date($this->first_subscription_date,'dayhourldap'); + if (isset($this->first_subscription_amount) && ! empty($conf->global->LDAP_FIELD_MEMBER_FIRSTSUBSCRIPTION_AMOUNT)) $info[$conf->global->LDAP_FIELD_MEMBER_FIRSTSUBSCRIPTION_AMOUNT] = $this->first_subscription_amount; + if ($this->last_subscription_date && ! empty($conf->global->LDAP_FIELD_MEMBER_LASTSUBSCRIPTION_DATE)) $info[$conf->global->LDAP_FIELD_MEMBER_LASTSUBSCRIPTION_DATE] = dol_print_date($this->last_subscription_date,'dayhourldap'); + if (isset($this->last_subscription_amount) && ! empty($conf->global->LDAP_FIELD_MEMBER_LASTSUBSCRIPTION_AMOUNT)) $info[$conf->global->LDAP_FIELD_MEMBER_LASTSUBSCRIPTION_AMOUNT] = $this->last_subscription_amount; return $info; } diff --git a/htdocs/adherents/cotisations.php b/htdocs/adherents/cotisations.php index b0a75427697..1b4fabaf47e 100644 --- a/htdocs/adherents/cotisations.php +++ b/htdocs/adherents/cotisations.php @@ -99,7 +99,7 @@ if ($result) print_liste_field_titre($langs->trans("Name"),"cotisations.php","d.nom",$param,"","",$sortfield,$sortorder); print_liste_field_titre($langs->trans("Login"),"cotisations.php","d.login",$param,"","",$sortfield,$sortorder); print_liste_field_titre($langs->trans("Label"),"cotisations.php","c.note",$param,"",'align="left"',$sortfield,$sortorder); - if ($conf->banque->enabled) + if (! empty($conf->banque->enabled)) { print_liste_field_titre($langs->trans("Account"),"cotisations.php","b.fk_account",$pram,"","",$sortfield,$sortorder); } @@ -131,7 +131,7 @@ if ($result) $var=!$var; - if ($allowinsertbankafter && ! $objp->fk_account && $conf->banque->enabled && $objp->cotisation) + if ($allowinsertbankafter && ! $objp->fk_account && ! empty($conf->banque->enabled) && $objp->cotisation) { print ""; print ''; @@ -153,7 +153,7 @@ if ($result) print '
'.price($objp->cotisation).'
    
'.$langs->trans("LinkedToDolibarrThirdParty").''; print $form->select_company($object->fk_soc,'socid','',1); @@ -924,7 +924,7 @@ if ($action == 'edit') $rowspan=15; if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) $rowspan++; - if ($conf->societe->enabled) $rowspan++; + if (! empty($conf->societe->enabled)) $rowspan++; print '
'; print ''; @@ -1064,7 +1064,7 @@ if ($action == 'edit') } // Third party Dolibarr - if ($conf->societe->enabled) + if (! empty($conf->societe->enabled)) { print '
'.$langs->trans("LinkedToDolibarrThirdParty").''; if ($object->fk_soc) @@ -1148,7 +1148,7 @@ if ($rowid && $action != 'edit') array('label' => $langs->trans("LoginToCreate"), 'type' => 'text', 'name' => 'login', 'value' => $login) ); $text=$langs->trans("ConfirmCreateLogin").'
'; - if ($conf->societe->enabled) + if (! empty($conf->societe->enabled)) { if ($object->fk_soc > 0) $text.=$langs->trans("UserWillBeExternalUser"); else $text.=$langs->trans("UserWillBeInternalUser"); @@ -1204,8 +1204,8 @@ if ($rowid && $action != 'edit') // Cree un tableau formulaire $formquestion=array(); if ($object->email) $formquestion[]=array('type' => 'checkbox', 'name' => 'send_mail', 'label' => $label, 'value' => ($conf->global->ADHERENT_DEFAULT_SENDINFOBYMAIL?true:false)); - if ($conf->global->ADHERENT_USE_MAILMAN) { $formquestion[]=array('type'=>'other','label'=>$langs->transnoentitiesnoconv("SynchroMailManEnabled"),'value'=>''); } - if ($conf->global->ADHERENT_USE_SPIP) { $formquestion[]=array('type'=>'other','label'=>$langs->transnoentitiesnoconv("SynchroSpipEnabled"),'value'=>''); } + if (! empty($conf->global->ADHERENT_USE_MAILMAN)) { $formquestion[]=array('type'=>'other','label'=>$langs->transnoentitiesnoconv("SynchroMailManEnabled"),'value'=>''); } + if (! empty($conf->global->ADHERENT_USE_SPIP)) { $formquestion[]=array('type'=>'other','label'=>$langs->transnoentitiesnoconv("SynchroSpipEnabled"),'value'=>''); } print $form->formconfirm("fiche.php?rowid=".$rowid,$langs->trans("ValidateMember"),$langs->trans("ConfirmValidateMember"),"confirm_valid",$formquestion,1); } @@ -1276,7 +1276,7 @@ if ($rowid && $action != 'edit') $rowspan=17; if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) $rowspan++; - if ($conf->societe->enabled) $rowspan++; + if (! empty($conf->societe->enabled)) $rowspan++; print ''; @@ -1382,7 +1382,7 @@ if ($rowid && $action != 'edit') } // Third party Dolibarr - if ($conf->societe->enabled) + if (! empty($conf->societe->enabled)) { print '"; @@ -369,7 +369,7 @@ if (! empty($conf->propal->enabled) && $user->rights->propale->lire) * Proposals to process */ /* -if ($conf->propal->enabled) +if (! empty($conf->propal->enabled)) { $sql = "SELECT c.rowid, c.ref, c.fk_statut, s.nom, s.rowid as socid"; $sql.=" FROM ".MAIN_DB_PREFIX."propal as c"; @@ -418,7 +418,7 @@ if ($conf->propal->enabled) $filename=dol_sanitizeFileName($obj->ref); $filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref); $urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid; - $formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','',1,'',1); + print $formfile->getDocumentsLink($propalstatic->element, $filename, $filedir); print '
'; print ''; // Bank line - if ($conf->banque->enabled) + if (! empty($conf->banque->enabled)) { if ($conf->global->ADHERENT_BANK_USE || $subscription->fk_bank) { @@ -290,7 +290,7 @@ if ($rowid && $action != 'edit') //$formquestion=array(); //$formquestion['text']=''.$langs->trans("ThisWillAlsoDeleteBankRecord").''; $text=$langs->trans("ConfirmDeleteSubscription"); - if ($conf->banque->enabled && $conf->global->ADHERENT_BANK_USE) $text.='
'.img_warning().' '.$langs->trans("ThisWillAlsoDeleteBankRecord"); + if (! empty($conf->banque->enabled) && ! empty($conf->global->ADHERENT_BANK_USE)) $text.='
'.img_warning().' '.$langs->trans("ThisWillAlsoDeleteBankRecord"); $ret=$form->form_confirm($_SERVER["PHP_SELF"]."?rowid=".$subscription->id,$langs->trans("DeleteSubscription"),$text,"confirm_delete",$formquestion,0,1); if ($ret == 'html') print '
'; } @@ -335,7 +335,7 @@ if ($rowid && $action != 'edit') print ''; // Bank line - if ($conf->banque->enabled) + if (! empty($conf->banque->enabled)) { if ($conf->global->ADHERENT_BANK_USE || $subscription->fk_bank) { diff --git a/htdocs/adherents/ldap.php b/htdocs/adherents/ldap.php index a97c729a908..5cc02159675 100644 --- a/htdocs/adherents/ldap.php +++ b/htdocs/adherents/ldap.php @@ -120,7 +120,7 @@ print ''; print ''; // Password not crypted -if ($conf->global->LDAP_MEMBER_FIELD_PASSWORD) +if (! empty($conf->global->LDAP_MEMBER_FIELD_PASSWORD)) { print ''; print ''; @@ -128,7 +128,7 @@ if ($conf->global->LDAP_MEMBER_FIELD_PASSWORD) } // Password crypted -if ($conf->global->LDAP_MEMBER_FIELD_PASSWORD_CRYPTED) +if (! empty($conf->global->LDAP_MEMBER_FIELD_PASSWORD_CRYPTED)) { print ''; print ''; diff --git a/htdocs/adherents/liste.php b/htdocs/adherents/liste.php index 93549d1c516..ca87562153a 100644 --- a/htdocs/adherents/liste.php +++ b/htdocs/adherents/liste.php @@ -198,7 +198,7 @@ if ($resql) // Filter on categories $moreforfilter=''; - if ($conf->categorie->enabled) + if (! empty($conf->categorie->enabled)) { $moreforfilter.=$langs->trans('Categories'). ': '; $moreforfilter.=$formother->select_categories(3,$search_categ,'search_categ',1); diff --git a/htdocs/admin/barcode.php b/htdocs/admin/barcode.php index 91c376a32f6..2bd8736dfda 100644 --- a/htdocs/admin/barcode.php +++ b/htdocs/admin/barcode.php @@ -290,7 +290,7 @@ if (! isset($_SERVER['WINDIR'])) } // Module produits -if ($conf->societe->enabled) +if (! empty($conf->societe->enabled)) { $var=!$var; print ""; @@ -308,7 +308,7 @@ if ($conf->societe->enabled) } // Module produits -if ($conf->product->enabled) +if (! empty($conf->product->enabled)) { $var=!$var; print ""; diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php index 18d7aafe3f5..b1838928511 100644 --- a/htdocs/admin/company.php +++ b/htdocs/admin/company.php @@ -661,7 +661,7 @@ else $var=!$var; print ''; diff --git a/htdocs/admin/compta.php b/htdocs/admin/compta.php index 86d87117ac1..6f45e70bc98 100644 --- a/htdocs/admin/compta.php +++ b/htdocs/admin/compta.php @@ -113,7 +113,7 @@ print "\n"; print ''; print ''; print ""; print "'; // Synchro contact active -if ($conf->societe->enabled) +if (! empty($conf->societe->enabled)) { $var=!$var; print ''; // Port $var=!$var; print ''; // Pass $var=!$var; print '"; print ''; print '"; } -if($conf->global->DATABASE_PWD_ENCRYPTED) +if (! empty($conf->global->DATABASE_PWD_ENCRYPTED)) { print '\n"; print ''."\n"; $var=true; -if ($conf->facture->enabled) +if (! empty($conf->facture->enabled)) { $var=!$var; print ""; @@ -147,7 +147,7 @@ if ($conf->facture->enabled) print "\n\n\n"; } -if ($conf->commande->enabled) +if (! empty($conf->commande->enabled)) { $var=!$var; print ""; @@ -161,7 +161,7 @@ if ($conf->commande->enabled) print "\n\n\n"; } -if ($conf->expedition->enabled) +if (! empty($conf->expedition->enabled)) { $var=!$var; print ""; @@ -183,7 +183,7 @@ print " \n"; print ''."\n"; $var=true; -if ($conf->fournisseur->enabled) +if (! empty($conf->fournisseur->enabled)) { $var=!$var; print ""; @@ -197,7 +197,7 @@ if ($conf->fournisseur->enabled) print "\n\n\n"; } -if ($conf->fournisseur->enabled) +if (! empty($conf->fournisseur->enabled)) { $var=!$var; print ""; @@ -210,7 +210,7 @@ if ($conf->fournisseur->enabled) print ''; print "\n\n\n"; } -if ($conf->fournisseur->enabled) +if (! empty($conf->fournisseur->enabled)) { $var=!$var; print ""; diff --git a/htdocs/admin/tools/purge.php b/htdocs/admin/tools/purge.php index b835b4a5953..46eebf3f299 100644 --- a/htdocs/admin/tools/purge.php +++ b/htdocs/admin/tools/purge.php @@ -36,7 +36,7 @@ $choice=GETPOST('choice'); // Define filelog to discard it from purge $filelog=''; -if ($conf->syslog->enabled) +if (! empty($conf->syslog->enabled)) { $filelog=SYSLOG_FILE; $filelog=preg_replace('/DOL_DATA_ROOT/i',DOL_DATA_ROOT,$filelog); @@ -131,7 +131,7 @@ print '
'; @@ -1532,7 +1532,7 @@ if ($rowid && $action != 'edit') } // Create third party - if ($conf->societe->enabled && ! $object->fk_soc) + if (! empty($conf->societe->enabled) && ! $object->fk_soc) { if ($user->rights->societe->creer) { @@ -1570,7 +1570,7 @@ if ($rowid && $action != 'edit') } // Action SPIP - if ($conf->mailmanspip->enabled && $conf->global->ADHERENT_USE_SPIP) + if (! empty($conf->mailmanspip->enabled) && ! empty($conf->global->ADHERENT_USE_SPIP)) { $isinspip = $mailmanspip->is_in_spip($object); diff --git a/htdocs/adherents/fiche_subscription.php b/htdocs/adherents/fiche_subscription.php index 02c9539d262..8d8fb1aab13 100644 --- a/htdocs/adherents/fiche_subscription.php +++ b/htdocs/adherents/fiche_subscription.php @@ -66,7 +66,7 @@ if ($user->rights->adherent->cotisation->creer && $_REQUEST["action"] == 'update // If transaction consolidated if ($accountline->rappro) { - $errmsg=$langs->trans("SubscriptionLinkedToConciliatedTrnasaction"); + $errmsg=$langs->trans("SubscriptionLinkedToConciliatedTransaction"); } else { @@ -220,7 +220,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'edit') print '
'.$langs->trans("Label").''.$subscription->note.'
'.$langs->trans("Login").''.$adh->login.' 
'.$langs->trans("LDAPFieldPasswordNotCrypted").''.$adh->pass.'
'.$langs->trans("LDAPFieldPasswordCrypted").''.$adh->pass_crypted.'
'.$langs->trans("State").''; - if ($conf->global->MAIN_INFO_SOCIETE_DEPARTEMENT) print getState($conf->global->MAIN_INFO_SOCIETE_DEPARTEMENT); + if (! empty($conf->global->MAIN_INFO_SOCIETE_DEPARTEMENT)) print getState($conf->global->MAIN_INFO_SOCIETE_DEPARTEMENT); else print ' '; print '
'.$langs->trans('OptionModeTrue').''.nl2br($langs->trans('OptionModeTrueDesc')); // Write info on way to count VAT -if ($conf->global->MAIN_MODULE_COMPTABILITE) +if (! empty($conf->global->MAIN_MODULE_COMPTABILITE)) { // print "
\n"; // print nl2br($langs->trans('OptionModeTrueInfoModuleComptabilite')); diff --git a/htdocs/admin/confexped.php b/htdocs/admin/confexped.php index d6859188a25..ddbbb7ece69 100644 --- a/htdocs/admin/confexped.php +++ b/htdocs/admin/confexped.php @@ -84,14 +84,14 @@ $head[$h][1] = $langs->trans("Setup"); $hselected=$h; $h++; -if ($conf->global->MAIN_SUBMODULE_EXPEDITION) +if (! empty($conf->global->MAIN_SUBMODULE_EXPEDITION)) { $head[$h][0] = DOL_URL_ROOT."/admin/expedition.php"; $head[$h][1] = $langs->trans("Sending"); $h++; } -if ($conf->global->MAIN_SUBMODULE_LIVRAISON) +if (! empty($conf->global->MAIN_SUBMODULE_LIVRAISON)) { $head[$h][0] = DOL_URL_ROOT."/admin/livraison.php"; $head[$h][1] = $langs->trans("Receivings"); diff --git a/htdocs/admin/expedition.php b/htdocs/admin/expedition.php index 43814ccb377..d83a089c20c 100644 --- a/htdocs/admin/expedition.php +++ b/htdocs/admin/expedition.php @@ -206,7 +206,7 @@ $head[$h][1] = $langs->trans("Sending"); $hselected=$h; $h++; -if ($conf->global->MAIN_SUBMODULE_LIVRAISON) +if (! empty($conf->global->MAIN_SUBMODULE_LIVRAISON)) { $head[$h][0] = DOL_URL_ROOT."/admin/livraison.php"; $head[$h][1] = $langs->trans("Receivings"); diff --git a/htdocs/admin/facture.php b/htdocs/admin/facture.php index 3dbcbda8133..402bc7501cb 100644 --- a/htdocs/admin/facture.php +++ b/htdocs/admin/facture.php @@ -628,7 +628,7 @@ $var=!$var; print '
".$langs->trans("SuggestPaymentByRIBOnAccount").""; -if ($conf->banque->enabled) +if (! empty($conf->banque->enabled)) { $sql = "SELECT rowid, label"; $sql.= " FROM ".MAIN_DB_PREFIX."bank_account"; diff --git a/htdocs/admin/fckeditor.php b/htdocs/admin/fckeditor.php index d1a4ff48f67..17d4ddca75f 100644 --- a/htdocs/admin/fckeditor.php +++ b/htdocs/admin/fckeditor.php @@ -69,7 +69,7 @@ foreach($modules as $const => $desc) { dolibarr_set_const($db, "FCKEDITOR_ENABLE_".$const, "1",'chaine',0,'',$conf->entity); // Si fckeditor est active dans la description produit/service, on l'active dans les formulaires - if ($const == 'PRODUCTDESC' && $conf->global->PRODUIT_DESC_IN_FORM) + if ($const == 'PRODUCTDESC' && ! empty($conf->global->PRODUIT_DESC_IN_FORM)) { dolibarr_set_const($db, "FCKEDITOR_ENABLE_DETAILS", "1",'chaine',0,'',$conf->entity); } diff --git a/htdocs/admin/ldap.php b/htdocs/admin/ldap.php index ba4b76a7e2a..6cc42777343 100644 --- a/htdocs/admin/ldap.php +++ b/htdocs/admin/ldap.php @@ -124,7 +124,7 @@ if ($conf->global->LDAP_SYNCHRO_ACTIVE && ! $conf->global->LDAP_USER_DN) print '
'.$langs->trans("LDAPDnContactActive").''; @@ -136,7 +136,7 @@ if ($conf->societe->enabled) } // Synchro adherentt active -if ($conf->adherent->enabled) +if (! empty($conf->adherent->enabled)) { $var=!$var; print '
'.$langs->trans("LDAPDnMemberActive").''; @@ -189,7 +189,7 @@ print ''.$langs->trans("LDAPServerExample").'
'.$langs->trans("LDAPServerPort").''; -if ($conf->global->LDAP_SERVER_PORT) +if (! empty($conf->global->LDAP_SERVER_PORT)) { print ''; } @@ -227,7 +227,7 @@ print ''.$langs->trans("LDAPAdminDnExample").'
'.$langs->trans("LDAPPassword").''; -if ($conf->global->LDAP_ADMIN_PASS) +if (! empty($conf->global->LDAP_ADMIN_PASS)) { print '';// je le met en visible pour test } @@ -252,7 +252,7 @@ print ''; */ if (function_exists("ldap_connect")) { - if ($conf->global->LDAP_SERVER_HOST) + if (! empty($conf->global->LDAP_SERVER_HOST)) { print ''.$langs->trans("LDAPTestConnect").'

'; } @@ -269,7 +269,7 @@ if (function_exists("ldap_connect")) print ''.$langs->trans("LDAPTCPConnectOK",$conf->global->LDAP_SERVER_HOST,$conf->global->LDAP_SERVER_PORT).''; print '
'; - if ($conf->global->LDAP_ADMIN_DN && $conf->global->LDAP_ADMIN_PASS) + if ($conf->global->LDAP_ADMIN_DN && ! empty($conf->global->LDAP_ADMIN_PASS)) { if ($result == 2) { diff --git a/htdocs/admin/ldap_members.php b/htdocs/admin/ldap_members.php index 83dcb2c50c4..61a1b2fa3a7 100644 --- a/htdocs/admin/ldap_members.php +++ b/htdocs/admin/ldap_members.php @@ -373,7 +373,7 @@ print info_admin($langs->trans("LDAPDescValues")); /* * Test de la connexion */ -if ($conf->global->LDAP_MEMBER_ACTIVE) +if (! empty($conf->global->LDAP_MEMBER_ACTIVE)) { $butlabel=$langs->trans("LDAPTestSynchroMember"); $testlabel='testmember'; diff --git a/htdocs/admin/livraison.php b/htdocs/admin/livraison.php index 9a23e3f968d..8a9c4759568 100644 --- a/htdocs/admin/livraison.php +++ b/htdocs/admin/livraison.php @@ -189,7 +189,7 @@ $head[$h][0] = DOL_URL_ROOT."/admin/confexped.php"; $head[$h][1] = $langs->trans("Setup"); $h++; -if ($conf->global->MAIN_SUBMODULE_EXPEDITION) +if (! empty($conf->global->MAIN_SUBMODULE_EXPEDITION)) { $head[$h][0] = DOL_URL_ROOT."/admin/expedition.php"; $head[$h][1] = $langs->trans("Sending"); diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php index b2341019ead..6d869ba7a78 100644 --- a/htdocs/admin/mails.php +++ b/htdocs/admin/mails.php @@ -627,7 +627,7 @@ else print ''.$langs->trans("DoTestSend").''; - if ($conf->fckeditor->enabled) + if (! empty($conf->fckeditor->enabled)) { print ''.$langs->trans("DoTestSendHTML").''; } diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index 66f8b7991da..99f85b40fc9 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -252,19 +252,19 @@ $categidx='expdev'; if (! empty($categ[$categidx])) { $form = new Form($db); - $categidx='expdev'; + $categidx='expdev'; $head[$h][0] = DOL_URL_ROOT."/admin/modules.php?mode=".$categidx; - $head[$h][1] = $form->textwithpicto($langs->trans("ModuleFamilyExperimental"), $langs->trans('DoNotUseInProduction'), 1, 'warning', '', 0, 3); - $head[$h][2] = 'expdev'; - $h++; + $head[$h][1] = $form->textwithpicto($langs->trans("ModuleFamilyExperimental"), $langs->trans('DoNotUseInProduction'), 1, 'warning', '', 0, 3); + $head[$h][2] = 'expdev'; + $h++; } -$categidx='marketplace'; -$head[$h][0] = DOL_URL_ROOT."/admin/modules.php?mode=".$categidx; -$head[$h][1] = $langs->trans("ModulesMarketPlaces"); -$head[$h][2] = 'marketplace'; -$h++; - +$categidx='marketplace'; +$head[$h][0] = DOL_URL_ROOT."/admin/modules.php?mode=".$categidx; +$head[$h][1] = $langs->trans("ModulesMarketPlaces"); +$head[$h][2] = 'marketplace'; +$h++; + dol_fiche_head($head, $mode, $langs->trans("Modules")); diff --git a/htdocs/admin/prelevement.php b/htdocs/admin/prelevement.php index bee489b5454..453acee46fe 100644 --- a/htdocs/admin/prelevement.php +++ b/htdocs/admin/prelevement.php @@ -160,7 +160,7 @@ print '
'; * Notifications */ -if ($conf->global->MAIN_MODULE_NOTIFICATION) +if (! empty($conf->global->MAIN_MODULE_NOTIFICATION)) { $langs->load("mails"); print_titre($langs->trans("Notifications")); diff --git a/htdocs/admin/security.php b/htdocs/admin/security.php index 5d1c218f6a3..4413ab2c51b 100644 --- a/htdocs/admin/security.php +++ b/htdocs/admin/security.php @@ -301,7 +301,7 @@ $var=!$var; print "
'.$langs->trans("DoNotStoreClearPassword").''; -if ($conf->global->DATABASE_PWD_ENCRYPTED) +if (! empty($conf->global->DATABASE_PWD_ENCRYPTED)) { print img_picto($langs->trans("Active"),'tick'); } @@ -312,7 +312,7 @@ if (! $conf->global->DATABASE_PWD_ENCRYPTED) print ''.$langs->trans("Activate").''; print "'; if ($allow_disable_encryption) diff --git a/htdocs/admin/stock.php b/htdocs/admin/stock.php index deb55ee311c..cc604597d17 100644 --- a/htdocs/admin/stock.php +++ b/htdocs/admin/stock.php @@ -133,7 +133,7 @@ print "  
 
'; print ''; -if ($conf->banque->enabled) +if (! empty($conf->banque->enabled)) { $var=!$var; print ''; @@ -126,7 +126,7 @@ if ($conf->banque->enabled) print ''; } -if ($conf->stock->enabled) +if (! empty($conf->stock->enabled)) { $var=!$var; print ''; @@ -135,7 +135,7 @@ if ($conf->stock->enabled) print ''; } -if ($conf->service->enabled) +if (! empty($conf->service->enabled)) { $var=! $var; print ''; print "\n"; -if ($conf->stock->enabled) +if (! empty($conf->stock->enabled)) { $langs->load("stocks"); print ""; diff --git a/htdocs/cashdesk/index_verif.php b/htdocs/cashdesk/index_verif.php index d71b2cb866f..0b42d4a78fd 100644 --- a/htdocs/cashdesk/index_verif.php +++ b/htdocs/cashdesk/index_verif.php @@ -49,14 +49,14 @@ if (! ($thirdpartyid > 0)) } // If we setup stock module to ask movement on invoices, we must not allow access if required setup not finished. -if ($conf->stock->enabled && $conf->global->STOCK_CALCULATE_ON_BILL && ! ($warehouseid > 0)) +if (! empty($conf->stock->enabled) && $conf->global->STOCK_CALCULATE_ON_BILL && ! ($warehouseid > 0)) { $retour=$langs->trans("CashDeskSetupStock"); header('Location: '.DOL_URL_ROOT.'/cashdesk/index.php?err='.urlencode($retour).'&user='.$username.'&socid='.$thirdpartyid.'&warehouseid='.$warehouseid); exit; } -if (! empty($_POST['txtUsername']) && $conf->banque->enabled && (empty($conf_fkaccount_cash) || empty($conf_fkaccount_cheque) || empty($conf_fkaccount_cb))) +if (! empty($_POST['txtUsername']) && ! empty($conf->banque->enabled) && (empty($conf_fkaccount_cash) || empty($conf_fkaccount_cheque) || empty($conf_fkaccount_cb))) { $langs->load("errors"); $retour=$langs->trans("ErrorModuleSetupNotComplete"); diff --git a/htdocs/cashdesk/tpl/facturation1.tpl.php b/htdocs/cashdesk/tpl/facturation1.tpl.php index fc1a3f431c5..ec465c4bd6b 100644 --- a/htdocs/cashdesk/tpl/facturation1.tpl.php +++ b/htdocs/cashdesk/tpl/facturation1.tpl.php @@ -74,7 +74,7 @@ $langs->load("cashdesk"); $label = $tab_designations[$i]['label']; print ''."\n "; } @@ -92,7 +92,7 @@ $langs->load("cashdesk"); $label = $tab_designations[$i]['label']; print ''."\n "; } diff --git a/htdocs/cashdesk/tpl/menu.tpl.php b/htdocs/cashdesk/tpl/menu.tpl.php index ba9767e5983..b1cdf424f89 100644 --- a/htdocs/cashdesk/tpl/menu.tpl.php +++ b/htdocs/cashdesk/tpl/menu.tpl.php @@ -48,7 +48,7 @@ if (!empty($conf->global->CASHDESK_ID_BANKACCOUNT_CHEQUE)) $bankcheque->fetch($conf->global->CASHDESK_ID_BANKACCOUNT_CHEQUE); $bankchequeLink = $bankcheque->getNomUrl(1); } -if (!empty($_SESSION["CASHDESK_ID_WAREHOUSE"]) && $conf->stock->enabled) +if (!empty($_SESSION["CASHDESK_ID_WAREHOUSE"]) && ! empty($conf->stock->enabled)) { $warehouse=new Entrepot($db); $warehouse->fetch($_SESSION["CASHDESK_ID_WAREHOUSE"]); @@ -72,7 +72,7 @@ print $langs->trans("CashDeskThirdParty").': '.$companyLink.'
'; /*print $langs->trans("CashDeskBankCash").': '.$bankcashLink.'
'; print $langs->trans("CashDeskBankCB").': '.$bankcbLink.'
'; print $langs->trans("CashDeskBankCheque").': '.$bankchequeLink.'
';*/ -if (!empty($_SESSION["CASHDESK_ID_WAREHOUSE"]) && $conf->stock->enabled) +if (!empty($_SESSION["CASHDESK_ID_WAREHOUSE"]) && ! empty($conf->stock->enabled)) { print $langs->trans("CashDeskWarehouse").': '.$warehouseLink; } diff --git a/htdocs/cashdesk/validation_verif.php b/htdocs/cashdesk/validation_verif.php index fcd8eda6873..bb1df0af089 100644 --- a/htdocs/cashdesk/validation_verif.php +++ b/htdocs/cashdesk/validation_verif.php @@ -161,7 +161,7 @@ switch ($action) $product->fetch($tab_liste[$i]['fk_article']); $ret=array('label'=>$product->label,'tva_tx'=>$product->tva_tx,'price'=>$product->price); - if ($conf->global->PRODUIT_MULTIPRICES) + if (! empty($conf->global->PRODUIT_MULTIPRICES)) { if (isset($product->multiprices[$societe->price_level])) { diff --git a/htdocs/categories/categorie.php b/htdocs/categories/categorie.php index a50a3a53896..a69ded5360d 100644 --- a/htdocs/categories/categorie.php +++ b/htdocs/categories/categorie.php @@ -182,7 +182,7 @@ if ($socid) require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; $langs->load("companies"); - if ($conf->notification->enabled) $langs->load("mails"); + if (! empty($conf->notification->enabled)) $langs->load("mails"); $soc = new Societe($db); $result = $soc->fetch($socid); @@ -363,7 +363,7 @@ else if ($id || $ref) $rowspan=5; if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) $rowspan+=1; - if ($conf->societe->enabled) $rowspan++; + if (! empty($conf->societe->enabled)) $rowspan++; print '
'; -if ($conf->syslog->enabled) +if (! empty($conf->syslog->enabled)) { print 'clicktodial->enabled) +if (empty($conf->clicktodial->enabled)) { accessforbidden(); exit; diff --git a/htdocs/cashdesk/admin/cashdesk.php b/htdocs/cashdesk/admin/cashdesk.php index ddc72aa795a..af642f4bc3d 100644 --- a/htdocs/cashdesk/admin/cashdesk.php +++ b/htdocs/cashdesk/admin/cashdesk.php @@ -105,7 +105,7 @@ print '
'.$langs->trans("CashDeskThirdPartyFo print ''; print $form->select_company($conf->global->CASHDESK_ID_THIRDPARTY,'socid','s.client in (1,3)',1,1); print '
'.$langs->trans("CashDeskBankAccountForSell").'
'.$langs->trans("CashDeskIdWareHouse").'
'; diff --git a/htdocs/cashdesk/class/Facturation.class.php b/htdocs/cashdesk/class/Facturation.class.php index fb072f27d33..af0b033d81f 100644 --- a/htdocs/cashdesk/class/Facturation.class.php +++ b/htdocs/cashdesk/class/Facturation.class.php @@ -144,7 +144,7 @@ class Facturation $newcartarray[$i]['price']=$product->price; $newcartarray[$i]['price_ttc']=$product->price_ttc; - if ($conf->global->PRODUIT_MULTIPRICES) + if (! empty($conf->global->PRODUIT_MULTIPRICES)) { if (isset($product->multiprices[$societe->price_level])) { diff --git a/htdocs/cashdesk/facturation.php b/htdocs/cashdesk/facturation.php index 3d1f28768bf..09c1353e7e9 100644 --- a/htdocs/cashdesk/facturation.php +++ b/htdocs/cashdesk/facturation.php @@ -30,14 +30,14 @@ if ( $_GET['filtre'] ) { $ret=array(); $i=0; $sql = "SELECT p.rowid, p.ref, p.label, p.tva_tx, p.fk_product_type"; - if ($conf->stock->enabled && !empty($conf_fkentrepot)) $sql.= ", ps.reel"; + if (! empty($conf->stock->enabled) && !empty($conf_fkentrepot)) $sql.= ", ps.reel"; $sql.= " FROM ".MAIN_DB_PREFIX."product as p"; - if ($conf->stock->enabled && !empty($conf_fkentrepot)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_stock as ps ON p.rowid = ps.fk_product AND ps.fk_entrepot = '".$conf_fkentrepot."'"; + if (! empty($conf->stock->enabled) && !empty($conf_fkentrepot)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_stock as ps ON p.rowid = ps.fk_product AND ps.fk_entrepot = '".$conf_fkentrepot."'"; $sql.= " WHERE p.entity IN (".getEntity('product', 1).")"; $sql.= " AND p.tosell = 1"; if(!$conf->global->CASHDESK_SERVICES) $sql.= " AND p.fk_product_type = 0"; $sql.= " AND (p.ref LIKE '%".$_GET['filtre']."%' OR p.label LIKE '%".$_GET['filtre']."%' "; - if ($conf->barcode->enabled) $sql.= " OR p.barcode LIKE '%".$_GET['filtre']."%')"; + if (! empty($conf->barcode->enabled)) $sql.= " OR p.barcode LIKE '%".$_GET['filtre']."%')"; else $sql.= ")"; $sql.= " ORDER BY label"; @@ -67,9 +67,9 @@ if ( $_GET['filtre'] ) { $i=0; $sql = "SELECT p.rowid, ref, label, tva_tx, p.fk_product_type"; - if ($conf->stock->enabled && !empty($conf_fkentrepot)) $sql.= ", ps.reel"; + if (! empty($conf->stock->enabled) && !empty($conf_fkentrepot)) $sql.= ", ps.reel"; $sql.= " FROM ".MAIN_DB_PREFIX."product as p"; - if ($conf->stock->enabled && !empty($conf_fkentrepot)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_stock as ps ON p.rowid = ps.fk_product AND ps.fk_entrepot = '".$conf_fkentrepot."'"; + if (! empty($conf->stock->enabled) && !empty($conf_fkentrepot)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_stock as ps ON p.rowid = ps.fk_product AND ps.fk_entrepot = '".$conf_fkentrepot."'"; $sql.= " WHERE p.entity IN (".getEntity('product', 1).")"; $sql.= " AND p.tosell = 1"; if(!$conf->global->CASHDESK_SERVICES) $sql.= " AND p.fk_product_type = 0"; diff --git a/htdocs/cashdesk/facturation_dhtml.php b/htdocs/cashdesk/facturation_dhtml.php index d327b2af07c..911aae6a576 100644 --- a/htdocs/cashdesk/facturation_dhtml.php +++ b/htdocs/cashdesk/facturation_dhtml.php @@ -44,9 +44,9 @@ header("Content-type: text/html; charset=".$conf->file->character_set_client); if (dol_strlen($_GET["code"]) >= 0) // If search criteria is on char length at least { $sql = "SELECT p.rowid, p.ref, p.label, p.tva_tx"; - if ($conf->stock->enabled && !empty($conf_fkentrepot)) $sql.= ", ps.reel"; + if (! empty($conf->stock->enabled) && !empty($conf_fkentrepot)) $sql.= ", ps.reel"; $sql.= " FROM ".MAIN_DB_PREFIX."product as p"; - if ($conf->stock->enabled && !empty($conf_fkentrepot)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_stock as ps ON p.rowid = ps.fk_product AND ps.fk_entrepot = '".$conf_fkentrepot."'"; + if (! empty($conf->stock->enabled) && !empty($conf_fkentrepot)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_stock as ps ON p.rowid = ps.fk_product AND ps.fk_entrepot = '".$conf_fkentrepot."'"; $sql.= " WHERE p.entity IN (".getEntity('product', 1).")"; $sql.= " AND p.tosell = 1"; $sql.= " AND p.fk_product_type = 0"; diff --git a/htdocs/cashdesk/facturation_verif.php b/htdocs/cashdesk/facturation_verif.php index 86be5906cc4..ea2700e9a22 100644 --- a/htdocs/cashdesk/facturation_verif.php +++ b/htdocs/cashdesk/facturation_verif.php @@ -32,9 +32,9 @@ switch ( $_GET['action'] ) if ( $_POST['hdnSource'] != 'NULL' ) { $sql = "SELECT p.rowid, p.ref, p.price, p.tva_tx"; - if ($conf->stock->enabled && !empty($conf_fkentrepot)) $sql.= ", ps.reel"; + if (! empty($conf->stock->enabled) && !empty($conf_fkentrepot)) $sql.= ", ps.reel"; $sql.= " FROM ".MAIN_DB_PREFIX."product as p"; - if ($conf->stock->enabled && !empty($conf_fkentrepot)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_stock as ps ON p.rowid = ps.fk_product AND ps.fk_entrepot = ".$conf_fkentrepot; + if (! empty($conf->stock->enabled) && !empty($conf_fkentrepot)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_stock as ps ON p.rowid = ps.fk_product AND ps.fk_entrepot = ".$conf_fkentrepot; $sql.= " WHERE p.entity IN (".getEntity('product', 1).")"; // Recuperation des donnees en fonction de la source (liste deroulante ou champ texte) ... @@ -62,7 +62,7 @@ switch ( $_GET['action'] ) } /** add Ditto for MultiPrix*/ - if ($conf->global->PRODUIT_MULTIPRICES) + if (! empty($conf->global->PRODUIT_MULTIPRICES)) { $thirdpartyid = $_SESSION['CASHDESK_ID_THIRDPARTY']; $productid = $ret['rowid']; diff --git a/htdocs/cashdesk/index.php b/htdocs/cashdesk/index.php index 4fe0a225e3f..3dac2d0f57d 100644 --- a/htdocs/cashdesk/index.php +++ b/htdocs/cashdesk/index.php @@ -98,7 +98,7 @@ print $form->select_company(GETPOST('socid','int')?GETPOST('socid','int'):$conf- print '
'; diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index 34adae9b9d0..abf85d69cde 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -147,7 +147,7 @@ class Categorie dol_syslog(get_class($this).'::create sql='.$sql); $sql = "INSERT INTO ".MAIN_DB_PREFIX."categorie (label, description,"; - if ($conf->global->CATEGORY_ASSIGNED_TO_A_CUSTOMER) + if (! empty($conf->global->CATEGORY_ASSIGNED_TO_A_CUSTOMER)) { $sql.= "fk_soc,"; } @@ -157,7 +157,7 @@ class Categorie //$sql.= ", fk_parent_id"; $sql.= ")"; $sql.= " VALUES ('".$this->db->escape($this->label)."', '".$this->db->escape($this->description)."',"; - if ($conf->global->CATEGORY_ASSIGNED_TO_A_CUSTOMER) + if (! empty($conf->global->CATEGORY_ASSIGNED_TO_A_CUSTOMER)) { $sql.= ($this->socid != -1 ? $this->socid : 'null').","; } @@ -269,7 +269,7 @@ class Categorie { $sql .= ", description = '".$this->db->escape($this->description)."'"; } - if ($conf->global->CATEGORY_ASSIGNED_TO_A_CUSTOMER) + if (! empty($conf->global->CATEGORY_ASSIGNED_TO_A_CUSTOMER)) { $sql .= ", fk_soc = ".($this->socid != -1 ? $this->socid : 'null'); } diff --git a/htdocs/categories/photos.php b/htdocs/categories/photos.php index 36bd186c627..5e1598fcc4c 100644 --- a/htdocs/categories/photos.php +++ b/htdocs/categories/photos.php @@ -129,7 +129,7 @@ if ($object->id) print ''; // Visibility - /* if ($type == 0 && $conf->global->CATEGORY_ASSIGNED_TO_A_CUSTOMER) + /* if ($type == 0 && ! empty($conf->global->CATEGORY_ASSIGNED_TO_A_CUSTOMER)) { if ($object->socid) { diff --git a/htdocs/comm/action/document.php b/htdocs/comm/action/document.php index bde511d28ff..7fa1a71c5f3 100755 --- a/htdocs/comm/action/document.php +++ b/htdocs/comm/action/document.php @@ -33,7 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; -if ($conf->projet->enabled) require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; +if (! empty($conf->projet->enabled)) require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; $langs->load("companies"); $langs->load("commercial"); @@ -222,7 +222,7 @@ if ($objectid > 0) print ''; // Project - if ($conf->projet->enabled) + if (! empty($conf->projet->enabled)) { print ''; // Project - if ($conf->projet->enabled) + if (! empty($conf->projet->enabled)) { // Projet associe $langs->load("project"); @@ -927,7 +927,7 @@ if ($id) print ''; // Project - if ($conf->projet->enabled) + if (! empty($conf->projet->enabled)) { print '"; // Project - if ($conf->projet->enabled) + if (! empty($conf->projet->enabled)) { $projectid = 0; if ($origin == 'project') $projectid = ($originid?$originid:0); @@ -294,7 +294,7 @@ if ($action == 'create') } print ''; - if ($conf->global->PRODUCT_SHOW_WHEN_CREATE) print ''; + if (! empty($conf->global->PRODUCT_SHOW_WHEN_CREATE)) print ''; print ''; print ''; @@ -303,7 +303,7 @@ if ($action == 'create') if (! empty($conf->global->PRODUCT_SHOW_WHEN_CREATE)) { print ''; // Multiprice level - if ($conf->global->PRODUIT_MULTIPRICES) + if (! empty($conf->global->PRODUIT_MULTIPRICES)) { print ''; @@ -334,7 +334,7 @@ if (! empty($conf->propal->enabled) && $user->rights->propale->lire) $filename=dol_sanitizeFileName($obj->ref); $filedir=$conf->propal->dir_output . '/' . dol_sanitizeFileName($obj->ref); $urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->propalid; - $formfile->show_documents('propal',$filename,$filedir,$urlsource,'','','',1,'',1); + print $formfile->getDocumentsLink($propalstatic->element, $filename, $filedir); print '
'.$langs->trans("Project").''; if ($act->fk_project) diff --git a/htdocs/comm/action/fiche.php b/htdocs/comm/action/fiche.php index 837a995c966..6cdb7a77580 100644 --- a/htdocs/comm/action/fiche.php +++ b/htdocs/comm/action/fiche.php @@ -760,7 +760,7 @@ if ($id) print '
'.$langs->trans("Project").''; if ($act->fk_project) diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index bf0f58e5843..abd61760e75 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -31,7 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/agenda.lib.php'; -if ($conf->projet->enabled) require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; +if (! empty($conf->projet->enabled)) require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; if (! isset($conf->global->AGENDA_MAX_EVENTS_DAY_VIEW)) $conf->global->AGENDA_MAX_EVENTS_DAY_VIEW=3; diff --git a/htdocs/comm/addpropal.php b/htdocs/comm/addpropal.php index 69adcb1bd9e..52f63e172a7 100644 --- a/htdocs/comm/addpropal.php +++ b/htdocs/comm/addpropal.php @@ -212,7 +212,7 @@ if ($action == 'create') print "
 
 
'.$langs->trans("CreateEmptyPropal").'
'; - if ($conf->product->enabled || $conf->service->enabled) + if (! empty($conf->product->enabled) || ! empty($conf->service->enabled)) { $lib=$langs->trans("ProductsAndServices"); diff --git a/htdocs/comm/fiche.php b/htdocs/comm/fiche.php index f5b3b5a611b..889f13c635e 100644 --- a/htdocs/comm/fiche.php +++ b/htdocs/comm/fiche.php @@ -31,20 +31,20 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; -if ($conf->facture->enabled) require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; -if ($conf->propal->enabled) require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; -if ($conf->commande->enabled) require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; -if ($conf->contrat->enabled) require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; -if ($conf->adherent->enabled) require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; -if ($conf->ficheinter->enabled) require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php'; +if (! empty($conf->facture->enabled)) require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; +if (! empty($conf->propal->enabled)) require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; +if (! empty($conf->commande->enabled)) require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; +if (! empty($conf->contrat->enabled)) require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; +if (! empty($conf->adherent->enabled)) require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; +if (! empty($conf->ficheinter->enabled)) require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php'; $langs->load("companies"); -if ($conf->contrat->enabled) $langs->load("contracts"); -if ($conf->commande->enabled) $langs->load("orders"); -if ($conf->facture->enabled) $langs->load("bills"); -if ($conf->projet->enabled) $langs->load("projects"); -if ($conf->ficheinter->enabled) $langs->load("interventions"); -if ($conf->notification->enabled) $langs->load("mails"); +if (! empty($conf->contrat->enabled)) $langs->load("contracts"); +if (! empty($conf->commande->enabled)) $langs->load("orders"); +if (! empty($conf->facture->enabled)) $langs->load("bills"); +if (! empty($conf->projet->enabled)) $langs->load("projects"); +if (! empty($conf->ficheinter->enabled)) $langs->load("interventions"); +if (! empty($conf->notification->enabled)) $langs->load("mails"); // Security check $id = (GETPOST('socid','int') ? GETPOST('socid','int') : GETPOST('id','int')); @@ -345,7 +345,7 @@ if ($id > 0) print '
'; print '"; diff --git a/htdocs/comm/list.php b/htdocs/comm/list.php index f7da122ad49..da457735f9a 100755 --- a/htdocs/comm/list.php +++ b/htdocs/comm/list.php @@ -145,7 +145,7 @@ if ($result) // Filter on categories $moreforfilter=''; - if ($conf->categorie->enabled) + if (! empty($conf->categorie->enabled)) { $moreforfilter.=$langs->trans('Categories'). ': '; $moreforfilter.=$formother->select_categories(2,$search_categ,'search_categ',1); diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index 84a6e6eb5ca..d30f466df27 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -1231,7 +1231,7 @@ else if ($action == 'validate') } $text=$langs->trans('ConfirmValidateProp',$numref); - if ($conf->notification->enabled) + if (! empty($conf->notification->enabled)) { require_once DOL_DOCUMENT_ROOT .'/core/class/notify.class.php'; $notify=new Notify($db); @@ -1640,7 +1640,7 @@ if ($object->statut == 0 && $user->rights->propal->creer) $object->formAddFreeProduct(0,$mysoc,$soc,$hookmanager); // Add predefined products/services - if ($conf->product->enabled || $conf->service->enabled) + if (! empty($conf->product->enabled) || ! empty($conf->service->enabled)) { $var=!$var; $object->formAddPredefinedProduct(0,$mysoc,$soc,$hookmanager); @@ -1738,7 +1738,7 @@ if ($action != 'presend') // Create an invoice and classify billed if ($object->statut == 2 && $user->societe_id == 0) { - if ($conf->facture->enabled && $user->rights->facture->creer) + if (! empty($conf->facture->enabled) && $user->rights->facture->creer) { print ''.$langs->trans("AddBill").''; } diff --git a/htdocs/comm/propal/apercu.php b/htdocs/comm/propal/apercu.php index 5b4fc238342..d09ea9802e3 100644 --- a/htdocs/comm/propal/apercu.php +++ b/htdocs/comm/propal/apercu.php @@ -29,7 +29,7 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/propal.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; -if ($conf->projet->enabled) require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; +if (! empty($conf->projet->enabled)) require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; $langs->load('propal'); $langs->load("bills"); diff --git a/htdocs/comm/propal/index.php b/htdocs/comm/propal/index.php index 831970d2e14..fb6fa29902e 100644 --- a/htdocs/comm/propal/index.php +++ b/htdocs/comm/propal/index.php @@ -151,7 +151,7 @@ else /* * Draft proposals */ -if ($conf->propal->enabled) +if (! empty($conf->propal->enabled)) { $sql = "SELECT c.rowid, c.ref, s.nom as socname, s.rowid as socid, s.canvas, s.client"; $sql.= " FROM ".MAIN_DB_PREFIX."propal as c"; @@ -257,7 +257,7 @@ if ($resql) $filename=dol_sanitizeFileName($obj->ref); $filedir=$conf->propal->dir_output . '/' . dol_sanitizeFileName($obj->ref); $urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid; - $formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','',1,'',1); + print $formfile->getDocumentsLink($propalstatic->element, $filename, $filedir); print '
'; @@ -364,7 +364,7 @@ if ($id > 0) include DOL_DOCUMENT_ROOT.'/societe/tpl/linesalesrepresentative.tpl.php'; // Module Adherent - if ($conf->adherent->enabled) + if (! empty($conf->adherent->enabled)) { $langs->load("members"); $langs->load("users"); @@ -410,7 +410,7 @@ if ($id > 0) /* * Last proposals */ - if ($conf->propal->enabled && $user->rights->propal->lire) + if (! empty($conf->propal->enabled) && $user->rights->propal->lire) { $propal_static = new Propal($db); @@ -472,7 +472,7 @@ if ($id > 0) /* * Last orders */ - if ($conf->commande->enabled && $user->rights->commande->lire) + if (! empty($conf->commande->enabled) && $user->rights->commande->lire) { $commande_static=new Commande($db); @@ -527,7 +527,7 @@ if ($id > 0) /* * Last linked contracts */ - if ($conf->contrat->enabled && $user->rights->contrat->lire) + if (! empty($conf->contrat->enabled) && $user->rights->contrat->lire) { $contratstatic=new Contrat($db); @@ -587,7 +587,7 @@ if ($id > 0) /* * Last interventions */ - if ($conf->ficheinter->enabled && $user->rights->ficheinter->lire) + if (! empty($conf->ficheinter->enabled) && $user->rights->ficheinter->lire) { $sql = "SELECT s.nom, s.rowid, f.rowid as id, f.ref, f.fk_statut, f.duree as duration, f.datei as startdate"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."fichinter as f"; @@ -642,7 +642,7 @@ if ($id > 0) /* * Last invoices */ - if ($conf->facture->enabled && $user->rights->facture->lire) + if (! empty($conf->facture->enabled) && $user->rights->facture->lire) { $facturestatic = new Facture($db); @@ -723,13 +723,13 @@ if ($id > 0) */ print '
'; - if ($conf->propal->enabled && $user->rights->propal->creer) + if (! empty($conf->propal->enabled) && $user->rights->propal->creer) { $langs->load("propal"); print ''.$langs->trans("AddProp").''; } - if ($conf->commande->enabled && $user->rights->commande->creer) + if (! empty($conf->commande->enabled) && $user->rights->commande->creer) { $langs->load("orders"); print ''.$langs->trans("AddOrder").''; @@ -741,7 +741,7 @@ if ($id > 0) print ''.$langs->trans("AddContract").''; } - if ($conf->ficheinter->enabled && $user->rights->ficheinter->creer) + if (! empty($conf->ficheinter->enabled) && $user->rights->ficheinter->creer) { $langs->load("fichinter"); print ''.$langs->trans("AddIntervention").''; @@ -750,13 +750,13 @@ if ($id > 0) // Add invoice if ($user->societe_id == 0) { - if ($conf->deplacement->enabled) + if (! empty($conf->deplacement->enabled)) { $langs->load("trips"); print ''.$langs->trans("AddTrip").''; } - if ($conf->facture->enabled) + if (! empty($conf->facture->enabled)) { if ($user->rights->facture->creer) { @@ -772,7 +772,7 @@ if ($id > 0) } // Add action - if ($conf->agenda->enabled && ! empty($conf->global->MAIN_REPEATTASKONEACHTAB)) + if (! empty($conf->agenda->enabled) && ! empty($conf->global->MAIN_REPEATTASKONEACHTAB)) { if ($user->rights->agenda->myactions->create) { diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php index b46d47c57da..d124b836692 100644 --- a/htdocs/comm/index.php +++ b/htdocs/comm/index.php @@ -28,8 +28,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/societe/class/client.class.php'; require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/agenda.lib.php'; -if ($conf->contrat->enabled) require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; -if ($conf->propal->enabled) require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; +if (! empty($conf->contrat->enabled)) require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; +if (! empty($conf->propal->enabled)) require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; if (! $user->rights->societe->lire) accessforbidden(); @@ -80,7 +80,7 @@ $now=dol_now(); $form = new Form($db); $formfile = new FormFile($db); $companystatic=new Societe($db); -if ($conf->propal->enabled) $propalstatic=new Propal($db); +if (! empty($conf->propal->enabled)) $propalstatic=new Propal($db); llxHeader(); @@ -89,15 +89,15 @@ print_fiche_titre($langs->trans("CustomerArea")); print ''; print ''; -if (($conf->propal->enabled && $user->rights->propale->lire) || - ($conf->contrat->enabled && $user->rights->contrat->lire) || - ($conf->commande->enabled && $user->rights->commande->lire)) +if ((! empty($conf->propal->enabled) && $user->rights->propale->lire) || + (! empty($conf->contrat->enabled) && $user->rights->contrat->lire) || + (! empty($conf->commande->enabled) && $user->rights->commande->lire)) { print ''; print '
'; } // Recherche Propal -if ($conf->propal->enabled && $user->rights->propal->lire) +if (! empty($conf->propal->enabled) && $user->rights->propal->lire) { $var=false; print '
'; @@ -116,7 +116,7 @@ if ($conf->propal->enabled && $user->rights->propal->lire) /* * Recherche Contrat */ -if ($conf->contrat->enabled && $user->rights->contrat->lire) +if (! empty($conf->contrat->enabled) && $user->rights->contrat->lire) { $var=false; print ''; @@ -135,7 +135,7 @@ if ($conf->contrat->enabled && $user->rights->contrat->lire) /* * Draft proposals */ -if ($conf->propal->enabled && $user->rights->propal->lire) +if (! empty($conf->propal->enabled) && $user->rights->propal->lire) { $sql = "SELECT p.rowid, p.ref, p.total_ht, s.rowid as socid, s.nom as name, s.client, s.canvas"; $sql.= " FROM ".MAIN_DB_PREFIX."propal as p"; @@ -200,7 +200,7 @@ if ($conf->propal->enabled && $user->rights->propal->lire) /* * Draft orders */ -if ($conf->commande->enabled && $user->rights->commande->lire) +if (! empty($conf->commande->enabled) && $user->rights->commande->lire) { $langs->load("orders"); @@ -255,9 +255,9 @@ if ($conf->commande->enabled && $user->rights->commande->lire) } } -if (($conf->propal->enabled && $user->rights->propale->lire) || - ($conf->contrat->enabled && $user->rights->contrat->lire) || - ($conf->commande->enabled && $user->rights->commande->lire)) +if ((! empty($conf->propal->enabled) && $user->rights->propale->lire) || + (! empty($conf->contrat->enabled) && $user->rights->contrat->lire) || + (! empty($conf->commande->enabled) && $user->rights->commande->lire)) { print '
'; @@ -276,7 +276,7 @@ $max=3; /* * Last modified customers or prospects */ -if ($conf->societe->enabled && $user->rights->societe->lire) +if (! empty($conf->societe->enabled) && $user->rights->societe->lire) { $langs->load("boxes"); @@ -336,7 +336,7 @@ if ($conf->societe->enabled && $user->rights->societe->lire) } // Last suppliers -if ($conf->fournisseur->enabled && $user->rights->societe->lire) +if (! empty($conf->fournisseur->enabled) && $user->rights->societe->lire) { $langs->load("boxes"); @@ -408,7 +408,7 @@ if ($user->rights->agenda->myactions->read) /* * Last contracts */ -if ($conf->contrat->enabled && $user->rights->contrat->lire && 0) // TODO A REFAIRE DEPUIS NOUVEAU CONTRAT +if (! empty($conf->contrat->enabled) && $user->rights->contrat->lire && 0) // TODO A REFAIRE DEPUIS NOUVEAU CONTRAT { $langs->load("contracts"); @@ -466,7 +466,7 @@ if ($conf->contrat->enabled && $user->rights->contrat->lire && 0) // TODO A REFA /* * Opened proposals */ -if ($conf->propal->enabled && $user->rights->propal->lire) +if (! empty($conf->propal->enabled) && $user->rights->propal->lire) { $langs->load("propal"); @@ -516,7 +516,7 @@ if ($conf->propal->enabled && $user->rights->propal->lire) $filename=dol_sanitizeFileName($obj->ref); $filedir=$conf->propal->dir_output . '/' . dol_sanitizeFileName($obj->ref); $urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->propalid; - $formfile->show_documents('propal',$filename,$filedir,$urlsource,'','','',1,'',1); + print $formfile->getDocumentsLink($propalstatic->element, $filename, $filedir); print '
'; print "
'; print '
'; print "
'; print '
'; print ''; diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 7092e8dc180..8603f0a7394 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -320,8 +320,7 @@ if ($result) $filename=dol_sanitizeFileName($objp->ref); $filedir=$conf->propal->dir_output . '/' . dol_sanitizeFileName($objp->ref); $urlsource=$_SERVER['PHP_SELF'].'?id='.$objp->propalid; - //$formfile->show_documents('propal',$filename,$filedir,$urlsource,'','','',1,'',1); - print $formfile->getDocumentsLink('propal', $filename, $filedir); + print $formfile->getDocumentsLink($objectstatic->element, $filename, $filedir); print ''; if ($objp->client == 1) diff --git a/htdocs/comm/prospect/fiche.php b/htdocs/comm/prospect/fiche.php index 3a16307a760..14264358cfa 100644 --- a/htdocs/comm/prospect/fiche.php +++ b/htdocs/comm/prospect/fiche.php @@ -29,8 +29,8 @@ require_once DOL_DOCUMENT_ROOT.'/comm/prospect/class/prospect.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; -if ($conf->adherent->enabled) require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; -if ($conf->propal->enabled) require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; +if (! empty($conf->adherent->enabled)) require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; +if (! empty($conf->propal->enabled)) require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; $langs->load('companies'); $langs->load('projects'); @@ -152,7 +152,7 @@ if ($socid > 0) print ''; // Multiprice level - if ($conf->global->PRODUIT_MULTIPRICES) + if (! empty($conf->global->PRODUIT_MULTIPRICES)) { print ''; print ''; diff --git a/htdocs/commande/liste.php b/htdocs/commande/liste.php index 08c68939903..641d13f8643 100644 --- a/htdocs/commande/liste.php +++ b/htdocs/commande/liste.php @@ -308,7 +308,7 @@ if ($resql) $filename=dol_sanitizeFileName($objp->ref); $filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($objp->ref); $urlsource=$_SERVER['PHP_SELF'].'?id='.$objp->rowid; - $formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','',1,'',1); + print $formfile->getDocumentsLink($generic_commande->element, $filename, $filedir); print '
'; @@ -181,7 +181,7 @@ if ($socid > 0) include DOL_DOCUMENT_ROOT.'/societe/tpl/linesalesrepresentative.tpl.php'; // Module Adherent - if ($conf->adherent->enabled) + if (! empty($conf->adherent->enabled)) { $langs->load("members"); $langs->load("users"); @@ -225,7 +225,7 @@ if ($socid > 0) /* * Last proposals */ - if ($conf->propal->enabled && $user->rights->propale->lire) + if (! empty($conf->propal->enabled) && $user->rights->propale->lire) { $propal_static=new Propal($db); @@ -297,13 +297,13 @@ if ($socid > 0) print '
'; - if ($conf->propal->enabled && $user->rights->propale->creer) + if (! empty($conf->propal->enabled) && $user->rights->propale->creer) { print ''.$langs->trans("AddProp").''; } // Add action - if ($conf->agenda->enabled && ! empty($conf->global->MAIN_REPEATTASKONEACHTAB)) + if (! empty($conf->agenda->enabled) && ! empty($conf->global->MAIN_REPEATTASKONEACHTAB)) { if ($user->rights->agenda->myactions->create) { diff --git a/htdocs/comm/prospect/index.php b/htdocs/comm/prospect/index.php index 3280c456e4f..f4f603fb45b 100644 --- a/htdocs/comm/prospect/index.php +++ b/htdocs/comm/prospect/index.php @@ -50,7 +50,7 @@ print ''; print ''; @@ -353,7 +353,7 @@ if ($conf->commande->enabled) /* * Orders thar are in a shipping process */ -if ($conf->commande->enabled) +if (! empty($conf->commande->enabled)) { $sql = "SELECT c.rowid, c.ref, c.fk_statut, c.facture, s.nom, s.rowid as socid"; $sql.= " FROM ".MAIN_DB_PREFIX."commande as c"; @@ -402,7 +402,7 @@ if ($conf->commande->enabled) $filename=dol_sanitizeFileName($obj->ref); $filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref); $urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid; - $formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','',1,'',1); + print $formfile->getDocumentsLink($commandestatic->element, $filename, $filedir); print '
'; -if ($conf->propal->enabled) +if (! empty($conf->propal->enabled)) { $var=false; print ''; @@ -111,7 +111,7 @@ if ($resql) /* * Liste des propal brouillons */ -if ($conf->propal->enabled && $user->rights->propale->lire) +if (! empty($conf->propal->enabled) && $user->rights->propale->lire) { $sql = "SELECT p.rowid, p.ref, p.price, s.nom as sname"; $sql.= " FROM ".MAIN_DB_PREFIX."propal as p"; @@ -164,13 +164,13 @@ if ($conf->propal->enabled && $user->rights->propale->lire) */ print ''; // Delivery address - if ($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) + if (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT)) { print ''; @@ -282,7 +282,7 @@ else dol_print_error($db); /* * Orders to process */ -if ($conf->commande->enabled) +if (! empty($conf->commande->enabled)) { $sql = "SELECT c.rowid, c.ref, c.fk_statut, c.facture, s.nom, s.rowid as socid"; $sql.=" FROM ".MAIN_DB_PREFIX."commande as c"; @@ -331,7 +331,7 @@ if ($conf->commande->enabled) $filename=dol_sanitizeFileName($obj->ref); $filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref); $urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid; - $formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','',1,'',1); + print $formfile->getDocumentsLink($commandestatic->element, $filename, $filedir); print '
'; -if ($conf->agenda->enabled) show_array_actions_to_do(10); +if (! empty($conf->agenda->enabled)) show_array_actions_to_do(10); /* * Dernieres propales ouvertes * */ -if ($conf->propal->enabled && $user->rights->propale->lire) +if (! empty($conf->propal->enabled) && $user->rights->propale->lire) { $sql = "SELECT s.nom as name, s.rowid as socid, s.client, s.canvas,"; $sql.= " p.rowid as propalid, p.total as total_ttc, p.ref, p.datep as dp, c.label as statut, c.id as statutid"; diff --git a/htdocs/comm/prospect/list.php b/htdocs/comm/prospect/list.php index d24ac0c2e47..caac721333c 100755 --- a/htdocs/comm/prospect/list.php +++ b/htdocs/comm/prospect/list.php @@ -261,7 +261,7 @@ if ($resql) // Filter on categories $moreforfilter=''; - if ($conf->categorie->enabled) + if (! empty($conf->categorie->enabled)) { $moreforfilter.=$langs->trans('Categories'). ': '; $moreforfilter.=$formother->select_categories(2,$search_categ,'search_categ',1); diff --git a/htdocs/comm/prospect/recap-prospect.php b/htdocs/comm/prospect/recap-prospect.php index 3640cee6279..02c6b2508e3 100644 --- a/htdocs/comm/prospect/recap-prospect.php +++ b/htdocs/comm/prospect/recap-prospect.php @@ -28,7 +28,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; $langs->load("companies"); $langs->load('other'); -if ($conf->facture->enabled) $langs->load("bills"); +if (! empty($conf->facture->enabled)) $langs->load("bills"); // Security check $socid = $_GET["socid"]; diff --git a/htdocs/comm/recap-client.php b/htdocs/comm/recap-client.php index fe240ac2266..8b1d4c8aef1 100644 --- a/htdocs/comm/recap-client.php +++ b/htdocs/comm/recap-client.php @@ -27,7 +27,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; $langs->load("companies"); -if ($conf->facture->enabled) $langs->load("bills"); +if (! empty($conf->facture->enabled)) $langs->load("bills"); // Security check $socid = $_GET["socid"]; diff --git a/htdocs/commande/apercu.php b/htdocs/commande/apercu.php index 83822aa2407..87d84d297d3 100644 --- a/htdocs/commande/apercu.php +++ b/htdocs/commande/apercu.php @@ -29,8 +29,8 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/order.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; -if ($conf->propal->enabled) require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; -if ($conf->projet->enabled) require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; +if (! empty($conf->propal->enabled)) require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; +if (! empty($conf->projet->enabled)) require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; $langs->load('orders'); $langs->load('propal'); diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 71a863b6e07..6d6181ad75c 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -237,7 +237,7 @@ class Commande extends CommonOrder if (! $error) { // If stock is incremented on validate order, we must increment it - if ($result >= 0 && $conf->stock->enabled && $conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER == 1) + if ($result >= 0 && ! empty($conf->stock->enabled) && $conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER == 1) { require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php'; $langs->load("agenda"); @@ -351,7 +351,7 @@ class Commande extends CommonOrder if ($this->db->query($sql)) { // If stock is decremented on validate order, we must reincrement it - if ($conf->stock->enabled && $conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER == 1) + if (! empty($conf->stock->enabled) && $conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER == 1) { require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php'; $langs->load("agenda"); @@ -534,7 +534,7 @@ class Commande extends CommonOrder if ($this->db->query($sql)) { // If stock is decremented on validate order, we must reincrement it - if ($conf->stock->enabled && $conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER == 1) + if (! empty($conf->stock->enabled) && $conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER == 1) { require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php'; $langs->load("agenda"); @@ -2538,7 +2538,7 @@ class Commande extends CommonOrder $result=''; - if ($conf->expedition->enabled && ($option == 1 || $option == 2)) $url = DOL_URL_ROOT.'/expedition/shipment.php?id='.$this->id; + if (! empty($conf->expedition->enabled) && ($option == 1 || $option == 2)) $url = DOL_URL_ROOT.'/expedition/shipment.php?id='.$this->id; else $url = DOL_URL_ROOT.'/commande/fiche.php?id='.$this->id; if ($short) return $url; @@ -3140,7 +3140,7 @@ class OrderLine $sql.= " , total_ht=".price2num($this->total_ht).""; $sql.= " , total_tva=".price2num($this->total_tva).""; $sql.= " , total_ttc=".price2num($this->total_ttc).""; - $sql.= " , total_localtax1=".price2num($this->total_localtax1); + $sql.= " , total_localtax1=".price2num($this->total_localtax1); $sql.= " , total_localtax2=".price2num($this->total_localtax2); } $sql.= " , fk_product_fournisseur_price=".(! empty($this->fk_fournprice)?$this->fk_fournprice:"null"); diff --git a/htdocs/commande/contact.php b/htdocs/commande/contact.php index 0caf1c80d63..d190a550834 100644 --- a/htdocs/commande/contact.php +++ b/htdocs/commande/contact.php @@ -178,7 +178,7 @@ if ($id > 0 || ! empty($ref)) print ''.$object->client->getNomUrl(1).'
'; print '
'; diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php index 2c665ec982c..c186f05df5a 100644 --- a/htdocs/commande/fiche.php +++ b/htdocs/commande/fiche.php @@ -1462,7 +1462,7 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G // Date de livraison print "
".$langs->trans("DeliveryDate").''; - if ($conf->global->DATE_LIVRAISON_WEEK_DELAY) + if (! empty($conf->global->DATE_LIVRAISON_WEEK_DELAY)) { $datedelivery = time() + ((7*$conf->global->DATE_LIVRAISON_WEEK_DELAY) * 24 * 60 * 60); } @@ -1699,7 +1699,7 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G } $text=$langs->trans('ConfirmValidateOrder',$numref); - if ($conf->notification->enabled) + if (! empty($conf->notification->enabled)) { require_once DOL_DOCUMENT_ROOT .'/core/class/notify.class.php'; $notify=new Notify($db); @@ -1808,7 +1808,7 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G * Commande */ $nbrow=9; - if ($conf->projet->enabled) $nbrow++; + if (! empty($conf->projet->enabled)) $nbrow++; //Local taxes if ($mysoc->country_code=='ES') @@ -2153,7 +2153,7 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G $object->formAddFreeProduct(1,$mysoc,$soc,$hookmanager); // Add predefined products/services - if ($conf->product->enabled || $conf->service->enabled) + if (! empty($conf->product->enabled) || ! empty($conf->service->enabled)) { $var=!$var; $object->formAddPredefinedProduct(1,$mysoc,$soc,$hookmanager); @@ -2201,7 +2201,7 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G // Ship $numshipping=0; - if ($conf->expedition->enabled) + if (! empty($conf->expedition->enabled)) { $numshipping = $object->nb_expedition(); @@ -2235,7 +2235,7 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G // Create bill and Classify billed - if ($conf->facture->enabled && $object->statut > 0 && ! $object->billed) + if (! empty($conf->facture->enabled) && $object->statut > 0 && ! $object->billed) { if ($user->rights->facture->creer && empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) { diff --git a/htdocs/commande/index.php b/htdocs/commande/index.php index 0c7a40d2ac8..af38165d48a 100644 --- a/htdocs/commande/index.php +++ b/htdocs/commande/index.php @@ -165,7 +165,7 @@ else /* * Draft orders */ -if ($conf->commande->enabled) +if (! empty($conf->commande->enabled)) { $sql = "SELECT c.rowid, c.ref, s.nom, s.rowid as socid"; $sql.= " FROM ".MAIN_DB_PREFIX."commande as c"; @@ -262,7 +262,7 @@ if ($resql) $filename=dol_sanitizeFileName($obj->ref); $filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref); $urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid; - $formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','',1,'',1); + print $formfile->getDocumentsLink($commandestatic->element, $filename, $filedir); print '
'; print '
'; print '
'; print '
'; print ''; diff --git a/htdocs/commande/orderstoinvoice.php b/htdocs/commande/orderstoinvoice.php index c0ef16db6fb..3cc4ded371b 100755 --- a/htdocs/commande/orderstoinvoice.php +++ b/htdocs/commande/orderstoinvoice.php @@ -34,7 +34,7 @@ require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/report.lib.php'; -if ($conf->projet->enabled) require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; +if (! empty($conf->projet->enabled)) require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; $langs->load('orders'); $langs->load('deliveries'); @@ -416,7 +416,7 @@ if ($action == 'create') $html->select_types_paiements(isset($_POST['mode_reglement_id'])?$_POST['mode_reglement_id']:$mode_reglement_id,'mode_reglement_id'); print ''; // Project - if ($conf->projet->enabled) + if (! empty($conf->projet->enabled)) { $langs->load('projects'); print ''.$langs->trans('Project').''; @@ -469,10 +469,10 @@ if ($action == 'create') while ($i < $n) { print ''; - + $i++; } - + print "\n"; // Button "Create Draft" print '
'; @@ -496,7 +496,7 @@ if (($action != 'create' && $action != 'add') || ! empty($mesgs)) }); escape($sall)."%' OR c.note LIKE '%".$db->escape($sall)."%')"; } - + //Date filter if ($date_start && $date_end) $sql.= " AND c.date_commande >= '".$db->idate($date_start)."' AND c.date_commande <= '".$db->idate($date_end)."'"; if ($date_starty && $date_endy) $sql.= " AND c.date_livraison >= '".$db->idate($date_starty)."' AND c.date_livraison <= '".$db->idate($date_endy)."'"; - + if (!empty($sref_client)) { $sql.= ' AND c.ref_client LIKE \'%'.$db->escape($sref_client).'%\''; } $sql.= ' ORDER BY '.$sortfield.' '.$sortorder; $resql = $db->query($sql); - + if ($resql) { if ($socid) @@ -569,7 +569,7 @@ if (($action != 'create' && $action != 'add') || ! empty($mesgs)) print '

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

'; print ''; @@ -581,7 +581,7 @@ if (($action != 'create' && $action != 'add') || ! empty($mesgs)) print_liste_field_titre($langs->trans('Status'),'','','','','align="right"'); print_liste_field_titre($langs->trans('GenerateBill'),'','','','','align="center"'); print ''; - + // Lignes des champs de filtre print ''; print ''; @@ -593,88 +593,88 @@ if (($action != 'create' && $action != 'add') || ! empty($mesgs)) //print ''; - + //DATE DELIVERY print ''; - + //SEARCH BUTTON print ''; - + print ''; print ''; - + print ''; $var=True; $generic_commande = new Commande($db); - + while ($i < $num) { $objp = $db->fetch_object($resql); $var=!$var; print ''; print ''; - + print ''; - + // Order date print ''; - + //Delivery date print ''; - + // Statut print ''; - + // Checkbox print '' ; - + print ''; - + $total = $total + $objp->price; $subtotal = $subtotal + $objp->price; $i++; } print '
'; print ''; print ''; - + //DATE ORDER print ''; print $period; print ''; print $periodely; print ''; print ''; - + //ALL/NONE print ''; if ($conf->use_javascript_ajax) print ''.$langs->trans("All").' / '.$langs->trans("None").''; print '
'; - + $generic_commande->id=$objp->rowid; $generic_commande->ref=$objp->ref; - + print ''; print ''; - + print ''; - + print '
'; print $generic_commande->getNomUrl(1,$objp->fk_statut); print ''; if (($objp->fk_statut > 0) && ($objp->fk_statut < 3) && $db->jdate($objp->date_valid) < ($now - $conf->commande->client->warning_delay)) print img_picto($langs->trans("Late"),"warning"); print ''; $filename=dol_sanitizeFileName($objp->ref); $filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($objp->ref); $urlsource=$_SERVER['PHP_SELF'].'?id='.$objp->rowid; - $formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','',1,'',1); + print $formfile->getDocumentsLink($generic_commande->element, $filename, $filedir); print '
'; print '
'.$objp->ref_client.''; print dol_print_date($db->jdate($objp->date_commande),'day'); print ''; print dol_print_date($db->jdate($objp->date_livraison),'day'); print ''.$generic_commande->LibStatut($objp->fk_statut,$objp->facturee,5).''; print ''; print '
'; - + /* * Boutons actions */ diff --git a/htdocs/compta/bank/account.php b/htdocs/compta/bank/account.php index e215dbdcca2..e6c5cb4f580 100644 --- a/htdocs/compta/bank/account.php +++ b/htdocs/compta/bank/account.php @@ -429,11 +429,11 @@ if ($id > 0 || ! empty($ref)) $sql.= ", s.rowid as socid, s.nom as thirdparty"; } /* - if ($mode_search && $conf->adherent->enabled) + if ($mode_search && ! empty($conf->adherent->enabled)) { } - if ($mode_search && $conf->tax->enabled) + if ($mode_search && ! empty($conf->tax->enabled)) { } @@ -445,12 +445,12 @@ if ($id > 0 || ! empty($ref)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank_url as bu1 ON bu1.fk_bank = b.rowid AND bu1.type='company'"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON bu1.url_id = s.rowid"; } - if ($mode_search && $conf->tax->enabled) + if ($mode_search && ! empty($conf->tax->enabled)) { $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank_url as bu2 ON bu2.fk_bank = b.rowid AND bu2.type='payment_vat'"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."tva as t ON bu2.url_id = t.rowid"; } - if ($mode_search && $conf->adherent->enabled) + if ($mode_search && ! empty($conf->adherent->enabled)) { // TODO Mettre jointure sur adherent pour recherche sur un adherent //$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank_url as bu3 ON bu3.fk_bank = b.rowid AND bu3.type='company'"; diff --git a/htdocs/compta/bank/fiche.php b/htdocs/compta/bank/fiche.php index 65abe9ccb5f..490b228f25a 100644 --- a/htdocs/compta/bank/fiche.php +++ b/htdocs/compta/bank/fiche.php @@ -281,7 +281,7 @@ if ($action == 'create') print ''; // Accountancy code - if ($conf->global->MAIN_BANK_ACCOUNTANCY_CODE_ALWAYS_REQUIRED) + if (! empty($conf->global->MAIN_BANK_ACCOUNTANCY_CODE_ALWAYS_REQUIRED)) { print ''.$langs->trans("AccountancyCode").''; print ''; @@ -563,7 +563,7 @@ else print ''; // Accountancy code - if ($conf->global->MAIN_BANK_ACCOUNTANCY_CODE_ALWAYS_REQUIRED) + if (! empty($conf->global->MAIN_BANK_ACCOUNTANCY_CODE_ALWAYS_REQUIRED)) { print ''.$langs->trans("AccountancyCode").''; print 'account_number).'">'; diff --git a/htdocs/compta/bank/ligne.php b/htdocs/compta/bank/ligne.php index 584afaa321f..18227bf825d 100644 --- a/htdocs/compta/bank/ligne.php +++ b/htdocs/compta/bank/ligne.php @@ -32,7 +32,7 @@ $langs->load("banks"); $langs->load("compta"); $langs->load("bills"); $langs->load("categories"); -if ($conf->adherent->enabled) $langs->load("members"); +if (! empty($conf->adherent->enabled)) $langs->load("members"); $id = (GETPOST('id','int') ? GETPOST('id','int') : GETPOST('account','int')); diff --git a/htdocs/compta/deplacement/fiche.php b/htdocs/compta/deplacement/fiche.php index df453887ea1..754764fa32c 100644 --- a/htdocs/compta/deplacement/fiche.php +++ b/htdocs/compta/deplacement/fiche.php @@ -27,7 +27,7 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/trip.lib.php'; require_once DOL_DOCUMENT_ROOT.'/compta/deplacement/class/deplacement.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; -if ($conf->projet->enabled) +if (! empty($conf->projet->enabled)) { require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; @@ -489,7 +489,7 @@ else if ($id) print ''; // Project - if ($conf->projet->enabled) + if (! empty($conf->projet->enabled)) { $langs->load('projects'); print ''; diff --git a/htdocs/compta/dons/fiche.php b/htdocs/compta/dons/fiche.php index fb6c8de4f5a..e6ec1a422ae 100644 --- a/htdocs/compta/dons/fiche.php +++ b/htdocs/compta/dons/fiche.php @@ -29,7 +29,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/dons/class/don.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; -if ($conf->projet->enabled) require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; +if (! empty($conf->projet->enabled)) require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; $langs->load("companies"); $langs->load("donations"); @@ -280,7 +280,7 @@ if ($action == 'create') print ''; $nbrows=11; - if ($conf->projet->enabled) $nbrows++; + if (! empty($conf->projet->enabled)) $nbrows++; // Date print ''.$langs->trans("Date").''; @@ -318,7 +318,7 @@ if ($action == 'create') $form->select_types_paiements('', 'modepaiement', 'CRDT', 0, 1); print "\n"; - if ($conf->projet->enabled) + if (! empty($conf->projet->enabled)) { // Si module projet actif print "".$langs->trans("Project").""; @@ -368,7 +368,7 @@ if (! empty($id) && $action == 'edit') print ''; $nbrows=12; - if ($conf->projet->enabled) $nbrows++; + if (! empty($conf->projet->enabled)) $nbrows++; // Date print "".''.$langs->trans("Date").''; @@ -458,7 +458,7 @@ if (! empty($id) && $action != 'edit') $linkback = ''.$langs->trans("BackToList").''; $nbrows=12; - if ($conf->projet->enabled) $nbrows++; + if (! empty($conf->projet->enabled)) $nbrows++; // Ref print "".''.$langs->trans("Ref").''; @@ -502,7 +502,7 @@ if (! empty($id) && $action != 'edit') print "".''.$langs->trans("Status").''.$don->getLibStatut(4).''; // Project - if ($conf->projet->enabled) + if (! empty($conf->projet->enabled)) { print "".''.$langs->trans("Project").''.$don->projet.''; } diff --git a/htdocs/compta/dons/liste.php b/htdocs/compta/dons/liste.php index ced00f94c50..3a3a8d7a180 100644 --- a/htdocs/compta/dons/liste.php +++ b/htdocs/compta/dons/liste.php @@ -53,7 +53,7 @@ if (!$user->rights->don->lire) accessforbidden(); * View */ -if ($conf->projet->enabled) $projectstatic=new Project($db); +if (! empty($conf->projet->enabled)) $projectstatic=new Project($db); llxHeader('',$langs->trans("Donations"),'EN:Module_Donations|FR:Module_Dons|ES:Módulo_Donaciones'); @@ -160,7 +160,7 @@ if ($resql) print "".$objp->societe."\n"; print "".$donationstatic->getFullName($langs)."\n"; print ''.dol_print_date($db->jdate($objp->datedon),'day').''; - if ($conf->projet->enabled) + if (! empty($conf->projet->enabled)) { print ""; if ($objp->pid) diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 4e928108813..0c6e0e6c9b9 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -1882,7 +1882,7 @@ if ($action == 'create') print ''."\n"; // Proforma - if ($conf->global->FACTURE_USE_PROFORMAT) + if (! empty($conf->global->FACTURE_USE_PROFORMAT)) { print ''; print ''; @@ -1973,7 +1973,7 @@ if ($action == 'create') print ''; // Project - if ($conf->projet->enabled) + if (! empty($conf->projet->enabled)) { $langs->load('projects'); print ''.$langs->trans('Project').''; @@ -2080,7 +2080,7 @@ if ($action == 'create') print ''.$langs->trans('Qty').''; print ''.$langs->trans('ReductionShort').''; print '     '; - if ($conf->service->enabled) + if (! empty($conf->service->enabled)) { print ''.$langs->trans('ServiceLimitedDuration').''; } @@ -2090,7 +2090,7 @@ if ($action == 'create') print ''; print ''; // multiprix - if($conf->global->PRODUIT_MULTIPRICES) + if (! empty($conf->global->PRODUIT_MULTIPRICES)) $form->select_produits('','idprod'.$i,'',$conf->product->limit_size,$soc->price_level); else $form->select_produits('','idprod'.$i,'',$conf->product->limit_size); @@ -2099,7 +2099,7 @@ if ($action == 'create') print '%'; print ' '; // 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 ''; print ''; @@ -2243,7 +2243,7 @@ else if ($id > 0 || ! empty($ref)) } $text=$langs->trans('ConfirmValidateBill',$numref); - if ($conf->notification->enabled) + if (! empty($conf->notification->enabled)) { require_once DOL_DOCUMENT_ROOT .'/core/class/notify.class.php'; $notify=new Notify($db); @@ -2624,8 +2624,8 @@ else if ($id > 0 || ! empty($ref)) */ $nbrows=8; $nbcols=2; - if ($conf->projet->enabled) $nbrows++; - if ($conf->banque->enabled) $nbcols++; + if (! empty($conf->projet->enabled)) $nbrows++; + if (! empty($conf->banque->enabled)) $nbcols++; //Local taxes if ($mysoc->pays_code=='ES') @@ -2642,7 +2642,7 @@ else if ($id > 0 || ! empty($ref)) print ''; print ''; print ''; - if ($conf->banque->enabled) print ''; + if (! empty($conf->banque->enabled)) print ''; print ''; print ''; print ''; @@ -2679,7 +2679,7 @@ else if ($id > 0 || ! empty($ref)) print dol_print_date($db->jdate($objp->dp),'day').''; $label=($langs->trans("PaymentType".$objp->payment_code)!=("PaymentType".$objp->payment_code))?$langs->trans("PaymentType".$objp->payment_code):$objp->payment_label; print ''; - if ($conf->banque->enabled) + if (! empty($conf->banque->enabled)) { $bankaccountstatic->id=$objp->baid; $bankaccountstatic->ref=$objp->ref; @@ -3016,7 +3016,7 @@ else if ($id > 0 || ! empty($ref)) $object->formAddFreeProduct(1,$mysoc,$soc,$hookmanager); // Add predefined products/services - if ($conf->product->enabled || $conf->service->enabled) + if (! empty($conf->product->enabled) || ! empty($conf->service->enabled)) { $var=!$var; $object->formAddPredefinedProduct(1,$mysoc,$soc,$hookmanager); @@ -3268,7 +3268,7 @@ else if ($id > 0 || ! empty($ref)) $somethingshown=$object->showLinkedObjectBlock(); // Link for paypal payment - if ($conf->paypal->enabled && $object->statut != 0) + if (! empty($conf->paypal->enabled) && $object->statut != 0) { include_once DOL_DOCUMENT_ROOT.'/paypal/lib/paypal.lib.php'; print showPaypalPaymentUrl('invoice',$object->ref); diff --git a/htdocs/compta/facture/apercu.php b/htdocs/compta/facture/apercu.php index bac78a55c78..1ad6c0480ba 100644 --- a/htdocs/compta/facture/apercu.php +++ b/htdocs/compta/facture/apercu.php @@ -30,7 +30,7 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/invoice.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; -if ($conf->projet->enabled) require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; +if (! empty($conf->projet->enabled)) require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; $langs->load("bills"); @@ -288,7 +288,7 @@ if ($id > 0 || ! empty($ref)) print ''; $nbrows=5; - if ($conf->projet->enabled) $nbrows++; + if (! empty($conf->projet->enabled)) $nbrows++; print ''; // Projet - if ($conf->projet->enabled) + if (! empty($conf->projet->enabled)) { $langs->load("projects"); print ''; diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 3ec0b1576e7..6f6c85abd59 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -1809,7 +1809,7 @@ class Facture extends CommonInvoice if ($result) { // Si on decremente le produit principal et ses composants a la validation de facture, on réincrement - if ($this->type != 3 && $result >= 0 && $conf->stock->enabled && $conf->global->STOCK_CALCULATE_ON_BILL) + if ($this->type != 3 && $result >= 0 && ! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_BILL)) { require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php'; $langs->load("agenda"); @@ -3446,7 +3446,7 @@ class FactureLigne $sql.= ",total_ht=".price2num($this->total_ht).""; $sql.= ",total_tva=".price2num($this->total_tva).""; $sql.= ",total_ttc=".price2num($this->total_ttc).""; - $sql.= ",total_localtax1=".price2num($this->total_localtax1).""; + $sql.= ",total_localtax1=".price2num($this->total_localtax1).""; $sql.= ",total_localtax2=".price2num($this->total_localtax2).""; } $sql.= " , fk_product_fournisseur_price='".$this->fk_fournprice."'"; diff --git a/htdocs/compta/facture/fiche-rec.php b/htdocs/compta/facture/fiche-rec.php index 1f014a65aaf..a0173e74fa4 100644 --- a/htdocs/compta/facture/fiche-rec.php +++ b/htdocs/compta/facture/fiche-rec.php @@ -301,10 +301,10 @@ if ($action == 'create') $prodprice=$product_static->price; // price HT print '\n"; } - else - { - print ''; - } + else + { + print ''; + } } print ""; diff --git a/htdocs/compta/facture/impayees.php b/htdocs/compta/facture/impayees.php index 6cd4850ddd8..7b60344fc06 100644 --- a/htdocs/compta/facture/impayees.php +++ b/htdocs/compta/facture/impayees.php @@ -88,7 +88,7 @@ if ($action == "builddoc" && $user->rights->facture->lire) } $pdf->SetFont(pdf_getPDFFont($outputlangs)); - if ($conf->global->MAIN_DISABLE_PDF_COMPRESSION) $pdf->SetCompression(false); + if (! empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) $pdf->SetCompression(false); // Add all others foreach($files as $file) @@ -340,7 +340,7 @@ if ($resql) print ''; print '
'.($object->type == 2 ? $langs->trans("PaymentsBack") : $langs->trans('Payments')).''.$langs->trans('Type').''.$langs->trans('BankAccount').''.$langs->trans('BankAccount').''.$langs->trans('Amount').' 
'.$label.' '.$objp->num_paiement.''; /* @@ -366,7 +366,7 @@ if ($id > 0 || ! empty($ref)) print '
'.$langs->trans('Status').''.($object->getLibStatut(4,$totalpaye)).'
'.price($prodprice)."  
'; $filename=dol_sanitizeFileName($objp->facnumber); $filedir=$conf->facture->dir_output . '/' . dol_sanitizeFileName($objp->facnumber); - $foundpdf=$formfile->show_documents('facture',$filename,$filedir,$urlsource,'','','',1,'',1,$param); + print $formfile->getDocumentsLink($facturestatic->element, $filename, $filedir); print '
'; @@ -365,8 +365,10 @@ if ($resql) // Checkbox print ''; - if ($foundpdf) print ''; - else print ' '; + if (! empty($formfile->numoffiles)) + print ''; + else + print ' '; print '' ; print "\n"; diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 8a19de20180..9d668723f34 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -341,7 +341,7 @@ if ($resql) $filename=dol_sanitizeFileName($objp->facnumber); $filedir=$conf->facture->dir_output . '/' . dol_sanitizeFileName($objp->facnumber); $urlsource=$_SERVER['PHP_SELF'].'?id='.$objp->facid; - $formfile->show_documents('facture',$filename,$filedir,$urlsource,'','','',1,'',1); + print $formfile->getDocumentsLink($facturestatic->element, $filename, $filedir); print ''; print ''; print ''; diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php index bf2c773265b..7cbbbb8e5da 100644 --- a/htdocs/compta/index.php +++ b/htdocs/compta/index.php @@ -27,9 +27,9 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; -if ($conf->commande->enabled) require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; -if ($conf->commande->enabled) require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; -if ($conf->tax->enabled) require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php'; +if (! empty($conf->commande->enabled)) require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; +if (! empty($conf->commande->enabled)) require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; +if (! empty($conf->tax->enabled)) require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php'; // L'espace compta/treso doit toujours etre actif car c'est un espace partage // par de nombreux modules (banque, facture, commande a facturer, etc...) independamment @@ -40,7 +40,7 @@ if ($conf->tax->enabled) require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/ $langs->load("compta"); $langs->load("bills"); -if ($conf->commande->enabled) $langs->load("orders"); +if (! empty($conf->commande->enabled)) $langs->load("orders"); // Security check $socid=''; @@ -108,7 +108,7 @@ $max=3; /* * Search invoices */ -if ($conf->facture->enabled && $user->rights->facture->lire) +if (! empty($conf->facture->enabled) && $user->rights->facture->lire) { print ''; print ''; @@ -125,7 +125,7 @@ if ($conf->facture->enabled && $user->rights->facture->lire) /* * Search supplier invoices */ -if ($conf->fournisseur->enabled && $user->rights->fournisseur->lire) +if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->lire) { print ''; print ''; @@ -142,7 +142,7 @@ if ($conf->fournisseur->enabled && $user->rights->fournisseur->lire) /* * Search donations */ -if ($conf->don->enabled && $user->rights->don->lire) +if (! empty($conf->don->enabled) && $user->rights->don->lire) { print ''; print ''; @@ -159,7 +159,7 @@ if ($conf->don->enabled && $user->rights->don->lire) /* * Search expenses */ -if ($conf->deplacement->enabled && $user->rights->deplacement->lire) +if (! empty($conf->deplacement->enabled) && $user->rights->deplacement->lire) { print ''; print ''; @@ -176,7 +176,7 @@ if ($conf->deplacement->enabled && $user->rights->deplacement->lire) /** * Draft customers invoices */ -if ($conf->facture->enabled && $user->rights->facture->lire) +if (! empty($conf->facture->enabled) && $user->rights->facture->lire) { $sql = "SELECT f.facnumber, f.rowid, f.total_ttc, f.type,"; $sql.= " s.nom, s.rowid as socid"; @@ -250,7 +250,7 @@ if ($conf->facture->enabled && $user->rights->facture->lire) /** * Draft suppliers invoices */ -if ($conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire) +if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture->lire) { $sql = "SELECT f.facnumber, f.rowid, f.total_ttc, f.type,"; $sql.= " s.nom, s.rowid as socid"; @@ -320,7 +320,7 @@ print ''; print ''; // Last modified customer invoices -if ($conf->facture->enabled && $user->rights->facture->lire) +if (! empty($conf->facture->enabled) && $user->rights->facture->lire) { $langs->load("boxes"); $facstatic=new Facture($db); @@ -349,7 +349,7 @@ if ($conf->facture->enabled && $user->rights->facture->lire) print ''; print ''; - if ($conf->global->MAIN_SHOW_HT_ON_SUMMARY) print ''; + if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print ''; print ''; print ''; print ''; @@ -378,7 +378,7 @@ if ($conf->facture->enabled && $user->rights->facture->lire) $filename=dol_sanitizeFileName($obj->facnumber); $filedir=$conf->facture->dir_output . '/' . dol_sanitizeFileName($obj->facnumber); $urlsource=$_SERVER['PHP_SELF'].'?facid='.$obj->rowid; - $formfile->show_documents('facture',$filename,$filedir,$urlsource,'','','',1,'',1); + print $formfile->getDocumentsLink($facturestatic->element, $filename, $filedir); print '
'.$langs->trans("BoxTitleLastCustomerBills",$max).''.$langs->trans("AmountHT").''.$langs->trans("AmountHT").''.$langs->trans("AmountTTC").''.$langs->trans("DateModificationShort").' 
'; print ''; @@ -388,7 +388,7 @@ if ($conf->facture->enabled && $user->rights->facture->lire) $thirdpartystatic->client=1; print $thirdpartystatic->getNomUrl(1,'customer',44); print ''; - if ($conf->global->MAIN_SHOW_HT_ON_SUMMARY) print ''.price($obj->total).''; + if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print ''.price($obj->total).''; print ''.price($obj->total_ttc).''; print ''.dol_print_date($db->jdate($obj->tms),'day').''; print ''.$facstatic->LibStatut($obj->paye,$obj->fk_statut,3,$obj->am).''; @@ -404,7 +404,7 @@ if ($conf->facture->enabled && $user->rights->facture->lire) else { $colspan=5; - if ($conf->global->MAIN_SHOW_HT_ON_SUMMARY) $colspan++; + if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) $colspan++; print ''.$langs->trans("NoInvoice").''; } print '
'; @@ -419,7 +419,7 @@ if ($conf->facture->enabled && $user->rights->facture->lire) // Last modified supplier invoices -if ($conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire) +if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture->lire) { $langs->load("boxes"); $facstatic=new FactureFournisseur($db); @@ -446,7 +446,7 @@ if ($conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire) print ''; print ''; - if ($conf->global->MAIN_SHOW_HT_ON_SUMMARY) print ''; + if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print ''; print ''; print ''; print ''; @@ -469,7 +469,7 @@ if ($conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire) $thirdpartystatic->fournisseur=1; print $thirdpartystatic->getNomUrl(1,'supplier',44); print ''; - if ($conf->global->MAIN_SHOW_HT_ON_SUMMARY) print ''; + if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print ''; print ''; print ''; print ''; @@ -484,7 +484,7 @@ if ($conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire) else { $colspan=5; - if ($conf->global->MAIN_SHOW_HT_ON_SUMMARY) $colspan++; + if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) $colspan++; print ''; } print '
'.$langs->trans("BoxTitleLastSupplierBills",$max).''.$langs->trans("AmountHT").''.$langs->trans("AmountHT").''.$langs->trans("AmountTTC").''.$langs->trans("DateModificationShort").' '.price($obj->total_ht).''.price($obj->total_ht).''.price($obj->total_ttc).''.dol_print_date($db->jdate($obj->tms),'day').''.$facstatic->LibStatut($obj->paye,$obj->fk_statut,3).'
'.$langs->trans("NoInvoice").'

'; @@ -498,7 +498,7 @@ if ($conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire) // Last donations -if ($conf->don->enabled && $user->rights->societe->lire) +if (! empty($conf->don->enabled) && $user->rights->societe->lire) { include_once DOL_DOCUMENT_ROOT.'/compta/dons/class/don.class.php'; @@ -633,7 +633,7 @@ if (! empty($conf->deplacement->enabled) && $user->rights->deplacement->lire) /** * Social contributions to pay */ -if ($conf->tax->enabled && $user->rights->tax->charges->lire) +if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire) { if (!$socid) { @@ -709,7 +709,7 @@ if ($conf->tax->enabled && $user->rights->tax->charges->lire) /* * Customers orders to be billed */ -if ($conf->facture->enabled && $conf->commande->enabled && $user->rights->commande->lire) +if (! empty($conf->facture->enabled) && ! empty($conf->commande->enabled) && $user->rights->commande->lire) { $commandestatic=new Commande($db); $langs->load("orders"); @@ -742,7 +742,7 @@ if ($conf->facture->enabled && $conf->commande->enabled && $user->rights->comman print ''; print ""; print ''; - if ($conf->global->MAIN_SHOW_HT_ON_SUMMARY) print ''; + if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print ''; print ''; print ''; print ''; @@ -770,7 +770,7 @@ if ($conf->facture->enabled && $conf->commande->enabled && $user->rights->comman $filename=dol_sanitizeFileName($obj->ref); $filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref); $urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid; - $formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','',1,'',1); + print $formfile->getDocumentsLink($commandestatic->element, $filename, $filedir); print '
'.$langs->trans("OrdersToBill").' ('.$num.')'.$langs->trans("AmountHT").''.$langs->trans("AmountHT").''.$langs->trans("AmountTTC").''.$langs->trans("ToBill").' 
'; print ''; @@ -781,7 +781,7 @@ if ($conf->facture->enabled && $conf->commande->enabled && $user->rights->comman $societestatic->client=1; print $societestatic->getNomUrl(1,'customer',44); print ''; - if ($conf->global->MAIN_SHOW_HT_ON_SUMMARY) print ''.price($obj->total_ht).''; + if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print ''.price($obj->total_ht).''; print ''.price($obj->total_ttc).''; print ''.price($obj->total_ttc-$obj->tot_fttc).''; print ''.$commandestatic->LibStatut($obj->fk_statut,$obj->facture,3).''; @@ -795,7 +795,7 @@ if ($conf->facture->enabled && $conf->commande->enabled && $user->rights->comman } print ''.$langs->trans("Total").'   ('.$langs->trans("RemainderToBill").': '.price($tot_tobill).') '; - if ($conf->global->MAIN_SHOW_HT_ON_SUMMARY) print ''.price($tot_ht).''; + if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print ''.price($tot_ht).''; print ''.price($tot_ttc).''; print ''.price($tot_tobill).''; print ' '; @@ -813,7 +813,7 @@ if ($conf->facture->enabled && $conf->commande->enabled && $user->rights->comman /* * Unpaid customers invoices */ -if ($conf->facture->enabled && $user->rights->facture->lire) +if (! empty($conf->facture->enabled) && $user->rights->facture->lire) { $facstatic=new Facture($db); @@ -840,7 +840,7 @@ if ($conf->facture->enabled && $user->rights->facture->lire) print ''; print ''; - if ($conf->global->MAIN_SHOW_HT_ON_SUMMARY) print ''; + if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print ''; print ''; print ''; print ''; @@ -853,7 +853,6 @@ if ($conf->facture->enabled && $user->rights->facture->lire) { $obj = $db->fetch_object($resql); - print ''; print '
'.$langs->trans("BillsCustomersUnpaid",$num).' ('.$num.')'.$langs->trans("AmountHT").''.$langs->trans("AmountHT").''.$langs->trans("AmountTTC").''.$langs->trans("Received").' 
'; @@ -871,7 +870,7 @@ if ($conf->facture->enabled && $user->rights->facture->lire) $filename=dol_sanitizeFileName($obj->facnumber); $filedir=$conf->facture->dir_output . '/' . dol_sanitizeFileName($obj->facnumber); $urlsource=$_SERVER['PHP_SELF'].'?facid='.$obj->rowid; - $formfile->show_documents('facture',$filename,$filedir,$urlsource,'','','',1,'',1); + print $formfile->getDocumentsLink($facturestatic->element, $filename, $filedir); print '
'; print ''; @@ -881,7 +880,7 @@ if ($conf->facture->enabled && $user->rights->facture->lire) $societestatic->client=1; print $societestatic->getNomUrl(1,'customer',44); print ''; - if ($conf->global->MAIN_SHOW_HT_ON_SUMMARY) print ''.price($obj->total).''; + if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print ''.price($obj->total).''; print ''.price($obj->total_ttc).''; print ''.price($obj->am).''; print ''.$facstatic->LibStatut($obj->paye,$obj->fk_statut,3,$obj->am).''; @@ -895,7 +894,7 @@ if ($conf->facture->enabled && $user->rights->facture->lire) } print ''.$langs->trans("Total").'   ('.$langs->trans("RemainderToTake").': '.price($total_ttc-$totalam).') '; - if ($conf->global->MAIN_SHOW_HT_ON_SUMMARY) print ''.price($total).''; + if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print ''.price($total).''; print ''.price($total_ttc).''; print ''.price($totalam).''; print ' '; @@ -904,7 +903,7 @@ if ($conf->facture->enabled && $user->rights->facture->lire) else { $colspan=5; - if ($conf->global->MAIN_SHOW_HT_ON_SUMMARY) $colspan++; + if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) $colspan++; print ''.$langs->trans("NoInvoice").''; } print '
'; @@ -919,7 +918,7 @@ if ($conf->facture->enabled && $user->rights->facture->lire) /* * Unpayed supplier invoices */ -if ($conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire) +if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture->lire) { $facstatic=new FactureFournisseur($db); @@ -945,7 +944,7 @@ if ($conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire) print ''; print ''; - if ($conf->global->MAIN_SHOW_HT_ON_SUMMARY) print ''; + if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print ''; print ''; print ''; print ''; @@ -968,7 +967,7 @@ if ($conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire) $societestatic->nom=$obj->nom; $societestatic->client=0; print ''; - if ($conf->global->MAIN_SHOW_HT_ON_SUMMARY) print ''; + if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print ''; print ''; print ''; print ''; @@ -981,7 +980,7 @@ if ($conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire) } print ''; - if ($conf->global->MAIN_SHOW_HT_ON_SUMMARY) print ''; + if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print ''; print ''; print ''; print ''; @@ -990,7 +989,7 @@ if ($conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire) else { $colspan=5; - if ($conf->global->MAIN_SHOW_HT_ON_SUMMARY) $colspan++; + if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) $colspan++; print ''; } print '
'.$langs->trans("BillsSuppliersUnpaid",$num).' ('.$num.')'.$langs->trans("AmountHT").''.$langs->trans("AmountHT").''.$langs->trans("AmountTTC").''.$langs->trans("Paid").' '.$societestatic->getNomUrl(1, 'supplier', 44).''.price($obj->total_ht).''.price($obj->total_ht).''.price($obj->total_ttc).''.price($obj->am).''.$facstatic->LibStatut($obj->paye,$obj->fk_statut,3).'
'.$langs->trans("Total").'   ('.$langs->trans("RemainderToPay").': '.price($total_ttc-$totalam).') '.price($total).''.price($total).''.price($total_ttc).''.price($totalam).' 
'.$langs->trans("NoInvoice").'

'; diff --git a/htdocs/compta/localtax/class/localtax.class.php b/htdocs/compta/localtax/class/localtax.class.php index 3ad10ec2d08..a5afc66a9ef 100644 --- a/htdocs/compta/localtax/class/localtax.class.php +++ b/htdocs/compta/localtax/class/localtax.class.php @@ -464,12 +464,12 @@ class Localtax extends CommonObject $this->error=$langs->trans("ErrorFieldRequired",$langs->transnoentities("Amount")); return -4; } - if ($conf->banque->enabled && (empty($this->accountid) || $this->accountid <= 0)) + if (! empty($conf->banque->enabled) && (empty($this->accountid) || $this->accountid <= 0)) { $this->error=$langs->trans("ErrorFieldRequired",$langs->transnoentities("Account")); return -5; } - if ($conf->banque->enabled && (empty($this->paymenttype) || $this->paymenttype <= 0)) + if (! empty($conf->banque->enabled) && (empty($this->paymenttype) || $this->paymenttype <= 0)) { $this->error=$langs->trans("ErrorFieldRequired",$langs->transnoentities("PaymentMode")); return -5; @@ -496,7 +496,7 @@ class Localtax extends CommonObject if ($this->id > 0) { $ok=1; - if ($conf->banque->enabled) + if (! empty($conf->banque->enabled)) { // Insertion dans llx_bank require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; diff --git a/htdocs/compta/localtax/clients.php b/htdocs/compta/localtax/clients.php index e62dc08adc9..ed0b7e11752 100644 --- a/htdocs/compta/localtax/clients.php +++ b/htdocs/compta/localtax/clients.php @@ -107,7 +107,7 @@ if ($modetax==1) // Calculate on invoice for goods and services $nom=$langs->transcountry("LT2ReportByCustomersInInputOutputMode",$mysoc->country_code); $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1); $description=$langs->trans("RulesVATDue"); - if ($conf->global->MAIN_MODULE_COMPTABILITE) $description.='
'.$langs->trans("WarningDepositsNotIncluded"); + if (! empty($conf->global->MAIN_MODULE_COMPTABILITE)) $description.='
'.$langs->trans("WarningDepositsNotIncluded"); $description.=$fsearch; $description.='
('.$langs->trans("TaxModuleSetupToModifyRules",DOL_URL_ROOT.'/admin/taxes.php').')'; $builddate=time(); @@ -124,7 +124,7 @@ if ($modetax==0) // Invoice for goods, payment for services $nom=$langs->transcountry("LT2ReportByCustomersInInputOutputMode",$mysoc->country_code); $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1); $description=$langs->trans("RulesVATIn"); - if ($conf->global->MAIN_MODULE_COMPTABILITE) $description.='
'.$langs->trans("WarningDepositsNotIncluded"); + if (! empty($conf->global->MAIN_MODULE_COMPTABILITE)) $description.='
'.$langs->trans("WarningDepositsNotIncluded"); $description.=$fsearch; $description.='
('.$langs->trans("TaxModuleSetupToModifyRules",DOL_URL_ROOT.'/admin/taxes.php').')'; $builddate=time(); diff --git a/htdocs/compta/localtax/fiche.php b/htdocs/compta/localtax/fiche.php index cccee441ac5..ce8ce775cf3 100644 --- a/htdocs/compta/localtax/fiche.php +++ b/htdocs/compta/localtax/fiche.php @@ -168,7 +168,7 @@ if ($_GET["action"] == 'create') // Amount print ''.$langs->trans("Amount").''; - if ($conf->banque->enabled) + if (! empty($conf->banque->enabled)) { print ''.$langs->trans("Account").''; $form->select_comptes($_POST["accountid"],"accountid",0,"courant=1",1); // Affiche liste des comptes courant @@ -227,7 +227,7 @@ if ($id) print ''.$langs->trans("Amount").''.price($vatpayment->amount).''; - if ($conf->banque->enabled) + if (! empty($conf->banque->enabled)) { if ($vatpayment->fk_account > 0) { diff --git a/htdocs/compta/paiement.php b/htdocs/compta/paiement.php index 974b266354c..ed6e0c7f0aa 100644 --- a/htdocs/compta/paiement.php +++ b/htdocs/compta/paiement.php @@ -97,7 +97,7 @@ if ($action == 'add_paiement' || ($action == 'confirm_paiement' && $confirm=='ye $error++; } - if ($conf->banque->enabled) + if (! empty($conf->banque->enabled)) { // Si module bank actif, un compte est obligatoire lors de la saisie // d'un paiement @@ -245,7 +245,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie // Invoice with Paypal transaction // TODO add hook possibility (regis) - if ($conf->paypalplus->enabled && $conf->global->PAYPAL_ENABLE_TRANSACTION_MANAGEMENT && ! empty($facture->ref_int)) + if (! empty($conf->paypalplus->enabled) && $conf->global->PAYPAL_ENABLE_TRANSACTION_MANAGEMENT && ! empty($facture->ref_int)) { if (! empty($conf->global->PAYPAL_BANK_ACCOUNT)) $accountid=$conf->global->PAYPAL_BANK_ACCOUNT; $paymentnum=$facture->ref_int; @@ -385,7 +385,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie // Bank account print ''; - if ($conf->banque->enabled) + if (! empty($conf->banque->enabled)) { if ($facture->type != 2) print ''.$langs->trans('AccountToCredit').''; if ($facture->type == 2) print ''.$langs->trans('AccountToDebit').''; @@ -589,10 +589,10 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie { // print ''; print '

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


'; // print ''; diff --git a/htdocs/compta/paiement/class/paiement.class.php b/htdocs/compta/paiement/class/paiement.class.php index 74d891a7764..3d23f896c0e 100644 --- a/htdocs/compta/paiement/class/paiement.class.php +++ b/htdocs/compta/paiement/class/paiement.class.php @@ -192,7 +192,7 @@ class Paiement extends CommonObject // This payment might be this one or a previous one if ($paym['type']=='PRE') { - if ($conf->prelevement->enabled) + if (! empty($conf->prelevement->enabled)) { // TODO Check if this payment has a withdraw request // if not, $mustwait++; // This will disable automatic close on invoice to allow to process @@ -377,7 +377,7 @@ class Paiement extends CommonObject $bank_line_id=0; $this->fk_account=$accountid; - if ($conf->banque->enabled) + if (! empty($conf->banque->enabled)) { require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; diff --git a/htdocs/compta/paiement/fiche.php b/htdocs/compta/paiement/fiche.php index acd041cc5c3..96b13604708 100644 --- a/htdocs/compta/paiement/fiche.php +++ b/htdocs/compta/paiement/fiche.php @@ -29,7 +29,7 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT .'/core/modules/facture/modules_facture.php'; -if ($conf->banque->enabled) require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; +if (! empty($conf->banque->enabled)) require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; $langs->load('bills'); $langs->load('banks'); @@ -238,7 +238,7 @@ print $form->editfieldval("Note",'note',$object->note,$object,$user->rights->fac print ''; // Bank account -if ($conf->banque->enabled) +if (! empty($conf->banque->enabled)) { if ($object->bank_account) { @@ -355,7 +355,7 @@ print '
'; print '
'; -if ($conf->global->BILL_ADD_PAYMENT_VALIDATION) +if (! empty($conf->global->BILL_ADD_PAYMENT_VALIDATION)) { if ($user->societe_id == 0 && $object->statut == 0 && $_GET['action'] == '') { diff --git a/htdocs/compta/paiement/liste.php b/htdocs/compta/paiement/liste.php index 714d8a20d59..e1d460e0051 100644 --- a/htdocs/compta/paiement/liste.php +++ b/htdocs/compta/paiement/liste.php @@ -143,7 +143,7 @@ if ($resql) print_liste_field_titre($langs->trans("Account"),$_SERVER["PHP_SELF"],"ba.label","",$paramlist,"",$sortfield,$sortorder); print_liste_field_titre($langs->trans("Amount"),$_SERVER["PHP_SELF"],"p.amount","",$paramlist,'align="right"',$sortfield,$sortorder); //print_liste_field_titre($langs->trans("Invoices"),"","","",$paramlist,'align="left"',$sortfield,$sortorder); - if ($conf->global->BILL_ADD_PAYMENT_VALIDATION) + if (! empty($conf->global->BILL_ADD_PAYMENT_VALIDATION)) { print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"p.statut","",$paramlist,'align="right"',$sortfield,$sortorder); } @@ -168,7 +168,7 @@ if ($resql) print ''; print ''; print ''; - if ($conf->global->BILL_ADD_PAYMENT_VALIDATION) + if (! empty($conf->global->BILL_ADD_PAYMENT_VALIDATION)) { print ''; print ''; @@ -213,7 +213,7 @@ if ($resql) print ''; print ''.price($objp->amount).''; - if ($conf->global->BILL_ADD_PAYMENT_VALIDATION) + if (! empty($conf->global->BILL_ADD_PAYMENT_VALIDATION)) { print ''; if ($objp->statut == 0) print ''; diff --git a/htdocs/compta/paiement_charge.php b/htdocs/compta/paiement_charge.php index 8539e828ac5..ff53254f4aa 100755 --- a/htdocs/compta/paiement_charge.php +++ b/htdocs/compta/paiement_charge.php @@ -66,7 +66,7 @@ if ($_POST["action"] == 'add_payment') $mesg = $langs->trans("ErrorFieldRequired",$langs->transnoentities("Date")); $error++; } - if ($conf->banque->enabled && ! $_POST["accountid"] > 0) + if (! empty($conf->banque->enabled) && ! $_POST["accountid"] > 0) { $mesg = $langs->trans("ErrorFieldRequired",$langs->transnoentities("AccountToCredit")); $error++; diff --git a/htdocs/compta/payment_sc/fiche.php b/htdocs/compta/payment_sc/fiche.php index de865468d60..222c78a7f1d 100644 --- a/htdocs/compta/payment_sc/fiche.php +++ b/htdocs/compta/payment_sc/fiche.php @@ -30,7 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php' require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/paymentsocialcontribution.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/modules/facture/modules_facture.php'; -if ($conf->banque->enabled) require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; +if (! empty($conf->banque->enabled)) require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; $langs->load('bills'); $langs->load('banks'); @@ -189,7 +189,7 @@ print ''.$langs->trans('Amount').''.pr print ''.$langs->trans('Note').''.nl2br($paiement->note).''; // Bank account -if ($conf->banque->enabled) +if (! empty($conf->banque->enabled)) { if ($paiement->bank_account) { @@ -293,7 +293,7 @@ print '
'; print '
'; /* -if ($conf->global->BILL_ADD_PAYMENT_VALIDATION) +if (! empty($conf->global->BILL_ADD_PAYMENT_VALIDATION)) { if ($user->societe_id == 0 && $paiement->statut == 0 && $_GET['action'] == '') { diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index 0081af46ecf..11c575f701d 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -1185,7 +1185,7 @@ class BonPrelevement extends CommonObject if ($mysoc->country_code=='ES') { // TODO replace by a hook (external modules) - if ($conf->esaeb->enabled) + if (! empty($conf->esaeb->enabled)) { //Head $esaeb19 = new AEB19DocWritter; diff --git a/htdocs/compta/recap-compta.php b/htdocs/compta/recap-compta.php index c458f55813d..9b3cc8b487a 100644 --- a/htdocs/compta/recap-compta.php +++ b/htdocs/compta/recap-compta.php @@ -27,7 +27,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; $langs->load("companies"); -if ($conf->facture->enabled) $langs->load("bills"); +if (! empty($conf->facture->enabled)) $langs->load("bills"); // Security check $socid = $_GET["socid"]; @@ -79,7 +79,7 @@ if ($socid > 0) print '
'; - if ($conf->facture->enabled && $user->rights->facture->lire) + if (! empty($conf->facture->enabled) && $user->rights->facture->lire) { // Factures print_fiche_titre($langs->trans("CustomerPreview")); diff --git a/htdocs/compta/sociales/class/paymentsocialcontribution.class.php b/htdocs/compta/sociales/class/paymentsocialcontribution.class.php index 7bff88b37a4..cfbf7a91568 100644 --- a/htdocs/compta/sociales/class/paymentsocialcontribution.class.php +++ b/htdocs/compta/sociales/class/paymentsocialcontribution.class.php @@ -472,7 +472,7 @@ class PaymentSocialContribution extends CommonObject $error=0; - if ($conf->banque->enabled) + if (! empty($conf->banque->enabled)) { require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; diff --git a/htdocs/compta/stats/cabyuser.php b/htdocs/compta/stats/cabyuser.php index 31a86e475df..7087653459c 100644 --- a/htdocs/compta/stats/cabyuser.php +++ b/htdocs/compta/stats/cabyuser.php @@ -282,9 +282,9 @@ if (count($amount)) // Other stats print ''; - if ($conf->propal->enabled && $key>0) print ' 
'.img_picto($langs->trans("ProposalStats"),"stats").' '; - if ($conf->commande->enabled && $key>0) print ' '.img_picto($langs->trans("OrderStats"),"stats").' '; - if ($conf->facture->enabled && $key>0) print ' '.img_picto($langs->trans("InvoiceStats"),"stats").' '; + if (! empty($conf->propal->enabled) && $key>0) print ' '.img_picto($langs->trans("ProposalStats"),"stats").' '; + if (! empty($conf->commande->enabled) && $key>0) print ' '.img_picto($langs->trans("OrderStats"),"stats").' '; + if (! empty($conf->facture->enabled) && $key>0) print ' '.img_picto($langs->trans("InvoiceStats"),"stats").' '; print ''; print "\n"; diff --git a/htdocs/compta/stats/casoc.php b/htdocs/compta/stats/casoc.php index 3bf19f18942..1460cb185e5 100644 --- a/htdocs/compta/stats/casoc.php +++ b/htdocs/compta/stats/casoc.php @@ -292,9 +292,9 @@ if (count($amount)) // Other stats print ''; - if ($conf->propal->enabled && $key>0) print ' '.img_picto($langs->trans("ProposalStats"),"stats").' '; - if ($conf->commande->enabled && $key>0) print ' '.img_picto($langs->trans("OrderStats"),"stats").' '; - if ($conf->facture->enabled && $key>0) print ' '.img_picto($langs->trans("InvoiceStats"),"stats").' '; + if (! empty($conf->propal->enabled) && $key>0) print ' '.img_picto($langs->trans("ProposalStats"),"stats").' '; + if (! empty($conf->commande->enabled) && $key>0) print ' '.img_picto($langs->trans("OrderStats"),"stats").' '; + if (! empty($conf->facture->enabled) && $key>0) print ' '.img_picto($langs->trans("InvoiceStats"),"stats").' '; print ''; print "\n"; diff --git a/htdocs/compta/tva/class/tva.class.php b/htdocs/compta/tva/class/tva.class.php index 23d01de6631..7e2eeeebc0d 100644 --- a/htdocs/compta/tva/class/tva.class.php +++ b/htdocs/compta/tva/class/tva.class.php @@ -485,12 +485,12 @@ class Tva extends CommonObject $this->error=$langs->trans("ErrorFieldRequired",$langs->transnoentities("Amount")); return -4; } - if ($conf->banque->enabled && (empty($this->accountid) || $this->accountid <= 0)) + if (! empty($conf->banque->enabled) && (empty($this->accountid) || $this->accountid <= 0)) { $this->error=$langs->trans("ErrorFieldRequired",$langs->transnoentities("Account")); return -5; } - if ($conf->banque->enabled && (empty($this->paymenttype) || $this->paymenttype <= 0)) + if (! empty($conf->banque->enabled) && (empty($this->paymenttype) || $this->paymenttype <= 0)) { $this->error=$langs->trans("ErrorFieldRequired",$langs->transnoentities("PaymentMode")); return -5; @@ -525,7 +525,7 @@ class Tva extends CommonObject if ($this->id > 0) { $ok=1; - if ($conf->banque->enabled) + if (! empty($conf->banque->enabled)) { // Insertion dans llx_bank require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; diff --git a/htdocs/compta/tva/clients.php b/htdocs/compta/tva/clients.php index 71dbdb6c947..68bfe41d968 100644 --- a/htdocs/compta/tva/clients.php +++ b/htdocs/compta/tva/clients.php @@ -117,7 +117,7 @@ if ($modetax==1) // Calculate on invoice for goods and services $description.='
'; $description.=$langs->trans("RulesVATDueProducts"); //if ($conf->global->MAIN_MODULE_COMPTABILITE || $conf->global->MAIN_MODULE_ACCOUNTING) $description.='
'.img_warning().' '.$langs->trans('OptionVatInfoModuleComptabilite'); - //if ($conf->global->MAIN_MODULE_COMPTABILITE) $description.='
'.$langs->trans("WarningDepositsNotIncluded"); + //if (! empty($conf->global->MAIN_MODULE_COMPTABILITE)) $description.='
'.$langs->trans("WarningDepositsNotIncluded"); if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $description.='
'.$langs->trans("DepositsAreNotIncluded"); else $description.='
'.$langs->trans("DepositsAreIncluded"); $description.=$fsearch; @@ -147,7 +147,7 @@ if ($modetax==0) // Invoice for goods, payment for services if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $description.=' '.$langs->trans("DepositsAreNotIncluded"); else $description.=' '.$langs->trans("DepositsAreIncluded"); //if ($conf->global->MAIN_MODULE_COMPTABILITE || $conf->global->MAIN_MODULE_ACCOUNTING) $description.='
'.img_warning().' '.$langs->trans('OptionVatInfoModuleComptabilite'); - //if ($conf->global->MAIN_MODULE_COMPTABILITE) $description.='
'.$langs->trans("WarningDepositsNotIncluded"); + //if (! empty($conf->global->MAIN_MODULE_COMPTABILITE)) $description.='
'.$langs->trans("WarningDepositsNotIncluded"); $description.=$fsearch; $description.='
('.$langs->trans("TaxModuleSetupToModifyRules",DOL_URL_ROOT.'/admin/taxes.php').')'; $builddate=time(); diff --git a/htdocs/compta/tva/fiche.php b/htdocs/compta/tva/fiche.php index a5e1693c8f2..765b0d77fb8 100644 --- a/htdocs/compta/tva/fiche.php +++ b/htdocs/compta/tva/fiche.php @@ -172,7 +172,7 @@ if ($_GET["action"] == 'create') // Amount print ''.$langs->trans("Amount").''; - if ($conf->banque->enabled) + if (! empty($conf->banque->enabled)) { print ''.$langs->trans("Account").''; $form->select_comptes($_POST["accountid"],"accountid",0,"courant=1",1); // Affiche liste des comptes courant @@ -236,7 +236,7 @@ if ($id) print ''.$langs->trans("Amount").''.price($vatpayment->amount).''; - if ($conf->banque->enabled) + if (! empty($conf->banque->enabled)) { if ($vatpayment->fk_account > 0) { diff --git a/htdocs/compta/tva/quadri_detail.php b/htdocs/compta/tva/quadri_detail.php index 1bcd7cabb47..e323117091d 100644 --- a/htdocs/compta/tva/quadri_detail.php +++ b/htdocs/compta/tva/quadri_detail.php @@ -137,7 +137,7 @@ if ($modetax==1) // Calculate on invoice for goods and services $description.='
'; $description.=$langs->trans("RulesVATDueProducts"); //if ($conf->global->MAIN_MODULE_COMPTABILITE || $conf->global->MAIN_MODULE_ACCOUNTING) $description.='
'.img_warning().' '.$langs->trans('OptionVatInfoModuleComptabilite'); - //if ($conf->global->MAIN_MODULE_COMPTABILITE) $description.='
'.$langs->trans("WarningDepositsNotIncluded"); + //if (! empty($conf->global->MAIN_MODULE_COMPTABILITE)) $description.='
'.$langs->trans("WarningDepositsNotIncluded"); if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $description.='
'.$langs->trans("DepositsAreNotIncluded"); else $description.='
'.$langs->trans("DepositsAreIncluded"); $description.='
('.$langs->trans("TaxModuleSetupToModifyRules",DOL_URL_ROOT.'/admin/taxes.php').')'; @@ -174,7 +174,7 @@ if ($modetax==0) // Invoice for goods, payment for services if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $description.=' '.$langs->trans("DepositsAreNotIncluded"); else $description.=' '.$langs->trans("DepositsAreIncluded"); //if ($conf->global->MAIN_MODULE_COMPTABILITE || $conf->global->MAIN_MODULE_ACCOUNTING) $description.='
'.img_warning().' '.$langs->trans('OptionVatInfoModuleComptabilite'); - //if ($conf->global->MAIN_MODULE_COMPTABILITE) $description.='
'.$langs->trans("WarningDepositsNotIncluded"); + //if (! empty($conf->global->MAIN_MODULE_COMPTABILITE)) $description.='
'.$langs->trans("WarningDepositsNotIncluded"); $description.=$fsearch; $description.='
('.$langs->trans("TaxModuleSetupToModifyRules",DOL_URL_ROOT.'/admin/taxes.php').')'; $builddate=time(); diff --git a/htdocs/contact/canvas/actions_contactcard_common.class.php b/htdocs/contact/canvas/actions_contactcard_common.class.php index c839f7a24e1..bcfaa39be96 100644 --- a/htdocs/contact/canvas/actions_contactcard_common.class.php +++ b/htdocs/contact/canvas/actions_contactcard_common.class.php @@ -310,7 +310,7 @@ abstract class ActionsContactCardCommon if ($action == 'view' || $action == 'edit' || $action == 'delete') { // Emailing - if ($conf->mailing->enabled) + if (! empty($conf->mailing->enabled)) { $langs->load("mails"); $this->tpl['nb_emailing'] = $this->object->getNbOfEMailings(); @@ -322,25 +322,25 @@ abstract class ActionsContactCardCommon $this->object->load_ref_elements(); - if ($conf->commande->enabled) + if (! empty($conf->commande->enabled)) { $this->tpl['contact_element'][$i]['linked_element_label'] = $langs->trans("ContactForOrders"); $this->tpl['contact_element'][$i]['linked_element_value'] = $this->object->ref_commande?$this->object->ref_commande:$langs->trans("NoContactForAnyOrder"); $i++; } - if ($conf->propal->enabled) + if (! empty($conf->propal->enabled)) { $this->tpl['contact_element'][$i]['linked_element_label'] = $langs->trans("ContactForProposals"); $this->tpl['contact_element'][$i]['linked_element_value'] = $this->object->ref_propal?$this->object->ref_propal:$langs->trans("NoContactForAnyProposal"); $i++; } - if ($conf->contrat->enabled) + if (! empty($conf->contrat->enabled)) { $this->tpl['contact_element'][$i]['linked_element_label'] = $langs->trans("ContactForContracts"); $this->tpl['contact_element'][$i]['linked_element_value'] = $this->object->ref_contrat?$this->object->ref_contrat:$langs->trans("NoContactForAnyContract"); $i++; } - if ($conf->facture->enabled) + if (! empty($conf->facture->enabled)) { $this->tpl['contact_element'][$i]['linked_element_label'] = $langs->trans("ContactForInvoices"); $this->tpl['contact_element'][$i]['linked_element_value'] = $this->object->ref_facturation?$this->object->ref_facturation:$langs->trans("NoContactForAnyInvoice"); diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index 93ee8e61692..7e09f688d2a 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -331,9 +331,9 @@ class Contact extends CommonObject $this->fullname=$this->getFullName($langs); // Fields - if ($this->fullname && $conf->global->LDAP_CONTACT_FIELD_FULLNAME) $info[$conf->global->LDAP_CONTACT_FIELD_FULLNAME] = $this->fullname; - if ($this->lastname && $conf->global->LDAP_CONTACT_FIELD_NAME) $info[$conf->global->LDAP_CONTACT_FIELD_NAME] = $this->lastname; - if ($this->firstname && $conf->global->LDAP_CONTACT_FIELD_FIRSTNAME) $info[$conf->global->LDAP_CONTACT_FIELD_FIRSTNAME] = $this->firstname; + if ($this->fullname && ! empty($conf->global->LDAP_CONTACT_FIELD_FULLNAME)) $info[$conf->global->LDAP_CONTACT_FIELD_FULLNAME] = $this->fullname; + if ($this->lastname && ! empty($conf->global->LDAP_CONTACT_FIELD_NAME)) $info[$conf->global->LDAP_CONTACT_FIELD_NAME] = $this->lastname; + if ($this->firstname && ! empty($conf->global->LDAP_CONTACT_FIELD_FIRSTNAME)) $info[$conf->global->LDAP_CONTACT_FIELD_FIRSTNAME] = $this->firstname; if ($this->poste) $info["title"] = $this->poste; if ($this->socid > 0) @@ -346,16 +346,16 @@ class Contact extends CommonObject if ($soc->client == 2) $info["businessCategory"] = "Prospects"; if ($soc->fournisseur == 1) $info["businessCategory"] = "Suppliers"; } - if ($this->address && $conf->global->LDAP_CONTACT_FIELD_ADDRESS) $info[$conf->global->LDAP_CONTACT_FIELD_ADDRESS] = $this->address; - if ($this->cp && $conf->global->LDAP_CONTACT_FIELD_ZIP) $info[$conf->global->LDAP_CONTACT_FIELD_ZIP] = $this->cp; - if ($this->ville && $conf->global->LDAP_CONTACT_FIELD_TOWN) $info[$conf->global->LDAP_CONTACT_FIELD_TOWN] = $this->ville; - if ($this->country_code && $conf->global->LDAP_CONTACT_FIELD_COUNTRY) $info[$conf->global->LDAP_CONTACT_FIELD_COUNTRY] = $this->country_code; - if ($this->phone_pro && $conf->global->LDAP_CONTACT_FIELD_PHONE) $info[$conf->global->LDAP_CONTACT_FIELD_PHONE] = $this->phone_pro; - if ($this->phone_perso && $conf->global->LDAP_CONTACT_FIELD_HOMEPHONE) $info[$conf->global->LDAP_CONTACT_FIELD_HOMEPHONE] = $this->phone_perso; - if ($this->phone_mobile && $conf->global->LDAP_CONTACT_FIELD_MOBILE) $info[$conf->global->LDAP_CONTACT_FIELD_MOBILE] = $this->phone_mobile; - if ($this->fax && $conf->global->LDAP_CONTACT_FIELD_FAX) $info[$conf->global->LDAP_CONTACT_FIELD_FAX] = $this->fax; - if ($this->note && $conf->global->LDAP_CONTACT_FIELD_DESCRIPTION) $info[$conf->global->LDAP_CONTACT_FIELD_DESCRIPTION] = $this->note; - if ($this->email && $conf->global->LDAP_CONTACT_FIELD_MAIL) $info[$conf->global->LDAP_CONTACT_FIELD_MAIL] = $this->email; + if ($this->address && ! empty($conf->global->LDAP_CONTACT_FIELD_ADDRESS)) $info[$conf->global->LDAP_CONTACT_FIELD_ADDRESS] = $this->address; + if ($this->cp && ! empty($conf->global->LDAP_CONTACT_FIELD_ZIP)) $info[$conf->global->LDAP_CONTACT_FIELD_ZIP] = $this->cp; + if ($this->ville && ! empty($conf->global->LDAP_CONTACT_FIELD_TOWN)) $info[$conf->global->LDAP_CONTACT_FIELD_TOWN] = $this->ville; + if ($this->country_code && ! empty($conf->global->LDAP_CONTACT_FIELD_COUNTRY)) $info[$conf->global->LDAP_CONTACT_FIELD_COUNTRY] = $this->country_code; + if ($this->phone_pro && ! empty($conf->global->LDAP_CONTACT_FIELD_PHONE)) $info[$conf->global->LDAP_CONTACT_FIELD_PHONE] = $this->phone_pro; + if ($this->phone_perso && ! empty($conf->global->LDAP_CONTACT_FIELD_HOMEPHONE)) $info[$conf->global->LDAP_CONTACT_FIELD_HOMEPHONE] = $this->phone_perso; + if ($this->phone_mobile && ! empty($conf->global->LDAP_CONTACT_FIELD_MOBILE)) $info[$conf->global->LDAP_CONTACT_FIELD_MOBILE] = $this->phone_mobile; + if ($this->fax && ! empty($conf->global->LDAP_CONTACT_FIELD_FAX)) $info[$conf->global->LDAP_CONTACT_FIELD_FAX] = $this->fax; + if ($this->note && ! empty($conf->global->LDAP_CONTACT_FIELD_DESCRIPTION)) $info[$conf->global->LDAP_CONTACT_FIELD_DESCRIPTION] = $this->note; + if ($this->email && ! empty($conf->global->LDAP_CONTACT_FIELD_MAIL)) $info[$conf->global->LDAP_CONTACT_FIELD_MAIL] = $this->email; if ($conf->global->LDAP_SERVER_TYPE == 'egroupware') { diff --git a/htdocs/contact/fiche.php b/htdocs/contact/fiche.php index 03a356a8a72..07d2ee9e5c2 100644 --- a/htdocs/contact/fiche.php +++ b/htdocs/contact/fiche.php @@ -658,28 +658,28 @@ else $object->load_ref_elements(); - if ($conf->commande->enabled) + if (! empty($conf->commande->enabled)) { print ''.$langs->trans("ContactForOrders").''; print $object->ref_commande?$object->ref_commande:$langs->trans("NoContactForAnyOrder"); print ''; } - if ($conf->propal->enabled) + if (! empty($conf->propal->enabled)) { print ''.$langs->trans("ContactForProposals").''; print $object->ref_propal?$object->ref_propal:$langs->trans("NoContactForAnyProposal"); print ''; } - if ($conf->contrat->enabled) + if (! empty($conf->contrat->enabled)) { print ''.$langs->trans("ContactForContracts").''; print $object->ref_contrat?$object->ref_contrat:$langs->trans("NoContactForAnyContract"); print ''; } - if ($conf->facture->enabled) + if (! empty($conf->facture->enabled)) { print ''.$langs->trans("ContactForInvoices").''; print $object->ref_facturation?$object->ref_facturation:$langs->trans("NoContactForAnyInvoice"); @@ -744,7 +744,7 @@ else //array('label' => $form->textwithpicto($langs->trans("Type"),$langs->trans("InternalExternalDesc")), 'type' => 'select', 'name' => 'intern', 'default' => 1, 'values' => array(0=>$langs->trans('Internal'),1=>$langs->trans('External'))) ); $text=$langs->trans("ConfirmCreateContact").'
'; - if ($conf->societe->enabled) + if (! empty($conf->societe->enabled)) { if ($object->socid > 0) $text.=$langs->trans("UserWillBeExternalUser"); else $text.=$langs->trans("UserWillBeInternalUser"); @@ -823,7 +823,7 @@ else // Email print ''.$langs->trans("EMail").''.dol_print_email($object->email,$object->id,$object->socid,'AC_EMAIL').''; - if ($conf->mailing->enabled) + if (! empty($conf->mailing->enabled)) { $langs->load("mails"); print ''.$langs->trans("NbOfEMailingsReceived").''; @@ -857,28 +857,28 @@ else $object->load_ref_elements(); - if ($conf->commande->enabled) + if (! empty($conf->commande->enabled)) { print ''.$langs->trans("ContactForOrders").''; print $object->ref_commande?$object->ref_commande:$langs->trans("NoContactForAnyOrder"); print ''; } - if ($conf->propal->enabled) + if (! empty($conf->propal->enabled)) { print ''.$langs->trans("ContactForProposals").''; print $object->ref_propal?$object->ref_propal:$langs->trans("NoContactForAnyProposal"); print ''; } - if ($conf->contrat->enabled) + if (! empty($conf->contrat->enabled)) { print ''.$langs->trans("ContactForContracts").''; print $object->ref_contrat?$object->ref_contrat:$langs->trans("NoContactForAnyContract"); print ''; } - if ($conf->facture->enabled) + if (! empty($conf->facture->enabled)) { print ''.$langs->trans("ContactForInvoices").''; print $object->ref_facturation?$object->ref_facturation:$langs->trans("NoContactForAnyInvoice"); diff --git a/htdocs/contrat/fiche.php b/htdocs/contrat/fiche.php index 4c9ba902cd0..c402c184366 100644 --- a/htdocs/contrat/fiche.php +++ b/htdocs/contrat/fiche.php @@ -33,7 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/modules/contract/modules_contract.php'; if (! empty($conf->produit->enabled) || ! empty($conf->service->enabled)) require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; if (! empty($conf->propal->enabled)) require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; -if ($conf->projet->enabled) { +if (! empty($conf->projet->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; } @@ -618,7 +618,7 @@ if ($action == 'create') $form->select_date($datecontrat,'',0,0,'',"contrat"); print ""; - if ($conf->projet->enabled) + if (! empty($conf->projet->enabled)) { print ''.$langs->trans("Project").''; select_projects($soc->id,GETPOST("projectid"),"projectid"); @@ -767,7 +767,7 @@ else print ''.dol_print_date($object->date_contrat,"dayhour")."\n"; // Projet - if ($conf->projet->enabled) + if (! empty($conf->projet->enabled)) { $langs->load("projects"); print ''; @@ -1276,7 +1276,7 @@ else print ""; print ''; // multiprix - if($conf->global->PRODUIT_MULTIPRICES) + if (! empty($conf->global->PRODUIT_MULTIPRICES)) $form->select_produits('','idprod',1,$conf->product->limit_size,$object->thirdparty->price_level); else $form->select_produits('','idprod',1,$conf->product->limit_size); @@ -1359,7 +1359,7 @@ else else print ''.$langs->trans("Validate").''; } - if ($conf->facture->enabled && $object->statut > 0 && $object->nbofservicesclosed < $nbofservices) + if (! empty($conf->facture->enabled) && $object->statut > 0 && $object->nbofservicesclosed < $nbofservices) { $langs->load("bills"); if ($user->rights->facture->creer) print ''.$langs->trans("CreateBill").''; diff --git a/htdocs/core/admin_extrafields.inc.php b/htdocs/core/admin_extrafields.inc.php index 5384c3c4490..35492db4fdc 100644 --- a/htdocs/core/admin_extrafields.inc.php +++ b/htdocs/core/admin_extrafields.inc.php @@ -25,9 +25,9 @@ $maxsizestring=255; $maxsizeint=10; $extrasize=GETPOST('size'); -if (GETPOST('type')=='double' && strpos($extrasize,',')===false) $extrasize='24,8'; -if (GETPOST('type')=='date') $extrasize=''; -if (GETPOST('type')=='datetime') $extrasize=''; +if (GETPOST('type')=='double' && strpos($extrasize,',')===false) $extrasize='24,8'; +if (GETPOST('type')=='date') $extrasize=''; +if (GETPOST('type')=='datetime') $extrasize=''; // Add attribute @@ -38,10 +38,10 @@ if ($action == 'add') // Check values if (! GETPOST('type')) { - $error++; - $langs->load("errors"); - $mesg=$langs->trans("ErrorFieldRequired",$langs->trans("Type")); - $action = 'create'; + $error++; + $langs->load("errors"); + $mesg=$langs->trans("ErrorFieldRequired",$langs->trans("Type")); + $action = 'create'; } if (GETPOST('type')=='varchar' && $extrasize > $maxsizestring) diff --git a/htdocs/core/ajax/ziptown.php b/htdocs/core/ajax/ziptown.php index c9dfed825d6..eae960970a9 100644 --- a/htdocs/core/ajax/ziptown.php +++ b/htdocs/core/ajax/ziptown.php @@ -60,7 +60,7 @@ if (! empty($_GET['zipcode']) || ! empty($_GET['town'])) $zipcode = $_GET['zipcode']?$_GET['zipcode']:''; $town = $_GET['town']?$_GET['town']:''; - if ($conf->global->MAIN_USE_ZIPTOWN_DICTIONNARY) // Use zip-town table + if (! empty($conf->global->MAIN_USE_ZIPTOWN_DICTIONNARY)) // Use zip-town table { $sql = "SELECT z.rowid, z.zip, z.town, z.fk_county, z.fk_pays as fk_country"; $sql.= ", p.rowid as fk_country, p.code as country_code, p.libelle as country"; diff --git a/htdocs/core/boxes/box_activity.php b/htdocs/core/boxes/box_activity.php index 762d79bda25..5e4267bd12c 100644 --- a/htdocs/core/boxes/box_activity.php +++ b/htdocs/core/boxes/box_activity.php @@ -77,7 +77,7 @@ class box_activity extends ModeleBoxes $this->info_box_head = array('text' => $textHead, 'limit'=> dol_strlen($textHead)); // list the summary of the bills - if ($conf->facture->enabled && $user->rights->facture->lire) + if (! empty($conf->facture->enabled) && $user->rights->facture->lire) { $sql = "SELECT f.paye, f.fk_statut, sum(f.total_ttc) as Mnttot, count(*) as nb"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f"; @@ -133,7 +133,7 @@ class box_activity extends ModeleBoxes } // list the summary of the orders - if ($conf->commande->enabled && $user->rights->commande->lire) + if (! empty($conf->commande->enabled) && $user->rights->commande->lire) { $sql = "SELECT c.fk_statut,c.facture, sum(c.total_ttc) as Mnttot, count(*) as nb"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."commande as c"; @@ -175,7 +175,7 @@ class box_activity extends ModeleBoxes } // list the summary of the propals - if ($conf->propal->enabled && $user->rights->propal->lire) + if (! empty($conf->propal->enabled) && $user->rights->propal->lire) { $sql = "SELECT p.fk_statut, sum(p.total) as Mnttot, count(*) as nb"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."propal as p"; diff --git a/htdocs/core/boxes/box_produits.php b/htdocs/core/boxes/box_produits.php index f0645659062..627ffad350f 100644 --- a/htdocs/core/boxes/box_produits.php +++ b/htdocs/core/boxes/box_produits.php @@ -93,7 +93,7 @@ class box_produits extends ModeleBoxes $datem=$db->jdate($objp->tms); // Multilangs - if ($conf->global->MAIN_MULTILANGS) // si l'option est active + if (! empty($conf->global->MAIN_MULTILANGS)) // si l'option est active { $sqld = "SELECT label"; $sqld.= " FROM ".MAIN_DB_PREFIX."product_lang"; diff --git a/htdocs/core/boxes/box_services_contracts.php b/htdocs/core/boxes/box_services_contracts.php index d4a701ca5ef..ff082c23b23 100644 --- a/htdocs/core/boxes/box_services_contracts.php +++ b/htdocs/core/boxes/box_services_contracts.php @@ -105,7 +105,7 @@ class box_services_contracts extends ModeleBoxes $datem=$db->jdate($objp->datem); // Multilangs - if ($conf->global->MAIN_MULTILANGS) // si l'option est active + if (! empty($conf->global->MAIN_MULTILANGS)) // si l'option est active { $sqld = "SELECT label"; $sqld.= " FROM ".MAIN_DB_PREFIX."product_lang"; diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php index 2da3527aa6f..ae7efcac3b9 100644 --- a/htdocs/core/class/CMailFile.class.php +++ b/htdocs/core/class/CMailFile.class.php @@ -1050,7 +1050,7 @@ class CMailFile } if ($format == 0 || $format == 3) { - if ($conf->global->MAIN_MAIL_NO_FULL_EMAIL) $newemail='<'.$email.'>'; + if (! empty($conf->global->MAIN_MAIL_NO_FULL_EMAIL)) $newemail='<'.$email.'>'; elseif (! $name) $newemail='<'.$email.'>'; else $newemail=($format==3?'"':'').($encode?$this->encodetorfc2822($name):$name).($format==3?'"':'').' <'.$email.'>'; } diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index bf577e76229..29e58b35135 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -2959,9 +2959,9 @@ abstract class CommonObject print ''.$langs->trans('SellingPrice').''; print ''.$langs->trans('BuyingPrice').''; print ''.$langs->trans('Margin').''; - if($conf->global->DISPLAY_MARGIN_RATES) + if (! empty($conf->global->DISPLAY_MARGIN_RATES)) print ''.$langs->trans('MarginRate').''; - if($conf->global->DISPLAY_MARK_RATES) + if (! empty($conf->global->DISPLAY_MARK_RATES)) print ''.$langs->trans('MarkRate').''; print ''; //if ($marginInfo['margin_on_products'] != 0 && $marginInfo['margin_on_services'] != 0) { @@ -2970,9 +2970,9 @@ abstract class CommonObject print ''.price($marginInfo['pv_products']).''; print ''.price($marginInfo['pa_products']).''; print ''.price($marginInfo['margin_on_products']).''; - if($conf->global->DISPLAY_MARGIN_RATES) + if (! empty($conf->global->DISPLAY_MARGIN_RATES)) print ''.(($marginInfo['margin_rate_products'] == '')?'n/a':price($marginInfo['margin_rate_products']).'%').''; - if($conf->global->DISPLAY_MARK_RATES) + if (! empty($conf->global->DISPLAY_MARK_RATES)) print ''.(($marginInfo['mark_rate_products'] == '')?'n/a':price($marginInfo['mark_rate_products']).'%').''; print ''; print ''; @@ -2980,9 +2980,9 @@ abstract class CommonObject print ''.price($marginInfo['pv_services']).''; print ''.price($marginInfo['pa_services']).''; print ''.price($marginInfo['margin_on_services']).''; - if($conf->global->DISPLAY_MARGIN_RATES) + if (! empty($conf->global->DISPLAY_MARGIN_RATES)) print ''.(($marginInfo['margin_rate_services'] == '')?'n/a':price($marginInfo['margin_rate_services']).'%').''; - if($conf->global->DISPLAY_MARK_RATES) + if (! empty($conf->global->DISPLAY_MARK_RATES)) print ''.(($marginInfo['mark_rate_services'] == '')?'n/a':price($marginInfo['mark_rate_services']).'%').''; print ''; //} @@ -2991,9 +2991,9 @@ abstract class CommonObject print ''.price($marginInfo['pv_total']).''; print ''.price($marginInfo['pa_total']).''; print ''.price($marginInfo['total_margin']).''; - if($conf->global->DISPLAY_MARGIN_RATES) + if (! empty($conf->global->DISPLAY_MARGIN_RATES)) print ''.(($marginInfo['total_margin_rate'] == '')?'n/a':price($marginInfo['total_margin_rate']).'%').''; - if($conf->global->DISPLAY_MARK_RATES) + if (! empty($conf->global->DISPLAY_MARK_RATES)) print ''.(($marginInfo['total_mark_rate'] == '')?'n/a':price($marginInfo['total_mark_rate']).'%').''; print ''; print ''; diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index af20aaf1a03..92c38a2d408 100755 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -483,7 +483,7 @@ class ExtraFields else if ($type == 'text') { require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor=new DolEditor('options_'.$key,$value,'',200,'dolibarr_notes','In',false,false,$conf->fckeditor->enabled && $conf->global->FCKEDITOR_ENABLE_SOCIETE,5,100); + $doleditor=new DolEditor('options_'.$key,$value,'',200,'dolibarr_notes','In',false,false,! empty($conf->fckeditor->enabled) && $conf->global->FCKEDITOR_ENABLE_SOCIETE,5,100); $out=$doleditor->Create(1); } // Add comments diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index d2eb3c0f4af..299df8afdf1 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -369,8 +369,8 @@ class Form else $paramfortooltiptd =($extracss?' class="'.$extracss.'"':''); // Attribut to put on td text tag $s=""; if (empty($notabs)) $s.=''; - if ($direction < 0) $s.='<'.$tag.$paramfortooltipimg.' valign="top" width="14">'.$img.''; - if ($text != '') $s.='<'.$tag.$paramfortooltiptd.'>'.(($direction < 0)?' ':'').$text.(($direction > 0)?' ':'').''; + if ($direction < 0) $s.='<'.$tag.$paramfortooltipimg.' valign="top" width="14">'.$img.''; + if ($text != '') $s.='<'.$tag.$paramfortooltiptd.'>'.(($direction < 0)?' ':'').$text.(($direction > 0)?' ':'').''; if ($direction > 0) $s.='<'.$tag.$paramfortooltipimg.' valign="top" width="14">'.$img.''; if (empty($notabs)) $s.='
'; diff --git a/htdocs/core/class/html.formbarcode.class.php b/htdocs/core/class/html.formbarcode.class.php index 5a9ab8b6ee8..86ef77b3536 100644 --- a/htdocs/core/class/html.formbarcode.class.php +++ b/htdocs/core/class/html.formbarcode.class.php @@ -74,8 +74,8 @@ class FormBarCode } // We check if barcode is already selected by default - if ((($conf->product->enabled || $conf->service->enabled) && $conf->global->PRODUIT_DEFAULT_BARCODE_TYPE == $code_id) || - ($conf->societe->enabled && $conf->global->GENBARCODE_BARCODETYPE_THIRDPARTY == $code_id)) + if (((! empty($conf->product->enabled) || ! empty($conf->service->enabled)) && $conf->global->PRODUIT_DEFAULT_BARCODE_TYPE == $code_id) || + (! empty($conf->societe->enabled) && $conf->global->GENBARCODE_BARCODETYPE_THIRDPARTY == $code_id)) { $disable = 'disabled="disabled"'; } diff --git a/htdocs/core/class/html.formcompany.class.php b/htdocs/core/class/html.formcompany.class.php index b848d6b2759..f4eca4bc09b 100644 --- a/htdocs/core/class/html.formcompany.class.php +++ b/htdocs/core/class/html.formcompany.class.php @@ -521,7 +521,7 @@ class FormCompany $sql = "SELECT s.rowid, s.nom FROM"; $sql.= " ".MAIN_DB_PREFIX."societe as s"; $sql.= " WHERE s.entity IN (".getEntity('societe', 1).")"; - if ($selected && $conf->use_javascript_ajax && $conf->global->COMPANY_USE_SEARCH_TO_SELECT) $sql.= " AND rowid = ".$selected; + if ($selected && $conf->use_javascript_ajax && ! empty($conf->global->COMPANY_USE_SEARCH_TO_SELECT)) $sql.= " AND rowid = ".$selected; else { // For ajax search we limit here. For combo list, we limit later @@ -536,7 +536,7 @@ class FormCompany $resql = $this->db->query($sql); if ($resql) { - if ($conf->use_javascript_ajax && $conf->global->COMPANY_USE_SEARCH_TO_SELECT) + if ($conf->use_javascript_ajax && ! empty($conf->global->COMPANY_USE_SEARCH_TO_SELECT)) { $minLength = (is_numeric($conf->global->COMPANY_USE_SEARCH_TO_SELECT)?$conf->global->COMPANY_USE_SEARCH_TO_SELECT:2); diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index edef760ec00..07f51ebd72c 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -65,7 +65,7 @@ class FormFile { global $conf,$langs; - if ($conf->global->MAIN_USE_JQUERY_FILEUPLOAD) + if (! empty($conf->global->MAIN_USE_JQUERY_FILEUPLOAD)) { return $this->_formAjaxFileUpload($object); } @@ -199,9 +199,9 @@ class FormFile global $langs,$bc,$conf; - // For backward compatibility - if (! empty($iconPDF)) { - return $this->getDocumentsLink($modulepart, $filename, $filedir); + // For backward compatibility + if (! empty($iconPDF)) { + return $this->getDocumentsLink($modulepart, $filename, $filedir); } $forname='builddoc'; @@ -470,15 +470,15 @@ class FormFile if (preg_match('/text/',$mime)) $out.= ' target="_blank"'; $out.= '>'; $out.= img_mime($file["name"],$langs->trans("File").': '.$file["name"]).' '.dol_trunc($file["name"],$maxfilenamelength); - $out.= ''."\n"; + $out.= ''."\n"; $out.= ''; - + // Show file size - $size=(! empty($file['size'])?$file['size']:dol_filesize($filedir."/".$file["name"])); + $size=(! empty($file['size'])?$file['size']:dol_filesize($filedir."/".$file["name"])); $out.= ''.dol_print_size($size).''; - + // Show file date - $date=(! empty($file['date'])?$file['date']:dol_filemtime($filedir."/".$file["name"])); + $date=(! empty($file['date'])?$file['date']:dol_filemtime($filedir."/".$file["name"])); $out.= ''.dol_print_date($date, 'dayhour').''; if ($delallowed) @@ -526,35 +526,39 @@ class FormFile } $out=''; - + + $this->numoffiles=0; + $file_list=dol_dir_list($filedir, 'files', 0, $filename.'.pdf', '\.meta$|\.png$'); - // For ajax treatment + // For ajax treatment $out.= '
'.img_picto('', 'refresh').'
'."\n"; if (! empty($file_list)) { - // Loop on each file found - foreach($file_list as $file) - { - // Define relative path for download link (depends on module) - $relativepath=$file["name"]; // Cas general - if ($filename) $relativepath=$filename."/".$file["name"]; // Cas propal, facture... - // Autre cas - if ($modulepart == 'donation') { - $relativepath = get_exdir($filename,2).$file["name"]; - } - if ($modulepart == 'export') { - $relativepath = $file["name"]; - } - - // Show file name with link to download - $out.= 'numoffiles++; } } diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index df775c55cd7..174b76231da 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -567,7 +567,7 @@ class FormMail elseif (! is_numeric($this->withbody)) { $defaultmessage=$this->withbody; } // Complete substitution array - if ($conf->paypal->enabled && $conf->global->PAYPAL_ADD_PAYMENT_URL) + if (! empty($conf->paypal->enabled) && ! empty($conf->global->PAYPAL_ADD_PAYMENT_URL)) { require_once DOL_DOCUMENT_ROOT.'/paypal/lib/paypal.lib.php'; diff --git a/htdocs/core/class/ldap.class.php b/htdocs/core/class/ldap.class.php index 35da1b90beb..9e06d62ff74 100644 --- a/htdocs/core/class/ldap.class.php +++ b/htdocs/core/class/ldap.class.php @@ -107,8 +107,8 @@ class Ldap global $conf; //Server - if ($conf->global->LDAP_SERVER_HOST) $this->server[] = $conf->global->LDAP_SERVER_HOST; - if ($conf->global->LDAP_SERVER_HOST_SLAVE) $this->server[] = $conf->global->LDAP_SERVER_HOST_SLAVE; + if (! empty($conf->global->LDAP_SERVER_HOST)) $this->server[] = $conf->global->LDAP_SERVER_HOST; + if (! empty($conf->global->LDAP_SERVER_HOST_SLAVE)) $this->server[] = $conf->global->LDAP_SERVER_HOST_SLAVE; $this->serverPort = $conf->global->LDAP_SERVER_PORT; $this->ldapProtocolVersion = $conf->global->LDAP_SERVER_PROTOCOLVERSION; $this->dn = $conf->global->LDAP_SERVER_DN; diff --git a/htdocs/core/lib/agenda.lib.php b/htdocs/core/lib/agenda.lib.php index 30989a272e7..990fee14ae9 100644 --- a/htdocs/core/lib/agenda.lib.php +++ b/htdocs/core/lib/agenda.lib.php @@ -47,7 +47,7 @@ function print_actions_filter($form,$canedit,$status,$year,$month,$day,$showbirt global $conf,$langs,$db; // Filters - if ($canedit || $conf->projet->enabled) + if ($canedit || ! empty($conf->projet->enabled)) { print ''; print ''; @@ -57,7 +57,7 @@ function print_actions_filter($form,$canedit,$status,$year,$month,$day,$showbirt print ''; print ''; print ''; - if ($canedit || $conf->projet->enabled) + if ($canedit || ! empty($conf->projet->enabled)) { print ''; } - if ($conf->projet->enabled) + if (! empty($conf->projet->enabled)) { print ''; print ''; - if ($conf->agenda->enabled && $user->rights->agenda->myactions->create) + if (! empty($conf->agenda->enabled) && $user->rights->agenda->myactions->create) { print ''; // Propals - if ($conf->propal->enabled && $user->rights->propale->lire) + if (! empty($conf->propal->enabled) && $user->rights->propale->lire) { $ret=$product->load_stats_propale($socid); if ($ret < 0) dol_print_error($db); @@ -206,7 +206,7 @@ function show_stats_for_company($product,$socid) print ''; } // Commandes clients - if ($conf->commande->enabled && $user->rights->commande->lire) + if (! empty($conf->commande->enabled) && $user->rights->commande->lire) { $ret=$product->load_stats_commande($socid); if ($ret < 0) dol_print_error($db); @@ -223,7 +223,7 @@ function show_stats_for_company($product,$socid) print ''; } // Commandes fournisseurs - if ($conf->fournisseur->enabled && $user->rights->fournisseur->commande->lire) + if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->commande->lire) { $ret=$product->load_stats_commande_fournisseur($socid); if ($ret < 0) dol_print_error($db); @@ -240,7 +240,7 @@ function show_stats_for_company($product,$socid) print ''; } // Contrats - if ($conf->contrat->enabled && $user->rights->contrat->lire) + if (! empty($conf->contrat->enabled) && $user->rights->contrat->lire) { $ret=$product->load_stats_contrat($socid); if ($ret < 0) dol_print_error($db); @@ -257,7 +257,7 @@ function show_stats_for_company($product,$socid) print ''; } // Factures clients - if ($conf->facture->enabled && $user->rights->facture->lire) + if (! empty($conf->facture->enabled) && $user->rights->facture->lire) { $ret=$product->load_stats_facture($socid); if ($ret < 0) dol_print_error($db); @@ -274,7 +274,7 @@ function show_stats_for_company($product,$socid) print ''; } // Factures fournisseurs - if ($conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire) + if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture->lire) { $ret=$product->load_stats_facture_fournisseur($socid); if ($ret < 0) dol_print_error($db); diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index 3f8e5831d9d..563d3b638e0 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -48,8 +48,9 @@ function project_prepare_head($object) $head[$h][2] = 'contact'; $h++; - if ($conf->fournisseur->enabled || $conf->propal->enabled || $conf->commande->enabled || $conf->facture->enabled || $conf->contrat->enabled - || $conf->ficheinter->enabled || $conf->agenda->enabled || $conf->deplacement->enabled) + if (! empty($conf->fournisseur->enabled) || ! empty($conf->propal->enabled) || ! empty($conf->commande->enabled) + || ! empty($conf->facture->enabled) || ! empty($conf->contrat->enabled) + || ! empty($conf->ficheinter->enabled) || ! empty($conf->agenda->enabled) || ! empty($conf->deplacement->enabled)) { $head[$h][0] = DOL_URL_ROOT.'/projet/element.php?id='.$object->id; $head[$h][1] = $langs->trans("Referers"); diff --git a/htdocs/core/lib/propal.lib.php b/htdocs/core/lib/propal.lib.php index ca30e8631f1..a0922fc4c4c 100644 --- a/htdocs/core/lib/propal.lib.php +++ b/htdocs/core/lib/propal.lib.php @@ -43,9 +43,8 @@ function propal_prepare_head($object) $head[$h][2] = 'comm'; $h++; - if ((!$conf->commande->enabled && - (($conf->expedition_bon->enabled && $user->rights->expedition->lire) - || ($conf->livraison_bon->enabled && $user->rights->expedition->livraison->lire)))) + if ((empty($conf->commande->enabled) && ((! empty($conf->expedition_bon->enabled) && $user->rights->expedition->lire) + || (! empty($conf->livraison_bon->enabled) && $user->rights->expedition->livraison->lire)))) { $langs->load("sendings"); $head[$h][0] = DOL_URL_ROOT.'/expedition/propal.php?id='.$object->id; @@ -62,7 +61,7 @@ function propal_prepare_head($object) $head[$h][2] = 'preview'; $h++; } - + if (empty($conf->global->MAIN_DISABLE_CONTACTS_TAB)) { $head[$h][0] = DOL_URL_ROOT.'/comm/propal/contact.php?id='.$object->id; diff --git a/htdocs/core/lib/security2.lib.php b/htdocs/core/lib/security2.lib.php index 3d1b69279f6..5f402fad68c 100644 --- a/htdocs/core/lib/security2.lib.php +++ b/htdocs/core/lib/security2.lib.php @@ -432,7 +432,7 @@ function getRandomPassword($generic=false) $generated_password=''; if ($generic) $generated_password=dol_hash(mt_rand()); - else if ($conf->global->USER_PASSWORD_GENERATED) + else if (! empty($conf->global->USER_PASSWORD_GENERATED)) { $nomclass="modGeneratePass".ucfirst($conf->global->USER_PASSWORD_GENERATED); $nomfichier=$nomclass.".class.php"; diff --git a/htdocs/core/lib/stock.lib.php b/htdocs/core/lib/stock.lib.php index caf9d7ef43d..7fb81297cb3 100644 --- a/htdocs/core/lib/stock.lib.php +++ b/htdocs/core/lib/stock.lib.php @@ -52,7 +52,7 @@ function stock_prepare_head($object) */ /* Disabled because will never be implemented. Table always empty. - if ($conf->global->STOCK_USE_WAREHOUSE_BY_USER) + if (! empty($conf->global->STOCK_USE_WAREHOUSE_BY_USER)) { // Should not be enabled by defaut because does not work yet correctly because // personnal stocks are not tagged into table llx_entrepot diff --git a/htdocs/core/lib/tax.lib.php b/htdocs/core/lib/tax.lib.php index 7bd6e542a42..eab91d27d4b 100644 --- a/htdocs/core/lib/tax.lib.php +++ b/htdocs/core/lib/tax.lib.php @@ -106,7 +106,7 @@ function vat_by_thirdparty($db, $y, $date_start, $date_end, $modetax, $direction if ($modetax == 1) { // If vat paid on due invoices (non draft) - if ($conf->global->MAIN_MODULE_ACCOUNTING) + if (! empty($conf->global->MAIN_MODULE_ACCOUNTING)) { // TODO a ce jour on se sait pas la compter car le montant tva d'un payment // n'est pas stocke dans la table des payments. @@ -115,7 +115,7 @@ function vat_by_thirdparty($db, $y, $date_start, $date_end, $modetax, $direction // detail part tva et part ht). $sql = 'TODO'; } - if ($conf->global->MAIN_MODULE_COMPTABILITE) + if (! empty($conf->global->MAIN_MODULE_COMPTABILITE)) { $sql = "SELECT s.rowid as socid, s.nom as nom, s.siren as tva_intra, s.tva_assuj as assuj,"; $sql.= " sum(fd.total_ht) as amount, sum(fd.".$total_tva.") as tva,"; @@ -145,7 +145,7 @@ function vat_by_thirdparty($db, $y, $date_start, $date_end, $modetax, $direction } else { - if ($conf->global->MAIN_MODULE_ACCOUNTING) + if (! empty($conf->global->MAIN_MODULE_ACCOUNTING)) { // If vat paid on payments // TODO a ce jour on se sait pas la compter car le montant tva d'un payment @@ -155,7 +155,7 @@ function vat_by_thirdparty($db, $y, $date_start, $date_end, $modetax, $direction // detail part tva et part ht). $sql = 'TODO'; } - if ($conf->global->MAIN_MODULE_COMPTABILITE) + if (! empty($conf->global->MAIN_MODULE_COMPTABILITE)) { // Tva sur factures payes (should be on payment) /* $sql = "SELECT s.rowid as socid, s.nom as nom, s.tva_intra as tva_intra, s.tva_assuj as assuj,"; @@ -262,7 +262,7 @@ function vat_by_date($db, $y, $q, $date_start, $date_end, $modetax, $direction, $sql=''; if ($modetax == 1) // Option vat on delivery for goods (payment) and debit invoice for services { - if ($conf->global->MAIN_MODULE_ACCOUNTING) + if (! empty($conf->global->MAIN_MODULE_ACCOUNTING)) { // TODO a ce jour on se sait pas la compter car le montant tva d'un payment // n'est pas stocke dans la table des payments. @@ -271,7 +271,7 @@ function vat_by_date($db, $y, $q, $date_start, $date_end, $modetax, $direction, // detail part tva et part ht). $sql='TODO'; } - if ($conf->global->MAIN_MODULE_COMPTABILITE) + if (! empty($conf->global->MAIN_MODULE_COMPTABILITE)) { // Count on delivery date (use invoice date as delivery is unknown) $sql = "SELECT d.rowid, d.product_type as dtype, d.".$fk_facture." as facid, d.tva_tx as rate, d.total_ht as total_ht, d.total_ttc as total_ttc, d.".$total_tva." as total_vat, d.description as descr,"; @@ -307,7 +307,7 @@ function vat_by_date($db, $y, $q, $date_start, $date_end, $modetax, $direction, } else // Option vat on delivery for goods (payments) and payments for services { - if ($conf->global->MAIN_MODULE_ACCOUNTING) + if (! empty($conf->global->MAIN_MODULE_ACCOUNTING)) { // TODO a ce jour on se sait pas la compter car le montant tva d'un payment // n'est pas stocke dans la table des payments. @@ -316,7 +316,7 @@ function vat_by_date($db, $y, $q, $date_start, $date_end, $modetax, $direction, // detail part tva et part ht). $sql='TODO'; } - if ($conf->global->MAIN_MODULE_COMPTABILITE) + if (! empty($conf->global->MAIN_MODULE_COMPTABILITE)) { // Count on delivery date (use invoice date as delivery is unknown) $sql = "SELECT d.rowid, d.product_type as dtype, d.".$fk_facture." as facid, d.tva_tx as rate, d.total_ht as total_ht, d.total_ttc as total_ttc, d.".$total_tva." as total_vat, d.description as descr,"; @@ -419,7 +419,7 @@ function vat_by_date($db, $y, $q, $date_start, $date_end, $modetax, $direction, $sql=''; if ($modetax == 1) // Option vat on delivery for goods (payment) and debit invoice for services { - if ($conf->global->MAIN_MODULE_ACCOUNTING) + if (! empty($conf->global->MAIN_MODULE_ACCOUNTING)) { // Count on invoice date // TODO a ce jour on se sait pas la compter car le montant tva d'un payment @@ -429,7 +429,7 @@ function vat_by_date($db, $y, $q, $date_start, $date_end, $modetax, $direction, // detail part tva et part ht). $sql='TODO'; } - if ($conf->global->MAIN_MODULE_COMPTABILITE) + if (! empty($conf->global->MAIN_MODULE_COMPTABILITE)) { // Count on invoice date $sql = "SELECT d.rowid, d.product_type as dtype, d.".$fk_facture." as facid, d.tva_tx as rate, d.total_ht as total_ht, d.total_ttc as total_ttc, d.".$total_tva." as total_vat, d.description as descr,"; @@ -465,7 +465,7 @@ function vat_by_date($db, $y, $q, $date_start, $date_end, $modetax, $direction, } else // Option vat on delivery for goods (payments) and payments for services { - if ($conf->global->MAIN_MODULE_ACCOUNTING) + if (! empty($conf->global->MAIN_MODULE_ACCOUNTING)) { // Count on payments date // TODO a ce jour on se sait pas la compter car le montant tva d'un payment @@ -475,7 +475,7 @@ function vat_by_date($db, $y, $q, $date_start, $date_end, $modetax, $direction, // detail part tva et part ht). $sql='TODO'; } - if ($conf->global->MAIN_MODULE_COMPTABILITE) + if (! empty($conf->global->MAIN_MODULE_COMPTABILITE)) { // Count on payments date $sql = "SELECT d.rowid, d.product_type as dtype, d.".$fk_facture." as facid, d.tva_tx as rate, d.total_ht as total_ht, d.total_ttc as total_ttc, d.".$total_tva." as total_vat, d.description as descr,"; diff --git a/htdocs/core/login/functions_ldap.php b/htdocs/core/login/functions_ldap.php index e38e33e2c79..f39ce16b629 100644 --- a/htdocs/core/login/functions_ldap.php +++ b/htdocs/core/login/functions_ldap.php @@ -146,7 +146,7 @@ function check_user_password_ldap($usertotest,$passwordtotest,$entitytotest) $login=$usertotest; // ldap2dolibarr synchronisation - if ($login && $conf->ldap->enabled && $conf->global->LDAP_SYNCHRO_ACTIVE == 'ldap2dolibarr') + if ($login && ! empty($conf->ldap->enabled) && $conf->global->LDAP_SYNCHRO_ACTIVE == 'ldap2dolibarr') { // On charge les attributs du user ldap if ($ldapdebug) print "DEBUG: login ldap = ".$login."
\n"; diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 512c358b3c3..e6f170cb7a4 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -124,9 +124,9 @@ function print_eldy_menu($db,$atarget,$type_user) $classname = 'class="tmenu"'; } $chaine=""; - if ($conf->product->enabled) { $chaine.=$langs->trans("Products"); } - if ($conf->product->enabled && $conf->service->enabled) { $chaine.="/"; } - if ($conf->service->enabled) { $chaine.=$langs->trans("Services"); } + if (! empty($conf->product->enabled)) { $chaine.=$langs->trans("Products"); } + if (! empty($conf->product->enabled) && ! empty($conf->service->enabled)) { $chaine.="/"; } + if (! empty($conf->service->enabled)) { $chaine.=$langs->trans("Services"); } $idsel='products'; if ($user->rights->produit->lire || $user->rights->service->lire) @@ -738,7 +738,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after) if ($mainmenu == 'companies') { // Societes - if ($conf->societe->enabled) + if (! empty($conf->societe->enabled)) { $langs->load("companies"); $newmenu->add("/societe/index.php?leftmenu=thirdparties", $langs->trans("ThirdParty"), 0, $user->rights->societe->lire, '', $mainmenu, 'thirdparties'); @@ -751,7 +751,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after) } // Prospects - if ($conf->societe->enabled && empty($conf->global->SOCIETE_DISABLE_PROSPECTS)) + if (! empty($conf->societe->enabled) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS)) { $langs->load("commercial"); $newmenu->add("/comm/prospect/list.php?leftmenu=prospects", $langs->trans("ListProspectsShort"), 1, $user->rights->societe->lire, '', $mainmenu, 'prospects'); @@ -767,7 +767,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after) } // Clients - if ($conf->societe->enabled) + if (! empty($conf->societe->enabled)) { $langs->load("commercial"); $newmenu->add("/comm/list.php?leftmenu=customers", $langs->trans("ListCustomersShort"), 1, $user->rights->societe->lire, '', $mainmenu, 'customers'); @@ -777,7 +777,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after) } // Fournisseurs - if ($conf->societe->enabled && $conf->fournisseur->enabled) + if (! empty($conf->societe->enabled) && ! empty($conf->fournisseur->enabled)) { $langs->load("suppliers"); $newmenu->add("/fourn/liste.php?leftmenu=suppliers", $langs->trans("ListSuppliersShort"), 1, $user->rights->fournisseur->lire, '', $mainmenu, 'suppliers'); @@ -796,12 +796,12 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after) $newmenu->add("/contact/list.php?leftmenu=contacts", $langs->trans("List"), 1, $user->rights->societe->contact->lire); if (empty($conf->global->SOCIETE_DISABLE_PROSPECTS)) $newmenu->add("/contact/list.php?leftmenu=contacts&type=p", $langs->trans("Prospects"), 2, $user->rights->societe->contact->lire); $newmenu->add("/contact/list.php?leftmenu=contacts&type=c", $langs->trans("Customers"), 2, $user->rights->societe->contact->lire); - if ($conf->fournisseur->enabled) $newmenu->add("/contact/list.php?leftmenu=contacts&type=f", $langs->trans("Suppliers"), 2, $user->rights->societe->contact->lire); + if (! empty($conf->fournisseur->enabled)) $newmenu->add("/contact/list.php?leftmenu=contacts&type=f", $langs->trans("Suppliers"), 2, $user->rights->societe->contact->lire); $newmenu->add("/contact/list.php?leftmenu=contacts&type=o", $langs->trans("Others"), 2, $user->rights->societe->contact->lire); //$newmenu->add("/contact/list.php?userid=$user->id", $langs->trans("MyContacts"), 1, $user->rights->societe->contact->lire); // Categories - if ($conf->categorie->enabled) + if (! empty($conf->categorie->enabled)) { $langs->load("categories"); // Categories prospects/customers @@ -811,7 +811,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after) $newmenu->add("/categories/fiche.php?action=create&type=2", $langs->trans("NewCategory"), 1, $user->rights->categorie->creer); } // Categories suppliers - if ($conf->fournisseur->enabled) + if (! empty($conf->fournisseur->enabled)) { $newmenu->add("/categories/index.php?leftmenu=cat&type=1", $langs->trans("SuppliersCategoriesShort"), 0, $user->rights->categorie->lire); if (empty($user->societe_id)) @@ -856,7 +856,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after) $newmenu->add("/commande/liste.php?leftmenu=orders", $langs->trans("List"), 1, $user->rights->commande->lire); if ($leftmenu=="orders") $newmenu->add("/commande/liste.php?leftmenu=orders&viewstatut=0", $langs->trans("StatusOrderDraftShort"), 2, $user->rights->commande->lire); if ($leftmenu=="orders") $newmenu->add("/commande/liste.php?leftmenu=orders&viewstatut=1", $langs->trans("StatusOrderValidated"), 2, $user->rights->commande->lire); - if ($leftmenu=="orders" && $conf->expedition->enabled) $newmenu->add("/commande/liste.php?leftmenu=orders&viewstatut=2", $langs->trans("StatusOrderOnProcessShort"), 2, $user->rights->commande->lire); + if ($leftmenu=="orders" && ! empty($conf->expedition->enabled)) $newmenu->add("/commande/liste.php?leftmenu=orders&viewstatut=2", $langs->trans("StatusOrderOnProcessShort"), 2, $user->rights->commande->lire); if ($leftmenu=="orders") $newmenu->add("/commande/liste.php?leftmenu=orders&viewstatut=".($conf->expedition->enabled?"3":"-2"), $langs->trans("StatusOrderToBill"), 2, $user->rights->commande->lire); if ($leftmenu=="orders") $newmenu->add("/commande/liste.php?leftmenu=orders&viewstatut=4", $langs->trans("StatusOrderProcessed"), 2, $user->rights->commande->lire); if ($leftmenu=="orders") $newmenu->add("/commande/liste.php?leftmenu=orders&viewstatut=-1", $langs->trans("StatusOrderCanceledShort"), 2, $user->rights->commande->lire); @@ -1047,7 +1047,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after) /* if ($leftmenu=="ca") $newmenu->add("/compta/stats/cumul.php?leftmenu=ca","Cumule",2,$user->rights->compta->resultat->lire); - if ($conf->propal->enabled) { + if (! empty($conf->propal->enabled)) { if ($leftmenu=="ca") $newmenu->add("/compta/stats/prev.php?leftmenu=ca","Previsionnel",2,$user->rights->compta->resultat->lire); if ($leftmenu=="ca") $newmenu->add("/compta/stats/comp.php?leftmenu=ca","Transforme",2,$user->rights->compta->resultat->lire); } @@ -1129,11 +1129,11 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after) $newmenu->add("/product/fiche.php?leftmenu=product&action=create&type=0", $langs->trans("NewProduct"), 1, $user->rights->produit->creer); $newmenu->add("/product/liste.php?leftmenu=product&type=0", $langs->trans("List"), 1, $user->rights->produit->lire); } - if ($conf->propal->enabled) + if (! empty($conf->propal->enabled)) { $newmenu->add("/product/popuprop.php?leftmenu=stats&type=0", $langs->trans("Statistics"), 1, $user->rights->produit->lire && $user->rights->propale->lire); } - if ($conf->stock->enabled) + if (! empty($conf->stock->enabled)) { $newmenu->add("/product/reassort.php?type=0", $langs->trans("Stocks"), 1, $user->rights->produit->lire && $user->rights->stock->lire); } @@ -1148,7 +1148,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after) $newmenu->add("/product/fiche.php?leftmenu=service&action=create&type=1", $langs->trans("NewService"), 1, $user->rights->service->creer); } $newmenu->add("/product/liste.php?leftmenu=service&type=1", $langs->trans("List"), 1, $user->rights->service->lire); - if ($conf->propal->enabled) + if (! empty($conf->propal->enabled)) { $newmenu->add("/product/popuprop.php?leftmenu=stats&type=1", $langs->trans("Statistics"), 1, $user->rights->service->lire && $user->rights->propale->lire); } @@ -1348,7 +1348,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after) } $newmenu->add("/adherents/index.php?leftmenu=export&mainmenu=members",$langs->trans("Exports"),0,$user->rights->adherent->export, '', $mainmenu, 'export'); - if ($conf->export->enabled && $leftmenu=="export") $newmenu->add("/exports/index.php?leftmenu=export",$langs->trans("Datas"),1,$user->rights->adherent->export); + if (! empty($conf->export->enabled) && $leftmenu=="export") $newmenu->add("/exports/index.php?leftmenu=export",$langs->trans("Datas"),1,$user->rights->adherent->export); if ($leftmenu=="export") $newmenu->add("/adherents/htpasswd.php?leftmenu=export",$langs->trans("Filehtpasswd"),1,$user->rights->adherent->export); if ($leftmenu=="export") $newmenu->add("/adherents/cartes/carte.php?leftmenu=export",$langs->trans("MembersCards"),1,$user->rights->adherent->export); diff --git a/htdocs/core/modules/cheque/pdf/modules_chequereceipts.php b/htdocs/core/modules/cheque/pdf/modules_chequereceipts.php index f031ea2d4aa..66115ca5068 100644 --- a/htdocs/core/modules/cheque/pdf/modules_chequereceipts.php +++ b/htdocs/core/modules/cheque/pdf/modules_chequereceipts.php @@ -83,7 +83,7 @@ function chequereceipt_pdf_create($db, $id, $message, $modele, $outputlangs) // Positionne modele sur le nom du modele a utiliser if (! dol_strlen($modele)) { - if ($conf->global->FACTURE_ADDON_PDF) + if (! empty($conf->global->FACTURE_ADDON_PDF)) { $modele = $conf->global->FACTURE_ADDON_PDF; } diff --git a/htdocs/core/modules/cheque/pdf/pdf_blochet.class.php b/htdocs/core/modules/cheque/pdf/pdf_blochet.class.php index c54a539f297..c56f20f8773 100644 --- a/htdocs/core/modules/cheque/pdf/pdf_blochet.class.php +++ b/htdocs/core/modules/cheque/pdf/pdf_blochet.class.php @@ -135,7 +135,7 @@ class BordereauChequeBlochet extends ModeleChequeReceipts $pdf->SetCreator("Dolibarr ".DOL_VERSION); $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs))); $pdf->SetKeyWords($outputlangs->transnoentities("CheckReceipt")." ".$number); - if ($conf->global->MAIN_DISABLE_PDF_COMPRESSION) $pdf->SetCompression(false); + if (! empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) $pdf->SetCompression(false); $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right diff --git a/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php b/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php index e46a7bfc2b6..90e1ab86aeb 100644 --- a/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php +++ b/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php @@ -315,7 +315,7 @@ class doc_generic_order_odt extends ModelePDFCommandes if (! empty($usecontact)) { // On peut utiliser le nom de la societe du contact - if ($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) $socobject = $object->contact; + if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socobject = $object->contact; else $socobject = $object->client; } else diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index f6b29b52b0a..5d693e675a8 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -203,7 +203,7 @@ class pdf_einstein extends ModelePDFCommandes $pdf->SetCreator("Dolibarr ".DOL_VERSION); $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs))); $pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("Order")); - if ($conf->global->MAIN_DISABLE_PDF_COMPRESSION) $pdf->SetCompression(false); + if (! empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) $pdf->SetCompression(false); $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right @@ -531,7 +531,7 @@ if ($pageposafter > $pageposbefore) { if (empty($object->mode_reglement_code) || $object->mode_reglement_code == 'CHQ') { // Si mode reglement non force ou si force a CHQ - if ($conf->global->FACTURE_CHQ_NUMBER) + if (! empty($conf->global->FACTURE_CHQ_NUMBER)) { if ($conf->global->FACTURE_CHQ_NUMBER > 0) { diff --git a/htdocs/core/modules/dons/modules_don.php b/htdocs/core/modules/dons/modules_don.php index c86a75652a5..922685bf649 100644 --- a/htdocs/core/modules/dons/modules_don.php +++ b/htdocs/core/modules/dons/modules_don.php @@ -167,7 +167,7 @@ function don_create($db, $id, $message, $modele, $outputlangs) // Set template to use if (! dol_strlen($modele)) { - if ($conf->global->DON_ADDON_MODEL) + if (! empty($conf->global->DON_ADDON_MODEL)) { $modele = $conf->global->DON_ADDON_MODEL; } diff --git a/htdocs/core/modules/expedition/doc/pdf_expedition_merou.modules.php b/htdocs/core/modules/expedition/doc/pdf_expedition_merou.modules.php index bd09ce8cd17..d569c780512 100644 --- a/htdocs/core/modules/expedition/doc/pdf_expedition_merou.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_expedition_merou.modules.php @@ -162,14 +162,14 @@ class pdf_expedition_merou extends ModelePdfExpedition $pagenb=0; $pdf->SetDrawColor(128,128,128); - $pdf->AliasNbPages(); + $pdf->AliasNbPages(); $pdf->SetTitle($outputlangs->convToOutputCharset($object->ref)); $pdf->SetSubject($outputlangs->transnoentities("Sending")); $pdf->SetCreator("Dolibarr ".DOL_VERSION); $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs))); $pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("Sending")); - if ($conf->global->MAIN_DISABLE_PDF_COMPRESSION) $pdf->SetCompression(false); + if (! empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) $pdf->SetCompression(false); $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right @@ -182,9 +182,9 @@ class pdf_expedition_merou extends ModelePdfExpedition $pdf->SetTextColor(0,0,0); $tab_top = 52; - $tab_top_newpage = 10; + $tab_top_newpage = 10; $tab_height = $this->page_hauteur - $tab_top - $heightforfooter; - $tab_height_newpage = $this->page_hauteur - $tab_top_newpage - $heightforfooter; + $tab_height_newpage = $this->page_hauteur - $tab_top_newpage - $heightforfooter; $pdf->SetFillColor(240,240,240); $pdf->SetTextColor(0,0,0); @@ -219,13 +219,13 @@ class pdf_expedition_merou extends ModelePdfExpedition $pdf->SetFont('','', $default_font_size - 3); - //Creation des cases a cocher - $pdf->Rect(10+3, $curY, 3, 3); - $pdf->Rect(20+3, $curY, 3, 3); - //Insertion de la reference du produit - $pdf->SetXY(30, $curY); - $pdf->SetFont('','B', $default_font_size - 3); - $pdf->MultiCell(24, 3, $outputlangs->convToOutputCharset($object->lines[$i]->ref), 0, 'L', 0); + //Creation des cases a cocher + $pdf->Rect(10+3, $curY, 3, 3); + $pdf->Rect(20+3, $curY, 3, 3); + //Insertion de la reference du produit + $pdf->SetXY(30, $curY); + $pdf->SetFont('','B', $default_font_size - 3); + $pdf->MultiCell(24, 3, $outputlangs->convToOutputCharset($object->lines[$i]->ref), 0, 'L', 0); $pdf->SetXY(140, $curY); $pdf->MultiCell(30, 3, $object->lines[$i]->qty_asked, 0, 'C', 0); @@ -269,16 +269,16 @@ class pdf_expedition_merou extends ModelePdfExpedition } } - // Show square - if ($pagenb == 1) - { - $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 0); - $bottomlasttab=$this->page_hauteur - $heightforinfotot + 1; - } - else - { - $this->_tableau($pdf, $tab_top_newpage - 1, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 0); - $bottomlasttab=$this->page_hauteur - $heightforinfotot + 1; + // Show square + if ($pagenb == 1) + { + $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 0); + $bottomlasttab=$this->page_hauteur - $heightforinfotot + 1; + } + else + { + $this->_tableau($pdf, $tab_top_newpage - 1, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 0); + $bottomlasttab=$this->page_hauteur - $heightforinfotot + 1; } // Pied de page @@ -571,7 +571,7 @@ class pdf_expedition_merou extends ModelePdfExpedition if (! empty($usecontact)) { // On peut utiliser le nom de la societe du contact - if ($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) $socname = $object->contact->socname; + if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socname = $object->contact->socname; else $socname = $object->client->nom; $carac_client_name=$outputlangs->convToOutputCharset($socname); } diff --git a/htdocs/core/modules/expedition/doc/pdf_expedition_rouget.modules.php b/htdocs/core/modules/expedition/doc/pdf_expedition_rouget.modules.php index cd4af15d121..ce7e5db6dfb 100644 --- a/htdocs/core/modules/expedition/doc/pdf_expedition_rouget.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_expedition_rouget.modules.php @@ -156,7 +156,7 @@ class pdf_expedition_rouget extends ModelePdfExpedition $pdf->SetCreator("Dolibarr ".DOL_VERSION); $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs))); $pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("Sending")); - if ($conf->global->MAIN_DISABLE_PDF_COMPRESSION) $pdf->SetCompression(false); + if (! empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) $pdf->SetCompression(false); $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right @@ -240,10 +240,10 @@ class pdf_expedition_rouget extends ModelePdfExpedition $pdf->setPage($pageposbefore); $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. - // We suppose that a too long description is moved completely on next page - if ($pageposafter > $pageposbefore) { - $pdf->setPage($pageposafter); $curY = $tab_top_newpage; - } + // We suppose that a too long description is moved completely on next page + if ($pageposafter > $pageposbefore) { + $pdf->setPage($pageposafter); $curY = $tab_top_newpage; + } $pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par defaut @@ -436,7 +436,7 @@ class pdf_expedition_rouget extends ModelePdfExpedition } // Show barcode - if ($conf->barcode->enabled) + if (! empty($conf->barcode->enabled)) { $posx=105; } @@ -445,7 +445,7 @@ class pdf_expedition_rouget extends ModelePdfExpedition $posx=$this->marge_gauche+3; } //$pdf->Rect($this->marge_gauche, $this->marge_haute, $this->page_largeur-$this->marge_gauche-$this->marge_droite, 30); - if ($conf->barcode->enabled) + if (! empty($conf->barcode->enabled)) { // TODO Build code bar with function writeBarCode of barcode module for sending ref $object->ref //$pdf->SetXY($this->marge_gauche+3, $this->marge_haute+3); @@ -453,7 +453,7 @@ class pdf_expedition_rouget extends ModelePdfExpedition } $pdf->SetDrawColor(128,128,128); - if ($conf->barcode->enabled) + if (! empty($conf->barcode->enabled)) { // TODO Build code bar with function writeBarCode of barcode module for sending ref $object->ref //$pdf->SetXY($this->marge_gauche+3, $this->marge_haute+3); @@ -579,7 +579,7 @@ class pdf_expedition_rouget extends ModelePdfExpedition if (! empty($usecontact)) { // On peut utiliser le nom de la societe du contact - if ($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) $socname = $object->contact->socname; + if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socname = $object->contact->socname; else $socname = $object->client->nom; $carac_client_name=$outputlangs->convToOutputCharset($socname); } diff --git a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php index d796fee8441..78e28d24fec 100644 --- a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php +++ b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php @@ -326,7 +326,7 @@ class doc_generic_invoice_odt extends ModelePDFFactures if (! empty($usecontact)) { // On peut utiliser le nom de la societe du contact - if ($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) $socobject = $object->contact; + if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socobject = $object->contact; else $socobject = $object->client; } else diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index 2804e78fb6a..b723206ef5c 100755 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -204,7 +204,7 @@ class pdf_crabe extends ModelePDFFactures $pdf->SetCreator("Dolibarr ".DOL_VERSION); $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs))); $pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("Invoice")); - if ($conf->global->MAIN_DISABLE_PDF_COMPRESSION) $pdf->SetCompression(false); + if (! empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) $pdf->SetCompression(false); $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right @@ -643,7 +643,7 @@ if ($pageposafter > $pageposbefore) { if (empty($object->mode_reglement_code) || $object->mode_reglement_code == 'CHQ') { // Si mode reglement non force ou si force a CHQ - if ($conf->global->FACTURE_CHQ_NUMBER) + if (! empty($conf->global->FACTURE_CHQ_NUMBER)) { if ($conf->global->FACTURE_CHQ_NUMBER > 0) { diff --git a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php index e71db402c7a..d12c18b8ee2 100644 --- a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php +++ b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php @@ -161,7 +161,7 @@ class pdf_soleil extends ModelePDFFicheinter $pdf->SetCreator("Dolibarr ".DOL_VERSION); $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs))); $pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("InterventionCard")); - if ($conf->global->MAIN_DISABLE_PDF_COMPRESSION) $pdf->SetCompression(false); + if (! empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) $pdf->SetCompression(false); $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right @@ -243,8 +243,8 @@ class pdf_soleil extends ModelePDFFicheinter { $curY = $nexY; - $pdf->setPageOrientation('', 1, $this->marge_basse+$heightforfooter+$heightforinfotot); // The only function to edit the bottom margin of current page to set it. - $pageposbefore=$pdf->getPage(); + $pdf->setPageOrientation('', 1, $this->marge_basse+$heightforfooter+$heightforinfotot); // The only function to edit the bottom margin of current page to set it. + $pageposbefore=$pdf->getPage(); $pdf->SetFont('','B', $default_font_size - 1); $pdf->SetXY($this->marge_gauche, $curY); @@ -273,16 +273,16 @@ class pdf_soleil extends ModelePDFFicheinter $nexY+=2; // Passe espace entre les lignes - $pageposafter=$pdf->getPage(); - $pdf->setPage($pageposbefore); - $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. + $pageposafter=$pdf->getPage(); + $pdf->setPage($pageposbefore); + $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. - // We suppose that a too long description is moved completely on next page - if ($pageposafter > $pageposbefore) { - $pdf->setPage($pageposafter); $curY = $tab_top_newpage; + // We suppose that a too long description is moved completely on next page + if ($pageposafter > $pageposbefore) { + $pdf->setPage($pageposafter); $curY = $tab_top_newpage; } - $pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par defaut + $pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par defaut // Detect if some page were added automatically and output _tableau for past pages while ($pagenb < $pageposafter) @@ -559,7 +559,7 @@ class pdf_soleil extends ModelePDFFicheinter if (! empty($usecontact)) { // On peut utiliser le nom de la societe du contact - if ($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) $socname = $object->contact->socname; + if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socname = $object->contact->socname; else $socname = $object->client->nom; $carac_client_name=$outputlangs->convToOutputCharset($socname); } diff --git a/htdocs/core/modules/fichinter/modules_fichinter.php b/htdocs/core/modules/fichinter/modules_fichinter.php index 0cda5ac63b7..452e94f9ad0 100644 --- a/htdocs/core/modules/fichinter/modules_fichinter.php +++ b/htdocs/core/modules/fichinter/modules_fichinter.php @@ -166,7 +166,7 @@ function fichinter_create($db, $object, $modele, $outputlangs, $hidedetails=0, $ // Positionne modele sur le nom du modele de fichinter a utiliser if (! dol_strlen($modele)) { - if ($conf->global->FICHEINTER_ADDON_PDF) + if (! empty($conf->global->FICHEINTER_ADDON_PDF)) { $modele = $conf->global->FICHEINTER_ADDON_PDF; } diff --git a/htdocs/core/modules/livraison/modules_livraison.php b/htdocs/core/modules/livraison/modules_livraison.php index 663c7198755..3e6d48bd29d 100644 --- a/htdocs/core/modules/livraison/modules_livraison.php +++ b/htdocs/core/modules/livraison/modules_livraison.php @@ -167,7 +167,7 @@ function delivery_order_pdf_create($db, $object, $modele, $outputlangs='') // Positionne modele sur le nom du modele de bon de livraison a utiliser if (! dol_strlen($modele)) { - if ($conf->global->LIVRAISON_ADDON_PDF) + if (! empty($conf->global->LIVRAISON_ADDON_PDF)) { $modele = $conf->global->LIVRAISON_ADDON_PDF; } diff --git a/htdocs/core/modules/livraison/pdf/pdf_sirocco.modules.php b/htdocs/core/modules/livraison/pdf/pdf_sirocco.modules.php index 78a16adf15f..6b9aa3a0279 100644 --- a/htdocs/core/modules/livraison/pdf/pdf_sirocco.modules.php +++ b/htdocs/core/modules/livraison/pdf/pdf_sirocco.modules.php @@ -158,7 +158,7 @@ class pdf_sirocco extends ModelePDFDeliveryOrder $pdf->SetCreator("Dolibarr ".DOL_VERSION); $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs))); $pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("DeliveryOrder")); - if ($conf->global->MAIN_DISABLE_PDF_COMPRESSION) $pdf->SetCompression(false); + if (! empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) $pdf->SetCompression(false); $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right @@ -351,7 +351,7 @@ if ($pageposafter > $pageposbefore) { $pdf->SetXY($this->marge_gauche,$posy); - if ($conf->global->MAIN_INFO_SOCIETE_NOM) + if (! empty($conf->global->MAIN_INFO_SOCIETE_NOM)) { $pdf->SetTextColor(0,0,200); $pdf->SetFont('','B', $default_font_size + 2); @@ -383,7 +383,7 @@ if ($pageposafter > $pageposbefore) { if (! empty($usecontact)) { // On peut utiliser le nom de la societe du contact - if ($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) $socname = $object->contact->socname; + if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socname = $object->contact->socname; else $socname = $object->client->nom; $carac_client_name=$outputlangs->convToOutputCharset($socname); } diff --git a/htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php b/htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php index 7f5a25550a4..51f5bf88b69 100644 --- a/htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php +++ b/htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php @@ -181,7 +181,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder $pdf->SetCreator("Dolibarr ".DOL_VERSION); $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs))); $pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("DeliveryOrder")); - if ($conf->global->MAIN_DISABLE_PDF_COMPRESSION) $pdf->SetCompression(false); + if (! empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) $pdf->SetCompression(false); $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right @@ -254,9 +254,9 @@ class pdf_typhon extends ModelePDFDeliveryOrder $pdf->setPage($pageposbefore); $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. - // We suppose that a too long description is moved completely on next page - if ($pageposafter > $pageposbefore) { - $pdf->setPage($pageposafter); $curY = $tab_top_newpage; + // We suppose that a too long description is moved completely on next page + if ($pageposafter > $pageposbefore) { + $pdf->setPage($pageposafter); $curY = $tab_top_newpage; } $pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par defaut @@ -642,7 +642,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder if (! empty($usecontact)) { // On peut utiliser le nom de la societe du contact - if ($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) $socname = $object->contact->socname; + if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socname = $object->contact->socname; else $socname = $object->client->nom; $carac_client_name=$outputlangs->convToOutputCharset($socname); } diff --git a/htdocs/core/modules/member/doc/pdf_standard.class.php b/htdocs/core/modules/member/doc/pdf_standard.class.php index e80973afd67..cf01009e6c2 100644 --- a/htdocs/core/modules/member/doc/pdf_standard.class.php +++ b/htdocs/core/modules/member/doc/pdf_standard.class.php @@ -461,7 +461,7 @@ class pdf_standard $pdf->SetCreator("Dolibarr ".DOL_VERSION); $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs))); $pdf->SetKeyWords($outputlangs->transnoentities('MembersCards')." ".$outputlangs->transnoentities("Foundation")." ".$outputlangs->convToOutputCharset($mysoc->name)); - if ($conf->global->MAIN_DISABLE_PDF_COMPRESSION) $pdf->SetCompression(false); + if (! empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) $pdf->SetCompression(false); $pdf->SetMargins(0,0); $pdf->SetAutoPageBreak(false); diff --git a/htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php b/htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php index 575d0172402..2b6ab211153 100644 --- a/htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php +++ b/htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php @@ -447,7 +447,7 @@ class pdf_standardlabel $pdf->SetCreator("Dolibarr ".DOL_VERSION); $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs))); $pdf->SetKeyWords($outputlangs->transnoentities('MembersLabels')." ".$outputlangs->transnoentities("Foundation")." ".$outputlangs->convToOutputCharset($mysoc->name)); - if ($conf->global->MAIN_DISABLE_PDF_COMPRESSION) $pdf->SetCompression(false); + if (! empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) $pdf->SetCompression(false); $pdf->SetMargins(0,0); $pdf->SetAutoPageBreak(false); diff --git a/htdocs/core/modules/project/pdf/pdf_baleine.modules.php b/htdocs/core/modules/project/pdf/pdf_baleine.modules.php index 72d5c19b697..dea29ca8bdb 100644 --- a/htdocs/core/modules/project/pdf/pdf_baleine.modules.php +++ b/htdocs/core/modules/project/pdf/pdf_baleine.modules.php @@ -154,7 +154,7 @@ class pdf_baleine extends ModelePDFProjects $pdf->SetCreator("Dolibarr ".DOL_VERSION); $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs))); $pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("Project")); - if ($conf->global->MAIN_DISABLE_PDF_COMPRESSION) $pdf->SetCompression(false); + if (! empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) $pdf->SetCompression(false); $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right diff --git a/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php b/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php index 86ff65a677a..5f15d9b86dc 100644 --- a/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php +++ b/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php @@ -314,7 +314,7 @@ class doc_generic_proposal_odt extends ModelePDFPropales if (! empty($usecontact)) { // On peut utiliser le nom de la societe du contact - if ($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) $socobject = $object->contact; + if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socobject = $object->contact; else $socobject = $object->client; } else diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index 436d0b2c72a..f35957f44e5 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -36,22 +36,22 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php'; */ class pdf_azur extends ModelePDFPropales { - var $db; - var $name; - var $description; - var $type; - - var $phpmin = array(4,3,0); // Minimum version of PHP required by module - var $version = 'dolibarr'; - - var $page_largeur; - var $page_hauteur; - var $format; - var $marge_gauche; - var $marge_droite; - var $marge_haute; - var $marge_basse; - + var $db; + var $name; + var $description; + var $type; + + var $phpmin = array(4,3,0); // Minimum version of PHP required by module + var $version = 'dolibarr'; + + var $page_largeur; + var $page_hauteur; + var $format; + var $marge_gauche; + var $marge_droite; + var $marge_haute; + var $marge_basse; + var $emetteur; // Objet societe qui emet @@ -142,7 +142,7 @@ class pdf_azur extends ModelePDFPropales $outputlangs->load("products"); $default_font_size = pdf_getPDFFontSize($outputlangs); - + if ($conf->propal->dir_output) { $object->fetch_thirdparty(); @@ -203,7 +203,7 @@ class pdf_azur extends ModelePDFPropales $pdf->SetCreator("Dolibarr ".DOL_VERSION); $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs))); $pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("CommercialProposal")); - if ($conf->global->MAIN_DISABLE_PDF_COMPRESSION) $pdf->SetCompression(false); + if (! empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) $pdf->SetCompression(false); $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right @@ -276,11 +276,11 @@ class pdf_azur extends ModelePDFPropales $pdf->setPage($pageposbefore); $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. -// We suppose that a too long description is moved completely on next page -if ($pageposafter > $pageposbefore) { - $pdf->setPage($pageposafter); $curY = $tab_top_newpage; -} - + // We suppose that a too long description is moved completely on next page + if ($pageposafter > $pageposbefore) { + $pdf->setPage($pageposafter); $curY = $tab_top_newpage; + } + $pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par defaut // VAT Rate @@ -563,7 +563,7 @@ if ($pageposafter > $pageposbefore) { if (empty($object->mode_reglement_code) || $object->mode_reglement_code == 'CHQ') { // Si mode reglement non force ou si force a CHQ - if ($conf->global->FACTURE_CHQ_NUMBER) + if (! empty($conf->global->FACTURE_CHQ_NUMBER)) { if ($conf->global->FACTURE_CHQ_NUMBER > 0) { @@ -640,7 +640,7 @@ if ($pageposafter > $pageposbefore) { $col1x = 120; $col2x = 170; $largcol2 = ($this->page_largeur - $this->marge_droite - $col2x); $index = 0; - + // Total HT $pdf->SetFillColor(255,255,255); $pdf->SetXY($col1x, $tab2_top + 0); @@ -790,7 +790,7 @@ if ($pageposafter > $pageposbefore) { } $pdf->SetTextColor(0,0,0); - + $resteapayer = $object->total_ttc - $deja_regle; if ($object->paye) $resteapayer=0; @@ -863,10 +863,10 @@ if ($pageposafter > $pageposbefore) { $pdf->SetXY($this->page_largeur - $this->marge_droite - ($pdf->GetStringWidth($titre) + 3), $tab_top-4); $pdf->MultiCell(($pdf->GetStringWidth($titre) + 3), 2, $titre); } - + $pdf->SetDrawColor(128,128,128); $pdf->SetFont('','',$default_font_size - 1); - + // Output Rect $this->printRect($pdf,$this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect prend une longueur en 3eme param et 4eme param @@ -877,7 +877,7 @@ if ($pageposafter > $pageposbefore) { $pdf->SetXY($this->posxdesc-1, $tab_top+1); $pdf->MultiCell(108,2, $outputlangs->transnoentities("Designation"),'','L'); } - + if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) { $pdf->line($this->posxtva-1, $tab_top, $this->posxtva-1, $tab_top + $tab_height); @@ -894,14 +894,14 @@ if ($pageposafter > $pageposbefore) { $pdf->SetXY($this->posxup-1, $tab_top+1); $pdf->MultiCell($this->posxqty-$this->posxup-1,2, $outputlangs->transnoentities("PriceUHT"),'','C'); } - + $pdf->line($this->posxqty-1, $tab_top, $this->posxqty-1, $tab_top + $tab_height); if (empty($hidetop)) { $pdf->SetXY($this->posxqty-1, $tab_top+1); $pdf->MultiCell($this->posxdiscount-$this->posxqty-1,2, $outputlangs->transnoentities("Qty"),'','C'); } - + $pdf->line($this->posxdiscount-1, $tab_top, $this->posxdiscount-1, $tab_top + $tab_height); if (empty($hidetop)) { @@ -942,7 +942,7 @@ if ($pageposafter > $pageposbefore) { $outputlangs->load("companies"); $default_font_size = pdf_getPDFFontSize($outputlangs); - + pdf_pagehead($pdf,$outputlangs,$this->page_hauteur); // Show Draft Watermark @@ -1057,8 +1057,8 @@ if ($pageposafter > $pageposbefore) { $pdf->SetXY($posx,$posy); $pdf->SetFillColor(230,230,230); $pdf->MultiCell(82, $hautcadre, "", 0, 'R', 1); - $pdf->SetTextColor(0,0,60); - + $pdf->SetTextColor(0,0,60); + // Show sender name $pdf->SetXY($posx+2,$posy+3); $pdf->SetFont('','B', $default_font_size); diff --git a/htdocs/core/modules/rapport/pdf_paiement.class.php b/htdocs/core/modules/rapport/pdf_paiement.class.php index b238ee3cfe6..d18c14b6b6d 100644 --- a/htdocs/core/modules/rapport/pdf_paiement.class.php +++ b/htdocs/core/modules/rapport/pdf_paiement.class.php @@ -180,7 +180,7 @@ class pdf_paiement $pdf->SetCreator("Dolibarr ".DOL_VERSION); $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs))); //$pdf->SetKeyWords(); - if ($conf->global->MAIN_DISABLE_PDF_COMPRESSION) $pdf->SetCompression(false); + if (! empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) $pdf->SetCompression(false); $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right $pdf->SetAutoPageBreak(1,0); diff --git a/htdocs/core/modules/societe/modules_societe.class.php b/htdocs/core/modules/societe/modules_societe.class.php index fc96075f430..63b470a28a1 100644 --- a/htdocs/core/modules/societe/modules_societe.class.php +++ b/htdocs/core/modules/societe/modules_societe.class.php @@ -381,7 +381,7 @@ function thirdparty_doc_create($db, $object, $message, $modele, $outputlangs) // Positionne modele sur le nom du modele a utiliser if (! dol_strlen($modele)) { - if ($conf->global->COMPANY_ADDON_PDF) + if (! empty($conf->global->COMPANY_ADDON_PDF)) { $modele = $conf->global->COMPANY_ADDON_PDF; } diff --git a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php index 756d94726e5..76a7d0f7fe9 100755 --- a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php +++ b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php @@ -202,7 +202,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $pdf->SetCreator("Dolibarr ".DOL_VERSION); $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs))); $pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("Order")); - if ($conf->global->MAIN_DISABLE_PDF_COMPRESSION) $pdf->SetCompression(false); + if (! empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) $pdf->SetCompression(false); $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right @@ -273,10 +273,10 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $pdf->setPage($pageposbefore); $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. -// We suppose that a too long description is moved completely on next page -if ($pageposafter > $pageposbefore) { - $pdf->setPage($pageposafter); $curY = $tab_top_newpage; -} +// We suppose that a too long description is moved completely on next page +if ($pageposafter > $pageposbefore) { + $pdf->setPage($pageposafter); $curY = $tab_top_newpage; +} $pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par defaut @@ -913,7 +913,7 @@ if ($pageposafter > $pageposbefore) { if (! empty($usecontact)) { // On peut utiliser le nom de la societe du contact - if ($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) $socname = $object->contact->socname; + if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socname = $object->contact->socname; else $socname = $mysoc->nom; $carac_client_name=$outputlangs->convToOutputCharset($socname); } diff --git a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php index 9e8e5bdd064..3067a82ae45 100644 --- a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php +++ b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php @@ -214,7 +214,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $pdf->SetCreator("Dolibarr ".DOL_VERSION); $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs))); $pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("Order")); - if ($conf->global->MAIN_DISABLE_PDF_COMPRESSION) $pdf->SetCompression(false); + if (! empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) $pdf->SetCompression(false); $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right @@ -540,7 +540,7 @@ if ($pageposafter > $pageposbefore) { if (empty($object->mode_reglement_code) || $object->mode_reglement_code == 'CHQ') { // Si mode reglement non force ou si force a CHQ - if ($conf->global->FACTURE_CHQ_NUMBER) + if (! empty($conf->global->FACTURE_CHQ_NUMBER)) { if ($conf->global->FACTURE_CHQ_NUMBER > 0) { @@ -1016,7 +1016,7 @@ if ($pageposafter > $pageposbefore) { if (! empty($usecontact)) { // On peut utiliser le nom de la societe du contact - if ($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) $socname = $object->contact->socname; + if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socname = $object->contact->socname; else $socname = $object->client->name; $carac_client_name=$outputlangs->convToOutputCharset($socname); } diff --git a/htdocs/core/tpl/ajaxrow.tpl.php b/htdocs/core/tpl/ajaxrow.tpl.php index bb26c2d891e..0745bc20959 100644 --- a/htdocs/core/tpl/ajaxrow.tpl.php +++ b/htdocs/core/tpl/ajaxrow.tpl.php @@ -1,6 +1,6 @@ - * Copyright (C) 2010-2011 Laurent Destailleur + * Copyright (C) 2010-2012 Laurent Destailleur * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -15,12 +15,19 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . * + * Javascript code to activate drag and drop on lines */ ?> -lines) > 1 && GETPOST('action') != 'editline') { ?> -
'; @@ -97,7 +97,7 @@ function print_actions_filter($form,$canedit,$status,$year,$month,$day,$showbirt print '
'; diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 00ff7db6ddd..77b571e51c4 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -408,12 +408,12 @@ function show_projects($conf,$langs,$db,$object,$backtopage='') $i = -1 ; - if ($conf->projet->enabled && $user->rights->projet->lire) + if (! empty($conf->projet->enabled) && $user->rights->projet->lire) { $langs->load("projects"); $buttoncreate=''; - if ($conf->projet->enabled && $user->rights->projet->creer) + if (! empty($conf->projet->enabled) && $user->rights->projet->creer) { //$buttoncreate=''.$langs->trans("AddProject").''; $buttoncreate=''.$langs->trans("AddProject").' '.img_picto($langs->trans("AddProject"),'filenew').''."\n"; @@ -510,7 +510,7 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='') $contactstatic = new Contact($db); - if ($conf->clicktodial->enabled) + if (! empty($conf->clicktodial->enabled)) { $user->fetch_clicktodial(); // lecture des infos de clicktodial } @@ -581,7 +581,7 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='') print dol_print_email($obj->email,$obj->rowid,$object->id,'AC_EMAIL'); print ''; print img_object($langs->trans("Rendez-Vous"),"action"); @@ -729,7 +729,7 @@ function show_actions_todo($conf,$langs,$db,$object,$objcon='',$noprint=0) $now=dol_now(); $out=''; - if ($conf->agenda->enabled) + if (! empty($conf->agenda->enabled)) { require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; $actionstatic=new ActionComm($db); @@ -891,7 +891,7 @@ function show_actions_done($conf,$langs,$db,$object,$objcon='',$noprint=0) $numaction = 0 ; $now=dol_now(); - if ($conf->agenda->enabled) + if (! empty($conf->agenda->enabled)) { // Recherche histo sur actioncomm $sql = "SELECT a.id, a.label,"; @@ -1001,7 +1001,7 @@ function show_actions_done($conf,$langs,$db,$object,$objcon='',$noprint=0) } - if ($conf->agenda->enabled || ($conf->mailing->enabled && ! empty($objcon->email))) + if (! empty($conf->agenda->enabled) || (! empty($conf->mailing->enabled) && ! empty($objcon->email))) { require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 160970b3aae..4d0ec456573 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -739,12 +739,12 @@ function dol_format_address($object) } else if (in_array($object->country_code,array('GB'))) // UK: title firstname name \n address lines \n town state \n zip \n country { - $ret .= ($ret ? "\n" : '' ).$object->town; - if ($object->state && in_array($object->country_code,$countriesusingstate)) - { - $ret.=", ".$object->departement; - } - if ($object->zip) $ret .= ($ret ? "\n" : '' ).$object->zip; + $ret .= ($ret ? "\n" : '' ).$object->town; + if ($object->state && in_array($object->country_code,$countriesusingstate)) + { + $ret.=", ".$object->departement; + } + if ($object->zip) $ret .= ($ret ? "\n" : '' ).$object->zip; } else // Other: title firstname name \n address lines \n zip town \n country { @@ -1149,7 +1149,7 @@ function dol_print_email($email,$cid=0,$socid=0,$addlink=0,$max=64,$showinvalid= $newemail.=img_warning($langs->trans("ErrorBadEMail",$email)); } - if (($cid || $socid) && $conf->agenda->enabled && $user->rights->agenda->myactions->create) + if (($cid || $socid) && ! empty($conf->agenda->enabled) && $user->rights->agenda->myactions->create) { $type='AC_EMAIL'; $link=''; if (! empty($conf->global->AGENDA_ADDACTIONFOREMAIL)) $link=''.img_object($langs->trans("AddAction"),"calendar").''; @@ -1236,7 +1236,7 @@ function dol_print_phone($phone,$country="FR",$cid=0,$socid=0,$addlink=0,$separ= $newphone.='>'.$newphonesav.''; } - //if (($cid || $socid) && $conf->agenda->enabled && $user->rights->agenda->myactions->create) + //if (($cid || $socid) && ! empty($conf->agenda->enabled) && $user->rights->agenda->myactions->create) if (! empty($conf->agenda->enabled) && $user->rights->agenda->myactions->create) { $type='AC_TEL'; $link=''; diff --git a/htdocs/core/lib/invoice.lib.php b/htdocs/core/lib/invoice.lib.php index 07e7550994b..8d3990942c1 100644 --- a/htdocs/core/lib/invoice.lib.php +++ b/htdocs/core/lib/invoice.lib.php @@ -57,7 +57,7 @@ function facture_prepare_head($object) } //if ($fac->mode_reglement_code == 'PRE') - if ($conf->prelevement->enabled) + if (! empty($conf->prelevement->enabled)) { $head[$h][0] = DOL_URL_ROOT.'/compta/facture/prelevement.php?facid='.$object->id; $head[$h][1] = $langs->trans('StandingOrders'); diff --git a/htdocs/core/lib/ldap.lib.php b/htdocs/core/lib/ldap.lib.php index a5200a320d9..fc8b139df1b 100644 --- a/htdocs/core/lib/ldap.lib.php +++ b/htdocs/core/lib/ldap.lib.php @@ -41,7 +41,7 @@ function ldap_prepare_head() $head[$h][2] = 'ldap'; $h++; - if ($conf->global->LDAP_SYNCHRO_ACTIVE) + if (! empty($conf->global->LDAP_SYNCHRO_ACTIVE)) { $head[$h][0] = DOL_URL_ROOT."/admin/ldap_users.php"; $head[$h][1] = $langs->trans("LDAPUsersSynchro"); @@ -49,7 +49,7 @@ function ldap_prepare_head() $h++; } - if ($conf->global->LDAP_SYNCHRO_ACTIVE) + if (! empty($conf->global->LDAP_SYNCHRO_ACTIVE)) { $head[$h][0] = DOL_URL_ROOT."/admin/ldap_groups.php"; $head[$h][1] = $langs->trans("LDAPGroupsSynchro"); @@ -57,7 +57,7 @@ function ldap_prepare_head() $h++; } - if ($conf->societe->enabled && $conf->global->LDAP_CONTACT_ACTIVE) + if (! empty($conf->societe->enabled) && ! empty($conf->global->LDAP_CONTACT_ACTIVE)) { $head[$h][0] = DOL_URL_ROOT."/admin/ldap_contacts.php"; $head[$h][1] = $langs->trans("LDAPContactsSynchro"); @@ -65,7 +65,7 @@ function ldap_prepare_head() $h++; } - if ($conf->adherent->enabled && $conf->global->LDAP_MEMBER_ACTIVE) + if (! empty($conf->adherent->enabled) && ! empty($conf->global->LDAP_MEMBER_ACTIVE)) { $head[$h][0] = DOL_URL_ROOT."/admin/ldap_members.php"; $head[$h][1] = $langs->trans("LDAPMembersSynchro"); diff --git a/htdocs/core/lib/order.lib.php b/htdocs/core/lib/order.lib.php index 2bd4fd8779b..3fc1bc73f04 100644 --- a/htdocs/core/lib/order.lib.php +++ b/htdocs/core/lib/order.lib.php @@ -34,13 +34,13 @@ function commande_prepare_head($object) { global $langs, $conf, $user; - if ($conf->expedition->enabled) $langs->load("sendings"); + if (! empty($conf->expedition->enabled)) $langs->load("sendings"); $langs->load("orders"); $h = 0; $head = array(); - if ($conf->commande->enabled && $user->rights->commande->lire) + if (! empty($conf->commande->enabled) && $user->rights->commande->lire) { $head[$h][0] = DOL_URL_ROOT.'/commande/fiche.php?id='.$object->id; $head[$h][1] = $langs->trans("OrderCard"); diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 33e562c464f..7cbcdb4854d 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -668,7 +668,7 @@ function pdf_pagefoot(&$pdf,$outputlangs,$paramfreetext,$fromcompany,$marge_bass { $pdf->SetXY($dims['lm'],-$posy); $width=20000; $align='L'; // By default, ask a manual break: We use a large value 20000, to not have automatic wrap. This make user understand, he need to add CR on its text. - if ($conf->global->MAIN_USE_AUTOWRAP_ON_FREETEXT) { $width=200; $align='C'; } + if (! empty($conf->global->MAIN_USE_AUTOWRAP_ON_FREETEXT)) { $width=200; $align='C'; } $pdf->MultiCell($width, 3, $line, 0, $align, 0); $posy-=($nbofline*3); // 6 of ligne + 3 of MultiCell } diff --git a/htdocs/core/lib/price.lib.php b/htdocs/core/lib/price.lib.php index 189e02b2cd0..78a357cd71b 100644 --- a/htdocs/core/lib/price.lib.php +++ b/htdocs/core/lib/price.lib.php @@ -56,16 +56,16 @@ function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $localtax1 $result=array(); // TODO Remove this code. Added for backward compatibility. To remove once localtaxX_type is provided by caller. - if ($localtax1_type == '?') - { - if ($mysoc->country_code=='ES') $localtax1_type='1'; - else $localtax1_type='0'; - } - if ($localtax2_type == '?') - { - if ($mysoc->country_code=='ES') $localtax2_type='1'; - else $localtax2_type='0'; - } + if ($localtax1_type == '?') + { + if ($mysoc->country_code=='ES') $localtax1_type='1'; + else $localtax1_type='0'; + } + if ($localtax2_type == '?') + { + if ($mysoc->country_code=='ES') $localtax2_type='1'; + else $localtax2_type='0'; + } // initialize total (may be HT or TTC depending on price_base_type) $tot_sans_remise = $pu * $qty; @@ -166,10 +166,10 @@ function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $localtax1 $apply_tax = false; //If price is 'TTC' we need to have the totals without VAT for a correct calculation - if ($price_base_type=='TTC') - { - $tot_sans_remise= price2num($tot_sans_remise / (1 + ($txtva / 100)),'MU'); - $tot_avec_remise= price2num($tot_avec_remise / (1 + ($txtva / 100)),'MU'); + if ($price_base_type=='TTC') + { + $tot_sans_remise= price2num($tot_sans_remise / (1 + ($txtva / 100)),'MU'); + $tot_avec_remise= price2num($tot_avec_remise / (1 + ($txtva / 100)),'MU'); } switch($localtax1_type) { diff --git a/htdocs/core/lib/product.lib.php b/htdocs/core/lib/product.lib.php index c78fb19af09..b2cbb2f55a5 100644 --- a/htdocs/core/lib/product.lib.php +++ b/htdocs/core/lib/product.lib.php @@ -49,7 +49,7 @@ function product_prepare_head($object, $user) $head[$h][2] = 'price'; $h++; - if ($conf->fournisseur->enabled && $user->rights->fournisseur->lire) + if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->lire) { $head[$h][0] = DOL_URL_ROOT."/product/fournisseurs.php?id=".$object->id; $head[$h][1] = $langs->trans("SuppliersPrices"); @@ -63,7 +63,7 @@ function product_prepare_head($object, $user) $h++; // Show category tab - if ($conf->categorie->enabled && $user->rights->categorie->lire) + if (! empty($conf->categorie->enabled) && $user->rights->categorie->lire) { $head[$h][0] = DOL_URL_ROOT."/categories/categorie.php?id=".$object->id.'&type=0'; $head[$h][1] = $langs->trans('Categories'); @@ -72,7 +72,7 @@ function product_prepare_head($object, $user) } // Multilangs - if($conf->global->MAIN_MULTILANGS) + if (! empty($conf->global->MAIN_MULTILANGS)) { $head[$h][0] = DOL_URL_ROOT."/product/traduction.php?id=".$object->id; $head[$h][1] = $langs->trans("Translation"); @@ -81,7 +81,7 @@ function product_prepare_head($object, $user) } // Sub products - if($conf->global->PRODUIT_SOUSPRODUITS) + if (! empty($conf->global->PRODUIT_SOUSPRODUITS)) { $head[$h][0] = DOL_URL_ROOT."/product/composition/fiche.php?id=".$object->id; $head[$h][1] = $langs->trans('AssociatedProducts'); @@ -101,7 +101,7 @@ function product_prepare_head($object, $user) if($object->isproduct()) // Si produit stockable { - if ($conf->stock->enabled && $user->rights->stock->lire) + if (! empty($conf->stock->enabled) && $user->rights->stock->lire) { $head[$h][0] = DOL_URL_ROOT."/product/stock/product.php?id=".$object->id; $head[$h][1] = $langs->trans("Stock"); @@ -189,7 +189,7 @@ function show_stats_for_company($product,$socid) print '