From 70aa4a22caec6b4c13b983e455884b38fc2024fa Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 5 Jan 2024 04:18:53 +0100 Subject: [PATCH] Clean code with rector --- .../rector/src/Renaming/GlobalToFunction.php | 4 +- htdocs/accountancy/bookkeeping/balance.php | 2 +- .../class/accountancyexport.class.php | 8 +- .../class/accountingaccount.class.php | 8 +- .../class/accountingjournal.class.php | 2 +- htdocs/accountancy/journal/bankjournal.php | 26 ++-- .../journal/expensereportsjournal.php | 2 +- htdocs/adherents/class/adherent.class.php | 6 +- htdocs/adherents/subscription.php | 10 +- htdocs/admin/agenda_extsites.php | 2 +- htdocs/admin/agenda_xcal.php | 24 ++-- htdocs/admin/delais.php | 8 +- htdocs/admin/dict.php | 2 +- htdocs/admin/dolistore/ajax/image.php | 4 +- .../admin/dolistore/class/dolistore.class.php | 8 +- htdocs/admin/ihm.php | 2 +- htdocs/admin/ldap_contacts.php | 6 +- htdocs/admin/ldap_members.php | 6 +- htdocs/admin/ldap_members_types.php | 6 +- htdocs/admin/mails.php | 6 +- htdocs/admin/mails_emailing.php | 4 +- htdocs/admin/mails_ticket.php | 4 +- htdocs/admin/menus/edit.php | 4 +- htdocs/admin/modules.php | 2 +- htdocs/admin/system/dolibarr.php | 2 +- htdocs/admin/system/filecheck.php | 2 +- htdocs/admin/tools/dolibarr_export.php | 6 +- htdocs/admin/website.php | 2 +- htdocs/api/class/api_setup.class.php | 2 +- htdocs/asset/agenda.php | 2 +- htdocs/asset/class/asset.class.php | 2 +- htdocs/asset/model/agenda.php | 2 +- htdocs/asterisk/wrapper.php | 16 +-- htdocs/barcode/printsheet.php | 4 +- htdocs/bom/bom_agenda.php | 2 +- htdocs/bom/class/bom.class.php | 4 +- htdocs/bookcal/bookcalindex.php | 2 +- htdocs/bookcal/class/availabilities.class.php | 4 +- htdocs/comm/action/index.php | 2 +- htdocs/comm/action/rapport/index.php | 2 +- htdocs/comm/card.php | 2 +- htdocs/comm/mailing/card.php | 6 +- htdocs/comm/propal/agenda.php | 2 +- htdocs/comm/propal/card.php | 2 +- htdocs/comm/propal/class/propal.class.php | 4 +- htdocs/comm/propal/document.php | 4 +- htdocs/commande/agenda.php | 2 +- htdocs/commande/card.php | 4 +- htdocs/commande/class/commande.class.php | 4 +- htdocs/commande/document.php | 4 +- htdocs/commande/list_det.php | 2 +- htdocs/compta/facture/agenda.php | 2 +- htdocs/compta/facture/card.php | 4 +- htdocs/compta/facture/class/facture.class.php | 8 +- htdocs/compta/facture/list.php | 2 +- htdocs/compta/paiement.php | 2 +- .../cheque/class/remisecheque.class.php | 2 +- .../compta/paiement/class/paiement.class.php | 2 +- htdocs/compta/resultat/clientfourn.php | 2 +- htdocs/compta/resultat/index.php | 2 +- htdocs/compta/resultat/result.php | 2 +- htdocs/compta/stats/cabyprodserv.php | 2 +- htdocs/compta/stats/cabyuser.php | 2 +- htdocs/compta/stats/casoc.php | 2 +- htdocs/compta/stats/index.php | 2 +- htdocs/compta/stats/supplier_turnover.php | 2 +- .../stats/supplier_turnover_by_prodserv.php | 2 +- .../stats/supplier_turnover_by_thirdparty.php | 2 +- htdocs/contact/class/contact.class.php | 2 +- htdocs/contact/document.php | 4 +- htdocs/contrat/card.php | 2 +- htdocs/contrat/class/contrat.class.php | 6 +- htdocs/contrat/list.php | 2 +- htdocs/core/actions_massactions.inc.php | 6 +- .../box_accountancy_suspense_account.php | 2 +- htdocs/core/boxes/box_activity.php | 4 +- htdocs/core/class/CMailFile.class.php | 10 +- htdocs/core/class/antivir.class.php | 4 +- htdocs/core/class/commonobject.class.php | 4 +- htdocs/core/class/commonpeople.class.php | 2 +- htdocs/core/class/dolgeoip.class.php | 8 +- htdocs/core/class/html.form.class.php | 10 +- htdocs/core/class/html.formfile.class.php | 2 +- htdocs/core/class/html.formmail.class.php | 18 +-- htdocs/core/class/html.formother.class.php | 2 +- htdocs/core/class/ldap.class.php | 4 +- htdocs/core/class/notify.class.php | 6 +- htdocs/core/class/openid.class.php | 4 +- htdocs/core/class/smtps.class.php | 4 +- htdocs/core/class/timespent.class.php | 4 +- htdocs/core/class/utils.class.php | 10 +- .../connectors/php/config.inc.php | 2 +- htdocs/core/get_info.php | 2 +- htdocs/core/lib/barcode.lib.php | 2 +- htdocs/core/lib/cron.lib.php | 2 +- htdocs/core/lib/files.lib.php | 6 +- htdocs/core/lib/functions.lib.php | 20 +-- htdocs/core/lib/functions2.lib.php | 2 +- htdocs/core/lib/payments.lib.php | 14 +-- htdocs/core/lib/pdf.lib.php | 6 +- htdocs/core/lib/price.lib.php | 12 +- htdocs/core/lib/project.lib.php | 8 +- htdocs/core/lib/security.lib.php | 2 +- htdocs/core/lib/security2.lib.php | 6 +- htdocs/core/lib/usergroups.lib.php | 8 +- htdocs/core/lib/xcal.lib.php | 2 +- htdocs/core/login/functions_dolibarr.php | 2 +- .../core/login/functions_openid_connect.php | 2 +- .../asset/doc/pdf_standard_asset.modules.php | 2 +- .../bank/doc/pdf_sepamandate.modules.php | 2 +- .../barcode/mod_barcode_product_standard.php | 4 +- .../mod_barcode_thirdparty_standard.php | 4 +- .../cheque/mod_chequereceipt_thyme.php | 2 +- .../modules/cheque/modules_chequereceipts.php | 2 +- .../contract/doc/pdf_strato.modules.php | 2 +- .../expedition/doc/pdf_espadon.modules.php | 2 +- .../expedition/doc/pdf_rouget.modules.php | 2 +- .../expensereport/mod_expensereport_jade.php | 2 +- .../modules/export/export_csviso.modules.php | 2 +- .../modules/export/export_csvutf8.modules.php | 2 +- .../core/modules/export/exportcsv.class.php | 4 +- .../modules/facture/doc/pdf_crabe.modules.php | 2 +- .../facture/doc/pdf_sponge.modules.php | 4 +- .../core/modules/facture/mod_facture_mars.php | 2 +- .../modules/facture/mod_facture_terre.php | 2 +- .../fichinter/doc/pdf_soleil.modules.php | 2 +- .../modules/fichinter/modules_fichinter.php | 2 +- htdocs/core/modules/member/modules_cards.php | 2 +- .../modules/mrp/doc/pdf_vinci.modules.php | 2 +- .../modules/printing/printgcp.modules.php | 2 +- .../modules/printsheet/modules_labels.php | 2 +- .../product/mod_codeproduct_elephant.php | 8 +- .../modules/propale/doc/pdf_cyan.modules.php | 2 +- .../modules/rapport/pdf_paiement.class.php | 2 +- .../reception/doc/pdf_squille.modules.php | 2 +- .../societe/mod_codeclient_elephant.php | 4 +- .../societe/mod_codecompta_aquarium.php | 4 +- .../societe/mod_codecompta_digitaria.php | 8 +- .../doc/pdf_eagle_proforma.modules.php | 2 +- .../supplier_order/doc/pdf_cornas.modules.php | 2 +- .../doc/pdf_aurore.modules.php | 2 +- .../doc/pdf_zenith.modules.php | 2 +- htdocs/core/tpl/card_presend.tpl.php | 10 +- htdocs/core/tpl/contacts.tpl.php | 2 +- htdocs/core/tpl/login.tpl.php | 10 +- htdocs/core/tpl/massactions_pre.tpl.php | 2 +- htdocs/core/tpl/objectline_create.tpl.php | 2 +- htdocs/core/tpl/objectline_edit.tpl.php | 2 +- htdocs/core/tpl/objectline_view.tpl.php | 2 +- ...interface_50_modLdap_Ldapsynchro.class.php | 2 +- ...terface_50_modTicket_TicketEmail.class.php | 4 +- htdocs/cron/card.php | 2 +- htdocs/delivery/class/delivery.class.php | 6 +- htdocs/don/class/don.class.php | 2 +- .../class/conferenceorbooth.class.php | 2 +- .../class/conferenceorboothattendee.class.php | 4 +- .../conferenceorboothattendee_card.php | 2 +- .../conferenceorboothattendee_list.php | 2 +- .../core/actions_massactions_mail.inc.php | 2 +- .../eventorganizationindex.php | 2 +- htdocs/expedition/class/expedition.class.php | 4 +- htdocs/expensereport/card.php | 32 ++--- .../class/expensereport.class.php | 4 +- htdocs/fichinter/card.php | 2 +- htdocs/fichinter/class/fichinter.class.php | 2 +- htdocs/fourn/card.php | 6 +- .../fourn/class/fournisseur.facture.class.php | 4 +- htdocs/fourn/class/paiementfourn.class.php | 4 +- htdocs/fourn/commande/card.php | 4 +- htdocs/ftp/index.php | 4 +- htdocs/holiday/card.php | 30 ++--- htdocs/holiday/card_group.php | 8 +- htdocs/holiday/class/holiday.class.php | 2 +- htdocs/hrm/class/evaluation.class.php | 4 +- htdocs/hrm/class/evaluationdet.class.php | 4 +- htdocs/hrm/class/job.class.php | 4 +- htdocs/hrm/class/position.class.php | 4 +- htdocs/hrm/class/skill.class.php | 4 +- htdocs/hrm/class/skilldet.class.php | 4 +- htdocs/hrm/class/skillrank.class.php | 4 +- htdocs/hrm/establishment/info.php | 2 +- htdocs/hrm/evaluation_agenda.php | 2 +- htdocs/hrm/job_agenda.php | 2 +- htdocs/hrm/position_agenda.php | 2 +- htdocs/hrm/skill_agenda.php | 2 +- htdocs/imports/import.php | 2 +- .../class/knowledgerecord.class.php | 4 +- .../knowledgerecord_agenda.php | 2 +- .../knowledgerecord_list.php | 2 +- htdocs/modulebuilder/index.php | 4 +- htdocs/mrp/class/mo.class.php | 4 +- htdocs/mrp/mo_agenda.php | 2 +- .../partnership/class/partnership.class.php | 4 +- .../class/partnershiputils.class.php | 2 +- htdocs/partnership/partnership_agenda.php | 2 +- htdocs/paybox/lib/paybox.lib.php | 12 +- htdocs/paypal/lib/paypal.lib.php | 14 +-- htdocs/paypal/lib/paypalfunctions.lib.php | 16 +-- htdocs/product/card.php | 2 +- .../product/class/html.formproduct.class.php | 4 +- htdocs/product/class/product.class.php | 4 +- .../class/productfournisseurprice.class.php | 4 +- htdocs/product/inventory/list.php | 2 +- htdocs/product/list.php | 2 +- htdocs/product/price.php | 18 +-- htdocs/product/stock/class/entrepot.class.php | 2 +- .../stock/class/mouvementstock.class.php | 2 +- .../product/stock/class/productlot.class.php | 2 +- htdocs/product/stock/massstockmove.php | 4 +- .../class/stocktransfer.class.php | 4 +- .../class/stocktransferline.class.php | 4 +- .../stocktransfer/stocktransfer_agenda.php | 2 +- .../stocktransfer/stocktransfer_card.php | 2 +- .../product/stock/tpl/stockcorrection.tpl.php | 2 +- htdocs/projet/card.php | 4 +- htdocs/projet/class/project.class.php | 4 +- htdocs/projet/class/task.class.php | 8 +- htdocs/projet/document.php | 4 +- htdocs/projet/list.php | 2 +- htdocs/projet/tasks.php | 2 +- htdocs/projet/tasks/list.php | 6 +- htdocs/public/agenda/agendaexport.php | 4 +- htdocs/public/company/new.php | 4 +- .../public/eventorganization/attendee_new.php | 6 +- .../eventorganization/subscriptionok.php | 4 +- htdocs/public/members/new.php | 16 +-- htdocs/public/onlinesign/newonlinesign.php | 4 +- htdocs/public/opensurvey/index.php | 4 +- htdocs/public/partnership/new.php | 4 +- htdocs/public/payment/newpayment.php | 14 +-- htdocs/public/payment/paymentko.php | 6 +- htdocs/public/payment/paymentok.php | 116 +++++++++--------- htdocs/public/project/new.php | 6 +- htdocs/public/project/suggestbooth.php | 6 +- htdocs/public/project/suggestconference.php | 4 +- htdocs/public/project/viewandvote.php | 4 +- htdocs/public/recruitment/index.php | 4 +- htdocs/public/recruitment/view.php | 4 +- htdocs/public/stripe/ipn.php | 18 +-- htdocs/public/test/test_badges.php | 2 +- htdocs/public/website/index.php | 2 +- htdocs/public/website/javascript.js.php | 2 +- htdocs/public/website/styles.css.php | 2 +- htdocs/reception/class/reception.class.php | 4 +- .../class/recruitmentcandidature.class.php | 4 +- .../class/recruitmentjobposition.class.php | 4 +- ...tandard_recruitmentjobposition.modules.php | 2 +- htdocs/recruitment/index.php | 2 +- .../recruitmentcandidature_agenda.php | 2 +- .../recruitmentjobposition_agenda.php | 2 +- .../canvas/actions_card_common.class.php | 2 +- htdocs/societe/card.php | 4 +- htdocs/societe/class/societe.class.php | 24 ++-- htdocs/societe/document.php | 4 +- htdocs/societe/index.php | 2 +- htdocs/societe/paymentmodes.php | 2 +- htdocs/societe/price.php | 8 +- htdocs/stripe/class/stripe.class.php | 4 +- .../class/supplier_proposal.class.php | 6 +- htdocs/takepos/index.php | 2 +- htdocs/takepos/invoice.php | 4 +- htdocs/takepos/pay.php | 4 +- htdocs/theme/eldy/manifest.json.php | 2 +- htdocs/theme/eldy/style.css.php | 2 +- htdocs/theme/md/style.css.php | 2 +- htdocs/ticket/class/actions_ticket.class.php | 2 +- htdocs/ticket/class/ticket.class.php | 6 +- htdocs/ticket/list.php | 4 +- htdocs/user/agenda_extsites.php | 2 +- htdocs/user/bank.php | 2 +- htdocs/user/class/user.class.php | 6 +- htdocs/user/class/usergroup.class.php | 4 +- htdocs/user/clicktodial.php | 2 +- htdocs/user/list.php | 2 +- htdocs/user/logout.php | 2 +- htdocs/user/passwordforgotten.php | 2 +- htdocs/variants/admin/admin.php | 2 +- htdocs/webhook/class/target.class.php | 2 +- htdocs/webhook/webhookindex.php | 2 +- htdocs/website/index.php | 2 +- .../workstation/class/workstation.class.php | 4 +- 281 files changed, 666 insertions(+), 672 deletions(-) diff --git a/dev/tools/rector/src/Renaming/GlobalToFunction.php b/dev/tools/rector/src/Renaming/GlobalToFunction.php index c5b1c7bfbc9..fd1a3d7dd66 100644 --- a/dev/tools/rector/src/Renaming/GlobalToFunction.php +++ b/dev/tools/rector/src/Renaming/GlobalToFunction.php @@ -140,7 +140,7 @@ class GlobalToFunction extends AbstractRector if ($node instanceof FuncCall) { $tmpfunctionname = $this->getName($node); // If function is ok. We must avoid a lot of cases like isset(), empty() - if (in_array($tmpfunctionname, array('dol_escape_htmltag', 'dol_hash', 'explode', 'length_accountg', 'length_accounta', 'make_substitutions', 'min', 'max', 'trunc', 'urlencode', 'yn'))) { + if (in_array($tmpfunctionname, array('dol_escape_htmltag', 'dol_hash', 'explode', 'is_numeric', 'length_accountg', 'length_accounta', 'make_substitutions', 'min', 'max', 'trunc', 'urlencode', 'yn'))) { //print "tmpfunctionname=".$tmpfunctionname."\n"; $args = $node->getArgs(); $nbofparam = count($args); @@ -170,7 +170,7 @@ class GlobalToFunction extends AbstractRector if ($node instanceof MethodCall) { $tmpmethodname = $this->getName($node->name); // If function is ok. We must avoid a lot of cases - if (in_array($tmpmethodname, array('idate', 'sanitize', 'select_language'))) { + if (in_array($tmpmethodname, array('fetch', 'idate', 'sanitize', 'select_language', 'trans'))) { //print "tmpmethodname=".$tmpmethodname."\n"; $expr = $node->var; $args = $node->getArgs(); diff --git a/htdocs/accountancy/bookkeeping/balance.php b/htdocs/accountancy/bookkeeping/balance.php index aaba332d2ef..1e35eebbed1 100644 --- a/htdocs/accountancy/bookkeeping/balance.php +++ b/htdocs/accountancy/bookkeeping/balance.php @@ -206,7 +206,7 @@ if (empty($reshook)) { } if ($action == 'export_csv') { - $sep = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV; + $sep = getDolGlobalString('ACCOUNTING_EXPORT_SEPARATORCSV'); $filename = 'balance'; $type_export = 'balance'; diff --git a/htdocs/accountancy/class/accountancyexport.class.php b/htdocs/accountancy/class/accountancyexport.class.php index e372ab9c206..06ab11b4f49 100644 --- a/htdocs/accountancy/class/accountancyexport.class.php +++ b/htdocs/accountancy/class/accountancyexport.class.php @@ -47,7 +47,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; */ class AccountancyExport { - // Type of export. Used into $conf->global->ACCOUNTING_EXPORT_MODELCSV + // Types of export. public static $EXPORT_TYPE_CONFIGURABLE = 1; // CSV public static $EXPORT_TYPE_AGIRIS = 10; public static $EXPORT_TYPE_EBP = 15; @@ -102,7 +102,7 @@ class AccountancyExport global $conf, $hookmanager; $this->db = $db; - $this->separator = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV; + $this->separator = getDolGlobalString('ACCOUNTING_EXPORT_SEPARATORCSV'); $this->end_line = getDolGlobalString('ACCOUNTING_EXPORT_ENDLINE') ? (getDolGlobalInt('ACCOUNTING_EXPORT_ENDLINE') == 1 ? "\n" : "\r\n") : "\n"; $hookmanager->initHooks(array('accountancyexport')); @@ -869,11 +869,11 @@ class AccountancyExport if ($line->doc_type == 'customer_invoice') { $tab['lib_alpha'] = strtoupper(str_pad('C'.self::trunc(dol_string_unaccent($line->subledger_label), 6), 7)); $tab['filler'] = str_repeat(' ', 52); - $tab['coll_compte'] = str_pad(self::trunc($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER, 8), 8); + $tab['coll_compte'] = str_pad(self::trunc(getDolGlobalString('ACCOUNTING_ACCOUNT_CUSTOMER'), 8), 8); } elseif ($line->doc_type == 'supplier_invoice') { $tab['lib_alpha'] = strtoupper(str_pad('F'.self::trunc(dol_string_unaccent($line->subledger_label), 6), 7)); $tab['filler'] = str_repeat(' ', 52); - $tab['coll_compte'] = str_pad(self::trunc($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER, 8), 8); + $tab['coll_compte'] = str_pad(self::trunc(getDolGlobalString('ACCOUNTING_ACCOUNT_SUPPLIER'), 8), 8); } else { $tab['filler'] = str_repeat(' ', 59); $tab['coll_compte'] = str_pad(' ', 8); diff --git a/htdocs/accountancy/class/accountingaccount.class.php b/htdocs/accountancy/class/accountingaccount.class.php index 637e2bc8f68..423ca2b4ddf 100644 --- a/htdocs/accountancy/class/accountingaccount.class.php +++ b/htdocs/accountancy/class/accountingaccount.class.php @@ -878,9 +878,9 @@ class AccountingAccount extends CommonObject if ($factureDet->desc == "(DEPOSIT)" || $facture->type == $facture::TYPE_DEPOSIT) { $accountdeposittoventilated = new self($this->db); if ($type == 'customer') { - $result = $accountdeposittoventilated->fetch('', $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT, 1); + $result = $accountdeposittoventilated->fetch('', getDolGlobalString('ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT'), 1); } elseif ($type == 'supplier') { - $result = $accountdeposittoventilated->fetch('', $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER_DEPOSIT, 1); + $result = $accountdeposittoventilated->fetch('', getDolGlobalString('ACCOUNTING_ACCOUNT_SUPPLIER_DEPOSIT'), 1); } if (isset($result) && $result < 0) { return -1; @@ -901,9 +901,9 @@ class AccountingAccount extends CommonObject if ($facture->type == $facture::TYPE_CREDIT_NOTE && $invoiceSource->type == $facture::TYPE_DEPOSIT) { $accountdeposittoventilated = new self($this->db); if ($type == 'customer') { - $accountdeposittoventilated->fetch('', $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT, 1); + $accountdeposittoventilated->fetch('', getDolGlobalString('ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT'), 1); } elseif ($type == 'supplier') { - $accountdeposittoventilated->fetch('', $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER_DEPOSIT, 1); + $accountdeposittoventilated->fetch('', getDolGlobalString('ACCOUNTING_ACCOUNT_SUPPLIER_DEPOSIT'), 1); } $code_l = $accountdeposittoventilated->ref; $code_p = ''; diff --git a/htdocs/accountancy/class/accountingjournal.class.php b/htdocs/accountancy/class/accountingjournal.class.php index dd8dd36e2c9..c8bc40560fe 100644 --- a/htdocs/accountancy/class/accountingjournal.class.php +++ b/htdocs/accountancy/class/accountingjournal.class.php @@ -930,7 +930,7 @@ class AccountingJournal extends CommonObject global $conf, $langs, $hookmanager; if (empty($sep)) { - $sep = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV; + $sep = getDolGlobalString('ACCOUNTING_EXPORT_SEPARATORCSV'); } $out = ''; diff --git a/htdocs/accountancy/journal/bankjournal.php b/htdocs/accountancy/journal/bankjournal.php index 11c00917743..4bd365acfa3 100644 --- a/htdocs/accountancy/journal/bankjournal.php +++ b/htdocs/accountancy/journal/bankjournal.php @@ -607,16 +607,16 @@ if (!$error && $action == 'writebookkeeping') { $now = dol_now(); $accountingaccountcustomer = new AccountingAccount($db); - $accountingaccountcustomer->fetch(null, $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER, true); + $accountingaccountcustomer->fetch(null, getDolGlobalString('ACCOUNTING_ACCOUNT_CUSTOMER'), true); $accountingaccountsupplier = new AccountingAccount($db); - $accountingaccountsupplier->fetch(null, $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER, true); + $accountingaccountsupplier->fetch(null, getDolGlobalString('ACCOUNTING_ACCOUNT_SUPPLIER'), true); $accountingaccountpayment = new AccountingAccount($db); - $accountingaccountpayment->fetch(null, $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT, true); + $accountingaccountpayment->fetch(null, getDolGlobalString('SALARIES_ACCOUNTING_ACCOUNT_PAYMENT'), true); $accountingaccountsuspense = new AccountingAccount($db); - $accountingaccountsuspense->fetch(null, $conf->global->ACCOUNTING_ACCOUNT_SUSPENSE, true); + $accountingaccountsuspense->fetch(null, getDolGlobalString('ACCOUNTING_ACCOUNT_SUSPENSE'), true); $error = 0; foreach ($tabpay as $key => $val) { // $key is rowid into llx_bank @@ -736,23 +736,23 @@ if (!$error && $action == 'writebookkeeping') { $lettering = true; $bookkeeping->subledger_account = $k; // For payment, the subledger account is stored as $key of $tabtp $bookkeeping->subledger_label = $tabcompany[$key]['name']; // $tabcompany is defined only if we are sure there is 1 thirdparty for the bank transaction - $bookkeeping->numero_compte = $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER; + $bookkeeping->numero_compte = getDolGlobalString('ACCOUNTING_ACCOUNT_CUSTOMER'); $bookkeeping->label_compte = $accountingaccountcustomer->label; } elseif ($tabtype[$key] == 'payment_supplier') { // If payment is payment of supplier invoice, we get ref of invoice $lettering = true; $bookkeeping->subledger_account = $k; // For payment, the subledger account is stored as $key of $tabtp $bookkeeping->subledger_label = $tabcompany[$key]['name']; // $tabcompany is defined only if we are sure there is 1 thirdparty for the bank transaction - $bookkeeping->numero_compte = $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER; + $bookkeeping->numero_compte = getDolGlobalString('ACCOUNTING_ACCOUNT_SUPPLIER'); $bookkeeping->label_compte = $accountingaccountsupplier->label; } elseif ($tabtype[$key] == 'payment_expensereport') { $bookkeeping->subledger_account = $tabuser[$key]['accountancy_code']; $bookkeeping->subledger_label = $tabuser[$key]['name']; - $bookkeeping->numero_compte = $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT; + $bookkeeping->numero_compte = getDolGlobalString('SALARIES_ACCOUNTING_ACCOUNT_PAYMENT'); $bookkeeping->label_compte = $accountingaccountpayment->label; } elseif ($tabtype[$key] == 'payment_salary') { $bookkeeping->subledger_account = $tabuser[$key]['accountancy_code']; $bookkeeping->subledger_label = $tabuser[$key]['name']; - $bookkeeping->numero_compte = $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT; + $bookkeeping->numero_compte = getDolGlobalString('SALARIES_ACCOUNTING_ACCOUNT_PAYMENT'); $bookkeeping->label_compte = $accountingaccountpayment->label; } elseif (in_array($tabtype[$key], array('sc', 'payment_sc'))) { // If payment is payment of social contribution $bookkeeping->subledger_account = ''; @@ -801,7 +801,7 @@ if (!$error && $action == 'writebookkeeping') { // Temporary account $bookkeeping->subledger_account = ''; $bookkeeping->subledger_label = ''; - $bookkeeping->numero_compte = $conf->global->ACCOUNTING_ACCOUNT_SUSPENSE; + $bookkeeping->numero_compte = getDolGlobalString('ACCOUNTING_ACCOUNT_SUSPENSE'); $bookkeeping->label_compte = $accountingaccountsuspense->label; } } @@ -1397,16 +1397,10 @@ if (empty($action) || $action == 'view') { print ''.$langs->trans("WaitAccountNotDefined").''; } else */ - print length_accountg($conf->global->ACCOUNTING_ACCOUNT_SUSPENSE); + print length_accountg(getDolGlobalString('ACCOUNTING_ACCOUNT_SUSPENSE')); print ""; // Subledger account print ""; - /*if (empty($accounttoshowsubledger) || $accounttoshowsubledger == 'NotDefined') - { - print ''.$langs->trans("WaitAccountNotDefined").''; - } - else print length_accountg($conf->global->ACCOUNTING_ACCOUNT_SUSPENSE); - */ print ""; print "".dol_escape_htmltag($reflabel).""; print ''.$val["type_payment"].""; diff --git a/htdocs/accountancy/journal/expensereportsjournal.php b/htdocs/accountancy/journal/expensereportsjournal.php index a1bf3006328..19d003d34e0 100644 --- a/htdocs/accountancy/journal/expensereportsjournal.php +++ b/htdocs/accountancy/journal/expensereportsjournal.php @@ -488,7 +488,7 @@ $userstatic = new User($db); // Export if ($action == 'exportcsv' && !$error) { // ISO and not UTF8 ! - $sep = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV; + $sep = getDolGlobalString('ACCOUNTING_EXPORT_SEPARATORCSV'); $filename = 'journal'; $type_export = 'journal'; diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index a3bc6ce2ade..8a79ea6f106 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -1817,7 +1817,7 @@ class Adherent extends CommonObject // Add line to draft invoice $idprodsubscription = 0; if (getDolGlobalString('ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS') && (isModEnabled("product") || isModEnabled("service"))) { - $idprodsubscription = $conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS; + $idprodsubscription = getDolGlobalString('ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS'); } $vattouse = 0; @@ -2598,7 +2598,7 @@ class Adherent extends CommonObject if ($this->model_pdf) { $modele = $this->model_pdf; } elseif (getDolGlobalString('ADHERENT_ADDON_PDF')) { - $modele = $conf->global->ADHERENT_ADDON_PDF; + $modele = getDolGlobalString('ADHERENT_ADDON_PDF'); } } @@ -2697,7 +2697,7 @@ class Adherent extends CommonObject $dn = getDolGlobalString('LDAP_KEY_MEMBERS') . "=".$info[getDolGlobalString('LDAP_KEY_MEMBERS')]."," . getDolGlobalString('LDAP_MEMBER_DN'); } if ($mode == 1) { - $dn = $conf->global->LDAP_MEMBER_DN; + $dn = getDolGlobalString('LDAP_MEMBER_DN'); } if ($mode == 2) { $dn = getDolGlobalString('LDAP_KEY_MEMBERS') . "=".$info[getDolGlobalString('LDAP_KEY_MEMBERS')]; diff --git a/htdocs/adherents/subscription.php b/htdocs/adherents/subscription.php index 511553b9e88..ff95d3c12c6 100644 --- a/htdocs/adherents/subscription.php +++ b/htdocs/adherents/subscription.php @@ -373,7 +373,7 @@ if ($user->hasRight('adherent', 'cotisation', 'creer') && $action == 'subscripti // Get email content from template $arraydefaultmessage = null; - $labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_SUBSCRIPTION; + $labeltouse = getDolGlobalString('ADHERENT_EMAIL_TEMPLATE_SUBSCRIPTION'); if (!empty($labeltouse)) { $arraydefaultmessage = $formmail->getEMailTemplate($db, 'member', $user, $outputlangs, 0, 1, $labeltouse); @@ -869,7 +869,7 @@ if (($action == 'addsubscription' || $action == 'create_thirdparty') && $user->h print "\n\n\n"; if ($conf->use_javascript_ajax) { - //var_dump($bankdirect.'-'.$bankviainvoice.'-'.$invoiceonly.'-'.empty($conf->global->ADHERENT_BANK_USE)); + //var_dump($bankdirect.'-'.$bankviainvoice.'-'.$invoiceonly); print "\n".'