From 7ee086b402ead3d4e615f350f558ed9d74871c52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 27 Jan 2019 11:55:16 +0100 Subject: [PATCH 01/15] PSR2 space after comma in function call --- .editorconfig | 3 +- dev/examples/code/create_invoice.php | 8 +- dev/examples/code/create_order.php | 8 +- dev/examples/code/create_product.php | 6 +- dev/examples/code/create_user.php | 8 +- dev/examples/code/get_contracts.php | 4 +- dev/initdata/generate-invoice.php | 112 +-- dev/initdata/generate-order.php | 112 +-- dev/initdata/generate-product.php | 6 +- dev/initdata/generate-proposal.php | 112 +-- dev/initdata/generate-thirdparty.php | 10 +- dev/initdata/import-products.php | 8 +- dev/initdata/import-thirdparties.php | 14 +- dev/initdata/import-users.php | 12 +- dev/initdata/purge-data.php | 18 +- dev/initdemo/sftpget_and_loaddump.php | 14 +- dev/initdemo/updatedemo.php | 4 +- dev/setup/codesniffer/ruleset.xml | 5 +- dev/translation/autotranslator.class.php | 58 +- dev/translation/autotranslator.php | 2 +- dev/translation/sanity_check_en_langfiles.php | 12 +- dev/translation/strip_language_file.php | 10 +- htdocs/accountancy/admin/account.php | 48 +- htdocs/accountancy/admin/accountmodel.php | 104 +-- htdocs/accountancy/admin/card.php | 52 +- htdocs/accountancy/admin/categories.php | 8 +- htdocs/accountancy/admin/categories_list.php | 94 +-- htdocs/accountancy/admin/fiscalyear.php | 12 +- htdocs/accountancy/admin/fiscalyear_card.php | 2 +- htdocs/accountancy/admin/fiscalyear_info.php | 2 +- htdocs/accountancy/admin/importaccounts.php | 12 +- htdocs/accountancy/admin/journals_list.php | 74 +- htdocs/accountancy/admin/productaccount.php | 28 +- htdocs/accountancy/bookkeeping/balance.php | 14 +- .../bookkeeping/balancebymonth.php | 2 +- htdocs/accountancy/bookkeeping/card.php | 62 +- htdocs/accountancy/bookkeeping/list.php | 24 +- .../accountancy/bookkeeping/listbyaccount.php | 10 +- .../thirdparty_lettering_customer.php | 2 +- .../thirdparty_lettering_supplier.php | 28 +- .../class/accountancyexport.class.php | 6 +- .../class/accountingaccount.class.php | 20 +- .../class/accountingjournal.class.php | 2 +- .../accountancy/class/bookkeeping.class.php | 2 +- htdocs/accountancy/class/lettering.class.php | 4 +- htdocs/accountancy/customer/index.php | 4 +- htdocs/accountancy/customer/lines.php | 24 +- htdocs/accountancy/customer/list.php | 38 +- htdocs/accountancy/expensereport/index.php | 4 +- htdocs/accountancy/expensereport/lines.php | 24 +- htdocs/accountancy/expensereport/list.php | 44 +- htdocs/accountancy/journal/bankjournal.php | 18 +- .../journal/expensereportsjournal.php | 8 +- .../accountancy/journal/purchasesjournal.php | 12 +- htdocs/accountancy/journal/sellsjournal.php | 12 +- htdocs/accountancy/supplier/index.php | 4 +- htdocs/accountancy/supplier/lines.php | 26 +- htdocs/accountancy/supplier/list.php | 38 +- htdocs/adherents/admin/adherent.php | 30 +- htdocs/adherents/admin/adherent_emails.php | 16 +- .../adherents/admin/adherent_extrafields.php | 4 +- .../admin/adherent_type_extrafields.php | 4 +- htdocs/adherents/admin/website.php | 28 +- htdocs/adherents/agenda.php | 28 +- .../actions_adherentcard_common.class.php | 24 +- .../actions_adherentcard_default.class.php | 6 +- .../default/tpl/adherentcard_create.tpl.php | 6 +- .../default/tpl/adherentcard_edit.tpl.php | 6 +- .../default/tpl/adherentcard_view.tpl.php | 2 +- htdocs/adherents/card.php | 264 +++--- htdocs/adherents/cartes/carte.php | 38 +- htdocs/adherents/class/adherent.class.php | 134 +-- .../adherents/class/adherent_type.class.php | 18 +- .../adherents/class/adherentstats.class.php | 10 +- htdocs/adherents/class/api_members.class.php | 8 +- .../class/api_memberstypes.class.php | 8 +- .../class/api_subscriptions.class.php | 2 +- htdocs/adherents/class/subscription.class.php | 6 +- htdocs/adherents/document.php | 20 +- htdocs/adherents/htpasswd.php | 6 +- htdocs/adherents/index.php | 50 +- htdocs/adherents/ldap.php | 18 +- htdocs/adherents/list.php | 162 ++-- htdocs/adherents/note.php | 8 +- htdocs/adherents/stats/byproperties.php | 8 +- htdocs/adherents/stats/geo.php | 12 +- htdocs/adherents/stats/index.php | 22 +- htdocs/adherents/subscription.php | 104 +-- htdocs/adherents/subscription/card.php | 24 +- htdocs/adherents/subscription/info.php | 2 +- htdocs/adherents/subscription/list.php | 98 +-- .../adherents/tpl/linkedobjectblock.tpl.php | 2 +- htdocs/adherents/type.php | 124 +-- htdocs/adherents/type_ldap.php | 14 +- htdocs/admin/accountant.php | 64 +- htdocs/admin/agenda.php | 18 +- htdocs/admin/agenda_extrafields.php | 2 +- htdocs/admin/agenda_extsites.php | 42 +- htdocs/admin/agenda_other.php | 62 +- htdocs/admin/agenda_reminder.php | 44 +- htdocs/admin/agenda_xcal.php | 38 +- htdocs/admin/bank_extrafields.php | 4 +- htdocs/admin/barcode.php | 52 +- htdocs/admin/boxes.php | 56 +- htdocs/admin/chequereceipts.php | 48 +- htdocs/admin/clicktodial.php | 16 +- htdocs/admin/commande.php | 98 +-- ...mande_fournisseur_dispatch_extrafields.php | 4 +- htdocs/admin/company.php | 318 ++++---- htdocs/admin/compta.php | 8 +- htdocs/admin/confexped.php | 18 +- htdocs/admin/const.php | 26 +- htdocs/admin/contract.php | 88 +- htdocs/admin/dav.php | 10 +- htdocs/admin/defaultvalues.php | 44 +- htdocs/admin/delais.php | 54 +- htdocs/admin/dict.php | 138 ++-- .../class/PSWebServiceLibrary.class.php | 2 +- htdocs/admin/ecm.php | 12 +- htdocs/admin/emailcollector_card.php | 16 +- htdocs/admin/emailcollector_list.php | 58 +- htdocs/admin/events.php | 10 +- htdocs/admin/expedition.php | 84 +- htdocs/admin/expedition_extrafields.php | 4 +- htdocs/admin/expeditiondet_extrafields.php | 4 +- htdocs/admin/expensereport.php | 88 +- htdocs/admin/expensereport_extrafields.php | 4 +- htdocs/admin/expensereport_ik.php | 12 +- htdocs/admin/expensereport_rules.php | 8 +- htdocs/admin/export.php | 4 +- htdocs/admin/external_rss.php | 20 +- htdocs/admin/facture.php | 164 ++-- htdocs/admin/fckeditor.php | 26 +- htdocs/admin/fichinter.php | 96 +-- htdocs/admin/geoipmaxmind.php | 22 +- htdocs/admin/holiday.php | 88 +- htdocs/admin/ihm.php | 140 ++-- htdocs/admin/index.php | 18 +- htdocs/admin/ldap.php | 72 +- htdocs/admin/ldap_contacts.php | 56 +- htdocs/admin/ldap_groups.php | 36 +- htdocs/admin/ldap_members.php | 84 +- htdocs/admin/ldap_members_types.php | 36 +- htdocs/admin/ldap_users.php | 78 +- htdocs/admin/limits.php | 52 +- htdocs/admin/livraison.php | 78 +- htdocs/admin/livraison_extrafields.php | 4 +- htdocs/admin/livraisondet_extrafields.php | 4 +- htdocs/admin/loan.php | 2 +- htdocs/admin/mailing.php | 22 +- htdocs/admin/mailman.php | 24 +- htdocs/admin/mails.php | 58 +- htdocs/admin/mails_emailing.php | 60 +- htdocs/admin/mails_senderprofile_list.php | 56 +- htdocs/admin/mails_templates.php | 78 +- htdocs/admin/menus.php | 56 +- htdocs/admin/menus/edit.php | 106 +-- htdocs/admin/menus/index.php | 48 +- htdocs/admin/menus/other.php | 14 +- htdocs/admin/modulehelp.php | 22 +- htdocs/admin/modules.php | 122 +-- htdocs/admin/notification.php | 26 +- htdocs/admin/oauth.php | 4 +- htdocs/admin/oauthlogintokens.php | 16 +- htdocs/admin/openinghours.php | 60 +- htdocs/admin/order_extrafields.php | 4 +- htdocs/admin/orderdet_extrafields.php | 4 +- htdocs/admin/payment.php | 54 +- htdocs/admin/pdf.php | 172 ++-- htdocs/admin/perms.php | 14 +- htdocs/admin/prelevement.php | 28 +- htdocs/admin/propal.php | 96 +-- htdocs/admin/proxy.php | 22 +- htdocs/admin/receiptprinter.php | 30 +- htdocs/admin/reception_extrafields.php | 4 +- htdocs/admin/reception_setup.php | 84 +- htdocs/admin/resource.php | 12 +- htdocs/admin/resource_extrafields.php | 4 +- htdocs/admin/salaries.php | 4 +- htdocs/admin/security.php | 42 +- htdocs/admin/security_file.php | 34 +- htdocs/admin/security_other.php | 26 +- htdocs/admin/sms.php | 30 +- htdocs/admin/socialnetworks.php | 10 +- htdocs/admin/spip.php | 18 +- htdocs/admin/stock.php | 12 +- htdocs/admin/supplier_invoice.php | 88 +- htdocs/admin/supplier_order.php | 92 +-- htdocs/admin/supplier_payment.php | 78 +- htdocs/admin/supplier_proposal.php | 96 +-- htdocs/admin/supplierinvoice_extrafields.php | 4 +- .../admin/supplierinvoicedet_extrafields.php | 4 +- htdocs/admin/supplierorder_extrafields.php | 4 +- htdocs/admin/supplierorderdet_extrafields.php | 4 +- htdocs/admin/syslog.php | 18 +- htdocs/admin/system/about.php | 24 +- htdocs/admin/system/browser.php | 2 +- htdocs/admin/system/constall.php | 10 +- htdocs/admin/system/database-tables.php | 6 +- htdocs/admin/system/database.php | 10 +- htdocs/admin/system/dbtable.php | 8 +- htdocs/admin/system/dolibarr.php | 50 +- htdocs/admin/system/filecheck.php | 18 +- htdocs/admin/system/index.php | 2 +- htdocs/admin/system/modules.php | 8 +- htdocs/admin/system/os.php | 2 +- htdocs/admin/system/perf.php | 86 +- htdocs/admin/system/phpinfo.php | 10 +- htdocs/admin/system/web.php | 2 +- htdocs/admin/system/xcache.php | 4 +- htdocs/admin/system/xdebug.php | 2 +- htdocs/admin/taxes.php | 20 +- htdocs/admin/tools/dolibarr_export.php | 30 +- htdocs/admin/tools/dolibarr_import.php | 20 +- htdocs/admin/tools/eaccelerator.php | 14 +- htdocs/admin/tools/export.php | 30 +- htdocs/admin/tools/export_files.php | 18 +- htdocs/admin/tools/index.php | 2 +- htdocs/admin/tools/listevents.php | 46 +- htdocs/admin/tools/listsessions.php | 36 +- htdocs/admin/tools/purge.php | 18 +- htdocs/admin/tools/update.php | 40 +- htdocs/admin/translation.php | 62 +- htdocs/admin/triggers.php | 4 +- htdocs/admin/user.php | 56 +- htdocs/admin/usergroup.php | 48 +- htdocs/admin/website.php | 74 +- htdocs/admin/website_options.php | 20 +- htdocs/admin/workflow.php | 12 +- htdocs/api/admin/explorer.php | 18 +- htdocs/api/admin/index.php | 16 +- htdocs/api/class/api.class.php | 6 +- htdocs/api/class/api_access.class.php | 2 +- htdocs/api/class/api_login.class.php | 2 +- htdocs/api/class/api_setup.class.php | 8 +- htdocs/api/index.php | 20 +- htdocs/asset/admin/assets_extrafields.php | 4 +- .../asset/admin/assets_type_extrafields.php | 4 +- htdocs/asset/admin/setup.php | 8 +- htdocs/asset/card.php | 16 +- htdocs/asset/class/asset.class.php | 26 +- htdocs/asset/class/asset_type.class.php | 14 +- htdocs/asset/document.php | 16 +- htdocs/asset/info.php | 6 +- htdocs/asset/list.php | 56 +- htdocs/asset/note.php | 4 +- htdocs/asset/type.php | 78 +- htdocs/asterisk/cidlookup.php | 2 +- htdocs/asterisk/wrapper.php | 22 +- htdocs/barcode/codeinit.php | 30 +- htdocs/barcode/printsheet.php | 36 +- htdocs/blockedlog/admin/blockedlog.php | 18 +- htdocs/blockedlog/admin/blockedlog_list.php | 108 +-- htdocs/blockedlog/ajax/authority.php | 6 +- htdocs/blockedlog/ajax/block-add.php | 12 +- htdocs/blockedlog/ajax/block-info.php | 8 +- htdocs/blockedlog/ajax/check_signature.php | 6 +- htdocs/blockedlog/class/authority.class.php | 6 +- htdocs/blockedlog/class/blockedlog.class.php | 4 +- htdocs/blockedlog/lib/blockedlog.lib.php | 4 +- htdocs/bookmarks/admin/bookmark.php | 8 +- htdocs/bookmarks/card.php | 38 +- htdocs/bookmarks/list.php | 40 +- htdocs/cashdesk/admin/cashdesk.php | 50 +- htdocs/cashdesk/affContenu.php | 4 +- htdocs/cashdesk/affIndex.php | 2 +- htdocs/cashdesk/class/Auth.class.php | 10 +- htdocs/cashdesk/class/Facturation.class.php | 4 +- htdocs/cashdesk/deconnexion.php | 8 +- htdocs/cashdesk/facturation.php | 4 +- htdocs/cashdesk/facturation_dhtml.php | 12 +- htdocs/cashdesk/facturation_verif.php | 4 +- htdocs/cashdesk/index.php | 18 +- htdocs/cashdesk/index_verif.php | 16 +- htdocs/cashdesk/tpl/facturation1.tpl.php | 6 +- htdocs/cashdesk/tpl/liste_articles.tpl.php | 4 +- htdocs/cashdesk/tpl/ticket.tpl.php | 12 +- htdocs/cashdesk/tpl/validation1.tpl.php | 12 +- htdocs/cashdesk/tpl/validation2.tpl.php | 2 +- htdocs/cashdesk/validation_ticket.php | 2 +- htdocs/cashdesk/validation_verif.php | 30 +- htdocs/categories/admin/categorie.php | 16 +- .../admin/categorie_extrafields.php | 4 +- htdocs/categories/card.php | 32 +- .../categories/class/api_categories.class.php | 10 +- htdocs/categories/class/categorie.class.php | 40 +- htdocs/categories/edit.php | 24 +- htdocs/categories/index.php | 18 +- htdocs/categories/photos.php | 18 +- htdocs/categories/traduction.php | 20 +- htdocs/categories/viewcat.php | 46 +- htdocs/collab/index.php | 18 +- htdocs/comm/action/card.php | 200 ++--- htdocs/comm/action/class/actioncomm.class.php | 108 +-- .../action/class/actioncommreminder.class.php | 22 +- .../action/class/api_agendaevents.class.php | 4 +- .../comm/action/class/cactioncomm.class.php | 4 +- htdocs/comm/action/class/ical.class.php | 30 +- htdocs/comm/action/document.php | 40 +- htdocs/comm/action/index.php | 296 +++---- htdocs/comm/action/info.php | 22 +- htdocs/comm/action/list.php | 146 ++-- htdocs/comm/action/pertype.php | 182 ++--- htdocs/comm/action/peruser.php | 180 ++--- htdocs/comm/action/rapport/index.php | 30 +- htdocs/comm/address.php | 42 +- htdocs/comm/admin/propal_extrafields.php | 4 +- htdocs/comm/admin/propaldet_extrafields.php | 4 +- htdocs/comm/card.php | 150 ++-- htdocs/comm/contact.php | 32 +- htdocs/comm/index.php | 44 +- htdocs/comm/mailing/advtargetemailing.php | 16 +- htdocs/comm/mailing/card.php | 164 ++-- htdocs/comm/mailing/cibles.php | 60 +- .../mailing/class/advtargetemailing.class.php | 92 +-- .../html.formadvtargetemailing.class.php | 14 +- htdocs/comm/mailing/class/mailing.class.php | 68 +- htdocs/comm/mailing/index.php | 22 +- htdocs/comm/mailing/info.php | 2 +- htdocs/comm/mailing/list.php | 62 +- htdocs/comm/multiprix.php | 10 +- htdocs/comm/propal/card.php | 82 +- .../comm/propal/class/api_proposals.class.php | 36 +- htdocs/comm/propal/class/propal.class.php | 104 +-- .../comm/propal/class/propalestats.class.php | 14 +- htdocs/comm/propal/contact.php | 16 +- htdocs/comm/propal/document.php | 24 +- htdocs/comm/propal/index.php | 24 +- htdocs/comm/propal/info.php | 8 +- htdocs/comm/propal/list.php | 184 ++--- htdocs/comm/propal/note.php | 8 +- htdocs/comm/propal/stats/index.php | 36 +- .../comm/propal/tpl/linkedobjectblock.tpl.php | 2 +- htdocs/comm/prospect/index.php | 12 +- htdocs/comm/remise.php | 24 +- htdocs/comm/remx.php | 122 +-- htdocs/commande/card.php | 62 +- htdocs/commande/class/api_orders.class.php | 36 +- htdocs/commande/class/commande.class.php | 166 ++-- htdocs/commande/class/commandestats.class.php | 14 +- htdocs/commande/contact.php | 14 +- htdocs/commande/customer.php | 34 +- htdocs/commande/document.php | 18 +- htdocs/commande/index.php | 28 +- htdocs/commande/info.php | 10 +- htdocs/commande/list.php | 180 ++--- htdocs/commande/note.php | 12 +- htdocs/commande/orderstoinvoice.php | 80 +- htdocs/commande/stats/index.php | 34 +- htdocs/commande/tpl/linkedobjectblock.tpl.php | 4 +- htdocs/compta/ajaxpayment.php | 14 +- htdocs/compta/bank/annuel.php | 32 +- htdocs/compta/bank/bankentries_list.php | 178 ++-- htdocs/compta/bank/budget.php | 4 +- htdocs/compta/bank/card.php | 112 +-- htdocs/compta/bank/categ.php | 6 +- htdocs/compta/bank/class/account.class.php | 42 +- .../bank/class/paymentvarious.class.php | 44 +- htdocs/compta/bank/document.php | 4 +- htdocs/compta/bank/graph.php | 110 +-- htdocs/compta/bank/ligne.php | 66 +- htdocs/compta/bank/list.php | 94 +-- htdocs/compta/bank/releve.php | 80 +- htdocs/compta/bank/transfer.php | 26 +- htdocs/compta/bank/treso.php | 20 +- htdocs/compta/bank/various_payment/card.php | 66 +- .../compta/bank/various_payment/document.php | 18 +- htdocs/compta/bank/various_payment/info.php | 8 +- htdocs/compta/bank/various_payment/list.php | 74 +- .../compta/cashcontrol/cashcontrol_card.php | 58 +- .../compta/cashcontrol/cashcontrol_list.php | 60 +- .../cashcontrol/class/cashcontrol.class.php | 20 +- htdocs/compta/cashcontrol/report.php | 18 +- htdocs/compta/charges/index.php | 116 +-- htdocs/compta/clients.php | 26 +- htdocs/compta/compta-files.php | 70 +- htdocs/compta/deplacement/card.php | 86 +- .../deplacement/class/deplacement.class.php | 28 +- .../class/deplacementstats.class.php | 10 +- htdocs/compta/deplacement/document.php | 18 +- htdocs/compta/deplacement/index.php | 26 +- htdocs/compta/deplacement/info.php | 2 +- htdocs/compta/deplacement/list.php | 46 +- htdocs/compta/deplacement/stats/index.php | 32 +- .../admin/facture_cust_extrafields.php | 4 +- .../admin/facture_rec_cust_extrafields.php | 4 +- .../admin/facturedet_cust_extrafields.php | 4 +- .../admin/facturedet_rec_cust_extrafields.php | 4 +- htdocs/compta/facture/card.php | 154 ++-- .../facture/class/api_invoices.class.php | 78 +- .../facture/class/facture-rec.class.php | 52 +- htdocs/compta/facture/class/facture.class.php | 128 +-- .../facture/class/facturestats.class.php | 14 +- htdocs/compta/facture/contact.php | 16 +- htdocs/compta/facture/document.php | 24 +- htdocs/compta/facture/fiche-rec.php | 130 +-- htdocs/compta/facture/info.php | 6 +- .../compta/facture/invoicetemplate_list.php | 126 +-- htdocs/compta/facture/list.php | 208 ++--- htdocs/compta/facture/note.php | 14 +- htdocs/compta/facture/prelevement.php | 58 +- htdocs/compta/facture/stats/index.php | 28 +- .../facture/tpl/linkedobjectblock.tpl.php | 2 +- .../tpl/linkedobjectblockForRec.tpl.php | 2 +- htdocs/compta/index.php | 84 +- htdocs/compta/journal/purchasesjournal.php | 16 +- htdocs/compta/journal/sellsjournal.php | 14 +- htdocs/compta/localtax/card.php | 30 +- .../compta/localtax/class/localtax.class.php | 16 +- htdocs/compta/localtax/clients.php | 58 +- htdocs/compta/localtax/index.php | 58 +- htdocs/compta/localtax/list.php | 10 +- htdocs/compta/localtax/quadri_detail.php | 96 +-- htdocs/compta/paiement.php | 100 +-- htdocs/compta/paiement/card.php | 36 +- htdocs/compta/paiement/cheque/card.php | 80 +- .../cheque/class/remisecheque.class.php | 44 +- htdocs/compta/paiement/cheque/index.php | 10 +- htdocs/compta/paiement/cheque/list.php | 52 +- .../compta/paiement/class/paiement.class.php | 26 +- htdocs/compta/paiement/info.php | 4 +- htdocs/compta/paiement/list.php | 78 +- htdocs/compta/paiement/rapport.php | 24 +- htdocs/compta/paiement/tovalidate.php | 28 +- htdocs/compta/paiement_charge.php | 20 +- htdocs/compta/payment_sc/card.php | 14 +- htdocs/compta/prelevement/bons.php | 42 +- htdocs/compta/prelevement/card.php | 52 +- .../class/bonprelevement.class.php | 100 +-- .../class/ligneprelevement.class.php | 20 +- .../class/rejetprelevement.class.php | 6 +- htdocs/compta/prelevement/create.php | 28 +- htdocs/compta/prelevement/demandes.php | 32 +- htdocs/compta/prelevement/factures.php | 36 +- htdocs/compta/prelevement/fiche-rejet.php | 20 +- htdocs/compta/prelevement/fiche-stat.php | 28 +- htdocs/compta/prelevement/index.php | 22 +- htdocs/compta/prelevement/ligne.php | 36 +- htdocs/compta/prelevement/list.php | 58 +- htdocs/compta/prelevement/rejets.php | 22 +- htdocs/compta/prelevement/stats.php | 18 +- htdocs/compta/recap-compta.php | 22 +- htdocs/compta/resultat/clientfourn.php | 78 +- htdocs/compta/resultat/index.php | 72 +- htdocs/compta/resultat/result.php | 46 +- htdocs/compta/salaries/card.php | 56 +- .../salaries/class/paymentsalary.class.php | 22 +- .../salaries/class/salariesstats.class.php | 10 +- htdocs/compta/salaries/document.php | 20 +- htdocs/compta/salaries/info.php | 8 +- htdocs/compta/salaries/list.php | 66 +- htdocs/compta/salaries/stats/index.php | 30 +- htdocs/compta/sociales/card.php | 60 +- .../sociales/class/cchargesociales.class.php | 18 +- .../sociales/class/chargesociales.class.php | 16 +- .../class/paymentsocialcontribution.class.php | 14 +- htdocs/compta/sociales/document.php | 18 +- htdocs/compta/sociales/info.php | 10 +- htdocs/compta/sociales/list.php | 64 +- htdocs/compta/sociales/payments.php | 108 +-- htdocs/compta/stats/byratecountry.php | 40 +- htdocs/compta/stats/cabyprodserv.php | 38 +- htdocs/compta/stats/cabyuser.php | 40 +- htdocs/compta/stats/casoc.php | 72 +- htdocs/compta/stats/index.php | 78 +- htdocs/compta/tva/card.php | 40 +- htdocs/compta/tva/class/tva.class.php | 18 +- htdocs/compta/tva/clients.php | 104 +-- htdocs/compta/tva/document.php | 20 +- htdocs/compta/tva/index.php | 46 +- htdocs/compta/tva/info.php | 10 +- htdocs/compta/tva/list.php | 74 +- htdocs/compta/tva/quadri_detail.php | 102 +-- htdocs/contact/agenda.php | 44 +- .../actions_contactcard_common.class.php | 28 +- .../actions_contactcard_default.class.php | 6 +- .../default/tpl/contactcard_create.tpl.php | 6 +- .../default/tpl/contactcard_edit.tpl.php | 6 +- .../default/tpl/contactcard_view.tpl.php | 2 +- htdocs/contact/card.php | 238 +++--- htdocs/contact/class/contact.class.php | 42 +- htdocs/contact/document.php | 16 +- htdocs/contact/info.php | 4 +- htdocs/contact/ldap.php | 14 +- htdocs/contact/list.php | 196 ++--- htdocs/contact/note.php | 4 +- htdocs/contact/perso.php | 26 +- htdocs/contact/vcard.php | 4 +- htdocs/contrat/admin/contract_extrafields.php | 2 +- .../contrat/admin/contractdet_extrafields.php | 2 +- htdocs/contrat/card.php | 170 ++-- htdocs/contrat/class/api_contracts.class.php | 18 +- htdocs/contrat/class/contrat.class.php | 130 +-- htdocs/contrat/contact.php | 24 +- htdocs/contrat/document.php | 20 +- htdocs/contrat/index.php | 94 +-- htdocs/contrat/info.php | 10 +- htdocs/contrat/list.php | 158 ++-- htdocs/contrat/note.php | 24 +- htdocs/contrat/services_list.php | 122 +-- htdocs/contrat/tpl/linkedobjectblock.tpl.php | 2 +- htdocs/core/actions_addupdatedelete.inc.php | 18 +- htdocs/core/actions_builddoc.inc.php | 20 +- htdocs/core/actions_comments.inc.php | 8 +- htdocs/core/actions_dellink.inc.php | 12 +- htdocs/core/actions_extrafields.inc.php | 76 +- htdocs/core/actions_lineupdown.inc.php | 4 +- htdocs/core/actions_linkedfiles.inc.php | 22 +- htdocs/core/actions_massactions.inc.php | 80 +- htdocs/core/actions_sendmails.inc.php | 64 +- htdocs/core/actions_setmoduleoptions.inc.php | 18 +- htdocs/core/actions_setnotes.inc.php | 22 +- htdocs/core/ajax/ajaxdirpreview.php | 50 +- htdocs/core/ajax/ajaxdirtree.php | 48 +- htdocs/core/ajax/bankconciliate.php | 36 +- htdocs/core/ajax/box.php | 28 +- htdocs/core/ajax/check_notifications.php | 12 +- htdocs/core/ajax/constantonoff.php | 18 +- htdocs/core/ajax/contacts.php | 16 +- htdocs/core/ajax/extraparams.php | 18 +- htdocs/core/ajax/fileupload.php | 14 +- htdocs/core/ajax/getaccountcurrency.php | 8 +- htdocs/core/ajax/loadinplace.php | 28 +- htdocs/core/ajax/objectonoff.php | 14 +- htdocs/core/ajax/price.php | 14 +- htdocs/core/ajax/row.php | 24 +- htdocs/core/ajax/saveinplace.php | 32 +- htdocs/core/ajax/security.php | 12 +- htdocs/core/ajax/selectobject.php | 12 +- htdocs/core/ajax/selectsearchbox.php | 48 +- htdocs/core/ajax/vatrates.php | 16 +- htdocs/core/ajax/ziptown.php | 18 +- htdocs/core/antispamimage.php | 18 +- htdocs/core/boxes/box_actions.php | 8 +- htdocs/core/boxes/box_activity.php | 40 +- htdocs/core/boxes/box_bookmarks.php | 4 +- htdocs/core/boxes/box_clients.php | 4 +- htdocs/core/boxes/box_commandes.php | 6 +- htdocs/core/boxes/box_comptes.php | 4 +- htdocs/core/boxes/box_contacts.php | 2 +- htdocs/core/boxes/box_contracts.php | 4 +- htdocs/core/boxes/box_external_rss.php | 18 +- htdocs/core/boxes/box_factures.php | 8 +- htdocs/core/boxes/box_factures_fourn.php | 8 +- htdocs/core/boxes/box_factures_fourn_imp.php | 8 +- htdocs/core/boxes/box_factures_imp.php | 8 +- htdocs/core/boxes/box_ficheinter.php | 6 +- htdocs/core/boxes/box_fournisseurs.php | 4 +- htdocs/core/boxes/box_goodcustomers.php | 10 +- .../boxes/box_graph_invoices_permonth.php | 26 +- .../box_graph_invoices_supplier_permonth.php | 26 +- .../core/boxes/box_graph_orders_permonth.php | 26 +- .../box_graph_orders_supplier_permonth.php | 26 +- .../boxes/box_graph_product_distribution.php | 44 +- .../boxes/box_graph_propales_permonth.php | 26 +- htdocs/core/boxes/box_lastlogin.php | 2 +- htdocs/core/boxes/box_members.php | 8 +- htdocs/core/boxes/box_produits.php | 12 +- .../core/boxes/box_produits_alerte_stock.php | 14 +- htdocs/core/boxes/box_project.php | 2 +- htdocs/core/boxes/box_propales.php | 6 +- htdocs/core/boxes/box_prospect.php | 6 +- htdocs/core/boxes/box_services_contracts.php | 12 +- htdocs/core/boxes/box_services_expired.php | 4 +- htdocs/core/boxes/box_supplier_orders.php | 4 +- htdocs/core/boxes/box_task.php | 12 +- htdocs/core/boxes/modules_boxes.php | 38 +- htdocs/core/class/CMailFile.class.php | 84 +- htdocs/core/class/CSMSFile.class.php | 12 +- htdocs/core/class/antivir.class.php | 18 +- htdocs/core/class/canvas.class.php | 6 +- htdocs/core/class/comment.class.php | 6 +- .../core/class/commondocgenerator.class.php | 110 +-- htdocs/core/class/commoninvoice.class.php | 72 +- htdocs/core/class/commonobject.class.php | 290 +++---- .../class/commonstickergenerator.class.php | 30 +- htdocs/core/class/conf.class.php | 18 +- htdocs/core/class/ctyperesource.class.php | 2 +- htdocs/core/class/doleditor.class.php | 16 +- htdocs/core/class/dolgeoip.class.php | 2 +- htdocs/core/class/dolgraph.class.php | 52 +- .../core/class/emailsenderprofile.class.php | 22 +- htdocs/core/class/events.class.php | 4 +- htdocs/core/class/extrafields.class.php | 128 +-- htdocs/core/class/fileupload.class.php | 18 +- htdocs/core/class/fiscalyear.class.php | 18 +- htdocs/core/class/hookmanager.class.php | 12 +- htdocs/core/class/html.form.class.php | 416 +++++----- .../core/class/html.formaccounting.class.php | 8 +- htdocs/core/class/html.formactions.class.php | 12 +- htdocs/core/class/html.formadmin.class.php | 32 +- htdocs/core/class/html.formcompany.class.php | 30 +- htdocs/core/class/html.formcontract.class.php | 2 +- htdocs/core/class/html.formfile.class.php | 172 ++-- .../class/html.formintervention.class.php | 2 +- htdocs/core/class/html.formmail.class.php | 102 +-- htdocs/core/class/html.formmargin.class.php | 4 +- htdocs/core/class/html.formorder.class.php | 2 +- htdocs/core/class/html.formother.class.php | 42 +- htdocs/core/class/html.formprojet.class.php | 12 +- htdocs/core/class/html.formsms.class.php | 14 +- .../class/html.formsocialcontrib.class.php | 10 +- htdocs/core/class/html.formticket.class.php | 2 +- htdocs/core/class/html.formwebsite.class.php | 2 +- htdocs/core/class/infobox.class.php | 22 +- htdocs/core/class/interfaces.class.php | 48 +- htdocs/core/class/ldap.class.php | 130 +-- htdocs/core/class/link.class.php | 10 +- htdocs/core/class/menu.class.php | 6 +- htdocs/core/class/menubase.class.php | 22 +- htdocs/core/class/notify.class.php | 90 +-- htdocs/core/class/openid.class.php | 14 +- htdocs/core/class/rssparser.class.php | 6 +- htdocs/core/class/smtps.class.php | 38 +- htdocs/core/class/translate.class.php | 90 +-- htdocs/core/class/utils.class.php | 52 +- htdocs/core/class/vcard.class.php | 2 +- htdocs/core/datepicker.php | 38 +- htdocs/core/db/DoliDB.class.php | 28 +- htdocs/core/db/mssql.class.php | 100 +-- htdocs/core/db/mysqli.class.php | 62 +- htdocs/core/db/pgsql.class.php | 196 ++--- htdocs/core/db/sqlite3.class.php | 170 ++-- .../browser/default/frmactualfolder.php | 4 +- .../browser/default/frmcreatefolder.php | 4 +- .../browser/default/frmfolders.php | 2 +- .../browser/default/frmresourceslist.php | 2 +- .../browser/default/frmupload.php | 2 +- .../filemanagerdol/connectors/php/config.php | 4 +- .../core/filemanagerdol/connectors/php/io.php | 2 +- htdocs/core/get_info.php | 16 +- htdocs/core/get_menudiv.php | 28 +- htdocs/core/lib/accounting.lib.php | 2 +- htdocs/core/lib/admin.lib.php | 146 ++-- htdocs/core/lib/agenda.lib.php | 34 +- htdocs/core/lib/ajax.lib.php | 16 +- htdocs/core/lib/asset.lib.php | 8 +- htdocs/core/lib/bank.lib.php | 8 +- htdocs/core/lib/barcode.lib.php | 18 +- htdocs/core/lib/categories.lib.php | 8 +- htdocs/core/lib/company.lib.php | 92 +-- htdocs/core/lib/contact.lib.php | 6 +- htdocs/core/lib/contract.lib.php | 12 +- htdocs/core/lib/cron.lib.php | 10 +- htdocs/core/lib/date.lib.php | 76 +- htdocs/core/lib/doc.lib.php | 16 +- htdocs/core/lib/doleditor.lib.php | 12 +- htdocs/core/lib/donation.lib.php | 4 +- htdocs/core/lib/ecm.lib.php | 4 +- htdocs/core/lib/emailing.lib.php | 4 +- htdocs/core/lib/expedition.lib.php | 4 +- htdocs/core/lib/expensereport.lib.php | 14 +- htdocs/core/lib/fichinter.lib.php | 16 +- htdocs/core/lib/files.lib.php | 210 ++--- htdocs/core/lib/fiscalyear.lib.php | 4 +- htdocs/core/lib/fourn.lib.php | 22 +- htdocs/core/lib/functions.lib.php | 764 +++++++++--------- htdocs/core/lib/functions2.lib.php | 342 ++++---- htdocs/core/lib/functions_ch.lib.php | 6 +- htdocs/core/lib/functionsnumtoword.lib.php | 4 +- htdocs/core/lib/geturl.lib.php | 4 +- htdocs/core/lib/holiday.lib.php | 10 +- htdocs/core/lib/hrm.lib.php | 8 +- htdocs/core/lib/images.lib.php | 30 +- htdocs/core/lib/invoice.lib.php | 16 +- htdocs/core/lib/invoice2.lib.php | 36 +- htdocs/core/lib/ldap.lib.php | 6 +- htdocs/core/lib/loan.lib.php | 6 +- htdocs/core/lib/member.lib.php | 24 +- htdocs/core/lib/memory.lib.php | 26 +- htdocs/core/lib/modulebuilder.lib.php | 2 +- htdocs/core/lib/order.lib.php | 12 +- htdocs/core/lib/parsemd.lib.php | 2 +- htdocs/core/lib/payments.lib.php | 32 +- htdocs/core/lib/pdf.lib.php | 262 +++--- htdocs/core/lib/prelevement.lib.php | 4 +- htdocs/core/lib/price.lib.php | 12 +- htdocs/core/lib/product.lib.php | 40 +- htdocs/core/lib/project.lib.php | 126 +-- htdocs/core/lib/propal.lib.php | 12 +- htdocs/core/lib/reception.lib.php | 6 +- htdocs/core/lib/resource.lib.php | 14 +- htdocs/core/lib/salaries.lib.php | 6 +- htdocs/core/lib/security.lib.php | 60 +- htdocs/core/lib/security2.lib.php | 68 +- htdocs/core/lib/sendings.lib.php | 38 +- htdocs/core/lib/signature.lib.php | 4 +- htdocs/core/lib/stock.lib.php | 4 +- htdocs/core/lib/supplier_proposal.lib.php | 12 +- htdocs/core/lib/tax.lib.php | 94 +-- htdocs/core/lib/ticket.lib.php | 4 +- htdocs/core/lib/treeview.lib.php | 8 +- htdocs/core/lib/trip.lib.php | 4 +- htdocs/core/lib/usergroups.lib.php | 72 +- htdocs/core/lib/vat.lib.php | 6 +- htdocs/core/lib/website.lib.php | 14 +- htdocs/core/lib/ws.lib.php | 6 +- htdocs/core/lib/xcal.lib.php | 132 +-- htdocs/core/login/functions_dolibarr.php | 6 +- htdocs/core/login/functions_ldap.php | 24 +- htdocs/core/menus/standard/auguria.lib.php | 64 +- htdocs/core/menus/standard/auguria_menu.php | 36 +- htdocs/core/menus/standard/eldy.lib.php | 450 +++++------ htdocs/core/menus/standard/eldy_menu.php | 40 +- htdocs/core/menus/standard/empty.php | 102 +-- htdocs/core/modules/action/modules_action.php | 12 +- htdocs/core/modules/action/rapport.pdf.php | 46 +- .../core/modules/bank/doc/pdf_ban.modules.php | 60 +- .../bank/doc/pdf_sepamandate.modules.php | 78 +- .../barcode/doc/phpbarcode.modules.php | 6 +- .../barcode/mod_barcode_product_standard.php | 16 +- .../modules/barcode/modules_barcode.class.php | 16 +- .../modules/cheque/doc/pdf_blochet.class.php | 112 +-- .../modules/cheque/mod_chequereceipt_mint.php | 12 +- .../cheque/mod_chequereceipt_thyme.php | 12 +- .../modules/cheque/modules_chequereceipts.php | 6 +- .../doc/doc_generic_order_odt.modules.php | 60 +- .../commande/doc/pdf_einstein.modules.php | 272 +++---- .../commande/doc/pdf_eratosthene.modules.php | 286 +++---- .../modules/commande/mod_commande_marbre.php | 10 +- .../modules/commande/mod_commande_saphir.php | 12 +- .../doc/doc_generic_contract_odt.modules.php | 58 +- .../contract/doc/pdf_strato.modules.php | 140 ++-- .../modules/contract/mod_contract_magre.php | 12 +- .../modules/contract/mod_contract_serpis.php | 12 +- .../modules/contract/modules_contract.php | 2 +- .../modules/dons/html_cerfafr.modules.php | 104 +-- htdocs/core/modules/dons/modules_don.php | 2 +- .../doc/doc_generic_shipment_odt.modules.php | 66 +- .../expedition/doc/pdf_merou.modules.php | 172 ++-- .../expedition/doc/pdf_rouget.modules.php | 200 ++--- .../expedition/mod_expedition_ribera.php | 12 +- .../expedition/mod_expedition_safor.php | 12 +- .../modules/expedition/modules_expedition.php | 2 +- .../doc/pdf_standard.modules.php | 198 ++--- .../expensereport/mod_expensereport_jade.php | 12 +- .../expensereport/mod_expensereport_sand.php | 8 +- .../expensereport/modules_expensereport.php | 2 +- .../modules/export/export_csv.modules.php | 32 +- .../modules/export/export_excel.modules.php | 22 +- .../export/export_excel2007.modules.php | 2 +- .../export/export_excelnew.modules.php | 18 +- .../modules/export/export_tsv.modules.php | 28 +- htdocs/core/modules/export/modules_export.php | 2 +- .../doc/doc_generic_invoice_odt.modules.php | 64 +- .../modules/facture/doc/pdf_crabe.modules.php | 332 ++++---- .../facture/doc/pdf_sponge.modules.php | 348 ++++---- .../core/modules/facture/mod_facture_mars.php | 24 +- .../modules/facture/mod_facture_mercure.php | 20 +- .../modules/facture/mod_facture_terre.php | 30 +- .../core/modules/facture/modules_facture.php | 2 +- .../fichinter/doc/pdf_soleil.modules.php | 160 ++-- htdocs/core/modules/fichinter/mod_arctic.php | 12 +- htdocs/core/modules/fichinter/mod_pacific.php | 14 +- .../modules/fichinter/modules_fichinter.php | 12 +- .../holiday/mod_holiday_immaculate.php | 8 +- .../modules/holiday/mod_holiday_madonna.php | 12 +- .../modules/import/import_csv.modules.php | 64 +- .../modules/import/import_xlsx.modules.php | 52 +- htdocs/core/modules/import/modules_import.php | 4 +- .../livraison/doc/pdf_typhon.modules.php | 166 ++-- .../modules/livraison/mod_livraison_jade.php | 14 +- .../livraison/mod_livraison_saphir.php | 14 +- .../modules/livraison/modules_livraison.php | 2 +- .../mailings/advthirdparties.modules.php | 16 +- .../modules/mailings/contacts1.modules.php | 12 +- .../core/modules/mailings/fraise.modules.php | 16 +- .../modules/mailings/modules_mailings.php | 2 +- .../core/modules/mailings/pomme.modules.php | 2 +- .../modules/mailings/thirdparties.modules.php | 4 +- .../thirdparties_services_expired.modules.php | 10 +- .../modules/mailings/xinputfile.modules.php | 8 +- .../modules/mailings/xinputuser.modules.php | 6 +- .../modules/member/doc/pdf_standard.class.php | 62 +- htdocs/core/modules/member/modules_cards.php | 12 +- htdocs/core/modules/modAdherent.class.php | 6 +- htdocs/core/modules/modAgenda.class.php | 4 +- htdocs/core/modules/modApi.class.php | 2 +- htdocs/core/modules/modAsset.class.php | 4 +- htdocs/core/modules/modBanque.class.php | 4 +- htdocs/core/modules/modBarcode.class.php | 2 +- htdocs/core/modules/modBlockedLog.class.php | 2 +- htdocs/core/modules/modBookmark.class.php | 2 +- htdocs/core/modules/modCashDesk.class.php | 4 +- htdocs/core/modules/modCategorie.class.php | 4 +- htdocs/core/modules/modClickToDial.class.php | 2 +- htdocs/core/modules/modCollab.class.php | 2 +- htdocs/core/modules/modCommande.class.php | 8 +- htdocs/core/modules/modComptabilite.class.php | 4 +- htdocs/core/modules/modContrat.class.php | 8 +- htdocs/core/modules/modDav.class.php | 2 +- htdocs/core/modules/modDeplacement.class.php | 6 +- .../modules/modDocumentGeneration.class.php | 4 +- htdocs/core/modules/modDon.class.php | 4 +- .../core/modules/modDynamicPrices.class.php | 2 +- htdocs/core/modules/modECM.class.php | 2 +- .../core/modules/modEmailCollector.class.php | 2 +- htdocs/core/modules/modExpedition.class.php | 12 +- .../core/modules/modExpenseReport.class.php | 4 +- htdocs/core/modules/modExport.class.php | 2 +- htdocs/core/modules/modExternalRss.class.php | 8 +- htdocs/core/modules/modExternalSite.class.php | 2 +- htdocs/core/modules/modFTP.class.php | 2 +- htdocs/core/modules/modFckeditor.class.php | 4 +- htdocs/core/modules/modFicheinter.class.php | 4 +- htdocs/core/modules/modFournisseur.class.php | 4 +- htdocs/core/modules/modGeoIPMaxmind.class.php | 2 +- htdocs/core/modules/modHRM.class.php | 2 +- htdocs/core/modules/modHoliday.class.php | 2 +- htdocs/core/modules/modImport.class.php | 2 +- htdocs/core/modules/modIncoterm.class.php | 2 +- htdocs/core/modules/modLabel.class.php | 4 +- htdocs/core/modules/modLdap.class.php | 2 +- htdocs/core/modules/modLoan.class.php | 4 +- htdocs/core/modules/modMailing.class.php | 4 +- htdocs/core/modules/modMailmanSpip.class.php | 2 +- htdocs/core/modules/modMargin.class.php | 2 +- .../core/modules/modModuleBuilder.class.php | 2 +- htdocs/core/modules/modNotification.class.php | 4 +- htdocs/core/modules/modOauth.class.php | 2 +- htdocs/core/modules/modOpenSurvey.class.php | 4 +- htdocs/core/modules/modPaybox.class.php | 2 +- htdocs/core/modules/modPaypal.class.php | 2 +- htdocs/core/modules/modPrelevement.class.php | 4 +- htdocs/core/modules/modPrinting.class.php | 2 +- htdocs/core/modules/modProduct.class.php | 106 +-- htdocs/core/modules/modProductBatch.class.php | 4 +- htdocs/core/modules/modProjet.class.php | 14 +- htdocs/core/modules/modPropale.class.php | 8 +- .../core/modules/modReceiptPrinter.class.php | 4 +- htdocs/core/modules/modReception.class.php | 12 +- htdocs/core/modules/modSalaries.class.php | 4 +- htdocs/core/modules/modService.class.php | 24 +- .../core/modules/modSocialNetworks.class.php | 2 +- htdocs/core/modules/modSociete.class.php | 14 +- htdocs/core/modules/modStock.class.php | 10 +- htdocs/core/modules/modStripe.class.php | 2 +- .../modules/modSupplierProposal.class.php | 6 +- htdocs/core/modules/modSyslog.class.php | 2 +- htdocs/core/modules/modTakePos.class.php | 2 +- htdocs/core/modules/modTax.class.php | 4 +- htdocs/core/modules/modUser.class.php | 6 +- htdocs/core/modules/modVariants.class.php | 2 +- htdocs/core/modules/modWebServices.class.php | 2 +- .../modules/modWebServicesClient.class.php | 2 +- htdocs/core/modules/modWebsite.class.php | 6 +- htdocs/core/modules/modWorkflow.class.php | 4 +- .../modules/oauth/github_oauthcallback.php | 2 +- .../modules/oauth/google_oauthcallback.php | 2 +- .../oauth/stripetest_oauthcallback.php | 2 +- .../core/modules/payment/mod_payment_ant.php | 12 +- .../modules/payment/mod_payment_cicada.php | 12 +- .../modules/printing/modules_printing.php | 4 +- .../modules/printing/printgcp.modules.php | 8 +- .../modules/printing/printipp.modules.php | 20 +- .../doc/pdf_standardlabel.class.php | 56 +- .../printsheet/doc/pdf_tcpdflabel.class.php | 28 +- .../modules/printsheet/modules_labels.php | 12 +- .../doc/doc_generic_product_odt.modules.php | 56 +- .../product/doc/pdf_standard.modules.php | 96 +-- .../product/mod_codeproduct_elephant.php | 18 +- .../modules/product/modules_product.class.php | 24 +- .../doc/doc_generic_project_odt.modules.php | 128 +-- .../project/doc/pdf_baleine.modules.php | 96 +-- .../project/doc/pdf_beluga.modules.php | 90 +-- .../project/doc/pdf_timespent.modules.php | 96 +-- .../modules/project/mod_project_simple.php | 12 +- .../modules/project/mod_project_universal.php | 8 +- .../core/modules/project/modules_project.php | 2 +- .../task/doc/doc_generic_task_odt.modules.php | 106 +-- .../modules/project/task/mod_task_simple.php | 14 +- .../project/task/mod_task_universal.php | 10 +- .../modules/project/task/modules_task.php | 2 +- .../doc/doc_generic_proposal_odt.modules.php | 66 +- .../modules/propale/doc/pdf_azur.modules.php | 312 +++---- .../modules/propale/doc/pdf_cyan.modules.php | 326 ++++---- .../modules/propale/mod_propale_marbre.php | 14 +- .../modules/propale/mod_propale_saphir.php | 10 +- .../core/modules/propale/modules_propale.php | 2 +- .../modules/rapport/pdf_paiement.class.php | 48 +- .../doc/doc_generic_reception_odt.modules.php | 62 +- .../reception/doc/pdf_squille.modules.php | 202 ++--- .../modules/reception/mod_reception_beryl.php | 12 +- .../reception/mod_reception_moonstone.php | 12 +- .../modules/reception/modules_reception.php | 2 +- .../generate/modGeneratePassPerso.class.php | 20 +- .../societe/doc/doc_generic_odt.modules.php | 46 +- .../societe/mod_codeclient_elephant.php | 18 +- .../modules/societe/mod_codeclient_monkey.php | 6 +- .../societe/mod_codecompta_aquarium.php | 14 +- .../modules/societe/modules_societe.class.php | 28 +- .../doc/doc_generic_stock_odt.modules.php | 56 +- .../stock/doc/pdf_standard.modules.php | 152 ++-- .../stock/doc/pdf_stdmovement.modules.php | 184 ++--- .../core/modules/stock/modules_movement.php | 2 +- htdocs/core/modules/stock/modules_stock.php | 2 +- .../mod_facture_fournisseur_cactus.php | 30 +- .../mod_facture_fournisseur_tulip.php | 18 +- .../pdf/pdf_canelle.modules.php | 216 ++--- .../mod_commande_fournisseur_muguet.php | 14 +- .../mod_commande_fournisseur_orchidee.php | 12 +- .../modules_commandefournisseur.php | 2 +- .../pdf/pdf_muscadet.modules.php | 254 +++--- .../doc/pdf_standard.modules.php | 112 +-- .../mod_supplier_payment_brodator.php | 12 +- .../mod_supplier_payment_bronan.php | 12 +- .../modules_supplier_payment.php | 2 +- ..._generic_supplier_proposal_odt.modules.php | 64 +- .../doc/pdf_aurore.modules.php | 272 +++---- .../mod_supplier_proposal_marbre.php | 14 +- .../mod_supplier_proposal_saphir.php | 10 +- .../modules_supplier_proposal.php | 2 +- .../modules/syslog/mod_syslog_chromephp.php | 4 +- .../core/modules/syslog/mod_syslog_file.php | 2 +- .../user/doc/doc_generic_user_odt.modules.php | 56 +- .../core/modules/user/modules_user.class.php | 2 +- .../doc/doc_generic_usergroup_odt.modules.php | 64 +- htdocs/core/photos_resize.php | 56 +- htdocs/core/search.php | 16 +- htdocs/core/search_page.php | 12 +- htdocs/core/tools.php | 2 +- htdocs/core/tpl/admin_extrafields_add.tpl.php | 46 +- .../core/tpl/admin_extrafields_edit.tpl.php | 16 +- .../core/tpl/admin_extrafields_view.tpl.php | 2 +- htdocs/core/tpl/advtarget.tpl.php | 2 +- .../tpl/ajax/objectlinked_lineimport.tpl.php | 2 +- htdocs/core/tpl/ajaxrow.tpl.php | 2 +- htdocs/core/tpl/bloc_comment.tpl.php | 4 +- htdocs/core/tpl/card_presend.tpl.php | 8 +- htdocs/core/tpl/commonfields_add.tpl.php | 2 +- htdocs/core/tpl/commonfields_edit.tpl.php | 2 +- htdocs/core/tpl/contacts.tpl.php | 16 +- .../tpl/document_actions_post_headers.tpl.php | 2 +- .../tpl/extrafields_list_search_input.tpl.php | 2 +- .../tpl/extrafields_list_search_param.tpl.php | 2 +- .../tpl/extrafields_list_search_sql.tpl.php | 2 +- htdocs/core/tpl/extrafields_view.tpl.php | 2 +- htdocs/core/tpl/filemanager.tpl.php | 10 +- htdocs/core/tpl/login.tpl.php | 26 +- htdocs/core/tpl/massactions_pre.tpl.php | 2 +- htdocs/core/tpl/notes.tpl.php | 4 +- htdocs/core/tpl/objectline_create.tpl.php | 38 +- htdocs/core/tpl/objectline_edit.tpl.php | 22 +- htdocs/core/tpl/objectline_view.tpl.php | 30 +- htdocs/core/tpl/onlinepaymentlinks.tpl.php | 58 +- htdocs/core/tpl/passwordforgotten.tpl.php | 18 +- htdocs/core/tpl/resource_add.tpl.php | 6 +- htdocs/core/tpl/resource_view.tpl.php | 6 +- .../interface_20_all_Logevents.class.php | 36 +- ...e_20_modWorkflow_WorkflowManager.class.php | 18 +- ...terface_50_modAgenda_ActionsAuto.class.php | 256 +++--- ..._modBlockedlog_ActionsBlockedLog.class.php | 2 +- ...interface_50_modLdap_Ldapsynchro.class.php | 126 +-- ..._50_modNotification_Notification.class.php | 2 +- htdocs/core/website.inc.php | 12 +- htdocs/cron/admin/cron.php | 4 +- htdocs/cron/card.php | 100 +-- htdocs/cron/class/cronjob.class.php | 76 +- htdocs/cron/info.php | 4 +- htdocs/cron/list.php | 102 +-- htdocs/datapolicy/admin/setup.php | 6 +- htdocs/datapolicy/class/datapolicy.class.php | 12 +- htdocs/datapolicy/public/index.php | 2 +- htdocs/dav/dav.class.php | 18 +- htdocs/dav/dav.lib.php | 6 +- htdocs/dav/fileserver.php | 24 +- htdocs/document.php | 50 +- htdocs/don/admin/donation.php | 52 +- htdocs/don/admin/donation_extrafields.php | 4 +- htdocs/don/card.php | 122 +-- htdocs/don/class/api_donations.class.php | 12 +- htdocs/don/class/don.class.php | 82 +- htdocs/don/class/donstats.class.php | 6 +- htdocs/don/class/paymentdonation.class.php | 10 +- htdocs/don/document.php | 18 +- htdocs/don/index.php | 24 +- htdocs/don/info.php | 6 +- htdocs/don/list.php | 50 +- htdocs/don/note.php | 10 +- htdocs/don/payment/card.php | 22 +- htdocs/don/payment/payment.php | 26 +- htdocs/don/stats/index.php | 20 +- htdocs/ecm/ajax/ecmdatabase.php | 20 +- htdocs/ecm/class/ecmdirectory.class.php | 24 +- htdocs/ecm/class/ecmfiles.class.php | 10 +- htdocs/ecm/dir_add_card.php | 20 +- htdocs/ecm/dir_card.php | 50 +- htdocs/ecm/file_card.php | 32 +- htdocs/ecm/index.php | 38 +- htdocs/ecm/index_auto.php | 46 +- htdocs/ecm/search.php | 18 +- htdocs/ecm/tpl/enablefiletreeajax.tpl.php | 2 +- .../class/emailcollector.class.php | 38 +- .../class/emailcollectoraction.class.php | 26 +- .../class/emailcollectorfilter.class.php | 26 +- htdocs/expedition/card.php | 288 +++---- .../expedition/class/api_shipments.class.php | 12 +- htdocs/expedition/class/expedition.class.php | 82 +- .../class/expeditionstats.class.php | 6 +- htdocs/expedition/contact.php | 16 +- htdocs/expedition/document.php | 18 +- htdocs/expedition/index.php | 8 +- htdocs/expedition/list.php | 116 +-- htdocs/expedition/note.php | 6 +- htdocs/expedition/shipment.php | 60 +- htdocs/expedition/stats/index.php | 20 +- htdocs/expedition/stats/month.php | 2 +- .../expedition/tpl/linkedobjectblock.tpl.php | 2 +- htdocs/expensereport/ajax/ajaxik.php | 14 +- htdocs/expensereport/ajax/ajaxprojet.php | 16 +- htdocs/expensereport/card.php | 164 ++-- .../class/api_expensereports.class.php | 6 +- .../class/expensereport.class.php | 72 +- .../class/expensereportstats.class.php | 24 +- .../class/paymentexpensereport.class.php | 4 +- htdocs/expensereport/document.php | 18 +- htdocs/expensereport/export_csv.php | 24 +- htdocs/expensereport/index.php | 28 +- htdocs/expensereport/info.php | 6 +- htdocs/expensereport/list.php | 122 +-- htdocs/expensereport/note.php | 12 +- htdocs/expensereport/payment/card.php | 18 +- htdocs/expensereport/payment/info.php | 4 +- htdocs/expensereport/payment/payment.php | 30 +- htdocs/expensereport/stats/index.php | 30 +- .../tpl/linkedobjectblock.tpl.php | 2 +- htdocs/exports/class/export.class.php | 40 +- htdocs/exports/export.php | 114 +-- htdocs/exports/index.php | 12 +- htdocs/externalsite/admin/externalsite.php | 18 +- htdocs/externalsite/frametop.php | 4 +- .../fichinter/admin/fichinter_extrafields.php | 2 +- .../admin/fichinterdet_extrafields.php | 2 +- htdocs/fichinter/card.php | 214 ++--- .../class/api_interventions.class.php | 10 +- htdocs/fichinter/class/fichinter.class.php | 52 +- .../fichinter/class/fichinterstats.class.php | 14 +- htdocs/fichinter/contact.php | 18 +- htdocs/fichinter/document.php | 18 +- htdocs/fichinter/index.php | 26 +- htdocs/fichinter/info.php | 6 +- htdocs/fichinter/list.php | 102 +-- htdocs/fichinter/note.php | 8 +- htdocs/fichinter/stats/index.php | 32 +- .../fichinter/tpl/linkedobjectblock.tpl.php | 2 +- htdocs/filefunc.inc.php | 44 +- htdocs/fourn/ajax/getSupplierPrices.php | 22 +- htdocs/fourn/card.php | 100 +-- .../class/api_supplier_invoices.class.php | 10 +- .../fourn/class/api_supplier_orders.class.php | 10 +- .../class/fournisseur.commande.class.php | 134 +-- .../fournisseur.commande.dispatch.class.php | 26 +- .../fourn/class/fournisseur.facture.class.php | 50 +- .../fourn/class/fournisseur.product.class.php | 32 +- htdocs/fourn/class/paiementfourn.class.php | 20 +- htdocs/fourn/commande/card.php | 202 ++--- htdocs/fourn/commande/contact.php | 2 +- htdocs/fourn/commande/dispatch.php | 12 +- htdocs/fourn/commande/document.php | 20 +- htdocs/fourn/commande/index.php | 20 +- htdocs/fourn/commande/info.php | 24 +- htdocs/fourn/commande/list.php | 172 ++-- htdocs/fourn/commande/note.php | 6 +- htdocs/fourn/commande/orderstoinvoice.php | 16 +- .../commande/tpl/linkedobjectblock.tpl.php | 4 +- htdocs/fourn/contact.php | 22 +- htdocs/fourn/facture/card.php | 228 +++--- htdocs/fourn/facture/contact.php | 30 +- htdocs/fourn/facture/document.php | 42 +- htdocs/fourn/facture/impayees.php | 62 +- htdocs/fourn/facture/info.php | 4 +- htdocs/fourn/facture/list.php | 194 ++--- htdocs/fourn/facture/note.php | 30 +- htdocs/fourn/facture/paiement.php | 136 ++-- htdocs/fourn/facture/rapport.php | 24 +- .../facture/tpl/linkedobjectblock.tpl.php | 4 +- htdocs/fourn/index.php | 20 +- htdocs/fourn/paiement/card.php | 28 +- htdocs/fourn/paiement/info.php | 2 +- htdocs/fourn/product/list.php | 50 +- htdocs/fourn/recap-fourn.php | 12 +- htdocs/ftp/admin/ftpclient.php | 40 +- htdocs/ftp/index.php | 82 +- htdocs/holiday/card.php | 76 +- htdocs/holiday/class/holiday.class.php | 84 +- htdocs/holiday/common.inc.php | 2 +- htdocs/holiday/define_holiday.php | 30 +- htdocs/holiday/document.php | 28 +- htdocs/holiday/list.php | 124 +-- htdocs/holiday/month_report.php | 12 +- htdocs/holiday/view_log.php | 10 +- htdocs/hrm/admin/admin_establishment.php | 16 +- htdocs/hrm/class/establishment.class.php | 20 +- htdocs/hrm/establishment/card.php | 30 +- htdocs/hrm/establishment/info.php | 2 +- htdocs/hrm/index.php | 44 +- htdocs/imports/class/import.class.php | 10 +- htdocs/imports/emptyexample.php | 6 +- htdocs/imports/import.php | 218 ++--- htdocs/imports/index.php | 6 +- htdocs/index.php | 54 +- htdocs/install/check.php | 62 +- htdocs/install/fileconf.php | 22 +- htdocs/install/inc.php | 56 +- htdocs/install/index.php | 2 +- htdocs/install/lib/repair.lib.php | 4 +- htdocs/install/repair.php | 122 +-- htdocs/install/step1.php | 226 +++--- htdocs/install/step2.php | 88 +- htdocs/install/step4.php | 12 +- htdocs/install/step5.php | 76 +- htdocs/install/upgrade.php | 62 +- htdocs/install/upgrade2.php | 282 +++---- htdocs/livraison/card.php | 56 +- htdocs/livraison/class/livraison.class.php | 32 +- htdocs/loan/calcmens.php | 12 +- htdocs/loan/card.php | 72 +- htdocs/loan/class/loan.class.php | 8 +- htdocs/loan/class/loanschedule.class.php | 2 +- htdocs/loan/class/paymentloan.class.php | 6 +- htdocs/loan/createschedule.php | 22 +- htdocs/loan/document.php | 18 +- htdocs/loan/info.php | 10 +- htdocs/loan/list.php | 44 +- htdocs/loan/note.php | 6 +- htdocs/loan/payment/card.php | 20 +- htdocs/loan/payment/payment.php | 18 +- htdocs/loan/schedule.php | 24 +- .../mailmanspip/class/mailmanspip.class.php | 20 +- htdocs/main.inc.php | 310 +++---- htdocs/margin/admin/margin.php | 26 +- htdocs/margin/agentMargins.php | 38 +- htdocs/margin/checkMargins.php | 32 +- htdocs/margin/customerMargins.php | 50 +- htdocs/margin/lib/margins.lib.php | 4 +- htdocs/margin/productMargins.php | 48 +- htdocs/margin/tabs/productMargins.php | 48 +- htdocs/margin/tabs/thirdpartyMargins.php | 42 +- htdocs/master.inc.php | 20 +- htdocs/modulebuilder/index.php | 146 ++-- htdocs/modulebuilder/template/admin/setup.php | 4 +- .../template/class/api_mymodule.class.php | 6 +- .../template/class/myobject.class.php | 28 +- .../mailinglist_mymodule_myobject.modules.php | 4 +- .../core/modules/modMyModule.class.php | 2 +- .../template/css/mymodule.css.php | 12 +- .../template/lib/mymodule_myobject.lib.php | 2 +- .../modulebuilder/template/mymoduleindex.php | 6 +- .../template/myobject_agenda.php | 24 +- .../modulebuilder/template/myobject_card.php | 20 +- .../template/myobject_document.php | 16 +- .../modulebuilder/template/myobject_list.php | 60 +- .../modulebuilder/template/myobject_note.php | 4 +- .../template/scripts/myobject.php | 6 +- .../class/multicurrency.class.php | 36 +- htdocs/opensurvey/card.php | 46 +- .../class/opensurveysondage.class.php | 34 +- htdocs/opensurvey/exportcsv.php | 24 +- htdocs/opensurvey/fonctions.php | 10 +- htdocs/opensurvey/index.php | 4 +- htdocs/opensurvey/list.php | 70 +- htdocs/opensurvey/results.php | 88 +- htdocs/opensurvey/wizard/choix_autre.php | 2 +- htdocs/opensurvey/wizard/choix_date.php | 8 +- htdocs/opensurvey/wizard/create_survey.php | 12 +- htdocs/opensurvey/wizard/index.php | 2 +- htdocs/paybox/admin/paybox.php | 42 +- htdocs/paybox/lib/paybox.lib.php | 20 +- htdocs/paypal/admin/paypal.php | 60 +- htdocs/paypal/lib/paypal.lib.php | 30 +- htdocs/paypal/lib/paypalfunctions.lib.php | 2 +- htdocs/printing/admin/printing.php | 16 +- htdocs/printing/lib/printing.lib.php | 4 +- htdocs/product/admin/dynamic_prices.php | 6 +- htdocs/product/admin/price_rules.php | 2 +- htdocs/product/admin/product.php | 114 +-- htdocs/product/admin/product_extrafields.php | 4 +- .../product/admin/product_lot_extrafields.php | 4 +- htdocs/product/admin/product_tools.php | 24 +- htdocs/product/agenda.php | 32 +- htdocs/product/ajax/products.php | 4 +- .../product/actions_card_product.class.php | 60 +- .../canvas/product/tpl/card_create.tpl.php | 10 +- .../canvas/product/tpl/card_edit.tpl.php | 6 +- .../canvas/product/tpl/card_view.tpl.php | 4 +- .../service/actions_card_service.class.php | 36 +- .../canvas/service/tpl/card_create.tpl.php | 10 +- .../canvas/service/tpl/card_edit.tpl.php | 6 +- .../canvas/service/tpl/card_view.tpl.php | 4 +- htdocs/product/card.php | 206 ++--- .../product/class/html.formproduct.class.php | 12 +- htdocs/product/class/product.class.php | 28 +- htdocs/product/class/productbatch.class.php | 6 +- .../class/productcustomerprice.class.php | 2 +- htdocs/product/composition/card.php | 44 +- htdocs/product/document.php | 36 +- .../price_global_variable_updater.class.php | 2 +- htdocs/product/dynamic_price/editor.php | 8 +- htdocs/product/fournisseurs.php | 94 +-- htdocs/product/index.php | 38 +- htdocs/product/inventory/card.php | 12 +- .../inventory/class/inventory.class.php | 34 +- htdocs/product/inventory/list.php | 56 +- .../product/inventory/tpl/inventory.tpl.php | 2 +- htdocs/product/list.php | 144 ++-- htdocs/product/note.php | 8 +- htdocs/product/popuprop.php | 20 +- htdocs/product/price.php | 68 +- htdocs/product/reassort.php | 68 +- htdocs/product/reassortlot.php | 76 +- htdocs/product/stats/card.php | 48 +- htdocs/product/stats/commande.php | 40 +- htdocs/product/stats/commande_fournisseur.php | 12 +- htdocs/product/stats/contrat.php | 44 +- htdocs/product/stats/facture.php | 44 +- htdocs/product/stats/facture_fournisseur.php | 6 +- htdocs/product/stats/propal.php | 12 +- htdocs/product/stats/supplier_proposal.php | 12 +- htdocs/product/stock/card.php | 90 +-- .../stock/class/api_warehouses.class.php | 8 +- htdocs/product/stock/class/entrepot.class.php | 8 +- .../stock/class/mouvementstock.class.php | 20 +- .../product/stock/class/productlot.class.php | 8 +- .../class/productstockentrepot.class.php | 20 +- htdocs/product/stock/fiche-valo.php | 8 +- htdocs/product/stock/index.php | 26 +- htdocs/product/stock/info.php | 10 +- htdocs/product/stock/list.php | 58 +- htdocs/product/stock/massstockmove.php | 34 +- htdocs/product/stock/movement_list.php | 152 ++-- htdocs/product/stock/product.php | 66 +- htdocs/product/stock/productlot_card.php | 78 +- htdocs/product/stock/productlot_document.php | 24 +- htdocs/product/stock/productlot_list.php | 94 +-- htdocs/product/stock/replenish.php | 38 +- htdocs/product/stock/replenishorders.php | 14 +- .../product/stock/tpl/stockcorrection.tpl.php | 12 +- .../product/stock/tpl/stocktransfer.tpl.php | 14 +- htdocs/product/stock/valo.php | 44 +- htdocs/product/traduction.php | 22 +- htdocs/projet/activity/index.php | 26 +- htdocs/projet/activity/perday.php | 52 +- htdocs/projet/activity/perweek.php | 38 +- htdocs/projet/admin/project.php | 138 ++-- htdocs/projet/admin/project_extrafields.php | 4 +- .../projet/admin/project_task_extrafields.php | 4 +- htdocs/projet/ajax/projects.php | 24 +- htdocs/projet/card.php | 166 ++-- htdocs/projet/class/api_projects.class.php | 16 +- htdocs/projet/class/api_tasks.class.php | 10 +- htdocs/projet/class/project.class.php | 62 +- htdocs/projet/class/projectstats.class.php | 4 +- htdocs/projet/class/task.class.php | 78 +- htdocs/projet/comment.php | 20 +- htdocs/projet/contact.php | 38 +- htdocs/projet/document.php | 34 +- htdocs/projet/element.php | 78 +- htdocs/projet/ganttview.php | 22 +- htdocs/projet/graph_opportunities.inc.php | 2 +- htdocs/projet/index.php | 22 +- htdocs/projet/info.php | 36 +- htdocs/projet/list.php | 138 ++-- htdocs/projet/note.php | 18 +- htdocs/projet/stats/index.php | 40 +- htdocs/projet/tasks.php | 92 +-- htdocs/projet/tasks/comment.php | 42 +- htdocs/projet/tasks/contact.php | 48 +- htdocs/projet/tasks/document.php | 42 +- htdocs/projet/tasks/list.php | 136 ++-- htdocs/projet/tasks/note.php | 30 +- htdocs/projet/tasks/stats/index.php | 20 +- htdocs/projet/tasks/task.php | 84 +- htdocs/projet/tasks/time.php | 192 ++--- htdocs/public/agenda/agendaexport.php | 44 +- htdocs/public/cron/cron_run_jobs.php | 22 +- htdocs/public/demo/index.php | 44 +- htdocs/public/donations/donateurs_code.php | 6 +- htdocs/public/emailing/mailing-read.php | 10 +- .../public/emailing/mailing-unsubscribe.php | 8 +- htdocs/public/members/new.php | 66 +- htdocs/public/members/public_card.php | 14 +- htdocs/public/members/public_list.php | 28 +- htdocs/public/notice.php | 10 +- htdocs/public/onlinesign/newonlinesign.php | 32 +- htdocs/public/opensurvey/studs.php | 76 +- htdocs/public/paybox/newpayment.php | 6 +- htdocs/public/paybox/paymentko.php | 10 +- htdocs/public/paybox/paymentok.php | 14 +- htdocs/public/payment/newpayment.php | 224 ++--- htdocs/public/payment/paymentko.php | 10 +- htdocs/public/payment/paymentok.php | 36 +- htdocs/public/paypal/newpayment.php | 6 +- htdocs/public/paypal/paymentko.php | 10 +- htdocs/public/paypal/paymentok.php | 32 +- htdocs/public/stripe/ipn.php | 26 +- htdocs/public/stripe/newpayment.php | 6 +- htdocs/public/stripe/paymentko.php | 10 +- htdocs/public/stripe/paymentok.php | 14 +- htdocs/public/test/test_arrays.php | 12 +- htdocs/public/test/test_forms.php | 14 +- htdocs/public/test/test_sessionlock.php | 26 +- htdocs/public/ticket/create_ticket.php | 10 +- htdocs/public/ticket/index.php | 2 +- htdocs/public/website/index.php | 16 +- htdocs/public/website/styles.css.php | 16 +- htdocs/reception/card.php | 260 +++--- htdocs/reception/class/reception.class.php | 78 +- .../reception/class/receptionstats.class.php | 6 +- htdocs/reception/contact.php | 16 +- htdocs/reception/index.php | 8 +- htdocs/reception/list.php | 126 +-- htdocs/reception/note.php | 8 +- htdocs/reception/stats/index.php | 20 +- htdocs/reception/stats/month.php | 2 +- .../reception/tpl/linkedobjectblock.tpl.php | 2 +- htdocs/resource/agenda.php | 30 +- htdocs/resource/card.php | 36 +- htdocs/resource/class/dolresource.class.php | 48 +- .../class/html.formresource.class.php | 10 +- htdocs/resource/contact.php | 18 +- htdocs/resource/document.php | 20 +- htdocs/resource/element_resource.php | 76 +- htdocs/resource/list.php | 44 +- htdocs/resource/note.php | 8 +- htdocs/societe/admin/contact_extrafields.php | 4 +- htdocs/societe/admin/societe.php | 158 ++-- htdocs/societe/admin/societe_extrafields.php | 4 +- htdocs/societe/agenda.php | 28 +- htdocs/societe/ajax/company.php | 22 +- htdocs/societe/ajaxcompanies.php | 22 +- htdocs/societe/ajaxcountries.php | 14 +- .../canvas/actions_card_common.class.php | 60 +- .../company/actions_card_company.class.php | 30 +- .../canvas/company/tpl/card_view.tpl.php | 10 +- .../actions_card_individual.class.php | 6 +- .../canvas/individual/tpl/card_view.tpl.php | 10 +- htdocs/societe/card.php | 274 +++---- htdocs/societe/checkvat/checkVatPopup.php | 28 +- htdocs/societe/class/address.class.php | 12 +- htdocs/societe/class/api_contacts.class.php | 4 +- .../societe/class/api_thirdparties.class.php | 58 +- .../class/companybankaccount.class.php | 6 +- .../class/companypaymentmode.class.php | 26 +- htdocs/societe/class/societe.class.php | 162 ++-- htdocs/societe/class/societeaccount.class.php | 26 +- htdocs/societe/consumption.php | 94 +-- htdocs/societe/contact.php | 22 +- htdocs/societe/document.php | 22 +- htdocs/societe/index.php | 22 +- htdocs/societe/list.php | 228 +++--- htdocs/societe/note.php | 8 +- htdocs/societe/notify/card.php | 56 +- htdocs/societe/notify/index.php | 10 +- htdocs/societe/paymentmodes.php | 236 +++--- htdocs/societe/price.php | 10 +- htdocs/societe/project.php | 8 +- htdocs/societe/societecontact.php | 40 +- htdocs/societe/website.php | 42 +- htdocs/stripe/admin/stripe.php | 22 +- htdocs/stripe/charge.php | 42 +- htdocs/stripe/class/actions_stripe.class.php | 10 +- htdocs/stripe/config.php | 2 +- htdocs/stripe/lib/stripe.lib.php | 28 +- htdocs/stripe/payment.php | 116 +-- htdocs/stripe/transaction.php | 20 +- .../admin/supplier_proposal_extrafields.php | 6 +- .../supplier_proposaldet_extrafields.php | 6 +- htdocs/supplier_proposal/card.php | 62 +- .../class/api_supplier_proposals.class.php | 2 +- .../class/supplier_proposal.class.php | 88 +- htdocs/supplier_proposal/contact.php | 4 +- htdocs/supplier_proposal/document.php | 22 +- htdocs/supplier_proposal/index.php | 24 +- htdocs/supplier_proposal/info.php | 6 +- htdocs/supplier_proposal/list.php | 144 ++-- htdocs/supplier_proposal/note.php | 8 +- .../tpl/linkedobjectblock.tpl.php | 4 +- htdocs/support/inc.php | 18 +- htdocs/support/index.php | 38 +- htdocs/takepos/admin/orderprinters.php | 24 +- htdocs/takepos/admin/setup.php | 68 +- htdocs/takepos/ajax.php | 18 +- htdocs/takepos/customers.php | 224 ++--- htdocs/takepos/floors.php | 24 +- htdocs/takepos/freezone.php | 12 +- htdocs/takepos/genimg/index.php | 18 +- htdocs/takepos/pay.php | 12 +- htdocs/takepos/receipt.php | 8 +- htdocs/takepos/takepos.php | 14 +- htdocs/theme/eldy/style.css.php | 202 ++--- htdocs/theme/md/style.css.php | 208 ++--- htdocs/ticket/agenda.php | 22 +- htdocs/ticket/card.php | 36 +- htdocs/ticket/class/actions_ticket.class.php | 18 +- htdocs/ticket/class/ticket.class.php | 4 +- htdocs/ticket/css/styles.css.php | 12 +- htdocs/ticket/document.php | 4 +- htdocs/ticket/index.php | 2 +- htdocs/ticket/list.php | 68 +- htdocs/user/admin/group_extrafields.php | 4 +- htdocs/user/admin/user_extrafields.php | 4 +- htdocs/user/agenda_extsites.php | 16 +- htdocs/user/bank.php | 38 +- htdocs/user/card.php | 200 ++--- htdocs/user/class/user.class.php | 106 +-- htdocs/user/class/usergroup.class.php | 18 +- htdocs/user/clicktodial.php | 18 +- htdocs/user/document.php | 24 +- htdocs/user/group/card.php | 52 +- htdocs/user/group/ldap.php | 16 +- htdocs/user/group/list.php | 36 +- htdocs/user/group/perms.php | 18 +- htdocs/user/hierarchy.php | 26 +- htdocs/user/home.php | 22 +- htdocs/user/info.php | 2 +- htdocs/user/ldap.php | 14 +- htdocs/user/list.php | 120 +-- htdocs/user/logout.php | 22 +- htdocs/user/note.php | 14 +- htdocs/user/notify/card.php | 58 +- htdocs/user/param_ihm.php | 16 +- htdocs/user/passwordforgotten.php | 46 +- htdocs/user/perms.php | 28 +- htdocs/variants/admin/admin.php | 4 +- htdocs/variants/ajax/getCombinations.php | 10 +- htdocs/variants/ajax/get_attribute_values.php | 10 +- htdocs/variants/ajax/orderAttribute.php | 14 +- htdocs/variants/card.php | 16 +- htdocs/variants/combinations.php | 16 +- htdocs/variants/create_val.php | 12 +- htdocs/variants/generator.php | 2 +- htdocs/variants/list.php | 4 +- htdocs/viewimage.php | 74 +- htdocs/webservices/admin/index.php | 8 +- htdocs/webservices/index.php | 2 +- htdocs/webservices/server_actioncomm.php | 36 +- htdocs/webservices/server_category.php | 16 +- htdocs/webservices/server_contact.php | 34 +- htdocs/webservices/server_invoice.php | 58 +- htdocs/webservices/server_order.php | 52 +- htdocs/webservices/server_other.php | 20 +- htdocs/webservices/server_payment.php | 6 +- .../webservices/server_productorservice.php | 74 +- htdocs/webservices/server_project.php | 26 +- .../webservices/server_supplier_invoice.php | 28 +- htdocs/webservices/server_thirdparty.php | 46 +- htdocs/webservices/server_user.php | 42 +- htdocs/website/class/website.class.php | 26 +- htdocs/website/class/websitepage.class.php | 18 +- htdocs/website/index.php | 200 ++--- htdocs/website/websiteaccount_card.php | 14 +- .../accountancy/export-thirdpartyaccount.php | 4 +- scripts/bank/export-bank-receipts.php | 32 +- .../company/export-contacts-xls-example.php | 2 +- .../company/sync_contacts_dolibarr2ldap.php | 10 +- .../email_expire_services_to_customers.php | 20 +- ...ail_expire_services_to_representatives.php | 22 +- scripts/cron/cron_run_jobs.php | 22 +- scripts/emailings/mailing-send.php | 28 +- .../email_unpaid_invoices_to_customers.php | 18 +- ...ail_unpaid_invoices_to_representatives.php | 18 +- scripts/invoices/rebuild_merge_pdf.php | 38 +- .../members/sync_members_dolibarr2ldap.php | 14 +- .../members/sync_members_ldap2dolibarr.php | 20 +- .../sync_members_types_dolibarr2ldap.php | 6 +- .../sync_members_types_ldap2dolibarr.php | 20 +- scripts/modulebuilder/initmodule.php | 2 +- scripts/product/migrate_picture_path.php | 6 +- scripts/product/regenerate_thumbs.php | 8 +- scripts/user/sync_groups_dolibarr2ldap.php | 6 +- scripts/user/sync_groups_ldap2dolibarr.php | 24 +- scripts/user/sync_users_dolibarr2ldap.php | 6 +- scripts/user/sync_users_ldap2dolibarr.php | 28 +- scripts/withdrawals/build_withdrawal_file.php | 4 +- 1474 files changed, 28095 insertions(+), 28097 deletions(-) diff --git a/.editorconfig b/.editorconfig index 2df455f0d4f..a40a586406f 100644 --- a/.editorconfig +++ b/.editorconfig @@ -8,7 +8,8 @@ charset = utf-8 end_of_line = lf insert_final_newline = true [*.php] -indent_style = tab +indent_style = space +trim_trailing_whitespace = true [*.js] indent_style = tab [*.css] diff --git a/dev/examples/code/create_invoice.php b/dev/examples/code/create_invoice.php index e519c62a436..792341f5c79 100755 --- a/dev/examples/code/create_invoice.php +++ b/dev/examples/code/create_invoice.php @@ -48,8 +48,8 @@ $langs->load("main"); // To load language file for default language @set_time_limit(0); // Load user and its permissions -$result=$user->fetch('','admin'); // Load user for login 'admin'. Comment line to run as anonymous user. -if (! $result > 0) { dol_print_error('',$user->error); exit; } +$result=$user->fetch('', 'admin'); // Load user for login 'admin'. Comment line to run as anonymous user. +if (! $result > 0) { dol_print_error('', $user->error); exit; } $user->getrights(); @@ -89,13 +89,13 @@ if ($idobject > 0) else { $error++; - dol_print_error($db,$obj->error); + dol_print_error($db, $obj->error); } } else { $error++; - dol_print_error($db,$obj->error); + dol_print_error($db, $obj->error); } diff --git a/dev/examples/code/create_order.php b/dev/examples/code/create_order.php index 95b047705fa..fa3fa573223 100755 --- a/dev/examples/code/create_order.php +++ b/dev/examples/code/create_order.php @@ -48,8 +48,8 @@ $langs->load("main"); // To load language file for default language @set_time_limit(0); // Load user and its permissions -$result=$user->fetch('','admin'); // Load user for login 'admin'. Comment line to run as anonymous user. -if (! $result > 0) { dol_print_error('',$user->error); exit; } +$result=$user->fetch('', 'admin'); // Load user for login 'admin'. Comment line to run as anonymous user. +if (! $result > 0) { dol_print_error('', $user->error); exit; } $user->getrights(); @@ -87,13 +87,13 @@ if ($idobject > 0) else { $error++; - dol_print_error($db,$com->error); + dol_print_error($db, $com->error); } } else { $error++; - dol_print_error($db,$com->error); + dol_print_error($db, $com->error); } diff --git a/dev/examples/code/create_product.php b/dev/examples/code/create_product.php index 8cbc07a1b63..7ca09246980 100755 --- a/dev/examples/code/create_product.php +++ b/dev/examples/code/create_product.php @@ -48,8 +48,8 @@ $langs->load("main"); // To load language file for default language @set_time_limit(0); // Load user and its permissions -$result=$user->fetch('','admin'); // Load user for login 'admin'. Comment line to run as anonymous user. -if (! $result > 0) { dol_print_error('',$user->error); exit; } +$result=$user->fetch('', 'admin'); // Load user for login 'admin'. Comment line to run as anonymous user. +if (! $result > 0) { dol_print_error('', $user->error); exit; } $user->getrights(); @@ -86,7 +86,7 @@ if ($idobject > 0) else { $error++; - dol_print_error($db,$myproduct->error); + dol_print_error($db, $myproduct->error); } // -------------------- END OF YOUR CODE -------------------- diff --git a/dev/examples/code/create_user.php b/dev/examples/code/create_user.php index f8e0ba23011..e154b0ef6bb 100755 --- a/dev/examples/code/create_user.php +++ b/dev/examples/code/create_user.php @@ -48,8 +48,8 @@ $langs->load("main"); // To load language file for default language @set_time_limit(0); // Load user and its permissions -$result=$user->fetch('','admin'); // Load user for login 'admin'. Comment line to run as anonymous user. -if (! $result > 0) { dol_print_error('',$user->error); exit; } +$result=$user->fetch('', 'admin'); // Load user for login 'admin'. Comment line to run as anonymous user. +if (! $result > 0) { dol_print_error('', $user->error); exit; } $user->getrights(); @@ -77,7 +77,7 @@ if ($idobject > 0) else { $error++; - dol_print_error($db,$obj->error); + dol_print_error($db, $obj->error); } } else if ($obj->error == 'ErrorLoginAlreadyExists') @@ -87,7 +87,7 @@ else if ($obj->error == 'ErrorLoginAlreadyExists') else { $error++; - dol_print_error($db,$obj->error); + dol_print_error($db, $obj->error); } diff --git a/dev/examples/code/get_contracts.php b/dev/examples/code/get_contracts.php index daff0e43e6f..eafc0dfeed5 100755 --- a/dev/examples/code/get_contracts.php +++ b/dev/examples/code/get_contracts.php @@ -48,8 +48,8 @@ $langs->load("main"); // To load language file for default language @set_time_limit(0); // Load user and its permissions -$result=$user->fetch('','admin'); // Load user for login 'admin'. Comment line to run as anonymous user. -if (! $result > 0) { dol_print_error('',$user->error); exit; } +$result=$user->fetch('', 'admin'); // Load user for login 'admin'. Comment line to run as anonymous user. +if (! $result > 0) { dol_print_error('', $user->error); exit; } $user->getrights(); diff --git a/dev/initdata/generate-invoice.php b/dev/initdata/generate-invoice.php index 280518bd4e3..0f04a4d236f 100755 --- a/dev/initdata/generate-invoice.php +++ b/dev/initdata/generate-invoice.php @@ -43,59 +43,59 @@ require_once DOL_DOCUMENT_ROOT."/societe/class/societe.class.php"; define(GEN_NUMBER_FACTURE, 1); $year = 2016; -$dates = array (mktime(12,0,0,1,3,$year), - mktime(12,0,0,1,9,$year), - mktime(12,0,0,2,13,$year), - mktime(12,0,0,2,23,$year), - mktime(12,0,0,3,30,$year), - mktime(12,0,0,4,3,$year), - mktime(12,0,0,4,3,$year), - mktime(12,0,0,5,9,$year), - mktime(12,0,0,5,1,$year), - mktime(12,0,0,5,13,$year), - mktime(12,0,0,5,19,$year), - mktime(12,0,0,5,23,$year), - mktime(12,0,0,6,3,$year), - mktime(12,0,0,6,19,$year), - mktime(12,0,0,6,24,$year), - mktime(12,0,0,7,3,$year), - mktime(12,0,0,7,9,$year), - mktime(12,0,0,7,23,$year), - mktime(12,0,0,7,30,$year), - mktime(12,0,0,8,9,$year), - mktime(12,0,0,9,23,$year), - mktime(12,0,0,10,3,$year), - mktime(12,0,0,11,12,$year), - mktime(12,0,0,11,13,$year), - mktime(12,0,0,1,3,($year - 1)), - mktime(12,0,0,1,9,($year - 1)), - mktime(12,0,0,2,13,($year - 1)), - mktime(12,0,0,2,23,($year - 1)), - mktime(12,0,0,3,30,($year - 1)), - mktime(12,0,0,4,3,($year - 1)), - mktime(12,0,0,4,3,($year - 1)), - mktime(12,0,0,5,9,($year - 1)), - mktime(12,0,0,5,1,($year - 1)), - mktime(12,0,0,5,13,($year - 1)), - mktime(12,0,0,5,19,($year - 1)), - mktime(12,0,0,5,23,($year - 1)), - mktime(12,0,0,6,3,($year - 1)), - mktime(12,0,0,6,19,($year - 1)), - mktime(12,0,0,6,24,($year - 1)), - mktime(12,0,0,7,3,($year - 1)), - mktime(12,0,0,7,9,($year - 1)), - mktime(12,0,0,7,23,($year - 1)), - mktime(12,0,0,7,30,($year - 1)), - mktime(12,0,0,8,9,($year - 1)), - mktime(12,0,0,9,23,($year - 1)), - mktime(12,0,0,10,3,($year - 1)), - mktime(12,0,0,11,12,$year), - mktime(12,0,0,11,13,$year), - mktime(12,0,0,12,12,$year), - mktime(12,0,0,12,13,$year), +$dates = array (mktime(12, 0, 0, 1, 3, $year), + mktime(12, 0, 0, 1, 9, $year), + mktime(12, 0, 0, 2, 13, $year), + mktime(12, 0, 0, 2, 23, $year), + mktime(12, 0, 0, 3, 30, $year), + mktime(12, 0, 0, 4, 3, $year), + mktime(12, 0, 0, 4, 3, $year), + mktime(12, 0, 0, 5, 9, $year), + mktime(12, 0, 0, 5, 1, $year), + mktime(12, 0, 0, 5, 13, $year), + mktime(12, 0, 0, 5, 19, $year), + mktime(12, 0, 0, 5, 23, $year), + mktime(12, 0, 0, 6, 3, $year), + mktime(12, 0, 0, 6, 19, $year), + mktime(12, 0, 0, 6, 24, $year), + mktime(12, 0, 0, 7, 3, $year), + mktime(12, 0, 0, 7, 9, $year), + mktime(12, 0, 0, 7, 23, $year), + mktime(12, 0, 0, 7, 30, $year), + mktime(12, 0, 0, 8, 9, $year), + mktime(12, 0, 0, 9, 23, $year), + mktime(12, 0, 0, 10, 3, $year), + mktime(12, 0, 0, 11, 12, $year), + mktime(12, 0, 0, 11, 13, $year), + mktime(12, 0, 0, 1, 3, ($year - 1)), + mktime(12, 0, 0, 1, 9, ($year - 1)), + mktime(12, 0, 0, 2, 13, ($year - 1)), + mktime(12, 0, 0, 2, 23, ($year - 1)), + mktime(12, 0, 0, 3, 30, ($year - 1)), + mktime(12, 0, 0, 4, 3, ($year - 1)), + mktime(12, 0, 0, 4, 3, ($year - 1)), + mktime(12, 0, 0, 5, 9, ($year - 1)), + mktime(12, 0, 0, 5, 1, ($year - 1)), + mktime(12, 0, 0, 5, 13, ($year - 1)), + mktime(12, 0, 0, 5, 19, ($year - 1)), + mktime(12, 0, 0, 5, 23, ($year - 1)), + mktime(12, 0, 0, 6, 3, ($year - 1)), + mktime(12, 0, 0, 6, 19, ($year - 1)), + mktime(12, 0, 0, 6, 24, ($year - 1)), + mktime(12, 0, 0, 7, 3, ($year - 1)), + mktime(12, 0, 0, 7, 9, ($year - 1)), + mktime(12, 0, 0, 7, 23, ($year - 1)), + mktime(12, 0, 0, 7, 30, ($year - 1)), + mktime(12, 0, 0, 8, 9, ($year - 1)), + mktime(12, 0, 0, 9, 23, ($year - 1)), + mktime(12, 0, 0, 10, 3, ($year - 1)), + mktime(12, 0, 0, 11, 12, $year), + mktime(12, 0, 0, 11, 13, $year), + mktime(12, 0, 0, 12, 12, $year), + mktime(12, 0, 0, 12, 13, $year), ); -$ret=$user->fetch('','admin'); +$ret=$user->fetch('', 'admin'); if (! $ret > 0) { print 'A user with login "admin" and all permissions must be created to use this script.'."\n"; @@ -150,7 +150,7 @@ while ($i < GEN_NUMBER_FACTURE && $result >= 0) $object->mode_reglement_id = 3; $fuser = new User($db); - $fuser->fetch(mt_rand(1,2)); + $fuser->fetch(mt_rand(1, 2)); $fuser->getRights(); $result=$object->create($fuser); @@ -163,10 +163,10 @@ while ($i < GEN_NUMBER_FACTURE && $result >= 0) $prodid = mt_rand(1, $num_prods); $product=new Product($db); $result=$product->fetch($prodids[$prodid]); - $result=$object->addline($product->description, $product->price, mt_rand(1,5), 0, 0, 0, $prodids[$prodid], 0, '', '', 0, 0, '', $product->price_base_type, $product->price_ttc, $product->type); + $result=$object->addline($product->description, $product->price, mt_rand(1, 5), 0, 0, 0, $prodids[$prodid], 0, '', '', 0, 0, '', $product->price_base_type, $product->price_ttc, $product->type); if ($result < 0) { - dol_print_error($db,$propal->error); + dol_print_error($db, $propal->error); } $xnbp++; } @@ -178,11 +178,11 @@ while ($i < GEN_NUMBER_FACTURE && $result >= 0) } else { - dol_print_error($db,$object->error); + dol_print_error($db, $object->error); } } else { - dol_print_error($db,$object->error); + dol_print_error($db, $object->error); } } diff --git a/dev/initdata/generate-order.php b/dev/initdata/generate-order.php index 5e53fa752a2..87d0ea1dee6 100755 --- a/dev/initdata/generate-order.php +++ b/dev/initdata/generate-order.php @@ -49,59 +49,59 @@ require_once DOL_DOCUMENT_ROOT."/commande/class/commande.class.php"; define(GEN_NUMBER_COMMANDE, 10); $year = 2016; -$dates = array (mktime(12,0,0,1,3,$year), - mktime(12,0,0,1,9,$year), - mktime(12,0,0,2,13,$year), - mktime(12,0,0,2,23,$year), - mktime(12,0,0,3,30,$year), - mktime(12,0,0,4,3,$year), - mktime(12,0,0,4,3,$year), - mktime(12,0,0,5,9,$year), - mktime(12,0,0,5,1,$year), - mktime(12,0,0,5,13,$year), - mktime(12,0,0,5,19,$year), - mktime(12,0,0,5,23,$year), - mktime(12,0,0,6,3,$year), - mktime(12,0,0,6,19,$year), - mktime(12,0,0,6,24,$year), - mktime(12,0,0,7,3,$year), - mktime(12,0,0,7,9,$year), - mktime(12,0,0,7,23,$year), - mktime(12,0,0,7,30,$year), - mktime(12,0,0,8,9,$year), - mktime(12,0,0,9,23,$year), - mktime(12,0,0,10,3,$year), - mktime(12,0,0,11,12,$year), - mktime(12,0,0,11,13,$year), - mktime(12,0,0,1,3,($year - 1)), - mktime(12,0,0,1,9,($year - 1)), - mktime(12,0,0,2,13,($year - 1)), - mktime(12,0,0,2,23,($year - 1)), - mktime(12,0,0,3,30,($year - 1)), - mktime(12,0,0,4,3,($year - 1)), - mktime(12,0,0,4,3,($year - 1)), - mktime(12,0,0,5,9,($year - 1)), - mktime(12,0,0,5,1,($year - 1)), - mktime(12,0,0,5,13,($year - 1)), - mktime(12,0,0,5,19,($year - 1)), - mktime(12,0,0,5,23,($year - 1)), - mktime(12,0,0,6,3,($year - 1)), - mktime(12,0,0,6,19,($year - 1)), - mktime(12,0,0,6,24,($year - 1)), - mktime(12,0,0,7,3,($year - 1)), - mktime(12,0,0,7,9,($year - 1)), - mktime(12,0,0,7,23,($year - 1)), - mktime(12,0,0,7,30,($year - 1)), - mktime(12,0,0,8,9,($year - 1)), - mktime(12,0,0,9,23,($year - 1)), - mktime(12,0,0,10,3,($year - 1)), - mktime(12,0,0,11,12,$year), - mktime(12,0,0,11,13,$year), - mktime(12,0,0,12,12,$year), - mktime(12,0,0,12,13,$year), +$dates = array (mktime(12, 0, 0, 1, 3, $year), + mktime(12, 0, 0, 1, 9, $year), + mktime(12, 0, 0, 2, 13, $year), + mktime(12, 0, 0, 2, 23, $year), + mktime(12, 0, 0, 3, 30, $year), + mktime(12, 0, 0, 4, 3, $year), + mktime(12, 0, 0, 4, 3, $year), + mktime(12, 0, 0, 5, 9, $year), + mktime(12, 0, 0, 5, 1, $year), + mktime(12, 0, 0, 5, 13, $year), + mktime(12, 0, 0, 5, 19, $year), + mktime(12, 0, 0, 5, 23, $year), + mktime(12, 0, 0, 6, 3, $year), + mktime(12, 0, 0, 6, 19, $year), + mktime(12, 0, 0, 6, 24, $year), + mktime(12, 0, 0, 7, 3, $year), + mktime(12, 0, 0, 7, 9, $year), + mktime(12, 0, 0, 7, 23, $year), + mktime(12, 0, 0, 7, 30, $year), + mktime(12, 0, 0, 8, 9, $year), + mktime(12, 0, 0, 9, 23, $year), + mktime(12, 0, 0, 10, 3, $year), + mktime(12, 0, 0, 11, 12, $year), + mktime(12, 0, 0, 11, 13, $year), + mktime(12, 0, 0, 1, 3, ($year - 1)), + mktime(12, 0, 0, 1, 9, ($year - 1)), + mktime(12, 0, 0, 2, 13, ($year - 1)), + mktime(12, 0, 0, 2, 23, ($year - 1)), + mktime(12, 0, 0, 3, 30, ($year - 1)), + mktime(12, 0, 0, 4, 3, ($year - 1)), + mktime(12, 0, 0, 4, 3, ($year - 1)), + mktime(12, 0, 0, 5, 9, ($year - 1)), + mktime(12, 0, 0, 5, 1, ($year - 1)), + mktime(12, 0, 0, 5, 13, ($year - 1)), + mktime(12, 0, 0, 5, 19, ($year - 1)), + mktime(12, 0, 0, 5, 23, ($year - 1)), + mktime(12, 0, 0, 6, 3, ($year - 1)), + mktime(12, 0, 0, 6, 19, ($year - 1)), + mktime(12, 0, 0, 6, 24, ($year - 1)), + mktime(12, 0, 0, 7, 3, ($year - 1)), + mktime(12, 0, 0, 7, 9, ($year - 1)), + mktime(12, 0, 0, 7, 23, ($year - 1)), + mktime(12, 0, 0, 7, 30, ($year - 1)), + mktime(12, 0, 0, 8, 9, ($year - 1)), + mktime(12, 0, 0, 9, 23, ($year - 1)), + mktime(12, 0, 0, 10, 3, ($year - 1)), + mktime(12, 0, 0, 11, 12, $year), + mktime(12, 0, 0, 11, 13, $year), + mktime(12, 0, 0, 12, 12, $year), + mktime(12, 0, 0, 12, 13, $year), ); -$ret=$user->fetch('','admin'); +$ret=$user->fetch('', 'admin'); if ($ret <= 0) { print 'A user with login "admin" and all permissions must be created to use this script.'."\n"; @@ -177,7 +177,7 @@ for ($s = 0 ; $s < GEN_NUMBER_COMMANDE ; $s++) $listofuserid=array(12,13,16); $fuser = new User($db); - $fuser->fetch($listofuserid[mt_rand(0,2)]); + $fuser->fetch($listofuserid[mt_rand(0, 2)]); $fuser->getRights(); $db->begin(); @@ -192,10 +192,10 @@ for ($s = 0 ; $s < GEN_NUMBER_COMMANDE ; $s++) $prodid = mt_rand(1, $num_prods); $product=new Product($db); $result=$product->fetch($prodids[$prodid]); - $result=$object->addline($product->description, $product->price, mt_rand(1,5), 0, 0, 0, $prodids[$prodid], 0, 0, 0, $product->price_base_type, $product->price_ttc, '', '', $product->type); + $result=$object->addline($product->description, $product->price, mt_rand(1, 5), 0, 0, 0, $prodids[$prodid], 0, 0, 0, $product->price_base_type, $product->price_ttc, '', '', $product->type); if ($result <= 0) { - dol_print_error($db,$object->error); + dol_print_error($db, $object->error); } $xnbp++; } @@ -210,14 +210,14 @@ for ($s = 0 ; $s < GEN_NUMBER_COMMANDE ; $s++) { print " KO\n"; $db->rollback(); - dol_print_error($db,$object->error); + dol_print_error($db, $object->error); } } else { print " KO\n"; $db->rollback(); - dol_print_error($db,$object->error); + dol_print_error($db, $object->error); } } diff --git a/dev/initdata/generate-product.php b/dev/initdata/generate-product.php index 393d5c5ce3d..4de100cb393 100755 --- a/dev/initdata/generate-product.php +++ b/dev/initdata/generate-product.php @@ -49,7 +49,7 @@ include_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; define(GEN_NUMBER_PRODUIT, 100000); -$ret=$user->fetch('','admin'); +$ret=$user->fetch('', 'admin'); if (! $ret > 0) { print 'A user with login "admin" and all permissions must be created to use this script.'."\n"; @@ -85,12 +85,12 @@ for ($s = 0 ; $s < GEN_NUMBER_PRODUIT ; $s++) { print "Product ".$s; $produit = new Product($db); - $produit->type = mt_rand(0,1); + $produit->type = mt_rand(0, 1); $produit->status = 1; $produit->ref = ($produit->type?'S':'P').time().$s; $produit->label = 'Label '.time().$s; $produit->description = 'Description '.time().$s; - $produit->price = mt_rand(1,1000); + $produit->price = mt_rand(1, 1000); $produit->tva_tx = "19.6"; $ret=$produit->create($user); if ($ret < 0) print "Error $ret - ".$produit->error."\n"; diff --git a/dev/initdata/generate-proposal.php b/dev/initdata/generate-proposal.php index eb2bfe15a00..4bd9c2c654b 100755 --- a/dev/initdata/generate-proposal.php +++ b/dev/initdata/generate-proposal.php @@ -45,59 +45,59 @@ require_once DOL_DOCUMENT_ROOT."/societe/class/societe.class.php"; define(GEN_NUMBER_PROPAL, 10); $year = 2016; -$dates = array (mktime(12,0,0,1,3,$year), - mktime(12,0,0,1,9,$year), - mktime(12,0,0,2,13,$year), - mktime(12,0,0,2,23,$year), - mktime(12,0,0,3,30,$year), - mktime(12,0,0,4,3,$year), - mktime(12,0,0,4,3,$year), - mktime(12,0,0,5,9,$year), - mktime(12,0,0,5,1,$year), - mktime(12,0,0,5,13,$year), - mktime(12,0,0,5,19,$year), - mktime(12,0,0,5,23,$year), - mktime(12,0,0,6,3,$year), - mktime(12,0,0,6,19,$year), - mktime(12,0,0,6,24,$year), - mktime(12,0,0,7,3,$year), - mktime(12,0,0,7,9,$year), - mktime(12,0,0,7,23,$year), - mktime(12,0,0,7,30,$year), - mktime(12,0,0,8,9,$year), - mktime(12,0,0,9,23,$year), - mktime(12,0,0,10,3,$year), - mktime(12,0,0,11,12,$year), - mktime(12,0,0,11,13,$year), - mktime(12,0,0,1,3,($year - 1)), - mktime(12,0,0,1,9,($year - 1)), - mktime(12,0,0,2,13,($year - 1)), - mktime(12,0,0,2,23,($year - 1)), - mktime(12,0,0,3,30,($year - 1)), - mktime(12,0,0,4,3,($year - 1)), - mktime(12,0,0,4,3,($year - 1)), - mktime(12,0,0,5,9,($year - 1)), - mktime(12,0,0,5,1,($year - 1)), - mktime(12,0,0,5,13,($year - 1)), - mktime(12,0,0,5,19,($year - 1)), - mktime(12,0,0,5,23,($year - 1)), - mktime(12,0,0,6,3,($year - 1)), - mktime(12,0,0,6,19,($year - 1)), - mktime(12,0,0,6,24,($year - 1)), - mktime(12,0,0,7,3,($year - 1)), - mktime(12,0,0,7,9,($year - 1)), - mktime(12,0,0,7,23,($year - 1)), - mktime(12,0,0,7,30,($year - 1)), - mktime(12,0,0,8,9,($year - 1)), - mktime(12,0,0,9,23,($year - 1)), - mktime(12,0,0,10,3,($year - 1)), - mktime(12,0,0,11,12,$year), - mktime(12,0,0,11,13,$year), - mktime(12,0,0,12,12,$year), - mktime(12,0,0,12,13,$year), +$dates = array (mktime(12, 0, 0, 1, 3, $year), + mktime(12, 0, 0, 1, 9, $year), + mktime(12, 0, 0, 2, 13, $year), + mktime(12, 0, 0, 2, 23, $year), + mktime(12, 0, 0, 3, 30, $year), + mktime(12, 0, 0, 4, 3, $year), + mktime(12, 0, 0, 4, 3, $year), + mktime(12, 0, 0, 5, 9, $year), + mktime(12, 0, 0, 5, 1, $year), + mktime(12, 0, 0, 5, 13, $year), + mktime(12, 0, 0, 5, 19, $year), + mktime(12, 0, 0, 5, 23, $year), + mktime(12, 0, 0, 6, 3, $year), + mktime(12, 0, 0, 6, 19, $year), + mktime(12, 0, 0, 6, 24, $year), + mktime(12, 0, 0, 7, 3, $year), + mktime(12, 0, 0, 7, 9, $year), + mktime(12, 0, 0, 7, 23, $year), + mktime(12, 0, 0, 7, 30, $year), + mktime(12, 0, 0, 8, 9, $year), + mktime(12, 0, 0, 9, 23, $year), + mktime(12, 0, 0, 10, 3, $year), + mktime(12, 0, 0, 11, 12, $year), + mktime(12, 0, 0, 11, 13, $year), + mktime(12, 0, 0, 1, 3, ($year - 1)), + mktime(12, 0, 0, 1, 9, ($year - 1)), + mktime(12, 0, 0, 2, 13, ($year - 1)), + mktime(12, 0, 0, 2, 23, ($year - 1)), + mktime(12, 0, 0, 3, 30, ($year - 1)), + mktime(12, 0, 0, 4, 3, ($year - 1)), + mktime(12, 0, 0, 4, 3, ($year - 1)), + mktime(12, 0, 0, 5, 9, ($year - 1)), + mktime(12, 0, 0, 5, 1, ($year - 1)), + mktime(12, 0, 0, 5, 13, ($year - 1)), + mktime(12, 0, 0, 5, 19, ($year - 1)), + mktime(12, 0, 0, 5, 23, ($year - 1)), + mktime(12, 0, 0, 6, 3, ($year - 1)), + mktime(12, 0, 0, 6, 19, ($year - 1)), + mktime(12, 0, 0, 6, 24, ($year - 1)), + mktime(12, 0, 0, 7, 3, ($year - 1)), + mktime(12, 0, 0, 7, 9, ($year - 1)), + mktime(12, 0, 0, 7, 23, ($year - 1)), + mktime(12, 0, 0, 7, 30, ($year - 1)), + mktime(12, 0, 0, 8, 9, ($year - 1)), + mktime(12, 0, 0, 9, 23, ($year - 1)), + mktime(12, 0, 0, 10, 3, ($year - 1)), + mktime(12, 0, 0, 11, 12, $year), + mktime(12, 0, 0, 11, 13, $year), + mktime(12, 0, 0, 12, 12, $year), + mktime(12, 0, 0, 12, 13, $year), ); -$ret=$user->fetch('','admin'); +$ret=$user->fetch('', 'admin'); if (! $ret > 0) { print 'A user with login "admin" and all permissions must be created to use this script.'."\n"; @@ -174,7 +174,7 @@ while ($i < GEN_NUMBER_PROPAL && $result >= 0) $object = new Propal($db); $fuser = new User($db); - $fuser->fetch(mt_rand(1,2)); + $fuser->fetch(mt_rand(1, 2)); $fuser->getRights(); $object->contactid = $contids[$socids[$socid]][0]; @@ -193,10 +193,10 @@ while ($i < GEN_NUMBER_PROPAL && $result >= 0) $prodid = mt_rand(1, $num_prods); $product=new Product($db); $result=$product->fetch($prodids[$prodid]); - $result=$object->addline($product->description, $product->price, mt_rand(1,5), 0, 0, 0, $prodids[$prodid], 0); + $result=$object->addline($product->description, $product->price, mt_rand(1, 5), 0, 0, 0, $prodids[$prodid], 0); if ($result < 0) { - dol_print_error($db,$object->error); + dol_print_error($db, $object->error); } $xnbp++; } @@ -211,11 +211,11 @@ while ($i < GEN_NUMBER_PROPAL && $result >= 0) { print " KO\n"; $db->rollback(); - dol_print_error($db,$object->error); + dol_print_error($db, $object->error); } } else { - dol_print_error($db,$object->error); + dol_print_error($db, $object->error); } } diff --git a/dev/initdata/generate-thirdparty.php b/dev/initdata/generate-thirdparty.php index 7f2c3e2055d..0281d7a289e 100755 --- a/dev/initdata/generate-thirdparty.php +++ b/dev/initdata/generate-thirdparty.php @@ -52,7 +52,7 @@ $listoflastname = array("Joe","Marc","Steve","Laurent","Nico","Isabelle","Doroth define(GEN_NUMBER_SOCIETE, 10); -$ret=$user->fetch('','admin'); +$ret=$user->fetch('', 'admin'); if (! $ret > 0) { print 'A user with login "admin" and all permissions must be created to use this script.'."\n"; @@ -91,22 +91,22 @@ for ($s = 0 ; $s < GEN_NUMBER_SOCIETE ; $s++) $soc = new Societe($db); $soc->name = "Company num ".time()."$s"; $soc->town = $listoftown[mt_rand(0, count($listoftown)-1)]; - $soc->client = mt_rand(1,2); // Une societe sur 2 est prospect, l'autre client - $soc->fournisseur = mt_rand(0,1); // Une societe sur 2 est fournisseur + $soc->client = mt_rand(1, 2); // Une societe sur 2 est prospect, l'autre client + $soc->fournisseur = mt_rand(0, 1); // Une societe sur 2 est fournisseur $soc->code_client='CU'.time()."$s"; $soc->code_fournisseur='SU'.time()."$s"; $soc->tva_assuj=1; $soc->country_id=1; $soc->country_code='FR'; // Un client sur 3 a une remise de 5% - $user_remise=mt_rand(1,3); if ($user_remise==3) $soc->remise_percent=5; + $user_remise=mt_rand(1, 3); if ($user_remise==3) $soc->remise_percent=5; print "> client=".$soc->client.", fournisseur=".$soc->fournisseur.", remise=".$soc->remise_percent."\n"; $soc->note_private = 'Company created by the script generate-societe.php'; $socid = $soc->create(); if ($socid >= 0) { - $rand = mt_rand(1,4); + $rand = mt_rand(1, 4); print "> Generates $rand contact(s)\n"; for ($c = 0 ; $c < $rand ; $c++) { diff --git a/dev/initdata/import-products.php b/dev/initdata/import-products.php index 0f4856aefb2..4494e65c280 100755 --- a/dev/initdata/import-products.php +++ b/dev/initdata/import-products.php @@ -35,7 +35,7 @@ if (substr($sapi_type, 0, 3) == 'cgi') { } // Recupere root dolibarr -$path=preg_replace('/import-products.php/i','',$_SERVER["PHP_SELF"]); +$path=preg_replace('/import-products.php/i', '', $_SERVER["PHP_SELF"]); require $path."../../htdocs/master.inc.php"; include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; @@ -57,7 +57,7 @@ $error=0; @set_time_limit(0); print "***** ".$script_file." (".$version.") pid=".dol_getmypid()." *****\n"; -dol_syslog($script_file." launched with arg ".implode(',',$argv)); +dol_syslog($script_file." launched with arg ".implode(',', $argv)); $mode = $argv[1]; $filepath = $argv[2]; @@ -66,7 +66,7 @@ $defaultlang = empty($argv[3])?'en_US':$argv[3]; $startlinenb = empty($argv[4])?1:$argv[4]; $endlinenb = empty($argv[5])?0:$argv[5]; -if (empty($mode) || ! in_array($mode,array('test','confirm','confirmforced')) || empty($filepath)) { +if (empty($mode) || ! in_array($mode, array('test','confirm','confirmforced')) || empty($filepath)) { print "Usage: $script_file (test|confirm|confirmforced) filepath.csv [defaultlang] [startlinenb] [endlinenb]\n"; print "Usage: $script_file test myfilepath.csv fr_FR 2 1002\n"; print "\n"; @@ -78,7 +78,7 @@ if (! file_exists($filepath)) { exit(-1); } -$ret=$user->fetch('','admin'); +$ret=$user->fetch('', 'admin'); if (! $ret > 0) { print 'A user with login "admin" and all permissions must be created to use this script.'."\n"; diff --git a/dev/initdata/import-thirdparties.php b/dev/initdata/import-thirdparties.php index 63c6856e5ec..69b9bb8bdc6 100755 --- a/dev/initdata/import-thirdparties.php +++ b/dev/initdata/import-thirdparties.php @@ -35,7 +35,7 @@ if (substr($sapi_type, 0, 3) == 'cgi') { } // Recupere root dolibarr -$path=preg_replace('/import-thirdparties.php/i','',$_SERVER["PHP_SELF"]); +$path=preg_replace('/import-thirdparties.php/i', '', $_SERVER["PHP_SELF"]); require $path."../../htdocs/master.inc.php"; include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; @@ -57,7 +57,7 @@ $error=0; @set_time_limit(0); print "***** ".$script_file." (".$version.") pid=".dol_getmypid()." *****\n"; -dol_syslog($script_file." launched with arg ".implode(',',$argv)); +dol_syslog($script_file." launched with arg ".implode(',', $argv)); $mode = $argv[1]; $filepath = $argv[2]; @@ -66,7 +66,7 @@ $filepatherr = $filepath.'.err'; $startlinenb = empty($argv[3])?1:$argv[3]; $endlinenb = empty($argv[4])?0:$argv[4]; -if (empty($mode) || ! in_array($mode,array('test','confirm','confirmforced')) || empty($filepath)) { +if (empty($mode) || ! in_array($mode, array('test','confirm','confirmforced')) || empty($filepath)) { print "Usage: $script_file (test|confirm|confirmforced) filepath.csv [startlinenb] [endlinenb]\n"; print "Usage: $script_file test myfilepath.csv 2 1002\n"; print "\n"; @@ -78,7 +78,7 @@ if (! file_exists($filepath)) { exit(-1); } -$ret=$user->fetch('','admin'); +$ret=$user->fetch('', 'admin'); if (! $ret > 0) { print 'A user with login "admin" and all permissions must be created to use this script.'."\n"; @@ -199,13 +199,13 @@ while ($fields=fgetcsv($fhandle, $linelength, $delimiter, $enclosure, $escape)) { $salesrep=new User($db); - $tmp=explode(' ',$fields[3],2); + $tmp=explode(' ', $fields[3], 2); $salesrep->firstname = trim($tmp[0]); $salesrep->lastname = trim($tmp[1]); if ($salesrep->lastname) $salesrep->login = strtolower(substr($salesrep->firstname, 0, 1)) . strtolower(substr($salesrep->lastname, 0)); else $salesrep->login=strtolower($salesrep->firstname); - $salesrep->login=preg_replace('/ /','',$salesrep->login); - $salesrep->fetch(0,$salesrep->login); + $salesrep->login=preg_replace('/ /', '', $salesrep->login); + $salesrep->fetch(0, $salesrep->login); $result = $object->add_commercial($user, $salesrep->id); if ($result < 0) diff --git a/dev/initdata/import-users.php b/dev/initdata/import-users.php index c94f74341f6..2a1dcc3d826 100755 --- a/dev/initdata/import-users.php +++ b/dev/initdata/import-users.php @@ -35,7 +35,7 @@ if (substr($sapi_type, 0, 3) == 'cgi') { } // Recupere root dolibarr -$path=preg_replace('/import-users.php/i','',$_SERVER["PHP_SELF"]); +$path=preg_replace('/import-users.php/i', '', $_SERVER["PHP_SELF"]); require $path."../../htdocs/master.inc.php"; include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; @@ -57,7 +57,7 @@ $error=0; @set_time_limit(0); print "***** ".$script_file." (".$version.") pid=".dol_getmypid()." *****\n"; -dol_syslog($script_file." launched with arg ".implode(',',$argv)); +dol_syslog($script_file." launched with arg ".implode(',', $argv)); $mode = $argv[1]; $filepath = $argv[2]; @@ -66,7 +66,7 @@ $filepatherr = $filepath.'.err'; $startlinenb = empty($argv[3])?1:$argv[3]; $endlinenb = empty($argv[4])?0:$argv[4]; -if (empty($mode) || ! in_array($mode,array('test','confirm','confirmforced')) || empty($filepath)) { +if (empty($mode) || ! in_array($mode, array('test','confirm','confirmforced')) || empty($filepath)) { print "Usage: $script_file (test|confirm|confirmforced) filepath.csv [startlinenb] [endlinenb]\n"; print "Usage: $script_file test myfilepath.csv 2 1002\n"; print "\n"; @@ -78,7 +78,7 @@ if (! file_exists($filepath)) { exit(-1); } -$ret=$user->fetch('','admin'); +$ret=$user->fetch('', 'admin'); if (! $ret > 0) { print 'A user with login "admin" and all permissions must be created to use this script.'."\n"; @@ -127,12 +127,12 @@ while ($fields=fgetcsv($fhandle, $linelength, $delimiter, $enclosure, $escape)) $object = new User($db); $object->statut = 1; - $tmp=explode(' ',$fields[3],2); + $tmp=explode(' ', $fields[3], 2); $object->firstname = trim($tmp[0]); $object->lastname = trim($tmp[1]); if ($object->lastname) $object->login = strtolower(substr($object->firstname, 0, 1)) . strtolower(substr($object->lastname, 0)); else $object->login=strtolower($object->firstname); - $object->login=preg_replace('/ /','',$object->login); + $object->login=preg_replace('/ /', '', $object->login); $object->password = 'init'; print "Process line nb ".$i.", login ".$object->login; diff --git a/dev/initdata/purge-data.php b/dev/initdata/purge-data.php index 2bdf200225b..996ad42e451 100755 --- a/dev/initdata/purge-data.php +++ b/dev/initdata/purge-data.php @@ -35,7 +35,7 @@ if (substr($sapi_type, 0, 3) == 'cgi') { } // Recupere root dolibarr -$path=preg_replace('/purge-data.php/i','',$_SERVER["PHP_SELF"]); +$path=preg_replace('/purge-data.php/i', '', $_SERVER["PHP_SELF"]); require $path."../../htdocs/master.inc.php"; include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; include_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; @@ -150,22 +150,22 @@ $sqls=array( @set_time_limit(0); print "***** ".$script_file." (".$version.") pid=".dol_getmypid()." *****\n"; -dol_syslog($script_file." launched with arg ".implode(',',$argv)); +dol_syslog($script_file." launched with arg ".implode(',', $argv)); $mode = $argv[1]; $option = $argv[2]; -if (empty($mode) || ! in_array($mode,array('test','confirm'))) { +if (empty($mode) || ! in_array($mode, array('test','confirm'))) { print "Usage: $script_file (test|confirm) (all|option) [dbtype dbhost dbuser dbpassword dbname dbport]\n"; print "\n"; - print "option can be ".implode(',',array_keys($sqls))."\n"; + print "option can be ".implode(',', array_keys($sqls))."\n"; exit(-1); } -if (empty($option) || ! in_array($option, array_merge(array('all'),array_keys($sqls))) ) { +if (empty($option) || ! in_array($option, array_merge(array('all'), array_keys($sqls))) ) { print "Usage: $script_file (test|confirm) (all|option) [dbtype dbhost dbuser dbpassword dbname dbport]\n"; print "\n"; - print "option can be ".implode(',',array_keys($sqls))."\n"; + print "option can be ".implode(',', array_keys($sqls))."\n"; exit(-1); } @@ -179,7 +179,7 @@ if (! empty($argv[3])) } //var_dump($user->db->database_name); -$ret=$user->fetch('','admin'); +$ret=$user->fetch('', 'admin'); if (! $ret > 0) { print 'An admin user with login "admin" must exists to use this script.'."\n"; @@ -215,9 +215,9 @@ function processfamily($family) $error=0; foreach($sqls[$family] as $sql) { - if (preg_match('/^@/',$sql)) + if (preg_match('/^@/', $sql)) { - $newfamily=preg_replace('/@/','',$sql); + $newfamily=preg_replace('/@/', '', $sql); processfamily($newfamily); continue; } diff --git a/dev/initdemo/sftpget_and_loaddump.php b/dev/initdemo/sftpget_and_loaddump.php index 98cb6189935..e9641ac6816 100755 --- a/dev/initdemo/sftpget_and_loaddump.php +++ b/dev/initdemo/sftpget_and_loaddump.php @@ -46,8 +46,8 @@ if (! $res && file_exists($path."../../htdocs/master.inc.php")) $res=@include $p if (! $res && file_exists("../master.inc.php")) $res=@include "../master.inc.php"; if (! $res && file_exists("../../master.inc.php")) $res=@include "../../master.inc.php"; if (! $res && file_exists("../../../master.inc.php")) $res=@include "../../../master.inc.php"; -if (! $res && preg_match('/\/nltechno([^\/]*)\//',$_SERVER["PHP_SELF"],$reg)) $res=@include $path."../../../dolibarr".$reg[1]."/htdocs/master.inc.php"; // Used on dev env only -if (! $res && preg_match('/\/nltechno([^\/]*)\//',$_SERVER["PHP_SELF"],$reg)) $res=@include "../../../dolibarr".$reg[1]."/htdocs/master.inc.php"; // Used on dev env only +if (! $res && preg_match('/\/nltechno([^\/]*)\//', $_SERVER["PHP_SELF"], $reg)) $res=@include $path."../../../dolibarr".$reg[1]."/htdocs/master.inc.php"; // Used on dev env only +if (! $res && preg_match('/\/nltechno([^\/]*)\//', $_SERVER["PHP_SELF"], $reg)) $res=@include "../../../dolibarr".$reg[1]."/htdocs/master.inc.php"; // Used on dev env only if (! $res) die ("Failed to include master.inc.php file\n"); include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; @@ -58,7 +58,7 @@ include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; $login=''; $server=''; -if (preg_match('/^(.*)@(.*):(.*)$/',$sourceserver,$reg)) +if (preg_match('/^(.*)@(.*):(.*)$/', $sourceserver, $reg)) { $login=$reg[1]; $server=$reg[2]; @@ -84,7 +84,7 @@ print 'SFTP connect string : '.$sftpconnectstring."\n"; // SFTP connect if (! function_exists("ssh2_connect")) { - dol_print_error('','ssh2_connect function does not exists'); exit(1); + dol_print_error('', 'ssh2_connect function does not exists'); exit(1); } $connection = ssh2_connect($server, 22); @@ -92,7 +92,7 @@ if ($connection) { if (! @ssh2_auth_password($connection, $login, $password)) { - dol_syslog("Could not authenticate with username ".$login." . and password ".preg_replace('/./', '*', $password),LOG_ERR); + dol_syslog("Could not authenticate with username ".$login." . and password ".preg_replace('/./', '*', $password), LOG_ERR); exit(-5); } else @@ -112,11 +112,11 @@ if ($connection) ssh2_scp_recv($connection, $sourcefile, $targetdir.$targetfile); $fullcommand="cat ".$targetdir.$targetfile." | mysql -h".$databaseserver." -u".$loginbase." -p".$passwordbase." -D ".$database; - if (preg_match('/\.bz2$/',$targetfile)) + if (preg_match('/\.bz2$/', $targetfile)) { $fullcommand="bzip2 -c -d ".$targetdir.$targetfile." | mysql -h".$databaseserver." -u".$loginbase." -p".$passwordbase." -D ".$database; } - if (preg_match('/\.gz$/',$targetfile)) + if (preg_match('/\.gz$/', $targetfile)) { $fullcommand="gzip -d ".$targetdir.$targetfile." | mysql -h".$databaseserver." -u".$loginbase." -p".$passwordbase." -D ".$database; } diff --git a/dev/initdemo/updatedemo.php b/dev/initdemo/updatedemo.php index 53717314d5f..606bdbe6f56 100755 --- a/dev/initdemo/updatedemo.php +++ b/dev/initdemo/updatedemo.php @@ -41,8 +41,8 @@ if (! $res && file_exists($path."../../htdocs/master.inc.php")) $res=@include $p if (! $res && file_exists("../master.inc.php")) $res=@include "../master.inc.php"; if (! $res && file_exists("../../master.inc.php")) $res=@include "../../master.inc.php"; if (! $res && file_exists("../../../master.inc.php")) $res=@include "../../../master.inc.php"; -if (! $res && preg_match('/\/nltechno([^\/]*)\//',$_SERVER["PHP_SELF"],$reg)) $res=@include $path."../../../dolibarr".$reg[1]."/htdocs/master.inc.php"; // Used on dev env only -if (! $res && preg_match('/\/nltechno([^\/]*)\//',$_SERVER["PHP_SELF"],$reg)) $res=@include "../../../dolibarr".$reg[1]."/htdocs/master.inc.php"; // Used on dev env only +if (! $res && preg_match('/\/nltechno([^\/]*)\//', $_SERVER["PHP_SELF"], $reg)) $res=@include $path."../../../dolibarr".$reg[1]."/htdocs/master.inc.php"; // Used on dev env only +if (! $res && preg_match('/\/nltechno([^\/]*)\//', $_SERVER["PHP_SELF"], $reg)) $res=@include "../../../dolibarr".$reg[1]."/htdocs/master.inc.php"; // Used on dev env only if (! $res) die ("Failed to include master.inc.php file\n"); include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; diff --git a/dev/setup/codesniffer/ruleset.xml b/dev/setup/codesniffer/ruleset.xml index 879d791b8e9..19b32753940 100644 --- a/dev/setup/codesniffer/ruleset.xml +++ b/dev/setup/codesniffer/ruleset.xml @@ -65,7 +65,7 @@ 0 - + '."\n"; @@ -342,19 +342,19 @@ print "\n"; foreach($boxtoadd as $box) { - if (preg_match('/^([^@]+)@([^@]+)$/i',$box->boximg)) + if (preg_match('/^([^@]+)@([^@]+)$/i', $box->boximg)) { $logo = $box->boximg; } else { - $logo=preg_replace("/^object_/i","",$box->boximg); + $logo=preg_replace("/^object_/i", "", $box->boximg); } print "\n".''."\n"; print ''."\n"; - print ''.img_object("",$logo).' '.$langs->transnoentitiesnoconv($box->boxlabel); - if (! empty($box->class) && preg_match('/graph_/',$box->class)) print ' ('.$langs->trans("Graph").')'; + print ''.img_object("", $logo).' '.$langs->transnoentitiesnoconv($box->boxlabel); + if (! empty($box->class) && preg_match('/graph_/', $box->class)) print ' ('.$langs->trans("Graph").')'; print ''."\n"; print ''; if ($box->note == '(WarningUsingThisBoxSlowDown)') @@ -407,25 +407,25 @@ $box_order=1; $foundrupture=1; foreach($boxactivated as $key => $box) { - if (preg_match('/^([^@]+)@([^@]+)$/i',$box->boximg)) + if (preg_match('/^([^@]+)@([^@]+)$/i', $box->boximg)) { $logo = $box->boximg; } else { - $logo=preg_replace("/^object_/i","",$box->boximg); + $logo=preg_replace("/^object_/i", "", $box->boximg); } print "\n".''."\n"; print ''; - print ''.img_object("",$logo).' '.$langs->transnoentitiesnoconv($box->boxlabel); - if (! empty($box->class) && preg_match('/graph_/',$box->class)) print ' ('.$langs->trans("Graph").')'; + print ''.img_object("", $logo).' '.$langs->transnoentitiesnoconv($box->boxlabel); + if (! empty($box->class) && preg_match('/graph_/', $box->class)) print ' ('.$langs->trans("Graph").')'; print ''; print ''; if ($box->note == '(WarningUsingThisBoxSlowDown)') { $langs->load("errors"); - print img_warning('',0).' '.$langs->trans("WarningUsingThisBoxSlowDown"); + print img_warning('', 0).' '.$langs->trans("WarningUsingThisBoxSlowDown"); } else print ($box->note?$box->note:' '); print ''; @@ -476,7 +476,7 @@ print ''; if ($conf->global->MAIN_FEATURES_LEVEL == 2 || ! empty($conf->global->MAIN_ACTIVATE_FILECACHE)) { print ''.$langs->trans("EnableFileCache").''; - print $form->selectyesno('MAIN_ACTIVATE_FILECACHE',$conf->global->MAIN_ACTIVATE_FILECACHE,1); + print $form->selectyesno('MAIN_ACTIVATE_FILECACHE', $conf->global->MAIN_ACTIVATE_FILECACHE, 1); print ''; print ''; } diff --git a/htdocs/admin/chequereceipts.php b/htdocs/admin/chequereceipts.php index 013b140ee60..4efa3bc487b 100644 --- a/htdocs/admin/chequereceipts.php +++ b/htdocs/admin/chequereceipts.php @@ -37,8 +37,8 @@ $langs->loadLangs(array("admin","companies","bills","other","banks")); if (!$user->admin) accessforbidden(); -$action = GETPOST('action','alpha'); -$value = GETPOST('value','alpha'); +$action = GETPOST('action', 'alpha'); +$value = GETPOST('value', 'alpha'); if (empty($conf->global->CHEQUERECEIPTS_ADDON)) $conf->global->CHEQUERECEIPTS_ADDON = 'mod_chequereceipts_mint.php'; @@ -51,9 +51,9 @@ if (empty($conf->global->CHEQUERECEIPTS_ADDON)) $conf->global->CHEQUERECEIPTS_AD if ($action == 'updateMask') { - $maskconstchequereceipts=GETPOST('maskconstchequereceipts','alpha'); - $maskchequereceipts=GETPOST('maskchequereceipts','alpha'); - if ($maskconstchequereceipts) $res = dolibarr_set_const($db,$maskconstchequereceipts,$maskchequereceipts,'chaine',0,'',$conf->entity); + $maskconstchequereceipts=GETPOST('maskconstchequereceipts', 'alpha'); + $maskchequereceipts=GETPOST('maskchequereceipts', 'alpha'); + if ($maskconstchequereceipts) $res = dolibarr_set_const($db, $maskconstchequereceipts, $maskchequereceipts, 'chaine', 0, '', $conf->entity); if (! $res > 0) $error++; @@ -69,14 +69,14 @@ if ($action == 'updateMask') if ($action == 'setmod') { - dolibarr_set_const($db, "CHEQUERECEIPTS_ADDON",$value, 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "CHEQUERECEIPTS_ADDON", $value, 'chaine', 0, '', $conf->entity); } if ($action == 'set_BANK_CHEQUERECEIPT_FREE_TEXT') { - $freetext = GETPOST('BANK_CHEQUERECEIPT_FREE_TEXT','none'); // No alpha here, we want exact string + $freetext = GETPOST('BANK_CHEQUERECEIPT_FREE_TEXT', 'none'); // No alpha here, we want exact string - $res = dolibarr_set_const($db, "BANK_CHEQUERECEIPT_FREE_TEXT",$freetext,'chaine',0,'',$conf->entity); + $res = dolibarr_set_const($db, "BANK_CHEQUERECEIPT_FREE_TEXT", $freetext, 'chaine', 0, '', $conf->entity); if (! $res > 0) $error++; @@ -94,13 +94,13 @@ if ($action == 'set_BANK_CHEQUERECEIPT_FREE_TEXT') * view */ -$dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']); -llxHeader("",$langs->trans("BankSetupModule")); +$dirmodels=array_merge(array('/'), (array) $conf->modules_parts['models']); +llxHeader("", $langs->trans("BankSetupModule")); $form=new Form($db); $linkback=''.$langs->trans("BackToModuleList").''; -print load_fiche_titre($langs->trans("BankSetupModule"),$linkback,'title_setup'); +print load_fiche_titre($langs->trans("BankSetupModule"), $linkback, 'title_setup'); $head = bank_admin_prepare_head(null); dol_fiche_head($head, 'checkreceipts', $langs->trans("BankSetupModule"), -1, 'account'); @@ -136,7 +136,7 @@ foreach ($dirmodels as $reldir) { $filebis = $file; $name = substr($file, 4, dol_strlen($file) -16); - $classname = preg_replace('/\.php$/','',$file); + $classname = preg_replace('/\.php$/', '', $file); // For compatibility if (! is_file($dir.$filebis)) { @@ -144,11 +144,11 @@ foreach ($dirmodels as $reldir) $classname = "mod_chequereceipt_".$file; } // Check if there is a filter on country - preg_match('/\-(.*)_(.*)$/',$classname,$reg); + preg_match('/\-(.*)_(.*)$/', $classname, $reg); if (! empty($reg[2]) && $reg[2] != strtoupper($mysoc->country_code)) continue; - $classname = preg_replace('/\-.*$/','',$classname); - if (! class_exists($classname) && is_readable($dir.$filebis) && (preg_match('/mod_/',$filebis) || preg_match('/mod_/',$classname)) && substr($filebis, dol_strlen($filebis)-3, 3) == 'php') + $classname = preg_replace('/\-.*$/', '', $classname); + if (! class_exists($classname) && is_readable($dir.$filebis) && (preg_match('/mod_/', $filebis) || preg_match('/mod_/', $classname)) && substr($filebis, dol_strlen($filebis)-3, 3) == 'php') { // Charging the numbering class require_once $dir.$filebis; @@ -172,7 +172,7 @@ foreach ($dirmodels as $reldir) // Show example of numbering module print ''; $tmp=$module->getExample(); - if (preg_match('/^Error/',$tmp)) print '
'.$langs->trans($tmp).'
'; + if (preg_match('/^Error/', $tmp)) print '
'.$langs->trans($tmp).'
'; elseif ($tmp=='NotConfigured') print $langs->trans($tmp); else print $tmp; print ''."\n"; @@ -180,11 +180,11 @@ foreach ($dirmodels as $reldir) print ''; if ($conf->global->CHEQUERECEIPTS_ADDON == $file || $conf->global->CHEQUERECEIPTS_ADDON.'.php' == $file) { - print img_picto($langs->trans("Activated"),'switch_on'); + print img_picto($langs->trans("Activated"), 'switch_on'); } else { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'switch_off').''; + print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; } print ''; @@ -194,11 +194,11 @@ foreach ($dirmodels as $reldir) // Example $htmltooltip=''; $htmltooltip.=''.$langs->trans("Version").': '.$module->getVersion().'
'; - $nextval=$module->getNextValue($mysoc,$chequereceipts); + $nextval=$module->getNextValue($mysoc, $chequereceipts); if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval $htmltooltip.=$langs->trans("NextValue").': '; if ($nextval) { - if (preg_match('/^Error/',$nextval) || $nextval=='NotConfigured') + if (preg_match('/^Error/', $nextval) || $nextval=='NotConfigured') $nextval = $langs->trans($nextval); $htmltooltip.=$nextval.'
'; } else { @@ -207,11 +207,11 @@ foreach ($dirmodels as $reldir) } print ''; - print $form->textwithpicto('',$htmltooltip,1,0); + print $form->textwithpicto('', $htmltooltip, 1, 0); if ($conf->global->CHEQUERECEIPTS_ADDON.'.php' == $file) // If module is the one used, we show existing errors { - if (! empty($module->error)) dol_htmloutput_mesg($module->error,'','error',1); + if (! empty($module->error)) dol_htmloutput_mesg($module->error, '', 'error', 1); } print ''; @@ -235,7 +235,7 @@ print '
'; * Other options * */ -print load_fiche_titre($langs->trans("OtherOptions"),'',''); +print load_fiche_titre($langs->trans("OtherOptions"), '', ''); print '
'; print ''; @@ -264,7 +264,7 @@ if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) else { include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor=new DolEditor($variablename, $conf->global->$variablename,'',80,'dolibarr_notes'); + $doleditor=new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes'); print $doleditor->Create(); } print ''; diff --git a/htdocs/admin/clicktodial.php b/htdocs/admin/clicktodial.php index 34a641137dc..7f4a167edd9 100644 --- a/htdocs/admin/clicktodial.php +++ b/htdocs/admin/clicktodial.php @@ -31,7 +31,7 @@ $langs->load("admin"); if (!$user->admin) accessforbidden(); -$action = GETPOST('action','aZ09'); +$action = GETPOST('action', 'aZ09'); /* @@ -61,10 +61,10 @@ if ($action == 'setvalue' && $user->admin) $user->fetch_clicktodial(); $wikihelp='EN:Module_ClickToDial_En|FR:Module_ClickToDial|ES:Módulo_ClickTodial_Es'; -llxHeader('',$langs->trans("ClickToDialSetup"),$wikihelp); +llxHeader('', $langs->trans("ClickToDialSetup"), $wikihelp); $linkback=''.$langs->trans("BackToModuleList").''; -print load_fiche_titre($langs->trans("ClickToDialSetup"),$linkback,'title_setup'); +print load_fiche_titre($langs->trans("ClickToDialSetup"), $linkback, 'title_setup'); print $langs->trans("ClickToDialDesc")."
\n"; @@ -119,19 +119,19 @@ if (! empty($conf->global->CLICKTODIAL_URL)) if (GETPOST('phonefortest')) $phonefortest=GETPOST('phonefortest'); print ''; - print $langs->trans("LinkToTestClickToDial",$user->login).' : '; + print $langs->trans("LinkToTestClickToDial", $user->login).' : '; print ''; print ''; print '
'; $setupcomplete=1; - if (preg_match('/__LOGIN__/',$conf->global->CLICKTODIAL_URL) && empty($user->clicktodial_login)) $setupcomplete=0; - if (preg_match('/__PASSWORD__/',$conf->global->CLICKTODIAL_URL) && empty($user->clicktodial_password)) $setupcomplete=0; - if (preg_match('/__PHONEFROM__/',$conf->global->CLICKTODIAL_URL) && empty($user->clicktodial_poste)) $setupcomplete=0; + if (preg_match('/__LOGIN__/', $conf->global->CLICKTODIAL_URL) && empty($user->clicktodial_login)) $setupcomplete=0; + if (preg_match('/__PASSWORD__/', $conf->global->CLICKTODIAL_URL) && empty($user->clicktodial_password)) $setupcomplete=0; + if (preg_match('/__PHONEFROM__/', $conf->global->CLICKTODIAL_URL) && empty($user->clicktodial_poste)) $setupcomplete=0; if ($setupcomplete) { - print $langs->trans("LinkToTest",$user->login).': '.dol_print_phone($phonefortest, '', 0, 0, 'AC_TEL'); + print $langs->trans("LinkToTest", $user->login).': '.dol_print_phone($phonefortest, '', 0, 0, 'AC_TEL'); } else { diff --git a/htdocs/admin/commande.php b/htdocs/admin/commande.php index 2360c1f7b6e..cead1eb3acb 100644 --- a/htdocs/admin/commande.php +++ b/htdocs/admin/commande.php @@ -41,10 +41,10 @@ $langs->loadLangs(array('admin', 'errors', 'orders', 'other')); if (! $user->admin) accessforbidden(); -$action = GETPOST('action','alpha'); -$value = GETPOST('value','alpha'); -$label = GETPOST('label','alpha'); -$scandir = GETPOST('scan_dir','alpha'); +$action = GETPOST('action', 'alpha'); +$value = GETPOST('value', 'alpha'); +$label = GETPOST('label', 'alpha'); +$scandir = GETPOST('scan_dir', 'alpha'); $type = 'order'; @@ -56,10 +56,10 @@ include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php'; if ($action == 'updateMask') { - $maskconstorder=GETPOST('maskconstorder','alpha'); - $maskorder=GETPOST('maskorder','alpha'); + $maskconstorder=GETPOST('maskconstorder', 'alpha'); + $maskorder=GETPOST('maskorder', 'alpha'); - if ($maskconstorder) $res = dolibarr_set_const($db,$maskconstorder,$maskorder,'chaine',0,'',$conf->entity); + if ($maskconstorder) $res = dolibarr_set_const($db, $maskconstorder, $maskorder, 'chaine', 0, '', $conf->entity); if (! $res > 0) $error++; @@ -75,17 +75,17 @@ if ($action == 'updateMask') else if ($action == 'specimen') { - $modele=GETPOST('module','alpha'); + $modele=GETPOST('module', 'alpha'); $commande = new Commande($db); $commande->initAsSpecimen(); // Search template files $file=''; $classname=''; $filefound=0; - $dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']); + $dirmodels=array_merge(array('/'), (array) $conf->modules_parts['models']); foreach($dirmodels as $reldir) { - $file=dol_buildpath($reldir."core/modules/commande/doc/pdf_".$modele.".modules.php",0); + $file=dol_buildpath($reldir."core/modules/commande/doc/pdf_".$modele.".modules.php", 0); if (file_exists($file)) { $filefound=1; @@ -100,7 +100,7 @@ else if ($action == 'specimen') $module = new $classname($db); - if ($module->write_file($commande,$langs) > 0) + if ($module->write_file($commande, $langs) > 0) { header("Location: ".DOL_URL_ROOT."/document.php?modulepart=commande&file=SPECIMEN.pdf"); return; @@ -129,14 +129,14 @@ else if ($action == 'del') $ret = delDocumentModel($value, $type); if ($ret > 0) { - if ($conf->global->COMMANDE_ADDON_PDF == "$value") dolibarr_del_const($db, 'COMMANDE_ADDON_PDF',$conf->entity); + if ($conf->global->COMMANDE_ADDON_PDF == "$value") dolibarr_del_const($db, 'COMMANDE_ADDON_PDF', $conf->entity); } } // Set default model else if ($action == 'setdoc') { - if (dolibarr_set_const($db, "COMMANDE_ADDON_PDF",$value,'chaine',0,'',$conf->entity)) + if (dolibarr_set_const($db, "COMMANDE_ADDON_PDF", $value, 'chaine', 0, '', $conf->entity)) { // The constant that was read before the new set // We therefore requires a variable to have a coherent view @@ -156,13 +156,13 @@ else if ($action == 'setmod') // TODO Check if numbering module chosen can be activated // by calling method canBeActivated - dolibarr_set_const($db, "COMMANDE_ADDON",$value,'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "COMMANDE_ADDON", $value, 'chaine', 0, '', $conf->entity); } else if ($action == 'set_COMMANDE_DRAFT_WATERMARK') { $draft = GETPOST("COMMANDE_DRAFT_WATERMARK"); - $res = dolibarr_set_const($db, "COMMANDE_DRAFT_WATERMARK",trim($draft),'chaine',0,'',$conf->entity); + $res = dolibarr_set_const($db, "COMMANDE_DRAFT_WATERMARK", trim($draft), 'chaine', 0, '', $conf->entity); if (! $res > 0) $error++; @@ -178,9 +178,9 @@ else if ($action == 'set_COMMANDE_DRAFT_WATERMARK') else if ($action == 'set_ORDER_FREE_TEXT') { - $freetext = GETPOST("ORDER_FREE_TEXT",'none'); // No alpha here, we want exact string + $freetext = GETPOST("ORDER_FREE_TEXT", 'none'); // No alpha here, we want exact string - $res = dolibarr_set_const($db, "ORDER_FREE_TEXT",$freetext,'chaine',0,'',$conf->entity); + $res = dolibarr_set_const($db, "ORDER_FREE_TEXT", $freetext, 'chaine', 0, '', $conf->entity); if (! $res > 0) $error++; @@ -196,8 +196,8 @@ else if ($action == 'set_ORDER_FREE_TEXT') // Activate Set Shippable Icon In List else if ($action=="setshippableiconinlist") { - $setshippableiconinlist = GETPOST('value','int'); - $res = dolibarr_set_const($db, "SHIPPABLE_ORDER_ICON_IN_LIST", $setshippableiconinlist,'yesno',0,'',$conf->entity); + $setshippableiconinlist = GETPOST('value', 'int'); + $res = dolibarr_set_const($db, "SHIPPABLE_ORDER_ICON_IN_LIST", $setshippableiconinlist, 'yesno', 0, '', $conf->entity); if (! $res > 0) $error++; if (! $error) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); @@ -209,7 +209,7 @@ else if ($action=="setshippableiconinlist") { // Activate ask for payment bank else if ($action == 'set_BANK_ASK_PAYMENT_BANK_DURING_ORDER') { - $res = dolibarr_set_const($db, "BANK_ASK_PAYMENT_BANK_DURING_ORDER",$value,'chaine',0,'',$conf->entity); + $res = dolibarr_set_const($db, "BANK_ASK_PAYMENT_BANK_DURING_ORDER", $value, 'chaine', 0, '', $conf->entity); if (! $res > 0) $error++; @@ -226,7 +226,7 @@ else if ($action == 'set_BANK_ASK_PAYMENT_BANK_DURING_ORDER') // Activate ask for warehouse else if ($action == 'set_WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER') { - $res = dolibarr_set_const($db, "WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER",$value,'chaine',0,'',$conf->entity); + $res = dolibarr_set_const($db, "WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER", $value, 'chaine', 0, '', $conf->entity); if (! $res > 0) $error++; @@ -247,12 +247,12 @@ else if ($action == 'set_WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER') $form=new Form($db); -$dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']); +$dirmodels=array_merge(array('/'), (array) $conf->modules_parts['models']); -llxHeader("",$langs->trans("OrdersSetup")); +llxHeader("", $langs->trans("OrdersSetup")); $linkback=''.$langs->trans("BackToModuleList").''; -print load_fiche_titre($langs->trans("OrdersSetup"),$linkback,'title_setup'); +print load_fiche_titre($langs->trans("OrdersSetup"), $linkback, 'title_setup'); $head = order_admin_prepare_head(); @@ -262,7 +262,7 @@ dol_fiche_head($head, 'general', $langs->trans("Orders"), -1, 'order'); * Orders Numbering model */ -print load_fiche_titre($langs->trans("OrdersNumberingModules"),'',''); +print load_fiche_titre($langs->trans("OrdersNumberingModules"), '', ''); print ''; print ''; @@ -309,7 +309,7 @@ foreach ($dirmodels as $reldir) // Show example of numbering model print ''."\n"; @@ -317,12 +317,12 @@ foreach ($dirmodels as $reldir) print ''; @@ -334,11 +334,11 @@ foreach ($dirmodels as $reldir) $htmltooltip=''; $htmltooltip.=''.$langs->trans("Version").': '.$module->getVersion().'
'; $commande->type=0; - $nextval=$module->getNextValue($mysoc,$commande); + $nextval=$module->getNextValue($mysoc, $commande); if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval $htmltooltip.=''.$langs->trans("NextValue").': '; if ($nextval) { - if (preg_match('/^Error/',$nextval) || $nextval=='NotConfigured') + if (preg_match('/^Error/', $nextval) || $nextval=='NotConfigured') $nextval = $langs->trans($nextval); $htmltooltip.=$nextval.'
'; } else { @@ -347,7 +347,7 @@ foreach ($dirmodels as $reldir) } print ''; print "\n"; @@ -365,7 +365,7 @@ print "
'; $tmp=$module->getExample(); - if (preg_match('/^Error/',$tmp)) print '
'.$langs->trans($tmp).'
'; + if (preg_match('/^Error/', $tmp)) print '
'.$langs->trans($tmp).'
'; elseif ($tmp=='NotConfigured') print $langs->trans($tmp); else print $tmp; print '
'; if ($conf->global->COMMANDE_ADDON == $file) { - print img_picto($langs->trans("Activated"),'switch_on'); + print img_picto($langs->trans("Activated"), 'switch_on'); } else { print ''; - print img_picto($langs->trans("Disabled"),'switch_off'); + print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; } print ''; - print $form->textwithpicto('',$htmltooltip,1,0); + print $form->textwithpicto('', $htmltooltip, 1, 0); print '

\n"; * Document templates generators */ -print load_fiche_titre($langs->trans("OrdersModelModule"),'',''); +print load_fiche_titre($langs->trans("OrdersModelModule"), '', ''); // Load array def with activated templates $def = array(); @@ -423,7 +423,7 @@ foreach ($dirmodels as $reldir) foreach($filelist as $file) { - if (preg_match('/\.modules\.php$/i',$file) && preg_match('/^(pdf_|doc_)/',$file)) + if (preg_match('/\.modules\.php$/i', $file) && preg_match('/^(pdf_|doc_)/', $file)) { if (file_exists($dir.'/'.$file)) @@ -444,7 +444,7 @@ foreach ($dirmodels as $reldir) print ''; print (empty($module->name)?$name:$module->name); print "\n"; - if (method_exists($module,'info')) print $module->info($langs); + if (method_exists($module, 'info')) print $module->info($langs); else print $module->description; print ''; @@ -453,14 +453,14 @@ foreach ($dirmodels as $reldir) { print ''."\n"; print ''; - print img_picto($langs->trans("Enabled"),'switch_on'); + print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; print ''; } else { print ''."\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').''; + print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print ""; } @@ -468,11 +468,11 @@ foreach ($dirmodels as $reldir) print ''; if ($conf->global->COMMANDE_ADDON_PDF == $name) { - print img_picto($langs->trans("Default"),'on'); + print img_picto($langs->trans("Default"), 'on'); } else { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').''; + print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; @@ -484,28 +484,28 @@ foreach ($dirmodels as $reldir) $htmltooltip.='
'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur; } $htmltooltip.='

'.$langs->trans("FeaturesSupported").':'; - $htmltooltip.='
'.$langs->trans("Logo").': '.yn($module->option_logo,1,1); - $htmltooltip.='
'.$langs->trans("PaymentMode").': '.yn($module->option_modereg,1,1); - $htmltooltip.='
'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg,1,1); - $htmltooltip.='
'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang,1,1); + $htmltooltip.='
'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1); + $htmltooltip.='
'.$langs->trans("PaymentMode").': '.yn($module->option_modereg, 1, 1); + $htmltooltip.='
'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg, 1, 1); + $htmltooltip.='
'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang, 1, 1); //$htmltooltip.='
'.$langs->trans("Discounts").': '.yn($module->option_escompte,1,1); //$htmltooltip.='
'.$langs->trans("CreditNote").': '.yn($module->option_credit_note,1,1); - $htmltooltip.='
'.$langs->trans("WatermarkOnDraftOrders").': '.yn($module->option_draft_watermark,1,1); + $htmltooltip.='
'.$langs->trans("WatermarkOnDraftOrders").': '.yn($module->option_draft_watermark, 1, 1); print ''; - print $form->textwithpicto('',$htmltooltip,1,0); + print $form->textwithpicto('', $htmltooltip, 1, 0); print ''; // Preview print ''; if ($module->type == 'pdf') { - print ''.img_object($langs->trans("Preview"),'bill').''; + print ''.img_object($langs->trans("Preview"), 'bill').''; } else { - print img_object($langs->trans("PreviewNotAvailable"),'generic'); + print img_object($langs->trans("PreviewNotAvailable"), 'generic'); } print ''; @@ -526,7 +526,7 @@ print "
"; * Other options */ -print load_fiche_titre($langs->trans("OtherOptions"),'',''); +print load_fiche_titre($langs->trans("OtherOptions"), '', ''); print ''; print ''; print ''; @@ -553,7 +553,7 @@ if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) else { include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor=new DolEditor($variablename, $conf->global->$variablename,'',80,'dolibarr_notes'); + $doleditor=new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes'); print $doleditor->Create(); } print ''; // ProfID1 - if ($langs->transcountry("ProfId1",$mysoc->country_code) != '-') + if ($langs->transcountry("ProfId1", $mysoc->country_code) != '-') { - print ''; + print $formother->select_month($conf->global->SOCIETE_FISCAL_MONTH_START, 'SOCIETE_FISCAL_MONTH_START', 0, 1) . ''; print "
'.$langs->trans("Parameter").''; @@ -664,7 +664,7 @@ print '
'; * Notifications */ -print load_fiche_titre($langs->trans("Notifications"),'',''); +print load_fiche_titre($langs->trans("Notifications"), '', ''); print ''; print ''; print ''; diff --git a/htdocs/admin/commande_fournisseur_dispatch_extrafields.php b/htdocs/admin/commande_fournisseur_dispatch_extrafields.php index 9abc3dc23c7..cf2c7e20627 100644 --- a/htdocs/admin/commande_fournisseur_dispatch_extrafields.php +++ b/htdocs/admin/commande_fournisseur_dispatch_extrafields.php @@ -71,10 +71,10 @@ require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php'; $textobject=$langs->transnoentitiesnoconv("Receptions"); -llxHeader('',$langs->trans("ReceptionsSetup")); +llxHeader('', $langs->trans("ReceptionsSetup")); $linkback=''.$langs->trans("BackToModuleList").''; -print load_fiche_titre($langs->trans("ReceptionsSetup"),$linkback,'title_setup'); +print load_fiche_titre($langs->trans("ReceptionsSetup"), $linkback, 'title_setup'); print "
\n"; $head = reception_admin_prepare_head(); diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php index f0a0cde4c92..447b5f521ee 100644 --- a/htdocs/admin/company.php +++ b/htdocs/admin/company.php @@ -37,8 +37,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; -$action=GETPOST('action','aZ09'); -$contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'admincompany'; // To manage different context of search +$action=GETPOST('action', 'aZ09'); +$contextpage=GETPOST('contextpage', 'aZ')?GETPOST('contextpage', 'aZ'):'admincompany'; // To manage different context of search // Load translation files required by the page $langs->loadLangs(array('admin', 'companies')); @@ -56,13 +56,13 @@ $hookmanager->initHooks(array('admincompany','globaladmin')); */ $parameters=array(); -$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks +$reshook=$hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); -if ( ($action == 'update' && ! GETPOST("cancel",'alpha')) +if ( ($action == 'update' && ! GETPOST("cancel", 'alpha')) || ($action == 'updateedit') ) { - $tmparray=getCountry(GETPOST('country_id','int'),'all',$db,$langs,0); + $tmparray=getCountry(GETPOST('country_id', 'int'), 'all', $db, $langs, 0); if (! empty($tmparray['id'])) { $mysoc->country_id =$tmparray['id']; @@ -70,31 +70,31 @@ if ( ($action == 'update' && ! GETPOST("cancel",'alpha')) $mysoc->country_label=$tmparray['label']; $s=$mysoc->country_id.':'.$mysoc->country_code.':'.$mysoc->country_label; - dolibarr_set_const($db, "MAIN_INFO_SOCIETE_COUNTRY", $s,'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_INFO_SOCIETE_COUNTRY", $s, 'chaine', 0, '', $conf->entity); activateModulesRequiredByCountry($mysoc->country_code); } $db->begin(); - dolibarr_set_const($db, "MAIN_INFO_SOCIETE_NOM", GETPOST("nom",'nohtml'),'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_INFO_SOCIETE_ADDRESS", GETPOST("MAIN_INFO_SOCIETE_ADDRESS",'nohtml'),'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_INFO_SOCIETE_TOWN", GETPOST("MAIN_INFO_SOCIETE_TOWN",'nohtml'),'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_INFO_SOCIETE_ZIP", GETPOST("MAIN_INFO_SOCIETE_ZIP",'alpha'),'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_INFO_SOCIETE_STATE", GETPOST("state_id",'alpha'),'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_INFO_SOCIETE_REGION", GETPOST("region_code",'alpha'),'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_MONNAIE", GETPOST("currency",'aZ09'),'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_INFO_SOCIETE_TEL", GETPOST("tel",'alpha'),'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_INFO_SOCIETE_FAX", GETPOST("fax",'alpha'),'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_INFO_SOCIETE_MAIL", GETPOST("mail",'alpha'),'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_INFO_SOCIETE_WEB", GETPOST("web",'alpha'),'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_INFO_SOCIETE_NOTE", GETPOST("note",'none'),'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_INFO_SOCIETE_GENCOD", GETPOST("barcode",'alpha'),'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_INFO_SOCIETE_NOM", GETPOST("nom", 'nohtml'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_INFO_SOCIETE_ADDRESS", GETPOST("MAIN_INFO_SOCIETE_ADDRESS", 'nohtml'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_INFO_SOCIETE_TOWN", GETPOST("MAIN_INFO_SOCIETE_TOWN", 'nohtml'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_INFO_SOCIETE_ZIP", GETPOST("MAIN_INFO_SOCIETE_ZIP", 'alpha'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_INFO_SOCIETE_STATE", GETPOST("state_id", 'alpha'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_INFO_SOCIETE_REGION", GETPOST("region_code", 'alpha'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_MONNAIE", GETPOST("currency", 'aZ09'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_INFO_SOCIETE_TEL", GETPOST("tel", 'alpha'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_INFO_SOCIETE_FAX", GETPOST("fax", 'alpha'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_INFO_SOCIETE_MAIL", GETPOST("mail", 'alpha'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_INFO_SOCIETE_WEB", GETPOST("web", 'alpha'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_INFO_SOCIETE_NOTE", GETPOST("note", 'none'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_INFO_SOCIETE_GENCOD", GETPOST("barcode", 'alpha'), 'chaine', 0, '', $conf->entity); $varforimage='logo'; $dirforimage=$conf->mycompany->dir_output.'/logos/'; if ($_FILES[$varforimage]["tmp_name"]) { - if (preg_match('/([^\\/:]+)$/i',$_FILES[$varforimage]["name"],$reg)) + if (preg_match('/([^\\/:]+)$/i', $_FILES[$varforimage]["name"], $reg)) { $original_file=$reg[1]; @@ -106,10 +106,10 @@ if ( ($action == 'update' && ! GETPOST("cancel",'alpha')) { dol_mkdir($dirforimage); } - $result=dol_move_uploaded_file($_FILES[$varforimage]["tmp_name"],$dirforimage.$original_file,1,0,$_FILES[$varforimage]['error']); + $result=dol_move_uploaded_file($_FILES[$varforimage]["tmp_name"], $dirforimage.$original_file, 1, 0, $_FILES[$varforimage]['error']); if ($result > 0) { - dolibarr_set_const($db, "MAIN_INFO_SOCIETE_LOGO",$original_file,'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_INFO_SOCIETE_LOGO", $original_file, 'chaine', 0, '', $conf->entity); // Create thumbs of logo (Note that PDF use original file and not thumbs) if ($isimage > 0) @@ -119,30 +119,30 @@ if ( ($action == 'update' && ! GETPOST("cancel",'alpha')) // Create small thumb, Used on logon for example $imgThumbSmall = vignette($dirforimage.$original_file, $maxwidthsmall, $maxheightsmall, '_small', $quality); - if (image_format_supported($imgThumbSmall) >= 0 && preg_match('/([^\\/:]+)$/i',$imgThumbSmall,$reg)) + if (image_format_supported($imgThumbSmall) >= 0 && preg_match('/([^\\/:]+)$/i', $imgThumbSmall, $reg)) { $imgThumbSmall = $reg[1]; // Save only basename - dolibarr_set_const($db, "MAIN_INFO_SOCIETE_LOGO_SMALL",$imgThumbSmall,'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_INFO_SOCIETE_LOGO_SMALL", $imgThumbSmall, 'chaine', 0, '', $conf->entity); } else dol_syslog($imgThumbSmall); // Create mini thumb, Used on menu or for setup page for example $imgThumbMini = vignette($dirforimage.$original_file, $maxwidthmini, $maxheightmini, '_mini', $quality); - if (image_format_supported($imgThumbMini) >= 0 && preg_match('/([^\\/:]+)$/i',$imgThumbMini,$reg)) + if (image_format_supported($imgThumbMini) >= 0 && preg_match('/([^\\/:]+)$/i', $imgThumbMini, $reg)) { $imgThumbMini = $reg[1]; // Save only basename - dolibarr_set_const($db, "MAIN_INFO_SOCIETE_LOGO_MINI",$imgThumbMini,'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_INFO_SOCIETE_LOGO_MINI", $imgThumbMini, 'chaine', 0, '', $conf->entity); } else dol_syslog($imgThumbMini); } - else dol_syslog("ErrorImageFormatNotSupported",LOG_WARNING); + else dol_syslog("ErrorImageFormatNotSupported", LOG_WARNING); } - else if (preg_match('/^ErrorFileIsInfectedWithAVirus/',$result)) + else if (preg_match('/^ErrorFileIsInfectedWithAVirus/', $result)) { $error++; $langs->load("errors"); - $tmparray=explode(':',$result); - setEventMessages($langs->trans('ErrorFileIsInfectedWithAVirus',$tmparray[1]), null, 'errors'); + $tmparray=explode(':', $result); + setEventMessages($langs->trans('ErrorFileIsInfectedWithAVirus', $tmparray[1]), null, 'errors'); } else { @@ -159,26 +159,26 @@ if ( ($action == 'update' && ! GETPOST("cancel",'alpha')) } } - dolibarr_set_const($db, "MAIN_INFO_SOCIETE_MANAGERS", GETPOST("MAIN_INFO_SOCIETE_MANAGERS",'nohtml'),'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_INFO_GDPR", GETPOST("MAIN_INFO_GDPR",'nohtml'),'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_INFO_CAPITAL", GETPOST("capital",'nohtml'),'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_INFO_SOCIETE_FORME_JURIDIQUE", GETPOST("forme_juridique_code",'nohtml'),'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_INFO_SIREN", GETPOST("siren",'nohtml'),'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_INFO_SIRET", GETPOST("siret",'nohtml'),'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_INFO_APE", GETPOST("ape",'nohtml'),'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_INFO_RCS", GETPOST("rcs",'nohtml'),'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_INFO_PROFID5", GETPOST("MAIN_INFO_PROFID5",'nohtml'),'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_INFO_PROFID6", GETPOST("MAIN_INFO_PROFID6",'nohtml'),'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_INFO_SOCIETE_MANAGERS", GETPOST("MAIN_INFO_SOCIETE_MANAGERS", 'nohtml'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_INFO_GDPR", GETPOST("MAIN_INFO_GDPR", 'nohtml'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_INFO_CAPITAL", GETPOST("capital", 'nohtml'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_INFO_SOCIETE_FORME_JURIDIQUE", GETPOST("forme_juridique_code", 'nohtml'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_INFO_SIREN", GETPOST("siren", 'nohtml'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_INFO_SIRET", GETPOST("siret", 'nohtml'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_INFO_APE", GETPOST("ape", 'nohtml'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_INFO_RCS", GETPOST("rcs", 'nohtml'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_INFO_PROFID5", GETPOST("MAIN_INFO_PROFID5", 'nohtml'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_INFO_PROFID6", GETPOST("MAIN_INFO_PROFID6", 'nohtml'), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_INFO_TVAINTRA", GETPOST("tva",'nohtml'),'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_INFO_SOCIETE_OBJECT", GETPOST("object",'nohtml'),'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_INFO_TVAINTRA", GETPOST("tva", 'nohtml'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_INFO_SOCIETE_OBJECT", GETPOST("object", 'nohtml'), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "SOCIETE_FISCAL_MONTH_START", GETPOST("SOCIETE_FISCAL_MONTH_START",'int'),'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "SOCIETE_FISCAL_MONTH_START", GETPOST("SOCIETE_FISCAL_MONTH_START", 'int'), 'chaine', 0, '', $conf->entity); // Sale tax options - $usevat = GETPOST("optiontva",'aZ09'); - $uselocaltax1 = GETPOST("optionlocaltax1",'aZ09'); - $uselocaltax2 = GETPOST("optionlocaltax2",'aZ09'); + $usevat = GETPOST("optiontva", 'aZ09'); + $uselocaltax1 = GETPOST("optionlocaltax1", 'aZ09'); + $uselocaltax2 = GETPOST("optionlocaltax2", 'aZ09'); if ($uselocaltax1 == 'localtax1on' && ! $usevat) { setEventMessages($langs->trans("IfYouUseASecondTaxYouMustSetYouUseTheMainTax"), null, 'errors'); @@ -190,33 +190,33 @@ if ( ($action == 'update' && ! GETPOST("cancel",'alpha')) $error++; } - dolibarr_set_const($db, "FACTURE_TVAOPTION", $usevat,'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "FACTURE_LOCAL_TAX1_OPTION", $uselocaltax1,'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "FACTURE_LOCAL_TAX2_OPTION", $uselocaltax2,'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "FACTURE_TVAOPTION", $usevat, 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "FACTURE_LOCAL_TAX1_OPTION", $uselocaltax1, 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "FACTURE_LOCAL_TAX2_OPTION", $uselocaltax2, 'chaine', 0, '', $conf->entity); if($_POST["optionlocaltax1"]=="localtax1on") { if(!isset($_REQUEST['lt1'])) { - dolibarr_set_const($db, "MAIN_INFO_VALUE_LOCALTAX1", 0,'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_INFO_VALUE_LOCALTAX1", 0, 'chaine', 0, '', $conf->entity); } else { - dolibarr_set_const($db, "MAIN_INFO_VALUE_LOCALTAX1", GETPOST('lt1','aZ09'),'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_INFO_VALUE_LOCALTAX1", GETPOST('lt1', 'aZ09'), 'chaine', 0, '', $conf->entity); } - dolibarr_set_const($db,"MAIN_INFO_LOCALTAX_CALC1", GETPOST("clt1",'aZ09'),'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_INFO_LOCALTAX_CALC1", GETPOST("clt1", 'aZ09'), 'chaine', 0, '', $conf->entity); } if($_POST["optionlocaltax2"]=="localtax2on") { if(!isset($_REQUEST['lt2'])) { - dolibarr_set_const($db, "MAIN_INFO_VALUE_LOCALTAX2", 0,'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_INFO_VALUE_LOCALTAX2", 0, 'chaine', 0, '', $conf->entity); } else { - dolibarr_set_const($db, "MAIN_INFO_VALUE_LOCALTAX2", GETPOST('lt2','aZ09'),'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_INFO_VALUE_LOCALTAX2", GETPOST('lt2', 'aZ09'), 'chaine', 0, '', $conf->entity); } - dolibarr_set_const($db,"MAIN_INFO_LOCALTAX_CALC2", GETPOST("clt2",'aZ09'),'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_INFO_LOCALTAX_CALC2", GETPOST("clt2", 'aZ09'), 'chaine', 0, '', $conf->entity); } if (! $error) @@ -248,20 +248,20 @@ if ($action == 'addthumb') // Regenerate thumbs //$object->addThumbs($newfile); // We can't use addThumbs here yet because we need name of generated thumbs to add them into constants. TODO Check if need such constants. We should be able to retreive value with get... // Create small thumb. Used on logon for example - $imgThumbSmall = vignette($conf->mycompany->dir_output.'/logos/'.$_GET["file"], $maxwidthsmall, $maxheightsmall, '_small',$quality); - if (image_format_supported($imgThumbSmall) >= 0 && preg_match('/([^\\/:]+)$/i',$imgThumbSmall,$reg)) + $imgThumbSmall = vignette($conf->mycompany->dir_output.'/logos/'.$_GET["file"], $maxwidthsmall, $maxheightsmall, '_small', $quality); + if (image_format_supported($imgThumbSmall) >= 0 && preg_match('/([^\\/:]+)$/i', $imgThumbSmall, $reg)) { $imgThumbSmall = $reg[1]; // Save only basename - dolibarr_set_const($db, "MAIN_INFO_SOCIETE_LOGO_SMALL",$imgThumbSmall,'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_INFO_SOCIETE_LOGO_SMALL", $imgThumbSmall, 'chaine', 0, '', $conf->entity); } else dol_syslog($imgThumbSmall); // Create mini thumbs. Used on menu or for setup page for example - $imgThumbMini = vignette($conf->mycompany->dir_output.'/logos/'.$_GET["file"], $maxwidthmini, $maxheightmini, '_mini',$quality); - if (image_format_supported($imgThumbSmall) >= 0 && preg_match('/([^\\/:]+)$/i',$imgThumbMini,$reg)) + $imgThumbMini = vignette($conf->mycompany->dir_output.'/logos/'.$_GET["file"], $maxwidthmini, $maxheightmini, '_mini', $quality); + if (image_format_supported($imgThumbSmall) >= 0 && preg_match('/([^\\/:]+)$/i', $imgThumbMini, $reg)) { $imgThumbMini = $reg[1]; // Save only basename - dolibarr_set_const($db, "MAIN_INFO_SOCIETE_LOGO_MINI",$imgThumbMini,'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_INFO_SOCIETE_LOGO_MINI", $imgThumbMini, 'chaine', 0, '', $conf->entity); } else dol_syslog($imgThumbMini); @@ -273,15 +273,15 @@ if ($action == 'addthumb') // Regenerate thumbs $error++; $langs->load("errors"); setEventMessages($langs->trans("ErrorBadImageFormat"), null, 'errors'); - dol_syslog($langs->transnoentities("ErrorBadImageFormat"),LOG_WARNING); + dol_syslog($langs->transnoentities("ErrorBadImageFormat"), LOG_WARNING); } } else { $error++; $langs->load("errors"); - setEventMessages($langs->trans("ErrorFileDoesNotExists",$_GET["file"]), null, 'errors'); - dol_syslog($langs->transnoentities("ErrorFileDoesNotExists",$_GET["file"]),LOG_WARNING); + setEventMessages($langs->trans("ErrorFileDoesNotExists", $_GET["file"]), null, 'errors'); + dol_syslog($langs->transnoentities("ErrorFileDoesNotExists", $_GET["file"]), LOG_WARNING); } } @@ -291,17 +291,17 @@ if ($action == 'removelogo') $logofile=$conf->mycompany->dir_output.'/logos/'.$mysoc->logo; if ($mysoc->logo != '') dol_delete_file($logofile); - dolibarr_del_const($db, "MAIN_INFO_SOCIETE_LOGO",$conf->entity); + dolibarr_del_const($db, "MAIN_INFO_SOCIETE_LOGO", $conf->entity); $mysoc->logo=''; $logosmallfile=$conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_small; if ($mysoc->logo_small != '') dol_delete_file($logosmallfile); - dolibarr_del_const($db, "MAIN_INFO_SOCIETE_LOGO_SMALL",$conf->entity); + dolibarr_del_const($db, "MAIN_INFO_SOCIETE_LOGO_SMALL", $conf->entity); $mysoc->logo_small=''; $logominifile=$conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini; if ($mysoc->logo_mini != '') dol_delete_file($logominifile); - dolibarr_del_const($db, "MAIN_INFO_SOCIETE_LOGO_MINI",$conf->entity); + dolibarr_del_const($db, "MAIN_INFO_SOCIETE_LOGO_MINI", $conf->entity); $mysoc->logo_mini=''; } @@ -311,7 +311,7 @@ if ($action == 'removelogo') */ $wikihelp='EN:First_setup|FR:Premiers_paramétrages|ES:Primeras_configuraciones'; -llxHeader('',$langs->trans("Setup"),$wikihelp); +llxHeader('', $langs->trans("Setup"), $wikihelp); $form=new Form($db); $formother=new FormOther($db); @@ -319,7 +319,7 @@ $formcompany=new FormCompany($db); $countrynotdefined=''.$langs->trans("ErrorSetACountryFirst").' ('.$langs->trans("SeeAbove").')'; -print load_fiche_titre($langs->trans("CompanyFoundation"),'','title_setup'); +print load_fiche_titre($langs->trans("CompanyFoundation"), '', 'title_setup'); $head = company_admin_prepare_head(); @@ -352,27 +352,27 @@ if ($action == 'edit' || $action == 'updateedit') // Name print ''."\n"; + print ''."\n"; // Addresse print ''."\n"; + print ''."\n"; print ''."\n"; + print ''."\n"; print ''."\n"; + print ''."\n"; // Country print ''."\n"; @@ -432,7 +432,7 @@ if ($action == 'edit' || $action == 'updateedit') // Note print ''; + print ''; print ''; print '
'.$langs->trans("Parameter").'
'; - print '
'; - print '
'; - print '
'; - print '
'; //if (empty($country_selected)) $country_selected=substr($langs->defaultlang,-2); // By default, country of localization print $form->select_country($mysoc->country_id, 'country_id'); - if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); + if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); print '
'; - print '
'; @@ -473,10 +473,10 @@ if ($action == 'edit' || $action == 'updateedit') print '
'; + print '
'; if (! empty($mysoc->country_code)) { print ''; @@ -489,10 +489,10 @@ if ($action == 'edit' || $action == 'updateedit') } // ProfId2 - if ($langs->transcountry("ProfId2",$mysoc->country_code) != '-') + if ($langs->transcountry("ProfId2", $mysoc->country_code) != '-') { - print '
'; + print '
'; if (! empty($mysoc->country_code)) { print ''; @@ -505,10 +505,10 @@ if ($action == 'edit' || $action == 'updateedit') } // ProfId3 - if ($langs->transcountry("ProfId3",$mysoc->country_code) != '-') + if ($langs->transcountry("ProfId3", $mysoc->country_code) != '-') { - print '
'; + print '
'; if (! empty($mysoc->country_code)) { print ''; @@ -521,10 +521,10 @@ if ($action == 'edit' || $action == 'updateedit') } // ProfId4 - if ($langs->transcountry("ProfId4",$mysoc->country_code) != '-') + if ($langs->transcountry("ProfId4", $mysoc->country_code) != '-') { - print '
'; + print '
'; if (! empty($mysoc->country_code)) { print ''; @@ -537,10 +537,10 @@ if ($action == 'edit' || $action == 'updateedit') } // ProfId5 - if ($langs->transcountry("ProfId5",$mysoc->country_code) != '-') + if ($langs->transcountry("ProfId5", $mysoc->country_code) != '-') { - print '
'; + print '
'; if (! empty($mysoc->country_code)) { print ''; @@ -553,10 +553,10 @@ if ($action == 'edit' || $action == 'updateedit') } // ProfId6 - if ($langs->transcountry("ProfId6",$mysoc->country_code) != '-') + if ($langs->transcountry("ProfId6", $mysoc->country_code) != '-') { - print '
'; + print '
'; if (! empty($mysoc->country_code)) { print ''; @@ -592,7 +592,7 @@ if ($action == 'edit' || $action == 'updateedit') print '
'; - print $formother->select_month($conf->global->SOCIETE_FISCAL_MONTH_START,'SOCIETE_FISCAL_MONTH_START',0,1) . '
"; @@ -634,21 +634,21 @@ if ($action == 'edit' || $action == 'updateedit') print '
'; print ''; print ''; - print ''; + print ''; print ''; print "\n"; // Note: When option is not set, it must not appears as set on on, because there is no default value for this option - print ""; + print ""; print ''; @@ -459,14 +459,14 @@ foreach ($dirmodels as $reldir) { print ""; } else { print ""; } @@ -474,11 +474,11 @@ foreach ($dirmodels as $reldir) print "'; @@ -487,24 +487,24 @@ foreach ($dirmodels as $reldir) $htmltooltip.='
'.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown")); $htmltooltip.='
'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur; $htmltooltip.='

'.$langs->trans("FeaturesSupported").':'; - $htmltooltip.='
'.$langs->trans("Logo").': '.yn($module->option_logo,1,1); - $htmltooltip.='
'.$langs->trans("PaymentMode").': '.yn($module->option_modereg,1,1); - $htmltooltip.='
'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg,1,1); - $htmltooltip.='
'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang,1,1); - $htmltooltip.='
'.$langs->trans("WatermarkOnDraftOrders").': '.yn($module->option_draft_watermark,1,1); + $htmltooltip.='
'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1); + $htmltooltip.='
'.$langs->trans("PaymentMode").': '.yn($module->option_modereg, 1, 1); + $htmltooltip.='
'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg, 1, 1); + $htmltooltip.='
'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang, 1, 1); + $htmltooltip.='
'.$langs->trans("WatermarkOnDraftOrders").': '.yn($module->option_draft_watermark, 1, 1); print ''; // Preview print ''; @@ -524,7 +524,7 @@ print "
"; * Other options */ -print load_fiche_titre($langs->trans("OtherOptions"),'',''); +print load_fiche_titre($langs->trans("OtherOptions"), '', ''); print '
'.$langs->transcountry("LocalTax1Management",$mysoc->country_code).''.$langs->trans("Description").''.$langs->transcountry("LocalTax1Management", $mysoc->country_code).''.$langs->trans("Description").' 
global->FACTURE_LOCAL_TAX1_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1on")?" checked":"")."> ".$langs->transcountry("LocalTax1IsUsed",$mysoc->country_code)."
global->FACTURE_LOCAL_TAX1_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1on")?" checked":"")."> ".$langs->transcountry("LocalTax1IsUsed", $mysoc->country_code)."'; print ''; - print ""; - $example=$langs->transcountry("LocalTax1IsUsedExample",$mysoc->country_code); - print ($example!="LocalTax1IsUsedExample"?"\n":""); + print ""; + $example=$langs->transcountry("LocalTax1IsUsedExample", $mysoc->country_code); + print ($example!="LocalTax1IsUsedExample"?"\n":""); if(! isOnlyOneLocalTax(1)) { print ''; } @@ -661,12 +661,12 @@ if ($action == 'edit' || $action == 'updateedit') print "\n"; - print ""; + print ""; print '\n"; print "
".$langs->trans("Example").': '.$langs->transcountry("LocalTax1IsUsedExample",$mysoc->country_code)."
".$langs->trans("Example").': '.$langs->transcountry("LocalTax1IsUsedExample", $mysoc->country_code)."
: '; - $formcompany->select_localtax(1,$conf->global->MAIN_INFO_VALUE_LOCALTAX1, "lt1"); + $formcompany->select_localtax(1, $conf->global->MAIN_INFO_VALUE_LOCALTAX1, "lt1"); print '
global->FACTURE_LOCAL_TAX1_OPTION) || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1off")?" checked":"")."> ".$langs->transcountry("LocalTax1IsNotUsed",$mysoc->country_code)."
global->FACTURE_LOCAL_TAX1_OPTION) || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1off")?" checked":"")."> ".$langs->transcountry("LocalTax1IsNotUsed", $mysoc->country_code)."'; print ""; - print ""; - $example=$langs->transcountry("LocalTax1IsNotUsedExample",$mysoc->country_code); - print ($example!="LocalTax1IsNotUsedExample"?"\n":""); + print ""; + $example=$langs->transcountry("LocalTax1IsNotUsedExample", $mysoc->country_code); + print ($example!="LocalTax1IsNotUsedExample"?"\n":""); print "
".$langs->trans("Example").': '.$langs->transcountry("LocalTax1IsNotUsedExample",$mysoc->country_code)."
".$langs->trans("Example").': '.$langs->transcountry("LocalTax1IsNotUsedExample", $mysoc->country_code)."
"; print "
"; @@ -677,22 +677,22 @@ if ($action == 'edit' || $action == 'updateedit') print '
'; print ''; print ''; - print ''; + print ''; print ''; print "\n"; // Note: When option is not set, it must not appears as set on on, because there is no default value for this option - print ""; + print ""; print ''; @@ -759,35 +759,35 @@ else { $img=picto_from_langcode($mysoc->country_code); print $img?$img.' ':''; - print getCountry($mysoc->country_code,1); + print getCountry($mysoc->country_code, 1); } - else print img_warning().' '.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("CompanyCountry")).''; + else print img_warning().' '.$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CompanyCountry")).''; print ''; if (! empty($conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT)) print ''; print ''; - print ''; + print ''; - print ''; + print ''; - print ''; + print ''; // Web @@ -795,7 +795,7 @@ else $arrayofurl = preg_split('/\s/', $conf->global->MAIN_INFO_SOCIETE_WEB); foreach($arrayofurl as $urltoshow) { - if ($urltoshow) print dol_print_url($urltoshow,'_blank',80); + if ($urltoshow) print dol_print_url($urltoshow, '_blank', 80); } print ''; @@ -817,9 +817,9 @@ else print '
'; // It offers the generation of the thumbnail if it does not exist - if (!is_file($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini) && preg_match('/(\.jpg|\.jpeg|\.png)$/i',$mysoc->logo)) + if (!is_file($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini) && preg_match('/(\.jpg|\.jpeg|\.png)$/i', $mysoc->logo)) { - print '  '; + print '  '; } else if ($mysoc->logo_mini && is_file($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini)) { @@ -872,14 +872,14 @@ else print ''; // ProfId1 - if ($langs->transcountry("ProfId1",$mysoc->country_code) != '-') + if ($langs->transcountry("ProfId1", $mysoc->country_code) != '-') { - print '
'; + print dol_print_date(dol_mktime(12, 0, 0, $monthstart, 1, 2000, 1), '%B', 'gm') . ''; print "
'.$langs->transcountry("LocalTax2Management",$mysoc->country_code).''.$langs->trans("Description").''.$langs->transcountry("LocalTax2Management", $mysoc->country_code).''.$langs->trans("Description").' 
global->FACTURE_LOCAL_TAX2_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2on")?" checked":"")."> ".$langs->transcountry("LocalTax2IsUsed",$mysoc->country_code)."
global->FACTURE_LOCAL_TAX2_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2on")?" checked":"")."> ".$langs->transcountry("LocalTax2IsUsed", $mysoc->country_code)."'; print ''; - print ""; - $example=$langs->transcountry("LocalTax2IsUsedExample",$mysoc->country_code); - print ($example!="LocalTax2IsUsedExample"?"\n":""); + print ""; + $example=$langs->transcountry("LocalTax2IsUsedExample", $mysoc->country_code); + print ($example!="LocalTax2IsUsedExample"?"\n":""); if(! isOnlyOneLocalTax(2)) { print ''; } print '\n"; - print ""; + print ""; print '\n"; print "
".$langs->trans("Example").': '.$langs->transcountry("LocalTax2IsUsedExample",$mysoc->country_code)."
".$langs->trans("Example").': '.$langs->transcountry("LocalTax2IsUsedExample", $mysoc->country_code)."
: '; - $formcompany->select_localtax(2,$conf->global->MAIN_INFO_VALUE_LOCALTAX2, "lt2"); + $formcompany->select_localtax(2, $conf->global->MAIN_INFO_VALUE_LOCALTAX2, "lt2"); print '
: '; @@ -702,12 +702,12 @@ if ($action == 'edit' || $action == 'updateedit') print "
global->FACTURE_LOCAL_TAX2_OPTION) || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2off")?" checked":"")."> ".$langs->transcountry("LocalTax2IsNotUsed",$mysoc->country_code)."
global->FACTURE_LOCAL_TAX2_OPTION) || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2off")?" checked":"")."> ".$langs->transcountry("LocalTax2IsNotUsed", $mysoc->country_code)."'; print ""; - print ""; - $example=$langs->transcountry("LocalTax2IsNotUsedExample",$mysoc->country_code); - print ($example!="LocalTax2IsNotUsedExample"?"\n":""); + print ""; + $example=$langs->transcountry("LocalTax2IsNotUsedExample", $mysoc->country_code); + print ($example!="LocalTax2IsNotUsedExample"?"\n":""); print "
".$langs->trans("Example").': '.$langs->transcountry("LocalTax2IsNotUsedExample",$mysoc->country_code)."
".$langs->trans("Example").': '.$langs->transcountry("LocalTax2IsNotUsedExample", $mysoc->country_code)."
"; print "
"; @@ -741,7 +741,7 @@ else print '
'.$langs->trans("CompanyName").''; if (! empty($conf->global->MAIN_INFO_SOCIETE_NOM)) print $conf->global->MAIN_INFO_SOCIETE_NOM; - else print img_warning().' '.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("CompanyName")).''; + else print img_warning().' '.$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CompanyName")).''; print '
'.$langs->trans("Region-State").''; else print '
'.$langs->trans("State").''; - if (! empty($conf->global->MAIN_INFO_SOCIETE_STATE)) print getState($conf->global->MAIN_INFO_SOCIETE_STATE,$conf->global->MAIN_SHOW_STATE_CODE,0,$conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT); + if (! empty($conf->global->MAIN_INFO_SOCIETE_STATE)) print getState($conf->global->MAIN_INFO_SOCIETE_STATE, $conf->global->MAIN_SHOW_STATE_CODE, 0, $conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT); else print ' '; print '
'.$langs->trans("CompanyCurrency").''; - print currency_name($conf->currency,0); + print currency_name($conf->currency, 0); print ' ('.$conf->currency; print ($conf->currency != $langs->getCurrencySymbol($conf->currency) ? ' - '.$langs->getCurrencySymbol($conf->currency) : ''); print ')'; - print ' - '.$langs->trans("PriceFormatInCurrentLanguage", $langs->defaultlang).' : '.price(price2num('99.333333333','MT'), 1, $langs, 1, -1, -1, $conf->currency); + print ' - '.$langs->trans("PriceFormatInCurrentLanguage", $langs->defaultlang).' : '.price(price2num('99.333333333', 'MT'), 1, $langs, 1, -1, -1, $conf->currency); print '
'.$langs->trans("Phone").'' . dol_print_phone($conf->global->MAIN_INFO_SOCIETE_TEL,$mysoc->country_code) . '
'.$langs->trans("Phone").'' . dol_print_phone($conf->global->MAIN_INFO_SOCIETE_TEL, $mysoc->country_code) . '
'.$langs->trans("Fax").'' . dol_print_phone($conf->global->MAIN_INFO_SOCIETE_FAX,$mysoc->country_code) . '
'.$langs->trans("Fax").'' . dol_print_phone($conf->global->MAIN_INFO_SOCIETE_FAX, $mysoc->country_code) . '
'.$langs->trans("Mail").'' . dol_print_email($conf->global->MAIN_INFO_SOCIETE_MAIL,0,0,0,80) . '
'.$langs->trans("Mail").'' . dol_print_email($conf->global->MAIN_INFO_SOCIETE_MAIL, 0, 0, 0, 80) . '
'.$langs->transcountry("ProfId1",$mysoc->country_code).''; + print '
'.$langs->transcountry("ProfId1", $mysoc->country_code).''; if (! empty($conf->global->MAIN_INFO_SIREN)) { print $conf->global->MAIN_INFO_SIREN; - $s = $mysoc->id_prof_url(1,$mysoc); + $s = $mysoc->id_prof_url(1, $mysoc); if ($s) print ' - '.$s; } else { print ' '; @@ -888,14 +888,14 @@ else } // ProfId2 - if ($langs->transcountry("ProfId2",$mysoc->country_code) != '-') + if ($langs->transcountry("ProfId2", $mysoc->country_code) != '-') { - print '
'.$langs->transcountry("ProfId2",$mysoc->country_code).''; + print '
'.$langs->transcountry("ProfId2", $mysoc->country_code).''; if (! empty($conf->global->MAIN_INFO_SIRET)) { print $conf->global->MAIN_INFO_SIRET; - $s = $mysoc->id_prof_url(2,$mysoc); + $s = $mysoc->id_prof_url(2, $mysoc); if ($s) print ' - '.$s; } else { print ' '; @@ -904,14 +904,14 @@ else } // ProfId3 - if ($langs->transcountry("ProfId3",$mysoc->country_code) != '-') + if ($langs->transcountry("ProfId3", $mysoc->country_code) != '-') { - print '
'.$langs->transcountry("ProfId3",$mysoc->country_code).''; + print '
'.$langs->transcountry("ProfId3", $mysoc->country_code).''; if (! empty($conf->global->MAIN_INFO_APE)) { print $conf->global->MAIN_INFO_APE; - $s = $mysoc->id_prof_url(3,$mysoc); + $s = $mysoc->id_prof_url(3, $mysoc); if ($s) print ' - '.$s; } else { print ' '; @@ -920,14 +920,14 @@ else } // ProfId4 - if ($langs->transcountry("ProfId4",$mysoc->country_code) != '-') + if ($langs->transcountry("ProfId4", $mysoc->country_code) != '-') { - print '
'.$langs->transcountry("ProfId4",$mysoc->country_code).''; + print '
'.$langs->transcountry("ProfId4", $mysoc->country_code).''; if (! empty($conf->global->MAIN_INFO_RCS)) { print $conf->global->MAIN_INFO_RCS; - $s = $mysoc->id_prof_url(4,$mysoc); + $s = $mysoc->id_prof_url(4, $mysoc); if ($s) print ' - '.$s; } else { print ' '; @@ -936,14 +936,14 @@ else } // ProfId5 - if ($langs->transcountry("ProfId5",$mysoc->country_code) != '-') + if ($langs->transcountry("ProfId5", $mysoc->country_code) != '-') { - print '
'.$langs->transcountry("ProfId5",$mysoc->country_code).''; + print '
'.$langs->transcountry("ProfId5", $mysoc->country_code).''; if (! empty($conf->global->MAIN_INFO_PROFID5)) { print $conf->global->MAIN_INFO_PROFID5; - $s = $mysoc->id_prof_url(5,$mysoc); + $s = $mysoc->id_prof_url(5, $mysoc); if ($s) print ' - '.$s; } else { print ' '; @@ -952,14 +952,14 @@ else } // ProfId6 - if ($langs->transcountry("ProfId6",$mysoc->country_code) != '-') + if ($langs->transcountry("ProfId6", $mysoc->country_code) != '-') { - print '
'.$langs->transcountry("ProfId6",$mysoc->country_code).''; + print '
'.$langs->transcountry("ProfId6", $mysoc->country_code).''; if (! empty($conf->global->MAIN_INFO_PROFID6)) { print $conf->global->MAIN_INFO_PROFID6; - $s = $mysoc->id_prof_url(6,$mysoc); + $s = $mysoc->id_prof_url(6, $mysoc); if ($s) print ' - '.$s; } else { print ' '; @@ -989,11 +989,11 @@ else print ''; print "\n"; $s.=''.$langs->trans("VATIntraCheck").''; - $s = $form->textwithpicto($s,$langs->trans("VATIntraCheckDesc",$langs->trans("VATIntraCheck")),1); + $s = $form->textwithpicto($s, $langs->trans("VATIntraCheckDesc", $langs->trans("VATIntraCheck")), 1); } else { - $s.='id_country).'" target="_blank">'.img_picto($langs->trans("VATIntraCheckableOnEUSite"),'help').''; + $s.='id_country).'" target="_blank">'.img_picto($langs->trans("VATIntraCheckableOnEUSite"), 'help').''; } } print $s; @@ -1027,7 +1027,7 @@ else print '
'.$langs->trans("FiscalMonthStart").''; $monthstart=(! empty($conf->global->SOCIETE_FISCAL_MONTH_START)) ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1; - print dol_print_date(dol_mktime(12,0,0,$monthstart,1,2000,1),'%B','gm') . '
"; print ""; @@ -1076,18 +1076,18 @@ else print '
'; print ''; print ''; - print ''; + print ''; print ''; print "\n"; print ""; + print "global->FACTURE_LOCAL_TAX1_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1on")?" checked":"")."> ".$langs->transcountry("LocalTax1IsUsed", $mysoc->country_code).""; print ''; @@ -538,14 +538,14 @@ foreach ($dirmodels as $reldir) { print ''; } else { print ""; } @@ -553,11 +553,11 @@ foreach ($dirmodels as $reldir) print "'; @@ -569,28 +569,28 @@ foreach ($dirmodels as $reldir) $htmltooltip.='
'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur; } $htmltooltip.='

'.$langs->trans("FeaturesSupported").':'; - $htmltooltip.='
'.$langs->trans("Logo").': '.yn($module->option_logo,1,1); - $htmltooltip.='
'.$langs->trans("PaymentMode").': '.yn($module->option_modereg,1,1); - $htmltooltip.='
'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg,1,1); - $htmltooltip.='
'.$langs->trans("Discounts").': '.yn($module->option_escompte,1,1); - $htmltooltip.='
'.$langs->trans("CreditNote").': '.yn($module->option_credit_note,1,1); - $htmltooltip.='
'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang,1,1); - $htmltooltip.='
'.$langs->trans("WatermarkOnDraftInvoices").': '.yn($module->option_draft_watermark,1,1); + $htmltooltip.='
'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1); + $htmltooltip.='
'.$langs->trans("PaymentMode").': '.yn($module->option_modereg, 1, 1); + $htmltooltip.='
'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg, 1, 1); + $htmltooltip.='
'.$langs->trans("Discounts").': '.yn($module->option_escompte, 1, 1); + $htmltooltip.='
'.$langs->trans("CreditNote").': '.yn($module->option_credit_note, 1, 1); + $htmltooltip.='
'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang, 1, 1); + $htmltooltip.='
'.$langs->trans("WatermarkOnDraftInvoices").': '.yn($module->option_draft_watermark, 1, 1); print ''; // Preview print ''; @@ -611,7 +611,7 @@ if(!empty($conf->global->INVOICE_USE_DEFAULT_DOCUMENT)) // Hidden conf * Document templates generators */ print '
'; - print load_fiche_titre($langs->trans("BillsPDFModulesAccordindToInvoiceType"),'',''); + print load_fiche_titre($langs->trans("BillsPDFModulesAccordindToInvoiceType"), '', ''); print ''; print ''; print ''; @@ -639,7 +639,7 @@ if(!empty($conf->global->INVOICE_USE_DEFAULT_DOCUMENT)) // Hidden conf $current = !empty($conf->global->{$thisTypeConfName})?$conf->global->{$thisTypeConfName}:$conf->global->FACTURE_ADDON_PDF; print ''; print ''; - print ''; + print ''; print "\n"; } @@ -651,7 +651,7 @@ if(!empty($conf->global->INVOICE_USE_DEFAULT_DOCUMENT)) // Hidden conf * Modes de reglement */ print '
'; -print load_fiche_titre($langs->trans("SuggestedPaymentModesIfNotDefinedInInvoice"),'',''); +print load_fiche_titre($langs->trans("SuggestedPaymentModesIfNotDefinedInInvoice"), '', ''); print ''; print ''; @@ -733,7 +733,7 @@ if ($resql) print ''; + print '>'.$langs->trans("OwnerOfBankAccount", $row[1]).''; $i++; } @@ -745,7 +745,7 @@ print ""; print "
"; -print load_fiche_titre($langs->trans("OtherOptions"),'',''); +print load_fiche_titre($langs->trans("OtherOptions"), '', ''); print '
'.$langs->transcountry("LocalTax1Management",$mysoc->country_code).''.$langs->trans("Description").''.$langs->transcountry("LocalTax1Management", $mysoc->country_code).''.$langs->trans("Description").' 
"; - print "global->FACTURE_LOCAL_TAX1_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1on")?" checked":"")."> ".$langs->transcountry("LocalTax1IsUsed",$mysoc->country_code)."'; print ""; - print ""; - $example=$langs->transcountry("LocalTax1IsUsedExample",$mysoc->country_code); - print ($example!="LocalTax1IsUsedExample"?"\n":""); + print ""; + $example=$langs->transcountry("LocalTax1IsUsedExample", $mysoc->country_code); + print ($example!="LocalTax1IsUsedExample"?"\n":""); if($conf->global->MAIN_INFO_VALUE_LOCALTAX1!=0) { print ''; @@ -1111,12 +1111,12 @@ else print '"; + print "global->FACTURE_LOCAL_TAX1_OPTION) || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1off")?" checked":"")."> ".$langs->transcountry("LocalTax1IsNotUsed", $mysoc->country_code).""; print '\n"; @@ -1130,18 +1130,18 @@ else print '
'; print '
".$langs->transcountry("LocalTax1IsUsedDesc",$mysoc->country_code)."
".$langs->trans("Example").': '.$langs->transcountry("LocalTax1IsUsedExample",$mysoc->country_code)."
".$langs->transcountry("LocalTax1IsUsedDesc", $mysoc->country_code)."
".$langs->trans("Example").': '.$langs->transcountry("LocalTax1IsUsedExample", $mysoc->country_code)."
'.$langs->trans("LTRate").': '. $conf->global->MAIN_INFO_VALUE_LOCALTAX1 .'
'; - print "global->FACTURE_LOCAL_TAX1_OPTION) || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1off")?" checked":"")."> ".$langs->transcountry("LocalTax1IsNotUsed",$mysoc->country_code)."'; print ""; - print ""; - $example=$langs->transcountry("LocalTax1IsNotUsedExample",$mysoc->country_code); - print ($example!="LocalTax1IsNotUsedExample"?"\n":""); + print ""; + $example=$langs->transcountry("LocalTax1IsNotUsedExample", $mysoc->country_code); + print ($example!="LocalTax1IsNotUsedExample"?"\n":""); print "
".$langs->trans("Example").': '.$langs->transcountry("LocalTax1IsNotUsedExample",$mysoc->country_code)."
".$langs->trans("Example").': '.$langs->transcountry("LocalTax1IsNotUsedExample", $mysoc->country_code)."
"; print "
'; print ''; - print ''; + print ''; print ''; print "\n"; print ""; + print "global->FACTURE_LOCAL_TAX2_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2on")?" checked":"")."> ".$langs->transcountry("LocalTax2IsUsed", $mysoc->country_code).""; print ''; @@ -386,14 +386,14 @@ foreach ($dirmodels as $reldir) { print ''; } else { print '"; } @@ -401,11 +401,11 @@ foreach ($dirmodels as $reldir) print ''; @@ -417,26 +417,26 @@ foreach ($dirmodels as $reldir) $htmltooltip.='
'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur; } $htmltooltip.='

'.$langs->trans("FeaturesSupported").':'; - $htmltooltip.='
'.$langs->trans("Logo").': '.yn($module->option_logo,1,1); - $htmltooltip.='
'.$langs->trans("PaymentMode").': '.yn($module->option_modereg,1,1); - $htmltooltip.='
'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg,1,1); - $htmltooltip.='
'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang,1,1); - $htmltooltip.='
'.$langs->trans("WatermarkOnDraftOrders").': '.yn($module->option_draft_watermark,1,1); + $htmltooltip.='
'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1); + $htmltooltip.='
'.$langs->trans("PaymentMode").': '.yn($module->option_modereg, 1, 1); + $htmltooltip.='
'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg, 1, 1); + $htmltooltip.='
'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang, 1, 1); + $htmltooltip.='
'.$langs->trans("WatermarkOnDraftOrders").': '.yn($module->option_draft_watermark, 1, 1); print ''; // Preview print ''; @@ -462,7 +462,7 @@ print ''; print ''; print ''; -print load_fiche_titre($langs->trans("OtherOptions"),'',''); +print load_fiche_titre($langs->trans("OtherOptions"), '', ''); print '
'.$langs->transcountry("LocalTax2Management",$mysoc->country_code).''.$langs->trans("Description").''.$langs->transcountry("LocalTax2Management", $mysoc->country_code).''.$langs->trans("Description").' 
"; - print "global->FACTURE_LOCAL_TAX2_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2on")?" checked":"")."> ".$langs->transcountry("LocalTax2IsUsed",$mysoc->country_code)."'; print ""; - print ""; - $example=$langs->transcountry("LocalTax2IsUsedExample",$mysoc->country_code); - print ($example!="LocalTax2IsUsedExample"?"\n":""); + print ""; + $example=$langs->transcountry("LocalTax2IsUsedExample", $mysoc->country_code); + print ($example!="LocalTax2IsUsedExample"?"\n":""); if($conf->global->MAIN_INFO_VALUE_LOCALTAX2!=0) { print ''; @@ -1165,12 +1165,12 @@ else print "\n"; - print ""; + print ""; print '\n"; diff --git a/htdocs/admin/compta.php b/htdocs/admin/compta.php index 86d96227f3c..5bbfd15a0c4 100644 --- a/htdocs/admin/compta.php +++ b/htdocs/admin/compta.php @@ -35,7 +35,7 @@ $langs->loadLangs(array('admin', 'compta', 'accountancy')); if (!$user->admin) accessforbidden(); -$action = GETPOST('action','alpha'); +$action = GETPOST('action', 'alpha'); // Other parameters ACCOUNTING_* $list = array( @@ -64,10 +64,10 @@ if ($action == 'update') 'CREANCES-DETTES' ); - $accounting_mode = GETPOST('accounting_mode','alpha'); + $accounting_mode = GETPOST('accounting_mode', 'alpha'); - if (in_array($accounting_mode,$accounting_modes)) { + if (in_array($accounting_mode, $accounting_modes)) { if (!dolibarr_set_const($db, 'ACCOUNTING_MODE', $accounting_mode, 'chaine', 0, '', $conf->entity)) { $error++; @@ -103,7 +103,7 @@ llxHeader(); $form=new Form($db); $linkback=''.$langs->trans("BackToModuleList").''; -print load_fiche_titre($langs->trans('ComptaSetup'),$linkback,'title_setup'); +print load_fiche_titre($langs->trans('ComptaSetup'), $linkback, 'title_setup'); print '
'; diff --git a/htdocs/admin/confexped.php b/htdocs/admin/confexped.php index 660f7c7c500..e9a47e4db8f 100644 --- a/htdocs/admin/confexped.php +++ b/htdocs/admin/confexped.php @@ -35,7 +35,7 @@ $langs->loadLangs(array('admin', 'sendings', 'deliveries')); if (!$user->admin) accessforbidden(); -$action=GETPOST('action','alpha'); +$action=GETPOST('action', 'alpha'); /* @@ -46,7 +46,7 @@ $action=GETPOST('action','alpha'); if (! empty($conf->expedition->enabled) && empty($conf->global->MAIN_SUBMODULE_EXPEDITION)) { // This option should always be set to on when module is on. - dolibarr_set_const($db, "MAIN_SUBMODULE_EXPEDITION", "1",'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_SUBMODULE_EXPEDITION", "1", 'chaine', 0, '', $conf->entity); } /* if ($action == 'activate_sending') @@ -66,14 +66,14 @@ if ($action == 'disable_sending') // Delivery note if ($action == 'activate_delivery') { - dolibarr_set_const($db, "MAIN_SUBMODULE_EXPEDITION", "1",'chaine',0,'',$conf->entity); // We must also enable this - dolibarr_set_const($db, "MAIN_SUBMODULE_LIVRAISON", "1",'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_SUBMODULE_EXPEDITION", "1", 'chaine', 0, '', $conf->entity); // We must also enable this + dolibarr_set_const($db, "MAIN_SUBMODULE_LIVRAISON", "1", 'chaine', 0, '', $conf->entity); header("Location: confexped.php"); exit; } else if ($action == 'disable_delivery') { - dolibarr_del_const($db, "MAIN_SUBMODULE_LIVRAISON",$conf->entity); + dolibarr_del_const($db, "MAIN_SUBMODULE_LIVRAISON", $conf->entity); header("Location: confexped.php"); exit; } @@ -86,10 +86,10 @@ else if ($action == 'disable_delivery') $dir = DOL_DOCUMENT_ROOT."/core/modules/expedition/"; $form=new Form($db); -llxHeader("",$langs->trans("SendingsSetup")); +llxHeader("", $langs->trans("SendingsSetup")); $linkback=''.$langs->trans("BackToModuleList").''; -print load_fiche_titre($langs->trans("SendingsSetup"),$linkback,'title_setup'); +print load_fiche_titre($langs->trans("SendingsSetup"), $linkback, 'title_setup'); print '
'; $head = expedition_admin_prepare_head(); @@ -134,11 +134,11 @@ print '"; diff --git a/htdocs/admin/const.php b/htdocs/admin/const.php index cfda870e9da..ecba471fdbd 100644 --- a/htdocs/admin/const.php +++ b/htdocs/admin/const.php @@ -33,16 +33,16 @@ $langs->load("admin"); if (! $user->admin) accessforbidden(); -$rowid=GETPOST('rowid','int'); -$entity=GETPOST('entity','int'); -$action=GETPOST('action','alpha'); -$update=GETPOST('update','alpha'); -$delete=GETPOST('delete','none'); // Do not use alpha here -$debug=GETPOST('debug','int'); -$consts=GETPOST('const','array'); -$constname=GETPOST('constname','alpha'); -$constvalue=GETPOST('constvalue','none'); // We shoul dbe able to send everything here -$constnote=GETPOST('constnote','alpha'); +$rowid=GETPOST('rowid', 'int'); +$entity=GETPOST('entity', 'int'); +$action=GETPOST('action', 'alpha'); +$update=GETPOST('update', 'alpha'); +$delete=GETPOST('delete', 'none'); // Do not use alpha here +$debug=GETPOST('debug', 'int'); +$consts=GETPOST('const', 'array'); +$constname=GETPOST('constname', 'alpha'); +$constvalue=GETPOST('constvalue', 'none'); // We shoul dbe able to send everything here +$constnote=GETPOST('constnote', 'alpha'); @@ -148,7 +148,7 @@ if ($action == 'delete') $form = new Form($db); $wikihelp='EN:Setup_Other|FR:Paramétrage_Divers|ES:Configuración_Varios'; -llxHeader('',$langs->trans("Setup"),$wikihelp); +llxHeader('', $langs->trans("Setup"), $wikihelp); // Add logic to show/hide buttons if ($conf->use_javascript_ajax) @@ -174,7 +174,7 @@ jQuery(document).ready(function() { trans("OtherSetup"),'','title_setup'); +print load_fiche_titre($langs->trans("OtherSetup"), '', 'title_setup'); print $langs->trans("ConstDesc")."
\n"; print "
\n"; @@ -264,7 +264,7 @@ if ($result) // Note print ''; // Entity limit to superadmin diff --git a/htdocs/admin/contract.php b/htdocs/admin/contract.php index 60be9e062ba..87d65d65e6b 100644 --- a/htdocs/admin/contract.php +++ b/htdocs/admin/contract.php @@ -33,10 +33,10 @@ $langs->loadLangs(array("admin","errors","contracts")); if (!$user->admin) accessforbidden(); -$action = GETPOST('action','alpha'); -$value = GETPOST('value','alpha'); -$label = GETPOST('label','alpha'); -$scandir = GETPOST('scan_dir','alpha'); +$action = GETPOST('action', 'alpha'); +$value = GETPOST('value', 'alpha'); +$label = GETPOST('label', 'alpha'); +$scandir = GETPOST('scan_dir', 'alpha'); $type='contract'; if (empty($conf->global->CONTRACT_ADDON)) @@ -53,9 +53,9 @@ include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php'; if ($action == 'updateMask') { - $maskconst = GETPOST('maskconstcontract','alpha'); - $maskvalue = GETPOST('maskcontract','alpha'); - if ($maskconst) $res = dolibarr_set_const($db,$maskconst,$maskvalue,'chaine',0,'',$conf->entity); + $maskconst = GETPOST('maskconstcontract', 'alpha'); + $maskvalue = GETPOST('maskcontract', 'alpha'); + if ($maskconst) $res = dolibarr_set_const($db, $maskconst, $maskvalue, 'chaine', 0, '', $conf->entity); if (! $res > 0) $error++; @@ -71,17 +71,17 @@ if ($action == 'updateMask') else if ($action == 'specimen') // For contract { - $modele= GETPOST('module','alpha'); + $modele= GETPOST('module', 'alpha'); $contract = new Contrat($db); $contract->initAsSpecimen(); // Search template files $file=''; $classname=''; $filefound=0; - $dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']); + $dirmodels=array_merge(array('/'), (array) $conf->modules_parts['models']); foreach($dirmodels as $reldir) { - $file=dol_buildpath($reldir."core/modules/contract/doc/pdf_".$modele.".modules.php",0); + $file=dol_buildpath($reldir."core/modules/contract/doc/pdf_".$modele.".modules.php", 0); if (file_exists($file)) { $filefound=1; @@ -96,7 +96,7 @@ else if ($action == 'specimen') // For contract $module = new $classname($db); - if ($module->write_file($contract,$langs) > 0) + if ($module->write_file($contract, $langs) > 0) { header("Location: ".DOL_URL_ROOT."/document.php?modulepart=contract&file=SPECIMEN.pdf"); return; @@ -125,14 +125,14 @@ else if ($action == 'del') $ret = delDocumentModel($value, $type); if ($ret > 0) { - if ($conf->global->CONTRACT_ADDON_PDF == "$value") dolibarr_del_const($db, 'CONTRACT_ADDON_PDF',$conf->entity); + if ($conf->global->CONTRACT_ADDON_PDF == "$value") dolibarr_del_const($db, 'CONTRACT_ADDON_PDF', $conf->entity); } } // Set default model else if ($action == 'setdoc') { - if (dolibarr_set_const($db, "CONTRACT_ADDON_PDF",$value,'chaine',0,'',$conf->entity)) + if (dolibarr_set_const($db, "CONTRACT_ADDON_PDF", $value, 'chaine', 0, '', $conf->entity)) { // La constante qui a ete lue en avant du nouveau set // on passe donc par une variable pour avoir un affichage coherent @@ -152,16 +152,16 @@ else if ($action == 'setmod') // TODO Verifier si module numerotation choisi peut etre active // par appel methode canBeActivated - dolibarr_set_const($db, "CONTRACT_ADDON",$value,'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "CONTRACT_ADDON", $value, 'chaine', 0, '', $conf->entity); } else if ($action == 'set_other') { - $freetext= GETPOST('CONTRACT_FREE_TEXT','none'); // No alpha here, we want exact string - $res1 = dolibarr_set_const($db, "CONTRACT_FREE_TEXT",$freetext,'chaine',0,'',$conf->entity); + $freetext= GETPOST('CONTRACT_FREE_TEXT', 'none'); // No alpha here, we want exact string + $res1 = dolibarr_set_const($db, "CONTRACT_FREE_TEXT", $freetext, 'chaine', 0, '', $conf->entity); - $draft= GETPOST('CONTRACT_DRAFT_WATERMARK','alpha'); - $res2 = dolibarr_set_const($db, "CONTRACT_DRAFT_WATERMARK",trim($draft),'chaine',0,'',$conf->entity); + $draft= GETPOST('CONTRACT_DRAFT_WATERMARK', 'alpha'); + $res2 = dolibarr_set_const($db, "CONTRACT_DRAFT_WATERMARK", trim($draft), 'chaine', 0, '', $conf->entity); if (! $res1 > 0 || ! $res2 > 0) $error++; @@ -180,14 +180,14 @@ else if ($action == 'set_other') * View */ -$dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']); +$dirmodels=array_merge(array('/'), (array) $conf->modules_parts['models']); llxHeader(); $form=new Form($db); $linkback=''.$langs->trans("BackToModuleList").''; -print load_fiche_titre($langs->trans("ContractsSetup"),$linkback,'title_setup'); +print load_fiche_titre($langs->trans("ContractsSetup"), $linkback, 'title_setup'); $head=contract_admin_prepare_head(); @@ -197,7 +197,7 @@ dol_fiche_head($head, 'contract', $langs->trans("Contracts"), -1, 'contract'); * Contracts Numbering model */ -print load_fiche_titre($langs->trans("ContractsNumberingModules"),'',''); +print load_fiche_titre($langs->trans("ContractsNumberingModules"), '', ''); print '
".$langs->trans("Example").': '.$langs->transcountry("LocalTax2IsUsedExample",$mysoc->country_code)."
".$langs->trans("Example").': '.$langs->transcountry("LocalTax2IsUsedExample", $mysoc->country_code)."
'.$langs->trans("LTRate").': '. $conf->global->MAIN_INFO_VALUE_LOCALTAX2 .'
global->FACTURE_LOCAL_TAX2_OPTION) || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2off")?" checked":"")."> ".$langs->transcountry("LocalTax2IsNotUsed",$mysoc->country_code)."
global->FACTURE_LOCAL_TAX2_OPTION) || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2off")?" checked":"")."> ".$langs->transcountry("LocalTax2IsNotUsed", $mysoc->country_code)."'; print ""; - print ""; - $example=$langs->transcountry("LocalTax2IsNotUsedExample",$mysoc->country_code); - print ($example!="LocalTax2IsNotUsedExample"?"\n":""); + print ""; + $example=$langs->transcountry("LocalTax2IsNotUsedExample", $mysoc->country_code); + print ($example!="LocalTax2IsNotUsedExample"?"\n":""); print "
".$langs->trans("Example").': '.$langs->transcountry("LocalTax2IsNotUsedExample",$mysoc->country_code)."
".$langs->trans("Example").': '.$langs->transcountry("LocalTax2IsNotUsedExample", $mysoc->country_code)."
"; print "
'; if (empty($conf->global->MAIN_SUBMODULE_LIVRAISON)) { - print ''.img_picto($langs->trans("Disabled"),'switch_off').''; + print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; } else { - print ''.img_picto($langs->trans("Enabled"),'switch_on').''; + print ''.img_picto($langs->trans("Enabled"), 'switch_on').''; } print "'; - print ''; + print ''; print '
'; print ''; @@ -244,7 +244,7 @@ foreach ($dirmodels as $reldir) // Show example of numbering model print ''."\n"; @@ -252,12 +252,12 @@ foreach ($dirmodels as $reldir) print ''; @@ -268,11 +268,11 @@ foreach ($dirmodels as $reldir) // Info $htmltooltip=''; $htmltooltip.=''.$langs->trans("Version").': '.$module->getVersion().'
'; - $nextval=$module->getNextValue($mysoc,$contract); + $nextval=$module->getNextValue($mysoc, $contract); if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval $htmltooltip.=''.$langs->trans("NextValue").': '; if ($nextval) { - if (preg_match('/^Error/',$nextval) || $nextval=='NotConfigured') + if (preg_match('/^Error/', $nextval) || $nextval=='NotConfigured') $nextval = $langs->trans($nextval); $htmltooltip.=$nextval.'
'; } else { @@ -281,7 +281,7 @@ foreach ($dirmodels as $reldir) } print ''; print ''; @@ -299,7 +299,7 @@ print '
'; $tmp=$module->getExample(); - if (preg_match('/^Error/',$tmp)) { $langs->load("errors"); print '
'.$langs->trans($tmp).'
'; } + if (preg_match('/^Error/', $tmp)) { $langs->load("errors"); print '
'.$langs->trans($tmp).'
'; } elseif ($tmp=='NotConfigured') print $langs->trans($tmp); else print $tmp; print '
'; if ($conf->global->CONTRACT_ADDON == "$file") { - print img_picto($langs->trans("Activated"),'switch_on'); + print img_picto($langs->trans("Activated"), 'switch_on'); } else { print ''; - print img_picto($langs->trans("Disabled"),'switch_off'); + print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; } print ''; - print $form->textwithpicto('',$htmltooltip,1,0); + print $form->textwithpicto('', $htmltooltip, 1, 0); print '

'; * Documents models for Contracts */ -print load_fiche_titre($langs->trans("TemplatePDFContracts"),'',''); +print load_fiche_titre($langs->trans("TemplatePDFContracts"), '', ''); // Defini tableau def des modeles $def = array(); @@ -357,7 +357,7 @@ foreach ($dirmodels as $reldir) foreach($filelist as $file) { - if (preg_match('/\.modules\.php$/i',$file) && preg_match('/^(pdf_|doc_)/',$file)) + if (preg_match('/\.modules\.php$/i', $file) && preg_match('/^(pdf_|doc_)/', $file)) { if (file_exists($dir.'/'.$file)) @@ -377,7 +377,7 @@ foreach ($dirmodels as $reldir) print '
'; print (empty($module->name)?$name:$module->name); print "\n"; - if (method_exists($module,'info')) print $module->info($langs); + if (method_exists($module, 'info')) print $module->info($langs); else print $module->description; print ''."\n"; print ''; - print img_picto($langs->trans("Enabled"),'switch_on'); + print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; print ''."\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').''; + print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print "'; if ($conf->global->CONTRACT_ADDON_PDF == $name) { - print img_picto($langs->trans("Default"),'on'); + print img_picto($langs->trans("Default"), 'on'); } else { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').''; + print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; - print $form->textwithpicto('',$htmltooltip,1,0); + print $form->textwithpicto('', $htmltooltip, 1, 0); print ''; if ($module->type == 'pdf') { - print ''.img_object($langs->trans("Preview"),'contract').''; + print ''.img_object($langs->trans("Preview"), 'contract').''; } else { - print img_object($langs->trans("PreviewNotAvailable"),'generic'); + print img_object($langs->trans("PreviewNotAvailable"), 'generic'); } print '
'; print ''; print ''; @@ -486,7 +486,7 @@ if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) else { include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor=new DolEditor($variablename, $conf->global->$variablename,'',80,'dolibarr_notes'); + $doleditor=new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes'); print $doleditor->Create(); } print ''."\n"; diff --git a/htdocs/admin/dav.php b/htdocs/admin/dav.php index 51f68ffb7ff..1ab783474b8 100644 --- a/htdocs/admin/dav.php +++ b/htdocs/admin/dav.php @@ -57,7 +57,7 @@ include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php'; llxHeader('', $langs->trans("DAVSetup"), $wikihelp); $linkback=''.$langs->trans("BackToModuleList").''; -print load_fiche_titre($langs->trans("DAVSetup"),$linkback,'title_setup'); +print load_fiche_titre($langs->trans("DAVSetup"), $linkback, 'title_setup'); print ''; @@ -112,7 +112,7 @@ else foreach($arrayofparameters as $key => $val) { print '\n"; @@ -300,11 +300,11 @@ print "\n"; print ''; // Page print ''."\n"; // Field print ''; // Value if ($mode != 'focus' && $mode != 'mandatory') diff --git a/htdocs/admin/delais.php b/htdocs/admin/delais.php index a48be10b4e0..a9b7d9e75ca 100644 --- a/htdocs/admin/delais.php +++ b/htdocs/admin/delais.php @@ -32,7 +32,7 @@ $langs->load("admin"); if (! $user->admin) accessforbidden(); -$action=GETPOST('action','alpha'); +$action=GETPOST('action', 'alpha'); $modules=array( 'agenda' => array( @@ -145,15 +145,15 @@ if ($action == 'update') } } - dolibarr_set_const($db, "MAIN_DISABLE_METEO",$_POST["MAIN_DISABLE_METEO"],'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_USE_METEO_WITH_PERCENTAGE",GETPOST("MAIN_USE_METEO_WITH_PERCENTAGE"),'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_DISABLE_METEO", $_POST["MAIN_DISABLE_METEO"], 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_USE_METEO_WITH_PERCENTAGE", GETPOST("MAIN_USE_METEO_WITH_PERCENTAGE"), 'chaine', 0, '', $conf->entity); // For update value with percentage $plus=''; if(!empty($conf->global->MAIN_USE_METEO_WITH_PERCENTAGE)) $plus = '_PERCENTAGE'; // Update values for($i=0; $i<4; $i++) { - if(isset($_POST['MAIN_METEO'.$plus.'_LEVEL'.$i])) dolibarr_set_const($db, 'MAIN_METEO'.$plus.'_LEVEL'.$i, GETPOST('MAIN_METEO'.$plus.'_LEVEL'.$i, 'int'),'chaine',0,'',$conf->entity); + if(isset($_POST['MAIN_METEO'.$plus.'_LEVEL'.$i])) dolibarr_set_const($db, 'MAIN_METEO'.$plus.'_LEVEL'.$i, GETPOST('MAIN_METEO'.$plus.'_LEVEL'.$i, 'int'), 'chaine', 0, '', $conf->entity); } } @@ -166,10 +166,10 @@ $form = new Form($db); llxHeader(); -print load_fiche_titre($langs->trans("DelaysOfToleranceBeforeWarning"),'','title_setup'); +print load_fiche_titre($langs->trans("DelaysOfToleranceBeforeWarning"), '', 'title_setup'); -print $langs->transnoentities("DelaysOfToleranceDesc",img_warning()); -print " ".$langs->trans("OnlyActiveElementsAreShown",DOL_URL_ROOT.'/admin/modules.php')."
\n"; +print $langs->transnoentities("DelaysOfToleranceDesc", img_warning()); +print " ".$langs->trans("OnlyActiveElementsAreShown", DOL_URL_ROOT.'/admin/modules.php')."
\n"; print "
\n"; $countrynotdefined=''.$langs->trans("ErrorSetACountryFirst").' ('.$langs->trans("SeeAbove").')'; @@ -192,7 +192,7 @@ if ($action == 'edit') $value=(! empty($conf->global->{$delay['code']})?$conf->global->{$delay['code']}:0); print ''; - print ''; + print ''; print ''; } @@ -232,7 +232,7 @@ else $value=(! empty($conf->global->{$delay['code']})?$conf->global->{$delay['code']}:0); print ''; - print ''; + print ''; print ''; print ''; } @@ -294,16 +294,16 @@ if ($action == 'edit') { print '
'; print '
'; - print img_weather($text,'weather-clear.png', $options); + print img_weather($text, 'weather-clear.png', $options); print '= '; print '
'; - print img_weather($text,'weather-few-clouds.png',$options); + print img_weather($text, 'weather-few-clouds.png', $options); print '<= '; print '
'; - print img_weather($text,'weather-clouds.png',$options); + print img_weather($text, 'weather-clouds.png', $options); print '<= '; print '
'; - print img_weather($text,'weather-many-clouds.png',$options); + print img_weather($text, 'weather-many-clouds.png', $options); print '<= '; print '
'; print '
'; @@ -314,16 +314,16 @@ if ($action == 'edit') { print '
'; print '
'; - print img_weather($text,'weather-clear.png',$options); + print img_weather($text, 'weather-clear.png', $options); print '=  %'; print '
'; - print img_weather($text,'weather-few-clouds.png',$options); + print img_weather($text, 'weather-few-clouds.png', $options); print '<=  %'; print '
'; - print img_weather($text,'weather-clouds.png',$options); + print img_weather($text, 'weather-clouds.png', $options); print '<=  %'; print '
'; - print img_weather($text,'weather-many-clouds.png',$options); + print img_weather($text, 'weather-many-clouds.png', $options); print '<=  %'; print '
'; print '
'; @@ -365,19 +365,19 @@ if ($action == 'edit') { print '
'; print '
'; - print img_weather($text,'weather-clear.png',$options); + print img_weather($text, 'weather-clear.png', $options); print '= '.$conf->global->MAIN_METEO_PERCENTAGE_LEVEL0.' %'; print '
'; - print img_weather($text,'weather-few-clouds.png',$options); + print img_weather($text, 'weather-few-clouds.png', $options); print '<= '.$conf->global->MAIN_METEO_PERCENTAGE_LEVEL1.' %'; print '
'; - print img_weather($text,'weather-clouds.png',$options); + print img_weather($text, 'weather-clouds.png', $options); print '<= '.$conf->global->MAIN_METEO_PERCENTAGE_LEVEL2.' %'; print '
'; - print img_weather($text,'weather-many-clouds.png',$options); + print img_weather($text, 'weather-many-clouds.png', $options); print '<= '.$conf->global->MAIN_METEO_PERCENTAGE_LEVEL3.' %'; print '
'; - print img_weather($text,'weather-storm.png',$options); + print img_weather($text, 'weather-storm.png', $options); print '> '.$conf->global->MAIN_METEO_PERCENTAGE_LEVEL3.' %'; print '
'; print '
'; @@ -385,19 +385,19 @@ if ($action == 'edit') { print '
'; print '
'; - print img_weather($text,'weather-clear.png',$options); + print img_weather($text, 'weather-clear.png', $options); print '= '.$level0; print '
'; - print img_weather($text,'weather-few-clouds.png',$options); + print img_weather($text, 'weather-few-clouds.png', $options); print '<= '.$level1; print '
'; - print img_weather($text,'weather-clouds.png',$options); + print img_weather($text, 'weather-clouds.png', $options); print '<= '.$level2; print '
'; - print img_weather($text,'weather-many-clouds.png',$options); + print img_weather($text, 'weather-many-clouds.png', $options); print '<= '.$level3; print '
'; - print img_weather($text,'weather-storm.png',$options); + print img_weather($text, 'weather-storm.png', $options); print '> '.$level3; print '
'; print '
'; diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index fc3b8f15f39..d94ffeaf4e2 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -44,12 +44,12 @@ if (! empty($conf->accounting->enabled)) require_once DOL_DOCUMENT_ROOT . '/core // Load translation files required by the page $langs->loadLangs(array("errors","admin","main","companies","resource","holiday","accountancy","hrm","orders","contracts","projects","propal","bills","interventions")); -$action=GETPOST('action','alpha')?GETPOST('action','alpha'):'view'; -$confirm=GETPOST('confirm','alpha'); -$id=GETPOST('id','int'); -$rowid=GETPOST('rowid','alpha'); -$entity=GETPOST('entity','int'); -$code=GETPOST('code','alpha'); +$action=GETPOST('action', 'alpha')?GETPOST('action', 'alpha'):'view'; +$confirm=GETPOST('confirm', 'alpha'); +$id=GETPOST('id', 'int'); +$rowid=GETPOST('rowid', 'alpha'); +$entity=GETPOST('entity', 'int'); +$code=GETPOST('code', 'alpha'); $allowed=$user->admin; if ($id == 7 && ! empty($user->rights->accounting->chartofaccount)) $allowed=1; // Tax page allowed to manager of chart account @@ -59,27 +59,27 @@ if (! $allowed) accessforbidden(); $acts[0] = "activate"; $acts[1] = "disable"; -$actl[0] = img_picto($langs->trans("Disabled"),'switch_off'); -$actl[1] = img_picto($langs->trans("Activated"),'switch_on'); +$actl[0] = img_picto($langs->trans("Disabled"), 'switch_off'); +$actl[1] = img_picto($langs->trans("Activated"), 'switch_on'); $listoffset=GETPOST('listoffset'); $listlimit=GETPOST('listlimit')>0?GETPOST('listlimit'):1000; // To avoid too long dictionaries $active = 1; -$sortfield = GETPOST("sortfield",'alpha'); -$sortorder = GETPOST("sortorder",'alpha'); -$page = GETPOST("page",'int'); +$sortfield = GETPOST("sortfield", 'alpha'); +$sortorder = GETPOST("sortorder", 'alpha'); +$page = GETPOST("page", 'int'); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 $offset = $listlimit * $page ; $pageprev = $page - 1; $pagenext = $page + 1; -$search_country_id = GETPOST('search_country_id','int'); +$search_country_id = GETPOST('search_country_id', 'int'); if ($search_country_id == '' && ($id == 2 || $id == 3 || $id == 10)) // Not a so good idea to force on current country for all dictionaries. Some tables have entries that are for all countries, we must be able to see them, so this is done for dedicated dictionaries only. { $search_country_id = $mysoc->country_id; } -$search_code = GETPOST('search_code','alpha'); +$search_code = GETPOST('search_code', 'alpha'); // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager->initHooks(array('admin')); @@ -522,14 +522,14 @@ $tabfieldcheck[35]= array(); $tabfieldcheck[36]= array(); // Complete all arrays with entries found into modules -complete_dictionary_with_modules($taborder,$tabname,$tablib,$tabsql,$tabsqlsort,$tabfield,$tabfieldvalue,$tabfieldinsert,$tabrowid,$tabcond,$tabhelp,$tabfieldcheck); +complete_dictionary_with_modules($taborder, $tabname, $tablib, $tabsql, $tabsqlsort, $tabfield, $tabfieldvalue, $tabfieldinsert, $tabrowid, $tabcond, $tabhelp, $tabfieldcheck); // Defaut sortorder if (empty($sortfield)) { - $tmp1 = explode(',',$tabsqlsort[$id]); - $tmp2 = explode(' ',$tmp1[0]); + $tmp1 = explode(',', $tabsqlsort[$id]); + $tmp2 = explode(' ', $tmp1[0]); $sortfield=preg_replace('/^.*\./', '', $tmp2[0]); } @@ -601,17 +601,17 @@ if (GETPOST('button_removefilter', 'alpha') || GETPOST('button_removefilter.x', // Actions add or modify an entry into a dictionary if (GETPOST('actionadd') || GETPOST('actionmodify')) { - $listfield=explode(',', str_replace(' ', '',$tabfield[$id])); - $listfieldinsert=explode(',',$tabfieldinsert[$id]); - $listfieldmodify=explode(',',$tabfieldinsert[$id]); - $listfieldvalue=explode(',',$tabfieldvalue[$id]); + $listfield=explode(',', str_replace(' ', '', $tabfield[$id])); + $listfieldinsert=explode(',', $tabfieldinsert[$id]); + $listfieldmodify=explode(',', $tabfieldinsert[$id]); + $listfieldvalue=explode(',', $tabfieldvalue[$id]); // Check that all fields are filled $ok=1; foreach ($listfield as $f => $value) { - if ($value == 'country_id' && in_array($tablib[$id],array('DictionaryVAT','DictionaryRegion','DictionaryCompanyType','DictionaryHolidayTypes','DictionaryRevenueStamp','DictionaryAccountancysystem','DictionaryAccountancyCategory'))) continue; // For some pages, country is not mandatory - if ($value == 'country' && in_array($tablib[$id],array('DictionaryCanton','DictionaryCompanyType','DictionaryRevenueStamp'))) continue; // For some pages, country is not mandatory + if ($value == 'country_id' && in_array($tablib[$id], array('DictionaryVAT','DictionaryRegion','DictionaryCompanyType','DictionaryHolidayTypes','DictionaryRevenueStamp','DictionaryAccountancysystem','DictionaryAccountancyCategory'))) continue; // For some pages, country is not mandatory + if ($value == 'country' && in_array($tablib[$id], array('DictionaryCanton','DictionaryCompanyType','DictionaryRevenueStamp'))) continue; // For some pages, country is not mandatory if ($value == 'localtax1' && empty($_POST['localtax1_type'])) continue; if ($value == 'localtax2' && empty($_POST['localtax2_type'])) continue; if ($value == 'color' && empty($_POST['color'])) continue; @@ -646,7 +646,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) } } // Other checks - if (GETPOST('actionadd') && $tabname[$id] == MAIN_DB_PREFIX."c_actioncomm" && isset($_POST["type"]) && in_array($_POST["type"],array('system','systemauto'))) { + if (GETPOST('actionadd') && $tabname[$id] == MAIN_DB_PREFIX."c_actioncomm" && isset($_POST["type"]) && in_array($_POST["type"], array('system','systemauto'))) { $ok=0; setEventMessages($langs->transnoentities('ErrorReservedTypeSystemSystemAuto'), null, 'errors'); } @@ -665,20 +665,20 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) } if (isset($_POST["country"]) && ($_POST["country"]=='0') && ($id != 2)) { - if (in_array($tablib[$id],array('DictionaryCompanyType','DictionaryHolidayTypes'))) // Field country is no mandatory for such dictionaries + if (in_array($tablib[$id], array('DictionaryCompanyType','DictionaryHolidayTypes'))) // Field country is no mandatory for such dictionaries { $_POST["country"]=''; } else { $ok=0; - setEventMessages($langs->transnoentities("ErrorFieldRequired",$langs->transnoentities("Country")), null, 'errors'); + setEventMessages($langs->transnoentities("ErrorFieldRequired", $langs->transnoentities("Country")), null, 'errors'); } } if ($id == 3 && ! is_numeric($_POST["code"])) { $ok=0; - setEventMessages($langs->transnoentities("ErrorFieldMustBeANumeric",$langs->transnoentities("Code")), null, 'errors'); + setEventMessages($langs->transnoentities("ErrorFieldMustBeANumeric", $langs->transnoentities("Code")), null, 'errors'); } // Clean some parameters @@ -689,7 +689,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) if ($_POST["accountancy_code_buy"] <= 0) $_POST["accountancy_code_buy"]=''; // If empty, we force to null if ($id == 10 && isset($_POST["code"])) // Spaces are not allowed into code { - $_POST["code"]=preg_replace('/\s/','',$_POST["code"]); + $_POST["code"]=preg_replace('/\s/', '', $_POST["code"]); } // Si verif ok et action add, on ajoute la ligne @@ -713,20 +713,20 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) // Add new entry $sql = "INSERT INTO ".$tabname[$id]." ("; // List of fields - if ($tabrowid[$id] && ! in_array($tabrowid[$id],$listfieldinsert)) + if ($tabrowid[$id] && ! in_array($tabrowid[$id], $listfieldinsert)) $sql.= $tabrowid[$id].","; $sql.= $tabfieldinsert[$id]; $sql.=",active)"; $sql.= " VALUES("; // List of values - if ($tabrowid[$id] && ! in_array($tabrowid[$id],$listfieldinsert)) + if ($tabrowid[$id] && ! in_array($tabrowid[$id], $listfieldinsert)) $sql.= $newid.","; $i=0; foreach ($listfieldinsert as $f => $value) { - if ($value == 'price' || preg_match('/^amount/i',$value) || $value == 'taux') { - $_POST[$listfieldvalue[$i]] = price2num($_POST[$listfieldvalue[$i]],'MU'); + if ($value == 'price' || preg_match('/^amount/i', $value) || $value == 'taux') { + $_POST[$listfieldvalue[$i]] = price2num($_POST[$listfieldvalue[$i]], 'MU'); } else if ($value == 'entity') { $_POST[$listfieldvalue[$i]] = getEntity($tabname[$id]); @@ -769,7 +769,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) // Modify entry $sql = "UPDATE ".$tabname[$id]." SET "; // Modifie valeur des champs - if ($tabrowid[$id] && ! in_array($tabrowid[$id],$listfieldmodify)) + if ($tabrowid[$id] && ! in_array($tabrowid[$id], $listfieldmodify)) { $sql.= $tabrowid[$id]."="; $sql.= "'".$db->escape($rowid)."', "; @@ -777,8 +777,8 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) $i = 0; foreach ($listfieldmodify as $field) { - if ($field == 'price' || preg_match('/^amount/i',$field) || $field == 'taux') { - $_POST[$listfieldvalue[$i]] = price2num($_POST[$listfieldvalue[$i]],'MU'); + if ($field == 'price' || preg_match('/^amount/i', $field) || $field == 'taux') { + $_POST[$listfieldvalue[$i]] = price2num($_POST[$listfieldvalue[$i]], 'MU'); } else if ($field == 'entity') { $_POST[$listfieldvalue[$i]] = getEntity($tabname[$id]); @@ -943,7 +943,7 @@ if ($id == 7 && GETPOST('from') == 'accountancy') $titlepicto='title_accountancy'; } -print load_fiche_titre($titre,$linkback,$titlepicto); +print load_fiche_titre($titre, $linkback, $titlepicto); if (empty($id)) { @@ -960,13 +960,13 @@ if ($entity != '') $param.= '&entity=' . (int) $entity; $paramwithsearch = $param; if ($sortorder) $paramwithsearch.= '&sortorder='.urlencode($sortorder); if ($sortfield) $paramwithsearch.= '&sortfield='.urlencode($sortfield); -if (GETPOST('from')) $paramwithsearch.= '&from='.urlencode(GETPOST('from','alpha')); +if (GETPOST('from')) $paramwithsearch.= '&from='.urlencode(GETPOST('from', 'alpha')); // Confirmation de la suppression de la ligne if ($action == 'delete') { - print $form->formconfirm($_SERVER["PHP_SELF"].'?'.($page?'page='.$page.'&':'').'rowid='.urlencode($rowid).'&code='.urlencode($code).$paramwithsearch, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_delete','',0,1); + print $form->formconfirm($_SERVER["PHP_SELF"].'?'.($page?'page='.$page.'&':'').'rowid='.urlencode($rowid).'&code='.urlencode($code).$paramwithsearch, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_delete', '', 0, 1); } //var_dump($elementList); @@ -978,7 +978,7 @@ if ($id) // Complete requete recherche valeurs avec critere de tri $sql=$tabsql[$id]; - if (! preg_match('/ WHERE /',$sql)) $sql.= " WHERE 1 = 1"; + if (! preg_match('/ WHERE /', $sql)) $sql.= " WHERE 1 = 1"; if ($search_country_id > 0) $sql.= " AND c.rowid = ".$search_country_id; if ($search_code != '' && $id != 9) $sql.= natural_search("code", $search_code); if ($search_code != '' && $id == 9) $sql.= natural_search("code_iso", $search_code); @@ -994,14 +994,14 @@ if ($id) } $sql.=", "; // Clear the required sort criteria for the tabsqlsort to be able to force it with selected value - $tabsqlsort[$id]=preg_replace('/([a-z]+\.)?'.$sortfield.' '.$sortorder.',/i','',$tabsqlsort[$id]); - $tabsqlsort[$id]=preg_replace('/([a-z]+\.)?'.$sortfield.',/i','',$tabsqlsort[$id]); + $tabsqlsort[$id]=preg_replace('/([a-z]+\.)?'.$sortfield.' '.$sortorder.',/i', '', $tabsqlsort[$id]); + $tabsqlsort[$id]=preg_replace('/([a-z]+\.)?'.$sortfield.',/i', '', $tabsqlsort[$id]); } else { $sql.=" ORDER BY "; } $sql.=$tabsqlsort[$id]; - $sql.=$db->plimit($listlimit+1,$offset); + $sql.=$db->plimit($listlimit+1, $offset); //print $sql; if (empty($tabfield[$id])) @@ -1009,11 +1009,11 @@ if ($id) dol_print_error($db, 'The table with id '.$id.' has no array tabfield defined'); exit; } - $fieldlist=explode(',',$tabfield[$id]); + $fieldlist=explode(',', $tabfield[$id]); print ''; print ''; - print ''; + print ''; if ($id == 10 && empty($conf->global->FACTURE_TVAOPTION)) { @@ -1028,7 +1028,7 @@ if ($id) $alabelisused=0; $withentity=null; - $fieldlist=explode(',',$tabfield[$id]); + $fieldlist=explode(',', $tabfield[$id]); print '
'; print '
'.$langs->trans("Parameter").'
'; - print $form->textwithpicto($langs->trans($key),$langs->trans($key.'Tooltip')); + print $form->textwithpicto($langs->trans($key), $langs->trans($key.'Tooltip')); print ''; if ($key == 'DAV_ALLOW_PUBLIC_DIR' || $key == 'DAV_ALLOW_ECM_DIR') { @@ -149,7 +149,7 @@ print "
"; // Define $urlwithroot -$urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root)); +$urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root)); $urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file //$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current @@ -157,13 +157,13 @@ $urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain // Show message $message=''; $url=''.$urlwithroot.'/dav/fileserver.php'; -$message.=img_picto('','object_globe.png').' '.$langs->trans("WebDavServer",'WebDAV',$url); +$message.=img_picto('', 'object_globe.png').' '.$langs->trans("WebDavServer", 'WebDAV', $url); $message.='
'; if (! empty($conf->global->DAV_ALLOW_PUBLIC_DIR)) { $urlEntity = (! empty($conf->multicompany->enabled)?'?entity='.$conf->entity:''); $url=''.$urlwithroot.'/dav/fileserver.php/public/'.$urlEntity.''; - $message.=img_picto('','object_globe.png').' '.$langs->trans("WebDavServer",'WebDAV public',$url); + $message.=img_picto('', 'object_globe.png').' '.$langs->trans("WebDavServer", 'WebDAV public', $url); $message.='
'; } print $message; diff --git a/htdocs/admin/defaultvalues.php b/htdocs/admin/defaultvalues.php index dcd6548b498..41c1c990d39 100644 --- a/htdocs/admin/defaultvalues.php +++ b/htdocs/admin/defaultvalues.php @@ -36,15 +36,15 @@ $langs->loadLangs(array('companies', 'products', 'admin', 'sms', 'other', 'error if (!$user->admin) accessforbidden(); -$id=GETPOST('rowid','int'); -$action=GETPOST('action','alpha'); +$id=GETPOST('rowid', 'int'); +$action=GETPOST('action', 'alpha'); -$mode = GETPOST('mode','aZ09')?GETPOST('mode','aZ09'):'createform'; // 'createform', 'filters', 'sortorder', 'focus' +$mode = GETPOST('mode', 'aZ09')?GETPOST('mode', 'aZ09'):'createform'; // 'createform', 'filters', 'sortorder', 'focus' -$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit; -$sortfield = GETPOST("sortfield",'alpha'); -$sortorder = GETPOST("sortorder",'alpha'); -$page = GETPOST("page",'int'); +$limit = GETPOST('limit', 'int')?GETPOST('limit', 'int'):$conf->liste_limit; +$sortfield = GETPOST("sortfield", 'alpha'); +$sortorder = GETPOST("sortorder", 'alpha'); +$page = GETPOST("page", 'int'); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 $offset = $limit * $page; $pageprev = $page - 1; @@ -53,7 +53,7 @@ if (! $sortfield) $sortfield='page,param'; if (! $sortorder) $sortorder='ASC'; $defaulturl = GETPOST('defaulturl'); -$defaultkey = GETPOST('defaultkey','alpha'); +$defaultkey = GETPOST('defaultkey', 'alpha'); $defaultvalue = GETPOST('defaultvalue'); $defaulturl=preg_replace('/^\//', '', $defaulturl); @@ -70,17 +70,17 @@ $hookmanager->initHooks(array('admindefaultvalues','globaladmin')); * Actions */ -if (GETPOST('cancel','alpha')) { $action='list'; $massaction=''; } -if (! GETPOST('confirmmassaction','alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; } +if (GETPOST('cancel', 'alpha')) { $action='list'; $massaction=''; } +if (! GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; } $parameters=array('socid'=>$socid); -$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks +$reshook=$hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; // Purge search criteria -if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers +if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) // All tests are required to be compatible with all browsers { $defaulturl=''; $defaultkey=''; @@ -185,7 +185,7 @@ $form=new Form($db); $formadmin = new FormAdmin($db); $wikihelp='EN:Setup|FR:Paramétrage|ES:Configuración'; -llxHeader('',$langs->trans("Setup"),$wikihelp); +llxHeader('', $langs->trans("Setup"), $wikihelp); $param='&mode='.$mode; @@ -194,14 +194,14 @@ if (empty($conf->global->MAIN_ENABLE_DEFAULT_VALUES)) { // Button off, click to enable $enabledisablehtml.= ''; - $enabledisablehtml.= img_picto($langs->trans("Disabled"),'switch_off'); + $enabledisablehtml.= img_picto($langs->trans("Disabled"), 'switch_off'); $enabledisablehtml.= ''; } else { // Button on, click to disable $enabledisablehtml.= ''; - $enabledisablehtml.= img_picto($langs->trans("Activated"),'switch_on'); + $enabledisablehtml.= img_picto($langs->trans("Activated"), 'switch_on'); $enabledisablehtml.= ''; } @@ -252,7 +252,7 @@ $texthelp=$langs->trans("PageUrlForDefaultValues"); if ($mode == 'createform') $texthelp.=$langs->trans("PageUrlForDefaultValuesCreate", 'societe/card.php', 'societe/card.php?abc=val1&def=val2'); else $texthelp.=$langs->trans("PageUrlForDefaultValuesList", 'societe/list.php', 'societe/list.php?abc=val1&def=val2'); $texturl=$form->textwithpicto($langs->trans("Url"), $texthelp); -print_liste_field_titre($texturl,$_SERVER["PHP_SELF"],'page,param','',$param,'',$sortfield,$sortorder); +print_liste_field_titre($texturl, $_SERVER["PHP_SELF"], 'page,param', '', $param, '', $sortfield, $sortorder); // Field $texthelp=$langs->trans("TheKeyIsTheNameOfHtmlField"); if ($mode != 'sortorder') @@ -264,7 +264,7 @@ else $texthelp='field or alias.field'; $textkey=$form->textwithpicto($langs->trans("Field"), $texthelp); } -print_liste_field_titre($textkey,$_SERVER["PHP_SELF"],'param','',$param,'',$sortfield,$sortorder); +print_liste_field_titre($textkey, $_SERVER["PHP_SELF"], 'param', '', $param, '', $sortfield, $sortorder); // Value if ($mode != 'focus' && $mode != 'mandatory') { @@ -287,10 +287,10 @@ if ($mode != 'focus' && $mode != 'mandatory') print_liste_field_titre($textvalue, $_SERVER["PHP_SELF"], 'value', '', $param, '', $sortfield, $sortorder); } // Entity -if (! empty($conf->multicompany->enabled) && !$user->entity) print_liste_field_titre("Entity",$_SERVER["PHP_SELF"],'entity,page','',$param,'',$sortfield,$sortorder); -else print_liste_field_titre("",$_SERVER["PHP_SELF"],'','',$param,'',$sortfield,$sortorder); +if (! empty($conf->multicompany->enabled) && !$user->entity) print_liste_field_titre("Entity", $_SERVER["PHP_SELF"], 'entity,page', '', $param, '', $sortfield, $sortorder); +else print_liste_field_titre("", $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder); // Actions -print_liste_field_titre("",$_SERVER["PHP_SELF"],'','',$param,'',$sortfield,$sortorder); +print_liste_field_titre("", $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder); print "
'; -print ''; +print ''; print ''; -print ''; +print ''; print '
'.img_object('',$delay['img']).''.img_object('', $delay['img']).''.$langs->trans('Delays_'.$delay['code']).''; print ' '.$langs->trans("days").'
'.img_object('',$delay['img']).''.img_object('', $delay['img']).''.$langs->trans('Delays_'.$delay['code']).''.$value.' '.$langs->trans("days").'
'; @@ -1061,19 +1061,19 @@ if ($id) if ($fieldlist[$field]=='organization') { $valuetoshow=$langs->trans("Organization"); } if ($fieldlist[$field]=='lang') { $valuetoshow=$langs->trans("Language"); } if ($fieldlist[$field]=='type') { - if ($tabname[$id] == MAIN_DB_PREFIX."c_paiement") $valuetoshow=$form->textwithtooltip($langs->trans("Type"),$langs->trans("TypePaymentDesc"),2,1,img_help(1,'')); + if ($tabname[$id] == MAIN_DB_PREFIX."c_paiement") $valuetoshow=$form->textwithtooltip($langs->trans("Type"), $langs->trans("TypePaymentDesc"), 2, 1, img_help(1, '')); else $valuetoshow=$langs->trans("Type"); } if ($fieldlist[$field]=='code') { $valuetoshow=$langs->trans("Code"); $class='width100'; } if ($fieldlist[$field]=='libelle' || $fieldlist[$field]=='label') { - $valuetoshow=$form->textwithtooltip($langs->trans("Label"), $langs->trans("LabelUsedByDefault"),2,1,img_help(1,'')); + $valuetoshow=$form->textwithtooltip($langs->trans("Label"), $langs->trans("LabelUsedByDefault"), 2, 1, img_help(1, '')); } if ($fieldlist[$field]=='libelle_facture') { - $valuetoshow=$form->textwithtooltip($langs->trans("LabelOnDocuments"), $langs->trans("LabelUsedByDefault"),2,1,img_help(1,'')); + $valuetoshow=$form->textwithtooltip($langs->trans("LabelOnDocuments"), $langs->trans("LabelUsedByDefault"), 2, 1, img_help(1, '')); } if ($fieldlist[$field]=='country') { - if (in_array('region_id',$fieldlist)) { print ''; continue; } // For region page, we do not show the country input + if (in_array('region_id', $fieldlist)) { print ''; continue; } // For region page, we do not show the country input $valuetoshow=$langs->trans("Country"); } if ($fieldlist[$field]=='recuperableonly') { $valuetoshow=$langs->trans("NPR"); $class="center"; } @@ -1124,8 +1124,8 @@ if ($id) if ($valuetoshow != '') { print ''; - if (! empty($tabhelp[$id][$value]) && preg_match('/^http(s*):/i',$tabhelp[$id][$value])) print ''.$valuetoshow.' '.img_help(1,$valuetoshow).''; - else if (! empty($tabhelp[$id][$value])) print $form->textwithpicto($valuetoshow,$tabhelp[$id][$value]); + if (! empty($tabhelp[$id][$value]) && preg_match('/^http(s*):/i', $tabhelp[$id][$value])) print ''.$valuetoshow.' '.img_help(1, $valuetoshow).''; + else if (! empty($tabhelp[$id][$value])) print $form->textwithpicto($valuetoshow, $tabhelp[$id][$value]); else print $valuetoshow; print ''; } @@ -1158,7 +1158,7 @@ if ($id) $tmpaction = 'create'; $parameters=array('fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]); - $reshook=$hookmanager->executeHooks('createDictionaryFieldlist',$parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks + $reshook=$hookmanager->executeHooks('createDictionaryFieldlist', $parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks $error=$hookmanager->error; $errors=$hookmanager->errors; if ($id == 3) unset($fieldlist[2]); // Remove field ??? if dictionary Regions @@ -1190,7 +1190,7 @@ if ($id) print ''; print ''; - print ''; + print ''; // List of available record in database dol_syslog("htdocs/admin/dict", LOG_DEBUG); @@ -1363,7 +1363,7 @@ if ($id) { $tmpaction='edit'; $parameters=array('fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]); - $reshook=$hookmanager->executeHooks('editDictionaryFieldlist',$parameters,$obj, $tmpaction); // Note that $action and $object may have been modified by some hooks + $reshook=$hookmanager->executeHooks('editDictionaryFieldlist', $parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks $error=$hookmanager->error; $errors=$hookmanager->errors; // Show fields @@ -1385,7 +1385,7 @@ if ($id) { $tmpaction = 'view'; $parameters=array('fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]); - $reshook=$hookmanager->executeHooks('viewDictionaryFieldlist',$parameters,$obj, $tmpaction); // Note that $action and $object may have been modified by some hooks + $reshook=$hookmanager->executeHooks('viewDictionaryFieldlist', $parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks $error=$hookmanager->error; $errors=$hookmanager->errors; @@ -1437,7 +1437,7 @@ if ($id) elseif($valuetoshow == 2) $valuetoshow = $langs->trans('CurrentNext'); $align="center"; } - else if ($fieldlist[$field]=='price' || preg_match('/^amount/i',$fieldlist[$field])) { + else if ($fieldlist[$field]=='price' || preg_match('/^amount/i', $fieldlist[$field])) { $valuetoshow=price($valuetoshow); } if ($value == 'private') @@ -1523,7 +1523,7 @@ if ($id) $showfield=0; } else if ($fieldlist[$field]=='unicode') { - $valuetoshow = $langs->getCurrencySymbol($obj->code,1); + $valuetoshow = $langs->getCurrencySymbol($obj->code, 1); } else if ($fieldlist[$field]=='label' && $tabname[$_GET["id"]]==MAIN_DB_PREFIX.'c_units') { $langs->load("products"); @@ -1559,7 +1559,7 @@ if ($id) $valuetoshow = price($valuetoshow, 0, $langs, 0, 0); $align="center"; } - else if (in_array($fieldlist[$field],array('recuperableonly'))) + else if (in_array($fieldlist[$field], array('recuperableonly'))) { $align="center"; } @@ -1603,7 +1603,7 @@ if ($id) $iserasable=1;$canbedisabled=1;$canbemodified=1; // true by default if (isset($obj->code) && $id != 10) { - if (($obj->code == '0' || $obj->code == '' || preg_match('/unknown/i',$obj->code))) { $iserasable = 0; $canbedisabled = 0; } + if (($obj->code == '0' || $obj->code == '' || preg_match('/unknown/i', $obj->code))) { $iserasable = 0; $canbedisabled = 0; } else if ($obj->code == 'RECEP') { $iserasable = 0; $canbedisabled = 0; } else if ($obj->code == 'EF0') { $iserasable = 0; $canbedisabled = 0; } } @@ -1786,7 +1786,7 @@ function fieldList($fieldlist, $obj='', $tabname='', $context='') } elseif ($fieldlist[$field] == 'country') { - if (in_array('region_id',$fieldlist)) + if (in_array('region_id', $fieldlist)) { print ''; } elseif ($fieldlist[$field] == 'region_id') @@ -1824,27 +1824,27 @@ function fieldList($fieldlist, $obj='', $tabname='', $context='') elseif ($fieldlist[$field] == 'lang') { print ''; } // Le type de l'element (pour les type de contact) elseif ($fieldlist[$field] == 'element') { print ''; } // La source de l'element (pour les type de contact) elseif ($fieldlist[$field] == 'source') { print ''; } elseif ($fieldlist[$field] == 'private') { print ''; } elseif ($fieldlist[$field] == 'type' && $tabname == MAIN_DB_PREFIX."c_actioncomm") @@ -1860,13 +1860,13 @@ function fieldList($fieldlist, $obj='', $tabname='', $context='') if ($fieldlist[$field] == 'type_cdr') { print $form->selectarray($fieldlist[$field], array(0=>$langs->trans('None'), 1=>$langs->trans('AtEndOfMonth'), 2=>$langs->trans('CurrentNext')), (! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:'')); } else { - print $form->selectyesno($fieldlist[$field],(! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:''),1); + print $form->selectyesno($fieldlist[$field], (! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:''), 1); } print ''; } - elseif (in_array($fieldlist[$field],array('nbjour','decalage','taux','localtax1','localtax2'))) { + elseif (in_array($fieldlist[$field], array('nbjour','decalage','taux','localtax1','localtax2'))) { $align="left"; - if (in_array($fieldlist[$field],array('taux','localtax1','localtax2'))) $align="center"; // Fields aligned on right + if (in_array($fieldlist[$field], array('taux','localtax1','localtax2'))) $align="center"; // Fields aligned on right print ''; @@ -1891,7 +1891,7 @@ function fieldList($fieldlist, $obj='', $tabname='', $context='') } print ''; } - elseif ($fieldlist[$field] == 'price' || preg_match('/^amount/i',$fieldlist[$field])) { + elseif ($fieldlist[$field] == 'price' || preg_match('/^amount/i', $fieldlist[$field])) { print ''; } elseif ($fieldlist[$field] == 'code' && isset($obj->{$fieldlist[$field]})) { diff --git a/htdocs/admin/dolistore/class/PSWebServiceLibrary.class.php b/htdocs/admin/dolistore/class/PSWebServiceLibrary.class.php index c8fcd061689..9c691c88e88 100644 --- a/htdocs/admin/dolistore/class/PSWebServiceLibrary.class.php +++ b/htdocs/admin/dolistore/class/PSWebServiceLibrary.class.php @@ -226,7 +226,7 @@ class PrestaShopWebservice { libxml_clear_errors(); libxml_use_internal_errors(true); - $xml = simplexml_load_string($response,'SimpleXMLElement', LIBXML_NOCDATA); + $xml = simplexml_load_string($response, 'SimpleXMLElement', LIBXML_NOCDATA); if (libxml_get_errors()) { $msg = var_export(libxml_get_errors(), true); diff --git a/htdocs/admin/ecm.php b/htdocs/admin/ecm.php index 3126f432938..87350681754 100644 --- a/htdocs/admin/ecm.php +++ b/htdocs/admin/ecm.php @@ -34,7 +34,7 @@ if (! $user->admin) accessforbidden(); /* * Action */ -if (preg_match('/set_([a-z0-9_\-]+)/i',$action,$reg)) +if (preg_match('/set_([a-z0-9_\-]+)/i', $action, $reg)) { $code=$reg[1]; if (dolibarr_set_const($db, $code, 1, 'chaine', 0, '', $conf->entity) > 0) @@ -48,7 +48,7 @@ if (preg_match('/set_([a-z0-9_\-]+)/i',$action,$reg)) } } -if (preg_match('/del_([a-z0-9_\-]+)/i',$action,$reg)) +if (preg_match('/del_([a-z0-9_\-]+)/i', $action, $reg)) { $code=$reg[1]; if (dolibarr_del_const($db, $code, $conf->entity) > 0) @@ -68,10 +68,10 @@ if (preg_match('/del_([a-z0-9_\-]+)/i',$action,$reg)) */ $help_url=''; -llxHeader('',$langs->trans("ECMSetup"),$help_url); +llxHeader('', $langs->trans("ECMSetup"), $help_url); $linkback=''.$langs->trans("BackToModuleList").''; -print load_fiche_titre($langs->trans("ECMSetup"),$linkback,'title_setup'); +print load_fiche_titre($langs->trans("ECMSetup"), $linkback, 'title_setup'); print '
'; print '
  '; //print join(',',$fieldlist); @@ -1800,7 +1800,7 @@ function fieldList($fieldlist, $obj='', $tabname='', $context='') } elseif ($fieldlist[$field] == 'country_id') { - if (! in_array('country',$fieldlist)) // If there is already a field country, we don't show country_id (avoid duplicate) + if (! in_array('country', $fieldlist)) // If there is already a field country, we don't show country_id (avoid duplicate) { $country_id = (! empty($obj->{$fieldlist[$field]}) ? $obj->{$fieldlist[$field]} : 0); print ''; @@ -1811,7 +1811,7 @@ function fieldList($fieldlist, $obj='', $tabname='', $context='') elseif ($fieldlist[$field] == 'region') { print ''; - $formcompany->select_region($region_id,'region'); + $formcompany->select_region($region_id, 'region'); print ''; - print $formadmin->select_language($conf->global->MAIN_LANG_DEFAULT,'lang'); + print $formadmin->select_language($conf->global->MAIN_LANG_DEFAULT, 'lang'); print ''; - print $form->selectarray('element', $elementList,(! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:'')); + print $form->selectarray('element', $elementList, (! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:'')); print ''; - print $form->selectarray('source', $sourceList,(! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:'')); + print $form->selectarray('source', $sourceList, (! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:'')); print ''; - print $form->selectyesno("private",(! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:'')); + print $form->selectyesno("private", (! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:'')); print ''; print ''; print '
'; @@ -98,11 +98,11 @@ else { if (empty($conf->global->ECM_AUTO_TREE_ENABLED)) { - print ''.img_picto($langs->trans("Disabled"),'off').''; + print ''.img_picto($langs->trans("Disabled"), 'off').''; } else if(! empty($conf->global->USER_MAIL_REQUIRED)) { - print ''.img_picto($langs->trans("Enabled"),'on').''; + print ''.img_picto($langs->trans("Enabled"), 'on').''; } } print ''; diff --git a/htdocs/admin/emailcollector_card.php b/htdocs/admin/emailcollector_card.php index 12dd01d20f8..de4959354db 100644 --- a/htdocs/admin/emailcollector_card.php +++ b/htdocs/admin/emailcollector_card.php @@ -45,7 +45,7 @@ $ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09'); $confirm = GETPOST('confirm', 'alpha'); $cancel = GETPOST('cancel', 'aZ09'); -$contextpage= GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'myobjectcard'; // To manage different context of search +$contextpage= GETPOST('contextpage', 'aZ')?GETPOST('contextpage', 'aZ'):'myobjectcard'; // To manage different context of search $backtopage = GETPOST('backtopage', 'alpha'); // Initialize technical objects @@ -61,7 +61,7 @@ $search_array_options = $extrafields->getOptionalsFromPost($object->table_elemen $search_all = trim(GETPOST("search_all", 'alpha')); $search = array(); foreach ($object->fields as $key => $val) { - if (GETPOST('search_'.$key,'alpha')) $search[$key]=GETPOST('search_'.$key,'alpha'); + if (GETPOST('search_'.$key, 'alpha')) $search[$key]=GETPOST('search_'.$key, 'alpha'); } if (empty($action) && empty($id) && empty($ref)) $action='view'; @@ -103,10 +103,10 @@ if (empty($reshook)) include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php'; } -if (GETPOST('addfilter','alpha')) +if (GETPOST('addfilter', 'alpha')) { $emailcollectorfilter = new EmailCollectorFilter($db); - $emailcollectorfilter->type = GETPOST('filtertype','az09'); + $emailcollectorfilter->type = GETPOST('filtertype', 'az09'); $emailcollectorfilter->rulevalue = GETPOST('rulevalue', 'alpha'); $emailcollectorfilter->fk_emailcollector = $object->id; $emailcollectorfilter->status = 1; @@ -125,7 +125,7 @@ if (GETPOST('addfilter','alpha')) if ($action == 'deletefilter') { $emailcollectorfilter = new EmailCollectorFilter($db); - $emailcollectorfilter->fetch(GETPOST('filterid','int')); + $emailcollectorfilter->fetch(GETPOST('filterid', 'int')); $result = $emailcollectorfilter->delete($user); if ($result > 0) { @@ -137,10 +137,10 @@ if ($action == 'deletefilter') } } -if (GETPOST('addoperation','alpha')) +if (GETPOST('addoperation', 'alpha')) { $emailcollectoroperation = new EmailCollectorAction($db); - $emailcollectoroperation->type = GETPOST('operationtype','az09'); + $emailcollectoroperation->type = GETPOST('operationtype', 'az09'); $emailcollectoroperation->actionparam = GETPOST('operationparam', 'none'); $emailcollectoroperation->fk_emailcollector = $object->id; $emailcollectoroperation->status = 1; @@ -161,7 +161,7 @@ if (GETPOST('addoperation','alpha')) if ($action == 'deleteoperation') { $emailcollectoroperation = new EmailCollectorAction($db); - $emailcollectoroperation->fetch(GETPOST('operationid','int')); + $emailcollectoroperation->fetch(GETPOST('operationid', 'int')); $result = $emailcollectoroperation->delete($user); if ($result > 0) { diff --git a/htdocs/admin/emailcollector_list.php b/htdocs/admin/emailcollector_list.php index f388cea8b55..84534362e69 100644 --- a/htdocs/admin/emailcollector_list.php +++ b/htdocs/admin/emailcollector_list.php @@ -36,24 +36,24 @@ if (!$user->admin) accessforbidden(); // Load traductions files requiredby by page $langs->loadLangs(array("admin", "other")); -$action = GETPOST('action','aZ09')?GETPOST('action','aZ09'):'view'; // The action 'add', 'create', 'edit', 'update', 'view', ... -$massaction = GETPOST('massaction','alpha'); // The bulk action (combo box choice into lists) -$show_files = GETPOST('show_files','int'); // Show files area generated by bulk actions ? -$confirm = GETPOST('confirm','alpha'); // Result of a confirmation +$action = GETPOST('action', 'aZ09')?GETPOST('action', 'aZ09'):'view'; // The action 'add', 'create', 'edit', 'update', 'view', ... +$massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists) +$show_files = GETPOST('show_files', 'int'); // Show files area generated by bulk actions ? +$confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation $cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button $toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list -$contextpage= GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'emailcollectorlist'; // To manage different context of search -$backtopage = GETPOST('backtopage','alpha'); // Go back to a dedicated page -$optioncss = GETPOST('optioncss','aZ'); // Option for the css output (always '' except when 'print') +$contextpage= GETPOST('contextpage', 'aZ')?GETPOST('contextpage', 'aZ'):'emailcollectorlist'; // To manage different context of search +$backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page +$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') -$id = GETPOST('id','int'); +$id = GETPOST('id', 'int'); // Load variable for pagination -$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit; -$sortfield = GETPOST('sortfield','alpha'); -$sortorder = GETPOST('sortorder','alpha'); -$page = GETPOST('page','int'); -if (empty($page) || $page == -1 || GETPOST('button_search','alpha') || GETPOST('button_removefilter','alpha') || (empty($toselect) && $massaction === '0')) { $page = 0; } // If $page is not defined, or '' or -1 or if we click on clear filters or if we select empty mass action +$limit = GETPOST('limit', 'int')?GETPOST('limit', 'int'):$conf->liste_limit; +$sortfield = GETPOST('sortfield', 'alpha'); +$sortorder = GETPOST('sortorder', 'alpha'); +$page = GETPOST('page', 'int'); +if (empty($page) || $page == -1 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha') || (empty($toselect) && $massaction === '0')) { $page = 0; } // If $page is not defined, or '' or -1 or if we click on clear filters or if we select empty mass action $offset = $limit * $page; $pageprev = $page - 1; $pagenext = $page + 1; @@ -83,11 +83,11 @@ if ($user->societe_id > 0) // Protection if external user //$result = restrictedArea($user, 'emailcollector', $id, ''); // Initialize array of search criterias -$search_all=trim(GETPOST("search_all",'alpha')); +$search_all=trim(GETPOST("search_all", 'alpha')); $search=array(); foreach($object->fields as $key => $val) { - if (GETPOST('search_'.$key,'alpha')) $search[$key]=GETPOST('search_'.$key,'alpha'); + if (GETPOST('search_'.$key, 'alpha')) $search[$key]=GETPOST('search_'.$key, 'alpha'); } // List of fields to search into when doing a "search in all" @@ -122,8 +122,8 @@ $arrayfields = dol_sort_array($arrayfields, 'position'); * Actions */ -if (GETPOST('cancel','alpha')) { $action='list'; $massaction=''; } -if (! GETPOST('confirmmassaction','alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; } +if (GETPOST('cancel', 'alpha')) { $action='list'; $massaction=''; } +if (! GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; } $parameters=array(); $reshook=$hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks @@ -135,7 +135,7 @@ if (empty($reshook)) include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; // Purge search criteria - if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') ||GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers + if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') ||GETPOST('button_removefilter', 'alpha')) // All tests are required to be compatible with all browsers { foreach($object->fields as $key => $val) { @@ -144,8 +144,8 @@ if (empty($reshook)) $toselect=''; $search_array_options=array(); } - if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha') - || GETPOST('button_search_x','alpha') || GETPOST('button_search.x','alpha') || GETPOST('button_search','alpha')) + if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha') + || GETPOST('button_search_x', 'alpha') || GETPOST('button_search.x', 'alpha') || GETPOST('button_search', 'alpha')) { $massaction=''; // Protection to avoid mass action if we force a new search during a mass action confirmation } @@ -188,7 +188,7 @@ if (! empty($extrafields->attributes[$object->table_element]['label'])) $parameters=array(); $reshook=$hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook $sql.=$hookmanager->resPrint; -$sql=preg_replace('/, $/','', $sql); +$sql=preg_replace('/, $/', '', $sql); $sql.= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t"; if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (t.rowid = ef.fk_object)"; if ($object->ismultientitymanaged == 1) $sql.= " WHERE t.entity IN (".getEntity($object->element).")"; @@ -223,7 +223,7 @@ $sql.=$hookmanager->resPrint; $sql=preg_replace('/, $/','', $sql); */ -$sql.=$db->order($sortfield,$sortorder); +$sql.=$db->order($sortfield, $sortorder); // Count total nb of records $nbtotalofrecords = ''; @@ -305,7 +305,7 @@ $arrayofmassactions = array( //'builddoc'=>$langs->trans("PDFMerge"), ); if ($user->rights->emailcollector->delete) $arrayofmassactions['predelete']=$langs->trans("Delete"); -if (GETPOST('nomassaction','int') || in_array($massaction, array('presend','predelete'))) $arrayofmassactions=array(); +if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend','predelete'))) $arrayofmassactions=array(); $massactionbutton=$form->selectMassAction('', $arrayofmassactions); print ''; @@ -338,7 +338,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php'; if ($sall) { foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val); - print '
'.$langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall).'
'; + print '
'.$langs->trans("FilterOnInto", $sall) . join(', ', $fieldstosearchall).'
'; } $moreforfilter = ''; @@ -412,7 +412,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; $parameters=array('arrayfields'=>$arrayfields,'param'=>$param,'sortfield'=>$sortfield,'sortorder'=>$sortorder); $reshook=$hookmanager->executeHooks('printFieldListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; -print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"],'','','','align="center"',$sortfield,$sortorder,'maxwidthsearch ')."\n"; +print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', 'align="center"', $sortfield, $sortorder, 'maxwidthsearch ')."\n"; print ''."\n"; @@ -422,7 +422,7 @@ if (is_array($extrafields->attributes[$object->table_element]['computed']) && co { foreach ($extrafields->attributes[$object->table_element]['computed'] as $key => $val) { - if (preg_match('/\$object/',$val)) $needToFetchEachLine++; // There is at least one compute field that use $object + if (preg_match('/\$object/', $val)) $needToFetchEachLine++; // There is at least one compute field that use $object } } @@ -537,7 +537,7 @@ print ''."\n"; print ''."\n"; -if (in_array('builddoc',$arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) +if (in_array('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { $hidegeneratedfilelistifempty=1; if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) $hidegeneratedfilelistifempty=0; @@ -547,13 +547,13 @@ if (in_array('builddoc',$arrayofmassactions) && ($nbtotalofrecords === '' || $nb // Show list of available documents $urlsource=$_SERVER['PHP_SELF'].'?sortfield='.$sortfield.'&sortorder='.$sortorder; - $urlsource.=str_replace('&','&',$param); + $urlsource.=str_replace('&', '&', $param); $filedir=$diroutputmassaction; $genallowed=$user->rights->emailcollector->read; $delallowed=$user->rights->emailcollector->create; - print $formfile->showdocuments('massfilesarea_emailcollector','',$filedir,$urlsource,0,$delallowed,'',1,1,0,48,1,$param,$title,'','','',null,$hidegeneratedfilelistifempty); + print $formfile->showdocuments('massfilesarea_emailcollector', '', $filedir, $urlsource, 0, $delallowed, '', 1, 1, 0, 48, 1, $param, $title, '', '', '', null, $hidegeneratedfilelistifempty); } // End of page diff --git a/htdocs/admin/events.php b/htdocs/admin/events.php index 347f4c27489..f6e731aaee6 100644 --- a/htdocs/admin/events.php +++ b/htdocs/admin/events.php @@ -34,7 +34,7 @@ accessforbidden(); // Load translation files required by the page $langs->loadLangs(array("users","admin","other")); -$action=GETPOST('action','aZ09'); +$action=GETPOST('action', 'aZ09'); $securityevent=new Events($db); @@ -54,8 +54,8 @@ if ($action == "save") { $param='MAIN_LOGEVENTS_'.$arr['id']; //print "param=".$param." - ".$_POST[$param]; - if (! empty($_POST[$param])) dolibarr_set_const($db,$param,$_POST[$param],'chaine',0,'',$conf->entity); - else dolibarr_del_const($db,$param,$conf->entity); + if (! empty($_POST[$param])) dolibarr_set_const($db, $param, $_POST[$param], 'chaine', 0, '', $conf->entity); + else dolibarr_del_const($db, $param, $conf->entity); } $db->commit(); @@ -69,10 +69,10 @@ if ($action == "save") */ $wikihelp='EN:Setup_Security|FR:Paramétrage_Sécurité|ES:Configuración_Seguridad'; -llxHeader('',$langs->trans("Audit"),$wikihelp); +llxHeader('', $langs->trans("Audit"), $wikihelp); //$linkback=''.$langs->trans("BackToModuleList").''; -print load_fiche_titre($langs->trans("SecuritySetup"),'','title_setup'); +print load_fiche_titre($langs->trans("SecuritySetup"), '', 'title_setup'); print $langs->trans("LogEventDesc", $langs->transnoentitiesnoconv("AdminTools"), $langs->transnoentitiesnoconv("Audit"))."
\n"; print "
\n"; diff --git a/htdocs/admin/expedition.php b/htdocs/admin/expedition.php index 2ae3a7cad99..020c61688c0 100644 --- a/htdocs/admin/expedition.php +++ b/htdocs/admin/expedition.php @@ -40,10 +40,10 @@ $langs->loadLangs(array("admin", "sendings", "deliveries", "other")); if (! $user->admin) accessforbidden(); -$action=GETPOST('action','alpha'); -$value=GETPOST('value','alpha'); -$label = GETPOST('label','alpha'); -$scandir = GETPOST('scan_dir','alpha'); +$action=GETPOST('action', 'alpha'); +$value=GETPOST('value', 'alpha'); +$label = GETPOST('label', 'alpha'); +$scandir = GETPOST('scan_dir', 'alpha'); $type='shipping'; if (empty($conf->global->EXPEDITION_ADDON_NUMBER)) @@ -60,10 +60,10 @@ include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php'; if ($action == 'updateMask') { - $maskconst=GETPOST('maskconstexpedition','alpha'); - $maskvalue=GETPOST('maskexpedition','alpha'); + $maskconst=GETPOST('maskconstexpedition', 'alpha'); + $maskvalue=GETPOST('maskexpedition', 'alpha'); if (! empty($maskconst)) - $res = dolibarr_set_const($db,$maskconst,$maskvalue,'chaine',0,'',$conf->entity); + $res = dolibarr_set_const($db, $maskconst, $maskvalue, 'chaine', 0, '', $conf->entity); if (isset($res)) { @@ -76,16 +76,16 @@ if ($action == 'updateMask') else if ($action == 'set_param') { - $freetext=GETPOST('SHIPPING_FREE_TEXT','none'); // No alpha here, we want exact string - $res = dolibarr_set_const($db, "SHIPPING_FREE_TEXT",$freetext,'chaine',0,'',$conf->entity); + $freetext=GETPOST('SHIPPING_FREE_TEXT', 'none'); // No alpha here, we want exact string + $res = dolibarr_set_const($db, "SHIPPING_FREE_TEXT", $freetext, 'chaine', 0, '', $conf->entity); if ($res <= 0) { $error++; setEventMessages($langs->trans("Error"), null, 'errors'); } - $draft=GETPOST('SHIPPING_DRAFT_WATERMARK','alpha'); - $res = dolibarr_set_const($db, "SHIPPING_DRAFT_WATERMARK",trim($draft),'chaine',0,'',$conf->entity); + $draft=GETPOST('SHIPPING_DRAFT_WATERMARK', 'alpha'); + $res = dolibarr_set_const($db, "SHIPPING_DRAFT_WATERMARK", trim($draft), 'chaine', 0, '', $conf->entity); if ($res <= 0) { $error++; @@ -100,17 +100,17 @@ else if ($action == 'set_param') else if ($action == 'specimen') { - $modele=GETPOST('module','alpha'); + $modele=GETPOST('module', 'alpha'); $exp = new Expedition($db); $exp->initAsSpecimen(); // Search template files $file=''; $classname=''; $filefound=0; - $dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']); + $dirmodels=array_merge(array('/'), (array) $conf->modules_parts['models']); foreach($dirmodels as $reldir) { - $file=dol_buildpath($reldir."core/modules/expedition/doc/pdf_".$modele.".modules.php",0); + $file=dol_buildpath($reldir."core/modules/expedition/doc/pdf_".$modele.".modules.php", 0); if (file_exists($file)) { $filefound=1; @@ -125,7 +125,7 @@ else if ($action == 'specimen') $module = new $classname($db); - if ($module->write_file($exp,$langs) > 0) + if ($module->write_file($exp, $langs) > 0) { header("Location: ".DOL_URL_ROOT."/document.php?modulepart=expedition&file=SPECIMEN.pdf"); return; @@ -154,14 +154,14 @@ else if ($action == 'del') $ret = delDocumentModel($value, $type); if ($ret > 0) { - if ($conf->global->EXPEDITION_ADDON_PDF == "$value") dolibarr_del_const($db, 'EXPEDITION_ADDON_PDF',$conf->entity); + if ($conf->global->EXPEDITION_ADDON_PDF == "$value") dolibarr_del_const($db, 'EXPEDITION_ADDON_PDF', $conf->entity); } } // Set default model else if ($action == 'setdoc') { - if (dolibarr_set_const($db, "EXPEDITION_ADDON_PDF",$value,'chaine',0,'',$conf->entity)) + if (dolibarr_set_const($db, "EXPEDITION_ADDON_PDF", $value, 'chaine', 0, '', $conf->entity)) { // La constante qui a ete lue en avant du nouveau set // on passe donc par une variable pour avoir un affichage coherent @@ -178,7 +178,7 @@ else if ($action == 'setdoc') else if ($action == 'setmodel') { - dolibarr_set_const($db, "EXPEDITION_ADDON_NUMBER",$value,'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "EXPEDITION_ADDON_NUMBER", $value, 'chaine', 0, '', $conf->entity); } @@ -186,14 +186,14 @@ else if ($action == 'setmodel') * View */ -$dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']); +$dirmodels=array_merge(array('/'), (array) $conf->modules_parts['models']); $form=new Form($db); -llxHeader("",$langs->trans("SendingsSetup")); +llxHeader("", $langs->trans("SendingsSetup")); $linkback=''.$langs->trans("BackToModuleList").''; -print load_fiche_titre($langs->trans("SendingsSetup"),$linkback,'title_setup'); +print load_fiche_titre($langs->trans("SendingsSetup"), $linkback, 'title_setup'); print '
'; $head = expedition_admin_prepare_head(); @@ -247,7 +247,7 @@ foreach ($dirmodels as $reldir) // Show example of numbering module print ''; @@ -273,11 +273,11 @@ foreach ($dirmodels as $reldir) // Info $htmltooltip=''; $htmltooltip.=''.$langs->trans("Version").': '.$module->getVersion().'
'; - $nextval=$module->getNextValue($mysoc,$expedition); + $nextval=$module->getNextValue($mysoc, $expedition); if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval $htmltooltip.=''.$langs->trans("NextValue").': '; if ($nextval) { - if (preg_match('/^Error/',$nextval) || $nextval=='NotConfigured') + if (preg_match('/^Error/', $nextval) || $nextval=='NotConfigured') $nextval = $langs->trans($nextval); $htmltooltip.=$nextval.'
'; } else { @@ -286,7 +286,7 @@ foreach ($dirmodels as $reldir) } print ''; print ''; @@ -364,7 +364,7 @@ foreach ($dirmodels as $reldir) foreach($filelist as $file) { - if (preg_match('/\.modules\.php$/i',$file) && preg_match('/^(pdf_|doc_)/',$file)) + if (preg_match('/\.modules\.php$/i', $file) && preg_match('/^(pdf_|doc_)/', $file)) { if (file_exists($dir.'/'.$file)) @@ -384,7 +384,7 @@ foreach ($dirmodels as $reldir) print ''; @@ -393,14 +393,14 @@ foreach ($dirmodels as $reldir) { print ''; } else { print '"; } @@ -408,11 +408,11 @@ foreach ($dirmodels as $reldir) print ''; @@ -424,25 +424,25 @@ foreach ($dirmodels as $reldir) $htmltooltip.='
'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur; } $htmltooltip.='

'.$langs->trans("FeaturesSupported").':'; - $htmltooltip.='
'.$langs->trans("Logo").': '.yn($module->option_logo,1,1); - $htmltooltip.='
'.$langs->trans("PaymentMode").': '.yn($module->option_modereg,1,1); - $htmltooltip.='
'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg,1,1); - $htmltooltip.='
'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang,1,1); - $htmltooltip.='
'.$langs->trans("WatermarkOnDraftOrders").': '.yn($module->option_draft_watermark,1,1); + $htmltooltip.='
'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1); + $htmltooltip.='
'.$langs->trans("PaymentMode").': '.yn($module->option_modereg, 1, 1); + $htmltooltip.='
'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg, 1, 1); + $htmltooltip.='
'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang, 1, 1); + $htmltooltip.='
'.$langs->trans("WatermarkOnDraftOrders").': '.yn($module->option_draft_watermark, 1, 1); print ''; // Preview print ''; @@ -491,7 +491,7 @@ if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) else { include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor=new DolEditor($variablename, $conf->global->$variablename,'',80,'dolibarr_notes'); + $doleditor=new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes'); print $doleditor->Create(); } print "\n"; diff --git a/htdocs/admin/expedition_extrafields.php b/htdocs/admin/expedition_extrafields.php index 87682fe7514..9ef686962ed 100644 --- a/htdocs/admin/expedition_extrafields.php +++ b/htdocs/admin/expedition_extrafields.php @@ -68,10 +68,10 @@ require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php'; $textobject=$langs->transnoentitiesnoconv("Sendings"); -llxHeader('',$langs->trans("SendingsSetup")); +llxHeader('', $langs->trans("SendingsSetup")); $linkback=''.$langs->trans("BackToModuleList").''; -print load_fiche_titre($langs->trans("SendingsSetup"),$linkback,'title_setup'); +print load_fiche_titre($langs->trans("SendingsSetup"), $linkback, 'title_setup'); print "
\n"; $head = expedition_admin_prepare_head(); diff --git a/htdocs/admin/expeditiondet_extrafields.php b/htdocs/admin/expeditiondet_extrafields.php index e533ca64ac3..9c0fa60f12a 100644 --- a/htdocs/admin/expeditiondet_extrafields.php +++ b/htdocs/admin/expeditiondet_extrafields.php @@ -69,10 +69,10 @@ require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php'; $textobject=$langs->transnoentitiesnoconv("Sendings"); -llxHeader('',$langs->trans("SendingsSetup")); +llxHeader('', $langs->trans("SendingsSetup")); $linkback=''.$langs->trans("BackToModuleList").''; -print load_fiche_titre($langs->trans("SendingsSetup"),$linkback,'title_setup'); +print load_fiche_titre($langs->trans("SendingsSetup"), $linkback, 'title_setup'); print "
\n"; $head = expedition_admin_prepare_head(); diff --git a/htdocs/admin/expensereport.php b/htdocs/admin/expensereport.php index f8429069611..00b582096f0 100644 --- a/htdocs/admin/expensereport.php +++ b/htdocs/admin/expensereport.php @@ -39,10 +39,10 @@ $langs->loadLangs(array('admin', 'errors', 'trips', 'other')); if (! $user->admin) accessforbidden(); -$action = GETPOST('action','alpha'); -$value = GETPOST('value','alpha'); -$label = GETPOST('label','alpha'); -$scandir = GETPOST('scan_dir','alpha'); +$action = GETPOST('action', 'alpha'); +$value = GETPOST('value', 'alpha'); +$label = GETPOST('label', 'alpha'); +$scandir = GETPOST('scan_dir', 'alpha'); $type='expensereport'; @@ -54,9 +54,9 @@ include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php'; if ($action == 'updateMask') { - $maskconst=GETPOST('maskconst','alpha'); - $maskvalue=GETPOST('maskvalue','alpha'); - if ($maskconst) $res = dolibarr_set_const($db,$maskconst,$maskvalue,'chaine',0,'',$conf->entity); + $maskconst=GETPOST('maskconst', 'alpha'); + $maskvalue=GETPOST('maskvalue', 'alpha'); + if ($maskconst) $res = dolibarr_set_const($db, $maskconst, $maskvalue, 'chaine', 0, '', $conf->entity); if (! $res > 0) $error++; @@ -72,7 +72,7 @@ if ($action == 'updateMask') else if ($action == 'specimen') // For fiche inter { - $modele= GETPOST('module','alpha'); + $modele= GETPOST('module', 'alpha'); $inter = new ExpenseReport($db); $inter->initAsSpecimen(); @@ -81,10 +81,10 @@ else if ($action == 'specimen') // For fiche inter // Search template files $file=''; $classname=''; $filefound=0; - $dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']); + $dirmodels=array_merge(array('/'), (array) $conf->modules_parts['models']); foreach($dirmodels as $reldir) { - $file=dol_buildpath($reldir."core/modules/expensereport/doc/pdf_".$modele.".modules.php",0); + $file=dol_buildpath($reldir."core/modules/expensereport/doc/pdf_".$modele.".modules.php", 0); if (file_exists($file)) { $filefound=1; @@ -99,14 +99,14 @@ else if ($action == 'specimen') // For fiche inter $module = new $classname($db); - if ($module->write_file($inter,$langs) > 0) + if ($module->write_file($inter, $langs) > 0) { header("Location: ".DOL_URL_ROOT."/document.php?modulepart=expensereport&file=SPECIMEN.pdf"); return; } else { - setEventMessages($module->error, $module->errors,'errors'); + setEventMessages($module->error, $module->errors, 'errors'); dol_syslog($module->error, LOG_ERR); } } @@ -123,7 +123,7 @@ else if ($action == 'set') $ret = addDocumentModel($value, $type, $label, $scandir); if ($ret > 0 && empty($conf->global->EXPENSEREPORT_ADDON_PDF)) { - dolibarr_set_const($db, 'EXPENSEREPORT_ADDON_PDF', $value,'chaine',0,'',$conf->entity); + dolibarr_set_const($db, 'EXPENSEREPORT_ADDON_PDF', $value, 'chaine', 0, '', $conf->entity); } } @@ -132,14 +132,14 @@ else if ($action == 'del') $ret = delDocumentModel($value, $type); if ($ret > 0) { - if ($conf->global->EXPENSEREPORT_ADDON_PDF == "$value") dolibarr_del_const($db, 'EXPENSEREPORT_ADDON_PDF',$conf->entity); + if ($conf->global->EXPENSEREPORT_ADDON_PDF == "$value") dolibarr_del_const($db, 'EXPENSEREPORT_ADDON_PDF', $conf->entity); } } // Set default model else if ($action == 'setdoc') { - if (dolibarr_set_const($db, "EXPENSEREPORT_ADDON_PDF",$value,'chaine',0,'',$conf->entity)) + if (dolibarr_set_const($db, "EXPENSEREPORT_ADDON_PDF", $value, 'chaine', 0, '', $conf->entity)) { // La constante qui a ete lue en avant du nouveau set // on passe donc par une variable pour avoir un affichage coherent @@ -159,18 +159,18 @@ else if ($action == 'setmod') // TODO Verifier si module numerotation choisi peut etre active // par appel methode canBeActivated - dolibarr_set_const($db, "EXPENSEREPORT_ADDON",$value,'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "EXPENSEREPORT_ADDON", $value, 'chaine', 0, '', $conf->entity); } else if ($action == 'setoptions') { $db->begin(); - $freetext= GETPOST('EXPENSEREPORT_FREE_TEXT','none'); // No alpha here, we want exact string - $res1 = dolibarr_set_const($db, "EXPENSEREPORT_FREE_TEXT",$freetext,'chaine',0,'',$conf->entity); + $freetext= GETPOST('EXPENSEREPORT_FREE_TEXT', 'none'); // No alpha here, we want exact string + $res1 = dolibarr_set_const($db, "EXPENSEREPORT_FREE_TEXT", $freetext, 'chaine', 0, '', $conf->entity); - $draft= GETPOST('EXPENSEREPORT_DRAFT_WATERMARK','alpha'); - $res2 = dolibarr_set_const($db, "EXPENSEREPORT_DRAFT_WATERMARK",trim($draft),'chaine',0,'',$conf->entity); + $draft= GETPOST('EXPENSEREPORT_DRAFT_WATERMARK', 'alpha'); + $res2 = dolibarr_set_const($db, "EXPENSEREPORT_DRAFT_WATERMARK", trim($draft), 'chaine', 0, '', $conf->entity); if (! $res1 > 0 || ! $res2 > 0) $error++; @@ -191,14 +191,14 @@ else if ($action == 'setoptions') * View */ -$dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']); +$dirmodels=array_merge(array('/'), (array) $conf->modules_parts['models']); -llxHeader('',$langs->trans("ExpenseReportsSetup")); +llxHeader('', $langs->trans("ExpenseReportsSetup")); $form=new Form($db); $linkback=''.$langs->trans("BackToModuleList").''; -print load_fiche_titre($langs->trans("ExpenseReportsSetup"),$linkback,'title_setup'); +print load_fiche_titre($langs->trans("ExpenseReportsSetup"), $linkback, 'title_setup'); $head=expensereport_admin_prepare_head(); @@ -209,7 +209,7 @@ dol_fiche_head($head, 'expensereport', $langs->trans("ExpenseReports"), -1, 'tri * Expense report numbering model */ -print load_fiche_titre($langs->trans("ExpenseReportNumberingModules"),'',''); +print load_fiche_titre($langs->trans("ExpenseReportNumberingModules"), '', ''); print '
'; $tmp=$module->getExample(); - if (preg_match('/^Error/',$tmp)) { + if (preg_match('/^Error/', $tmp)) { $langs->load("errors"); print '
'.$langs->trans($tmp).'
'; } elseif ($tmp=='NotConfigured') print $langs->trans($tmp); @@ -257,12 +257,12 @@ foreach ($dirmodels as $reldir) print '
'; if ($conf->global->EXPEDITION_ADDON_NUMBER == "$file") { - print img_picto($langs->trans("Activated"),'switch_on'); + print img_picto($langs->trans("Activated"), 'switch_on'); } else { print 'scandir.'&label='.urlencode($module->name).'">'; - print img_picto($langs->trans("Disabled"),'switch_off'); + print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; } print ''; - print $form->textwithpicto('',$htmltooltip,1,0); + print $form->textwithpicto('', $htmltooltip, 1, 0); print '
'; print (empty($module->name)?$name:$module->name); print "\n"; - if (method_exists($module,'info')) print $module->info($langs); + if (method_exists($module, 'info')) print $module->info($langs); else print $module->description; print ''."\n"; print ''; - print img_picto($langs->trans("Enabled"),'switch_on'); + print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; print ''."\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').''; + print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print "'; if ($conf->global->EXPEDITION_ADDON_PDF == $name) { - print img_picto($langs->trans("Default"),'on'); + print img_picto($langs->trans("Default"), 'on'); } else { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').''; + print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; - print $form->textwithpicto('',$htmltooltip,1,0); + print $form->textwithpicto('', $htmltooltip, 1, 0); print ''; if ($module->type == 'pdf') { - print 'scandir.'&label='.urlencode($module->name).'">'.img_object($langs->trans("Preview"),'sending').''; + print 'scandir.'&label='.urlencode($module->name).'">'.img_object($langs->trans("Preview"), 'sending').''; } else { - print img_object($langs->trans("PreviewNotAvailable"),'generic'); + print img_object($langs->trans("PreviewNotAvailable"), 'generic'); } print '
'; print ''; @@ -255,7 +255,7 @@ foreach ($dirmodels as $reldir) // Show example of numbering model print ''."\n"; @@ -263,12 +263,12 @@ foreach ($dirmodels as $reldir) print ''; @@ -283,7 +283,7 @@ foreach ($dirmodels as $reldir) if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval $htmltooltip.=''.$langs->trans("NextValue").': '; if ($nextval) { - if (preg_match('/^Error/',$nextval) || $nextval=='NotConfigured') + if (preg_match('/^Error/', $nextval) || $nextval=='NotConfigured') $nextval = $langs->trans($nextval); $htmltooltip.=$nextval.'
'; } else { @@ -292,7 +292,7 @@ foreach ($dirmodels as $reldir) } print ''; print "\n"; @@ -365,7 +365,7 @@ foreach ($dirmodels as $reldir) foreach($filelist as $file) { - if (preg_match('/\.modules\.php$/i',$file) && preg_match('/^(pdf_|doc_)/',$file)) + if (preg_match('/\.modules\.php$/i', $file) && preg_match('/^(pdf_|doc_)/', $file)) { if (file_exists($dir.'/'.$file)) @@ -386,7 +386,7 @@ foreach ($dirmodels as $reldir) print ''; @@ -395,14 +395,14 @@ foreach ($dirmodels as $reldir) { print ""; } else { print ""; } @@ -410,11 +410,11 @@ foreach ($dirmodels as $reldir) print "'; @@ -423,24 +423,24 @@ foreach ($dirmodels as $reldir) $htmltooltip.='
'.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown")); $htmltooltip.='
'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur; $htmltooltip.='

'.$langs->trans("FeaturesSupported").':'; - $htmltooltip.='
'.$langs->trans("Logo").': '.yn($module->option_logo,1,1); - $htmltooltip.='
'.$langs->trans("PaymentMode").': '.yn($module->option_modereg,1,1); - $htmltooltip.='
'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg,1,1); - $htmltooltip.='
'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang,1,1); - $htmltooltip.='
'.$langs->trans("WatermarkOnDraftOrders").': '.yn($module->option_draft_watermark,1,1); + $htmltooltip.='
'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1); + $htmltooltip.='
'.$langs->trans("PaymentMode").': '.yn($module->option_modereg, 1, 1); + $htmltooltip.='
'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg, 1, 1); + $htmltooltip.='
'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang, 1, 1); + $htmltooltip.='
'.$langs->trans("WatermarkOnDraftOrders").': '.yn($module->option_draft_watermark, 1, 1); print ''; // Preview print ''; @@ -491,7 +491,7 @@ if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) else { include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor=new DolEditor($variablename, $conf->global->$variablename,'',80,'dolibarr_notes'); + $doleditor=new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes'); print $doleditor->Create(); } print ''."\n"; diff --git a/htdocs/admin/expensereport_extrafields.php b/htdocs/admin/expensereport_extrafields.php index 99de68e9e14..8d102bc8328 100644 --- a/htdocs/admin/expensereport_extrafields.php +++ b/htdocs/admin/expensereport_extrafields.php @@ -65,10 +65,10 @@ require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php'; $textobject=$langs->transnoentitiesnoconv("expensereports"); -llxHeader('',$langs->trans("ExpenseReportsSetup")); +llxHeader('', $langs->trans("ExpenseReportsSetup")); $linkback=''.$langs->trans("BackToModuleList").''; -print load_fiche_titre($langs->trans("ExpenseReportsSetup"),$linkback,'title_setup'); +print load_fiche_titre($langs->trans("ExpenseReportsSetup"), $linkback, 'title_setup'); $head = expensereport_admin_prepare_head(); diff --git a/htdocs/admin/expensereport_ik.php b/htdocs/admin/expensereport_ik.php index 0f01fa7a750..e79e7888f69 100644 --- a/htdocs/admin/expensereport_ik.php +++ b/htdocs/admin/expensereport_ik.php @@ -39,10 +39,10 @@ if (!$user->admin) accessforbidden(); $error = false; $message = false; -$action = GETPOST('action','alpha'); -$id = GETPOST('id','int'); -$offset = GETPOST('offset','int'); -$coef = GETPOST('coef','int'); +$action = GETPOST('action', 'alpha'); +$id = GETPOST('id', 'int'); +$offset = GETPOST('offset', 'int'); +$coef = GETPOST('coef', 'int'); $fk_c_exp_tax_cat = GETPOST('fk_c_exp_tax_cat'); $fk_range = GETPOST('fk_range'); @@ -86,12 +86,12 @@ $rangesbycateg = ExpenseReportIk::getAllRanges(); * View */ -llxHeader('',$langs->trans("ExpenseReportsSetup")); +llxHeader('', $langs->trans("ExpenseReportsSetup")); $form=new Form($db); $linkback=''.$langs->trans("BackToModuleList").''; -print load_fiche_titre($langs->trans("ExpenseReportsIkSetup"),$linkback,'title_setup'); +print load_fiche_titre($langs->trans("ExpenseReportsIkSetup"), $linkback, 'title_setup'); $head=expensereport_admin_prepare_head(); dol_fiche_head($head, 'expenseik', $langs->trans("ExpenseReportsIk"), -1, 'trip'); diff --git a/htdocs/admin/expensereport_rules.php b/htdocs/admin/expensereport_rules.php index 8594d060951..835a4b2b824 100644 --- a/htdocs/admin/expensereport_rules.php +++ b/htdocs/admin/expensereport_rules.php @@ -40,8 +40,8 @@ if (!$user->admin) accessforbidden(); $error = false; $message = false; -$action = GETPOST('action','alpha'); -$id = GETPOST('id','int'); +$action = GETPOST('action', 'alpha'); +$id = GETPOST('id', 'int'); $apply_to = GETPOST('apply_to'); $fk_user = GETPOST('fk_user'); @@ -143,12 +143,12 @@ $tab_rules_type = array('EX_DAY' => $langs->trans('Day'), 'EX_MON' => $langs->tr * View */ -llxHeader('',$langs->trans("ExpenseReportsSetup")); +llxHeader('', $langs->trans("ExpenseReportsSetup")); $form=new Form($db); $linkback=''.$langs->trans("BackToModuleList").''; -print load_fiche_titre($langs->trans("ExpenseReportsRulesSetup"),$linkback,'title_setup'); +print load_fiche_titre($langs->trans("ExpenseReportsRulesSetup"), $linkback, 'title_setup'); $head=expensereport_admin_prepare_head(); dol_fiche_head($head, 'expenserules', $langs->trans("ExpenseReportsRules"), -1, 'trip'); diff --git a/htdocs/admin/export.php b/htdocs/admin/export.php index cb97502c3f8..b477a75256b 100644 --- a/htdocs/admin/export.php +++ b/htdocs/admin/export.php @@ -37,8 +37,8 @@ $langs->loadLangs(array('admin', 'exports', 'other')); if (! $user->admin) accessforbidden(); -$action=GETPOST('action','alpha'); -$value=GETPOST('value','alpha'); +$action=GETPOST('action', 'alpha'); +$value=GETPOST('value', 'alpha'); /* * Actions diff --git a/htdocs/admin/external_rss.php b/htdocs/admin/external_rss.php index c289c64b217..b9b78e55ec9 100644 --- a/htdocs/admin/external_rss.php +++ b/htdocs/admin/external_rss.php @@ -39,7 +39,7 @@ if (!$user->admin) accessforbidden(); $def = array(); $lastexternalrss=0; -$action=GETPOST('action','aZ09'); +$action=GETPOST('action', 'aZ09'); /* @@ -55,7 +55,7 @@ if ($result) { while ($obj = $db->fetch_object($result)) { - preg_match('/([0-9]+)$/i',$obj->name,$reg); + preg_match('/([0-9]+)$/i', $obj->name, $reg); if ($reg[1] && $reg[1] > $lastexternalrss) $lastexternalrss = $reg[1]; } } @@ -103,8 +103,8 @@ if ($action == 'add' || GETPOST("modify")) } } - $result1=dolibarr_set_const($db, "EXTERNAL_RSS_TITLE_" . GETPOST("norss"),GETPOST($external_rss_title),'chaine',0,'',$conf->entity); - if ($result1) $result2=dolibarr_set_const($db, "EXTERNAL_RSS_URLRSS_" . GETPOST("norss"),GETPOST($external_rss_urlrss),'chaine',0,'',$conf->entity); + $result1=dolibarr_set_const($db, "EXTERNAL_RSS_TITLE_" . GETPOST("norss"), GETPOST($external_rss_title), 'chaine', 0, '', $conf->entity); + if ($result1) $result2=dolibarr_set_const($db, "EXTERNAL_RSS_URLRSS_" . GETPOST("norss"), GETPOST($external_rss_urlrss), 'chaine', 0, '', $conf->entity); if ($result1 && $result2) { @@ -151,7 +151,7 @@ if ($_POST["delete"]) if (! $resql) { $db->rollback(); - dol_print_error($db,"sql=".$sql); + dol_print_error($db, "sql=".$sql); exit; } @@ -163,13 +163,13 @@ if ($_POST["delete"]) else { $db->rollback(); - dol_print_error($db,"sql=".$sql); + dol_print_error($db, "sql=".$sql); exit; } - $result1=dolibarr_del_const($db,"EXTERNAL_RSS_TITLE_" . GETPOST("norss"),$conf->entity); - if ($result1) $result2=dolibarr_del_const($db,"EXTERNAL_RSS_URLRSS_" . GETPOST("norss"),$conf->entity); + $result1=dolibarr_del_const($db, "EXTERNAL_RSS_TITLE_" . GETPOST("norss"), $conf->entity); + if ($result1) $result2=dolibarr_del_const($db, "EXTERNAL_RSS_URLRSS_" . GETPOST("norss"), $conf->entity); if ($result1 && $result2) { @@ -190,7 +190,7 @@ if ($_POST["delete"]) * View */ -llxHeader('',$langs->trans("ExternalRSSSetup")); +llxHeader('', $langs->trans("ExternalRSSSetup")); $linkback=''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("ExternalRSSSetup"), $linkback, 'title_setup'); @@ -242,7 +242,7 @@ if ($resql) { $obj = $db->fetch_object($resql); - preg_match('/^([0-9]+)/i',$obj->note,$reg); + preg_match('/^([0-9]+)/i', $obj->note, $reg); $idrss = $reg[1]; $keyrsstitle="EXTERNAL_RSS_TITLE_".$idrss; $keyrssurl="EXTERNAL_RSS_URLRSS_".$idrss; diff --git a/htdocs/admin/facture.php b/htdocs/admin/facture.php index fe78e5aa5b6..4c9d2d41773 100644 --- a/htdocs/admin/facture.php +++ b/htdocs/admin/facture.php @@ -38,10 +38,10 @@ $langs->loadLangs(array('admin', 'errors', 'other', 'bills')); if (! $user->admin) accessforbidden(); -$action = GETPOST('action','alpha'); -$value = GETPOST('value','alpha'); -$label = GETPOST('label','alpha'); -$scandir = GETPOST('scan_dir','alpha'); +$action = GETPOST('action', 'alpha'); +$value = GETPOST('value', 'alpha'); +$label = GETPOST('label', 'alpha'); +$scandir = GETPOST('scan_dir', 'alpha'); $type='invoice'; @@ -53,18 +53,18 @@ include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php'; if ($action == 'updateMask') { - $maskconstinvoice=GETPOST('maskconstinvoice','alpha'); - $maskconstreplacement=GETPOST('maskconstreplacement','alpha'); - $maskconstcredit=GETPOST('maskconstcredit','alpha'); - $maskconstdeposit=GETPOST('maskconstdeposit','alpha'); - $maskinvoice=GETPOST('maskinvoice','alpha'); - $maskreplacement=GETPOST('maskreplacement','alpha'); - $maskcredit=GETPOST('maskcredit','alpha'); - $maskdeposit=GETPOST('maskdeposit','alpha'); - if ($maskconstinvoice) $res = dolibarr_set_const($db,$maskconstinvoice,$maskinvoice,'chaine',0,'',$conf->entity); - if ($maskconstreplacement) $res = dolibarr_set_const($db,$maskconstreplacement,$maskreplacement,'chaine',0,'',$conf->entity); - if ($maskconstcredit) $res = dolibarr_set_const($db,$maskconstcredit,$maskcredit,'chaine',0,'',$conf->entity); - if ($maskconstdeposit) $res = dolibarr_set_const($db,$maskconstdeposit,$maskdeposit,'chaine',0,'',$conf->entity); + $maskconstinvoice=GETPOST('maskconstinvoice', 'alpha'); + $maskconstreplacement=GETPOST('maskconstreplacement', 'alpha'); + $maskconstcredit=GETPOST('maskconstcredit', 'alpha'); + $maskconstdeposit=GETPOST('maskconstdeposit', 'alpha'); + $maskinvoice=GETPOST('maskinvoice', 'alpha'); + $maskreplacement=GETPOST('maskreplacement', 'alpha'); + $maskcredit=GETPOST('maskcredit', 'alpha'); + $maskdeposit=GETPOST('maskdeposit', 'alpha'); + if ($maskconstinvoice) $res = dolibarr_set_const($db, $maskconstinvoice, $maskinvoice, 'chaine', 0, '', $conf->entity); + if ($maskconstreplacement) $res = dolibarr_set_const($db, $maskconstreplacement, $maskreplacement, 'chaine', 0, '', $conf->entity); + if ($maskconstcredit) $res = dolibarr_set_const($db, $maskconstcredit, $maskcredit, 'chaine', 0, '', $conf->entity); + if ($maskconstdeposit) $res = dolibarr_set_const($db, $maskconstdeposit, $maskdeposit, 'chaine', 0, '', $conf->entity); if (! $res > 0) $error++; @@ -80,17 +80,17 @@ if ($action == 'updateMask') if ($action == 'specimen') { - $modele=GETPOST('module','alpha'); + $modele=GETPOST('module', 'alpha'); $facture = new Facture($db); $facture->initAsSpecimen(); // Search template files $file=''; $classname=''; $filefound=0; - $dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']); + $dirmodels=array_merge(array('/'), (array) $conf->modules_parts['models']); foreach($dirmodels as $reldir) { - $file=dol_buildpath($reldir."core/modules/facture/doc/pdf_".$modele.".modules.php",0); + $file=dol_buildpath($reldir."core/modules/facture/doc/pdf_".$modele.".modules.php", 0); if (file_exists($file)) { $filefound=1; @@ -105,7 +105,7 @@ if ($action == 'specimen') $module = new $classname($db); - if ($module->write_file($facture,$langs) > 0) + if ($module->write_file($facture, $langs) > 0) { header("Location: ".DOL_URL_ROOT."/document.php?modulepart=facture&file=SPECIMEN.pdf"); return; @@ -134,14 +134,14 @@ else if ($action == 'del') $ret = delDocumentModel($value, $type); if ($ret > 0) { - if ($conf->global->FACTURE_ADDON_PDF == "$value") dolibarr_del_const($db, 'FACTURE_ADDON_PDF',$conf->entity); + if ($conf->global->FACTURE_ADDON_PDF == "$value") dolibarr_del_const($db, 'FACTURE_ADDON_PDF', $conf->entity); } } // Set default model else if ($action == 'setdoc') { - if (dolibarr_set_const($db, "FACTURE_ADDON_PDF",$value,'chaine',0,'',$conf->entity)) + if (dolibarr_set_const($db, "FACTURE_ADDON_PDF", $value, 'chaine', 0, '', $conf->entity)) { // La constante qui a ete lue en avant du nouveau set // on passe donc par une variable pour avoir un affichage coherent @@ -161,16 +161,16 @@ else if ($action == 'setmod') // TODO Verifier si module numerotation choisi peut etre active // par appel methode canBeActivated - dolibarr_set_const($db, "FACTURE_ADDON",$value,'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "FACTURE_ADDON", $value, 'chaine', 0, '', $conf->entity); } if ($action == 'setribchq') { - $rib = GETPOST('rib','alpha'); - $chq = GETPOST('chq','alpha'); + $rib = GETPOST('rib', 'alpha'); + $chq = GETPOST('chq', 'alpha'); - $res = dolibarr_set_const($db, "FACTURE_RIB_NUMBER",$rib,'chaine',0,'',$conf->entity); - $res = dolibarr_set_const($db, "FACTURE_CHQ_NUMBER",$chq,'chaine',0,'',$conf->entity); + $res = dolibarr_set_const($db, "FACTURE_RIB_NUMBER", $rib, 'chaine', 0, '', $conf->entity); + $res = dolibarr_set_const($db, "FACTURE_CHQ_NUMBER", $chq, 'chaine', 0, '', $conf->entity); if (! $res > 0) $error++; @@ -186,9 +186,9 @@ if ($action == 'setribchq') if ($action == 'set_FACTURE_DRAFT_WATERMARK') { - $draft = GETPOST('FACTURE_DRAFT_WATERMARK','alpha'); + $draft = GETPOST('FACTURE_DRAFT_WATERMARK', 'alpha'); - $res = dolibarr_set_const($db, "FACTURE_DRAFT_WATERMARK",trim($draft),'chaine',0,'',$conf->entity); + $res = dolibarr_set_const($db, "FACTURE_DRAFT_WATERMARK", trim($draft), 'chaine', 0, '', $conf->entity); if (! $res > 0) $error++; @@ -204,9 +204,9 @@ if ($action == 'set_FACTURE_DRAFT_WATERMARK') if ($action == 'set_INVOICE_FREE_TEXT') { - $freetext = GETPOST('INVOICE_FREE_TEXT','none'); // No alpha here, we want exact string + $freetext = GETPOST('INVOICE_FREE_TEXT', 'none'); // No alpha here, we want exact string - $res = dolibarr_set_const($db, "INVOICE_FREE_TEXT",$freetext,'chaine',0,'',$conf->entity); + $res = dolibarr_set_const($db, "INVOICE_FREE_TEXT", $freetext, 'chaine', 0, '', $conf->entity); if (! $res > 0) $error++; @@ -222,9 +222,9 @@ if ($action == 'set_INVOICE_FREE_TEXT') if ($action == 'setforcedate') { - $forcedate = GETPOST('forcedate','alpha'); + $forcedate = GETPOST('forcedate', 'alpha'); - $res = dolibarr_set_const($db, "FAC_FORCE_DATE_VALIDATION",$forcedate,'chaine',0,'',$conf->entity); + $res = dolibarr_set_const($db, "FAC_FORCE_DATE_VALIDATION", $forcedate, 'chaine', 0, '', $conf->entity); if (! $res > 0) $error++; @@ -248,7 +248,7 @@ if ($action == 'setDefaultPDFModulesByType') foreach ($invoicetypemodels as $type => $value) { - $res = dolibarr_set_const($db, 'FACTURE_ADDON_PDF_'.intval($type),$value,'chaine',0,'',$conf->entity); + $res = dolibarr_set_const($db, 'FACTURE_ADDON_PDF_'.intval($type), $value, 'chaine', 0, '', $conf->entity); if (! $res > 0) $error++; } @@ -268,15 +268,15 @@ if ($action == 'setDefaultPDFModulesByType') * View */ -$dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']); +$dirmodels=array_merge(array('/'), (array) $conf->modules_parts['models']); -llxHeader("",$langs->trans("BillsSetup"),'EN:Invoice_Configuration|FR:Configuration_module_facture|ES:ConfiguracionFactura'); +llxHeader("", $langs->trans("BillsSetup"), 'EN:Invoice_Configuration|FR:Configuration_module_facture|ES:ConfiguracionFactura'); $form=new Form($db); $linkback=''.$langs->trans("BackToModuleList").''; -print load_fiche_titre($langs->trans("BillsSetup"),$linkback,'title_setup'); +print load_fiche_titre($langs->trans("BillsSetup"), $linkback, 'title_setup'); $head = invoice_admin_prepare_head(); dol_fiche_head($head, 'general', $langs->trans("Invoices"), -1, 'invoice'); @@ -285,7 +285,7 @@ dol_fiche_head($head, 'general', $langs->trans("Invoices"), -1, 'invoice'); * Numbering module */ -print load_fiche_titre($langs->trans("BillsNumberingModule"),'',''); +print load_fiche_titre($langs->trans("BillsNumberingModule"), '', ''); print '
'; $tmp=$module->getExample(); - if (preg_match('/^Error/',$tmp)) print '
'.$langs->trans($tmp).'
'; + if (preg_match('/^Error/', $tmp)) print '
'.$langs->trans($tmp).'
'; elseif ($tmp=='NotConfigured') print $langs->trans($tmp); else print $tmp; print '
'; if ($conf->global->EXPENSEREPORT_ADDON == $file) { - print img_picto($langs->trans("Activated"),'switch_on'); + print img_picto($langs->trans("Activated"), 'switch_on'); } else { print ''; - print img_picto($langs->trans("Disabled"),'switch_off'); + print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; } print ''; - print $form->textwithpicto('',$htmltooltip,1,0); + print $form->textwithpicto('', $htmltooltip, 1, 0); print '
'; print (empty($module->name)?$name:$module->name); print "\n"; - if (method_exists($module,'info')) print $module->info($langs); + if (method_exists($module, 'info')) print $module->info($langs); else print $module->description; print '\n"; print 'scandir.'&label='.urlencode($module->name).'">'; - print img_picto($langs->trans("Enabled"),'switch_on'); + print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; print "\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').''; + print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print ""; if ($conf->global->EXPENSEREPORT_ADDON_PDF == "$name") { - print img_picto($langs->trans("Default"),'on'); + print img_picto($langs->trans("Default"), 'on'); } else { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').''; + print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; - print $form->textwithpicto('',$htmltooltip,-1,0); + print $form->textwithpicto('', $htmltooltip, -1, 0); print ''; if ($module->type == 'pdf') { - print ''.img_object($langs->trans("Preview"),'intervention').''; + print ''.img_object($langs->trans("Preview"), 'intervention').''; } else { - print img_object($langs->trans("PreviewNotAvailable"),'generic'); + print img_object($langs->trans("PreviewNotAvailable"), 'generic'); } print '
'; print ''; @@ -311,7 +311,7 @@ foreach ($dirmodels as $reldir) if (! is_dir($dir.$file) || (substr($file, 0, 1) <> '.' && substr($file, 0, 3) <> 'CVS')) { $filebis = $file; - $classname = preg_replace('/\.php$/','',$file); + $classname = preg_replace('/\.php$/', '', $file); // For compatibility if (! is_file($dir.$filebis)) { @@ -319,11 +319,11 @@ foreach ($dirmodels as $reldir) $classname = "mod_facture_".$file; } // Check if there is a filter on country - preg_match('/\-(.*)_(.*)$/',$classname,$reg); + preg_match('/\-(.*)_(.*)$/', $classname, $reg); if (! empty($reg[2]) && $reg[2] != strtoupper($mysoc->country_code)) continue; - $classname = preg_replace('/\-.*$/','',$classname); - if (! class_exists($classname) && is_readable($dir.$filebis) && (preg_match('/mod_/',$filebis) || preg_match('/mod_/',$classname)) && substr($filebis, dol_strlen($filebis)-3, 3) == 'php') + $classname = preg_replace('/\-.*$/', '', $classname); + if (! class_exists($classname) && is_readable($dir.$filebis) && (preg_match('/mod_/', $filebis) || preg_match('/mod_/', $classname)) && substr($filebis, dol_strlen($filebis)-3, 3) == 'php') { // Charging the numbering class require_once $dir.$filebis; @@ -337,7 +337,7 @@ foreach ($dirmodels as $reldir) if ($module->isEnabled()) { print ''."\n"; @@ -356,11 +356,11 @@ foreach ($dirmodels as $reldir) //print "> ".$conf->global->FACTURE_ADDON." - ".$file; if ($conf->global->FACTURE_ADDON == $file || $conf->global->FACTURE_ADDON.'.php' == $file) { - print img_picto($langs->trans("Activated"),'switch_on'); + print img_picto($langs->trans("Activated"), 'switch_on'); } else { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'switch_off').''; + print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; } print ''; @@ -371,11 +371,11 @@ foreach ($dirmodels as $reldir) $htmltooltip=''; $htmltooltip.=''.$langs->trans("Version").': '.$module->getVersion().'
'; $facture->type=0; - $nextval=$module->getNextValue($mysoc,$facture); + $nextval=$module->getNextValue($mysoc, $facture); if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval $htmltooltip.=$langs->trans("NextValueForInvoices").': '; if ($nextval) { - if (preg_match('/^Error/',$nextval) || $nextval=='NotConfigured') + if (preg_match('/^Error/', $nextval) || $nextval=='NotConfigured') $nextval = $langs->trans($nextval); $htmltooltip.=$nextval.'
'; } else { @@ -384,11 +384,11 @@ foreach ($dirmodels as $reldir) } // Example for remplacement $facture->type=1; - $nextval=$module->getNextValue($mysoc,$facture); + $nextval=$module->getNextValue($mysoc, $facture); if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval $htmltooltip.=$langs->trans("NextValueForReplacements").': '; if ($nextval) { - if (preg_match('/^Error/',$nextval) || $nextval=='NotConfigured') + if (preg_match('/^Error/', $nextval) || $nextval=='NotConfigured') $nextval = $langs->trans($nextval); $htmltooltip.=$nextval.'
'; } else { @@ -398,11 +398,11 @@ foreach ($dirmodels as $reldir) // Example for credit invoice $facture->type=2; - $nextval=$module->getNextValue($mysoc,$facture); + $nextval=$module->getNextValue($mysoc, $facture); if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval $htmltooltip.=$langs->trans("NextValueForCreditNotes").': '; if ($nextval) { - if (preg_match('/^Error/',$nextval) || $nextval=='NotConfigured') + if (preg_match('/^Error/', $nextval) || $nextval=='NotConfigured') $nextval = $langs->trans($nextval); $htmltooltip.=$nextval.'
'; } else { @@ -411,11 +411,11 @@ foreach ($dirmodels as $reldir) } // Example for deposit invoice $facture->type=3; - $nextval=$module->getNextValue($mysoc,$facture); + $nextval=$module->getNextValue($mysoc, $facture); if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval $htmltooltip.=$langs->trans("NextValueForDeposit").': '; if ($nextval) { - if (preg_match('/^Error/',$nextval) || $nextval=='NotConfigured') + if (preg_match('/^Error/', $nextval) || $nextval=='NotConfigured') $nextval = $langs->trans($nextval); $htmltooltip.=$nextval; } else { @@ -424,11 +424,11 @@ foreach ($dirmodels as $reldir) } print ''; @@ -450,7 +450,7 @@ print '
'; - echo preg_replace('/\-.*$/','',preg_replace('/mod_facture_/','',preg_replace('/\.php$/','',$file))); + echo preg_replace('/\-.*$/', '', preg_replace('/mod_facture_/', '', preg_replace('/\.php$/', '', $file))); print "\n"; print $module->info(); @@ -347,7 +347,7 @@ foreach ($dirmodels as $reldir) // Show example of numbering module print ''; $tmp=$module->getExample(); - if (preg_match('/^Error/',$tmp)) print '
'.$langs->trans($tmp).'
'; + if (preg_match('/^Error/', $tmp)) print '
'.$langs->trans($tmp).'
'; elseif ($tmp=='NotConfigured') print $langs->trans($tmp); else print $tmp; print '
'; - print $form->textwithpicto('',$htmltooltip,1,0); + print $form->textwithpicto('', $htmltooltip, 1, 0); if ($conf->global->FACTURE_ADDON.'.php' == $file) // If module is the one used, we show existing errors { - if (! empty($module->error)) dol_htmloutput_mesg($module->error,'','error',1); + if (! empty($module->error)) dol_htmloutput_mesg($module->error, '', 'error', 1); } print '
'; * Document templates generators */ print '
'; -print load_fiche_titre($langs->trans("BillsPDFModules"),'',''); +print load_fiche_titre($langs->trans("BillsPDFModules"), '', ''); // Load array def with activated templates $type='invoice'; @@ -510,7 +510,7 @@ foreach ($dirmodels as $reldir) foreach($filelist as $file) { - if (preg_match('/\.modules\.php$/i',$file) && preg_match('/^(pdf_|doc_)/',$file)) + if (preg_match('/\.modules\.php$/i', $file) && preg_match('/^(pdf_|doc_)/', $file)) { if (file_exists($dir.'/'.$file)) { @@ -529,7 +529,7 @@ foreach ($dirmodels as $reldir) print '
'; print (empty($module->name)?$name:$module->name); print "\n"; - if (method_exists($module,'info')) print $module->info($langs); + if (method_exists($module, 'info')) print $module->info($langs); else print $module->description; print ''."\n"; print ''; - print img_picto($langs->trans("Enabled"),'switch_on'); + print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; print '\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("SetAsDefault"),'switch_off').''; + print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("SetAsDefault"), 'switch_off').''; print ""; if ($conf->global->FACTURE_ADDON_PDF == "$name") { - print img_picto($langs->trans("Default"),'on'); + print img_picto($langs->trans("Default"), 'on'); } else { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("SetAsDefault"),'off').''; + print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("SetAsDefault"), 'off').''; } print ''; - print $form->textwithpicto('',$htmltooltip,1,0); + print $form->textwithpicto('', $htmltooltip, 1, 0); print ''; if ($module->type == 'pdf') { - print ''.img_object($langs->trans("Preview"),'bill').''; + print ''.img_object($langs->trans("Preview"), 'bill').''; } else { - print img_object($langs->trans("PreviewNotAvailable"),'generic'); + print img_object($langs->trans("PreviewNotAvailable"), 'generic'); } print '
'.$trans.''.$form->selectarray('invoicetypemodels['.$type.']', ModelePDFFactures::liste_modeles($db), $current,0,0, 0).''.$form->selectarray('invoicetypemodels['.$type.']', ModelePDFFactures::liste_modeles($db), $current, 0, 0, 0).'
'; print ''; @@ -761,7 +761,7 @@ print ''; print '\n"; @@ -786,7 +786,7 @@ if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) else { include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor=new DolEditor($variablename, $conf->global->$variablename,'',80,'dolibarr_notes'); + $doleditor=new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes'); print $doleditor->Create(); } print '
'; print $langs->trans("ForceInvoiceDate"); print ''; -print $form->selectyesno("forcedate",$conf->global->FAC_FORCE_DATE_VALIDATION,1); +print $form->selectyesno("forcedate", $conf->global->FAC_FORCE_DATE_VALIDATION, 1); print ''; print ''; print "
'; @@ -814,7 +814,7 @@ print '
'; * Repertoire */ print '
'; -print load_fiche_titre($langs->trans("PathToDocuments"),'',''); +print load_fiche_titre($langs->trans("PathToDocuments"), '', ''); print ''."\n"; print ''."\n"; @@ -832,7 +832,7 @@ print "
\n"; * Notifications */ print '
'; -print load_fiche_titre($langs->trans("Notifications"),'',''); +print load_fiche_titre($langs->trans("Notifications"), '', ''); print ''; print ''; print ''; diff --git a/htdocs/admin/fckeditor.php b/htdocs/admin/fckeditor.php index 8751d906918..9902caffae0 100644 --- a/htdocs/admin/fckeditor.php +++ b/htdocs/admin/fckeditor.php @@ -31,14 +31,14 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; // Load translation files required by the page $langs->loadLangs(array('admin', 'fckeditor')); -$action = GETPOST('action','alpha'); +$action = GETPOST('action', 'alpha'); // Possible modes are: // dolibarr_details // dolibarr_notes // dolibarr_readonly // dolibarr_mailings // Full (not sure this one is used) -$mode=GETPOST('mode')?GETPOST('mode','alpha'):'dolibarr_notes'; +$mode=GETPOST('mode')?GETPOST('mode', 'alpha'):'dolibarr_notes'; if (!$user->admin) accessforbidden(); @@ -80,24 +80,24 @@ foreach($modules as $const => $desc) { if ($action == 'activate_'.strtolower($const)) { - dolibarr_set_const($db, "FCKEDITOR_ENABLE_".$const, "1",'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "FCKEDITOR_ENABLE_".$const, "1", 'chaine', 0, '', $conf->entity); // Si fckeditor est active dans la description produit/service, on l'active dans les formulaires if ($const == 'PRODUCTDESC' && ! empty($conf->global->PRODUIT_DESC_IN_FORM)) { - dolibarr_set_const($db, "FCKEDITOR_ENABLE_DETAILS", "1",'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "FCKEDITOR_ENABLE_DETAILS", "1", 'chaine', 0, '', $conf->entity); } header("Location: ".$_SERVER["PHP_SELF"]); exit; } if ($action == 'disable_'.strtolower($const)) { - dolibarr_del_const($db, "FCKEDITOR_ENABLE_".$const,$conf->entity); + dolibarr_del_const($db, "FCKEDITOR_ENABLE_".$const, $conf->entity); header("Location: ".$_SERVER["PHP_SELF"]); exit; } } -if (GETPOST('save','alpha')) +if (GETPOST('save', 'alpha')) { $error = 0; @@ -136,7 +136,7 @@ if (GETPOST('save','alpha')) llxHeader(); $linkback=''.$langs->trans("BackToModuleList").''; -print load_fiche_titre($langs->trans("AdvancedEditor"),$linkback,'title_setup'); +print load_fiche_titre($langs->trans("AdvancedEditor"), $linkback, 'title_setup'); print '
'; if (empty($conf->use_javascript_ajax)) @@ -158,18 +158,18 @@ else if (! $conditions[$const]) continue; print ''; - print ''; + print ''; print ''; print '"; @@ -183,7 +183,7 @@ else print ''."\n"; // Skins - show_skin(null,1); + show_skin(null, 1); print '
'."\n"; $listofmodes=array('dolibarr_mailings','dolibarr_notes','dolibarr_details','dolibarr_readonly','Full'); @@ -198,11 +198,11 @@ else $linkstomode.=''; } $linkstomode.=''; - print load_fiche_titre($langs->trans("TestSubmitForm"),$linkstomode,''); + print load_fiche_titre($langs->trans("TestSubmitForm"), $linkstomode, ''); print ''; $uselocalbrowser=true; $readonly=($mode=='dolibarr_readonly'?1:0); - $editor=new DolEditor('formtestfield',isset($conf->global->FCKEDITOR_TEST)?$conf->global->FCKEDITOR_TEST:'Test','',200,$mode,'In', true, $uselocalbrowser, 1, 120, 8, $readonly); + $editor=new DolEditor('formtestfield', isset($conf->global->FCKEDITOR_TEST)?$conf->global->FCKEDITOR_TEST:'Test', '', 200, $mode, 'In', true, $uselocalbrowser, 1, 120, 8, $readonly); $editor->Create(); print '
'."\n"; print '
'; diff --git a/htdocs/admin/fichinter.php b/htdocs/admin/fichinter.php index 9a259fd3c0d..0fdae9f6032 100644 --- a/htdocs/admin/fichinter.php +++ b/htdocs/admin/fichinter.php @@ -39,10 +39,10 @@ $langs->loadLangs(array('admin', 'errors', 'interventions', 'other')); if (! $user->admin) accessforbidden(); -$action = GETPOST('action','alpha'); -$value = GETPOST('value','alpha'); -$label = GETPOST('label','alpha'); -$scandir = GETPOST('scan_dir','alpha'); +$action = GETPOST('action', 'alpha'); +$value = GETPOST('value', 'alpha'); +$label = GETPOST('label', 'alpha'); +$scandir = GETPOST('scan_dir', 'alpha'); $type='ficheinter'; @@ -54,9 +54,9 @@ include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php'; if ($action == 'updateMask') { - $maskconst=GETPOST('maskconst','alpha'); - $maskvalue=GETPOST('maskvalue','alpha'); - if ($maskconst) $res = dolibarr_set_const($db,$maskconst,$maskvalue,'chaine',0,'',$conf->entity); + $maskconst=GETPOST('maskconst', 'alpha'); + $maskvalue=GETPOST('maskvalue', 'alpha'); + if ($maskconst) $res = dolibarr_set_const($db, $maskconst, $maskvalue, 'chaine', 0, '', $conf->entity); if (! $res > 0) $error++; @@ -72,17 +72,17 @@ if ($action == 'updateMask') else if ($action == 'specimen') // For fiche inter { - $modele= GETPOST('module','alpha'); + $modele= GETPOST('module', 'alpha'); $inter = new Fichinter($db); $inter->initAsSpecimen(); // Search template files $file=''; $classname=''; $filefound=0; - $dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']); + $dirmodels=array_merge(array('/'), (array) $conf->modules_parts['models']); foreach($dirmodels as $reldir) { - $file=dol_buildpath($reldir."core/modules/fichinter/doc/pdf_".$modele.".modules.php",0); + $file=dol_buildpath($reldir."core/modules/fichinter/doc/pdf_".$modele.".modules.php", 0); if (file_exists($file)) { $filefound=1; @@ -97,7 +97,7 @@ else if ($action == 'specimen') // For fiche inter $module = new $classname($db); - if ($module->write_file($inter,$langs) > 0) + if ($module->write_file($inter, $langs) > 0) { header("Location: ".DOL_URL_ROOT."/document.php?modulepart=ficheinter&file=SPECIMEN.pdf"); return; @@ -126,14 +126,14 @@ else if ($action == 'del') $ret = delDocumentModel($value, $type); if ($ret > 0) { - if ($conf->global->FICHEINTER_ADDON_PDF == "$value") dolibarr_del_const($db, 'FICHEINTER_ADDON_PDF',$conf->entity); + if ($conf->global->FICHEINTER_ADDON_PDF == "$value") dolibarr_del_const($db, 'FICHEINTER_ADDON_PDF', $conf->entity); } } // Set default model else if ($action == 'setdoc') { - if (dolibarr_set_const($db, "FICHEINTER_ADDON_PDF",$value,'chaine',0,'',$conf->entity)) + if (dolibarr_set_const($db, "FICHEINTER_ADDON_PDF", $value, 'chaine', 0, '', $conf->entity)) { // La constante qui a ete lue en avant du nouveau set // on passe donc par une variable pour avoir un affichage coherent @@ -153,13 +153,13 @@ else if ($action == 'setmod') // TODO Verifier si module numerotation choisi peut etre active // par appel methode canBeActivated - dolibarr_set_const($db, "FICHEINTER_ADDON",$value,'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "FICHEINTER_ADDON", $value, 'chaine', 0, '', $conf->entity); } else if ($action == 'set_FICHINTER_FREE_TEXT') { - $freetext= GETPOST('FICHINTER_FREE_TEXT','none'); // No alpha here, we want exact string - $res = dolibarr_set_const($db, "FICHINTER_FREE_TEXT",$freetext,'chaine',0,'',$conf->entity); + $freetext= GETPOST('FICHINTER_FREE_TEXT', 'none'); // No alpha here, we want exact string + $res = dolibarr_set_const($db, "FICHINTER_FREE_TEXT", $freetext, 'chaine', 0, '', $conf->entity); if (! $res > 0) $error++; @@ -175,8 +175,8 @@ else if ($action == 'set_FICHINTER_FREE_TEXT') else if ($action == 'set_FICHINTER_DRAFT_WATERMARK') { - $draft= GETPOST('FICHINTER_DRAFT_WATERMARK','alpha'); - $res = dolibarr_set_const($db, "FICHINTER_DRAFT_WATERMARK",trim($draft),'chaine',0,'',$conf->entity); + $draft= GETPOST('FICHINTER_DRAFT_WATERMARK', 'alpha'); + $res = dolibarr_set_const($db, "FICHINTER_DRAFT_WATERMARK", trim($draft), 'chaine', 0, '', $conf->entity); if (! $res > 0) $error++; @@ -192,8 +192,8 @@ else if ($action == 'set_FICHINTER_DRAFT_WATERMARK') elseif ($action == 'set_FICHINTER_PRINT_PRODUCTS') { - $val = GETPOST('FICHINTER_PRINT_PRODUCTS','alpha'); - $res = dolibarr_set_const($db, "FICHINTER_PRINT_PRODUCTS",($val == 'on' ? 1 : 0),'bool',0,'',$conf->entity); + $val = GETPOST('FICHINTER_PRINT_PRODUCTS', 'alpha'); + $res = dolibarr_set_const($db, "FICHINTER_PRINT_PRODUCTS", ($val == 'on' ? 1 : 0), 'bool', 0, '', $conf->entity); if (! $res > 0) $error++; @@ -255,14 +255,14 @@ elseif ($action == 'set_FICHINTER_PRINT_PRODUCTS') * View */ -$dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']); +$dirmodels=array_merge(array('/'), (array) $conf->modules_parts['models']); llxHeader(); $form=new Form($db); $linkback=''.$langs->trans("BackToModuleList").''; -print load_fiche_titre($langs->trans("InterventionsSetup"),$linkback,'title_setup'); +print load_fiche_titre($langs->trans("InterventionsSetup"), $linkback, 'title_setup'); $head=fichinter_admin_prepare_head(); @@ -271,7 +271,7 @@ dol_fiche_head($head, 'ficheinter', $langs->trans("Interventions"), -1, 'interve // Interventions numbering model -print load_fiche_titre($langs->trans("FicheinterNumberingModules"),'',''); +print load_fiche_titre($langs->trans("FicheinterNumberingModules"), '', ''); print '
'.$langs->trans("Parameter").'
'.img_object("",$picto[$const]).''.img_object("", $picto[$const]).''.$langs->trans($desc).''; $constante = 'FCKEDITOR_ENABLE_'.$const; $value = (isset($conf->global->$constante)?$conf->global->$constante:0); if ($value == 0) { - print ''.img_picto($langs->trans("Disabled"),'switch_off').''; + print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; } else if ($value == 1) { - print ''.img_picto($langs->trans("Enabled"),'switch_on').''; + print ''.img_picto($langs->trans("Enabled"), 'switch_on').''; } print "
'; print ''; @@ -296,10 +296,10 @@ foreach ($dirmodels as $reldir) while (($file = readdir($handle))!==false) { - if (preg_match('/^(mod_.*)\.php$/i',$file,$reg)) + if (preg_match('/^(mod_.*)\.php$/i', $file, $reg)) { $file = $reg[1]; - $classname = substr($file,4); + $classname = substr($file, 4); require_once $dir.$file.'.php'; @@ -319,7 +319,7 @@ foreach ($dirmodels as $reldir) // Show example of numbering model print ''."\n"; @@ -327,11 +327,11 @@ foreach ($dirmodels as $reldir) print ''; @@ -341,11 +341,11 @@ foreach ($dirmodels as $reldir) // Info $htmltooltip=''; $htmltooltip.=''.$langs->trans("Version").': '.$module->getVersion().'
'; - $nextval=$module->getNextValue($mysoc,$ficheinter); + $nextval=$module->getNextValue($mysoc, $ficheinter); if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval $htmltooltip.=''.$langs->trans("NextValue").': '; if ($nextval) { - if (preg_match('/^Error/',$nextval) || $nextval=='NotConfigured') + if (preg_match('/^Error/', $nextval) || $nextval=='NotConfigured') $nextval = $langs->trans($nextval); $htmltooltip.=$nextval.'
'; } else { @@ -353,7 +353,7 @@ foreach ($dirmodels as $reldir) } } print ''; print ''; @@ -372,7 +372,7 @@ print '
'; $tmp=$module->getExample(); - if (preg_match('/^Error/',$tmp)) print '
'.$langs->trans($tmp).'
'; + if (preg_match('/^Error/', $tmp)) print '
'.$langs->trans($tmp).'
'; elseif ($tmp=='NotConfigured') print $langs->trans($tmp); else print $tmp; print '
'; if ($conf->global->FICHEINTER_ADDON == $classname) { - print img_picto($langs->trans("Activated"),'switch_on'); + print img_picto($langs->trans("Activated"), 'switch_on'); } else { - print ''.img_picto($langs->trans("Disabled"),'switch_off').''; + print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; } print ''; - print $form->textwithpicto('',$htmltooltip,1,0); + print $form->textwithpicto('', $htmltooltip, 1, 0); print '

'; * Documents models for Interventions */ -print load_fiche_titre($langs->trans("TemplatePDFInterventions"),'',''); +print load_fiche_titre($langs->trans("TemplatePDFInterventions"), '', ''); // Defini tableau def des modeles $type='ficheinter'; @@ -429,7 +429,7 @@ foreach ($dirmodels as $reldir) foreach($filelist as $file) { - if (preg_match('/\.modules\.php$/i',$file) && preg_match('/^(pdf_|doc_)/',$file)) + if (preg_match('/\.modules\.php$/i', $file) && preg_match('/^(pdf_|doc_)/', $file)) { if (file_exists($dir.'/'.$file)) { @@ -450,7 +450,7 @@ foreach ($dirmodels as $reldir) print '
'; print (empty($module->name)?$name:$module->name); print "\n"; - if (method_exists($module,'info')) print $module->info($langs); + if (method_exists($module, 'info')) print $module->info($langs); else print $module->description; print '\n"; print 'scandir.'&label='.urlencode($module->name).'">'; - print img_picto($langs->trans("Enabled"),'switch_on'); + print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; print "\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').''; + print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print ""; if ($conf->global->FICHEINTER_ADDON_PDF == "$name") { - print img_picto($langs->trans("Default"),'on'); + print img_picto($langs->trans("Default"), 'on'); } else { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').''; + print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; - print $form->textwithpicto('',$htmltooltip,-1,0); + print $form->textwithpicto('', $htmltooltip, -1, 0); print ''; if ($module->type == 'pdf') { - print ''.img_object($langs->trans("Preview"),'intervention').''; + print ''.img_object($langs->trans("Preview"), 'intervention').''; } else { - print img_object($langs->trans("PreviewNotAvailable"),'generic'); + print img_object($langs->trans("PreviewNotAvailable"), 'generic'); } print '
'; print ''; print ''; @@ -551,7 +551,7 @@ if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) else { include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor=new DolEditor($variablename, $conf->global->$variablename,'',80,'dolibarr_notes'); + $doleditor=new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes'); print $doleditor->Create(); } print ''; print ''; print ''; // First day for weeks print ''; print ''; print ''; @@ -321,14 +321,14 @@ if ($action == 'edit') // Edit // Hide unauthorized button print ''; print ''; print ''; // Show logo print ''; print ''; print ''; @@ -345,15 +345,15 @@ if ($action == 'edit') // Edit // Show bugtrack link print ''; print ''; print ''; // Hide wiki link on login page $pictohelp=''; - print ''; print ''; print ''; @@ -404,7 +404,7 @@ if ($action == 'edit') // Edit // Hide helpcenter link on login page print ''; print ''; print ''; @@ -448,7 +448,7 @@ else // Show print ($conf->global->MAIN_LANG_DEFAULT=='auto'?$langs->trans("AutoDetectLang"):$langs->trans("Language_".$conf->global->MAIN_LANG_DEFAULT)); print ''; print ''; print ""; @@ -460,7 +460,7 @@ else // Show // Themes - show_theme(null,0); + show_theme(null, 0); print '
'; @@ -506,7 +506,7 @@ else // Show // Hide unauthorized button print ''; // Show logo @@ -528,8 +528,8 @@ else // Show // Link to wiki help $pictohelp=''; - print ''; // Message of the day @@ -556,7 +556,7 @@ else // Show // Link to help center print ''; // Background login diff --git a/htdocs/admin/index.php b/htdocs/admin/index.php index be9859c1beb..bce8c560d7c 100644 --- a/htdocs/admin/index.php +++ b/htdocs/admin/index.php @@ -38,25 +38,25 @@ $hookmanager->initHooks(array('homesetup')); */ $wikihelp='EN:First_setup|FR:Premiers_paramétrages|ES:Primeras_configuraciones'; -llxHeader('',$langs->trans("Setup"),$wikihelp); +llxHeader('', $langs->trans("Setup"), $wikihelp); $form = new Form($db); -print load_fiche_titre($langs->trans("SetupArea"),'','title_setup.png'); +print load_fiche_titre($langs->trans("SetupArea"), '', 'title_setup.png'); if (! empty($conf->global->MAIN_MOTD_SETUPPAGE)) { - $conf->global->MAIN_MOTD_SETUPPAGE=preg_replace('//i','
',$conf->global->MAIN_MOTD_SETUPPAGE); + $conf->global->MAIN_MOTD_SETUPPAGE=preg_replace('//i', '
', $conf->global->MAIN_MOTD_SETUPPAGE); if (! empty($conf->global->MAIN_MOTD_SETUPPAGE)) { $i=0; - while (preg_match('/__\(([a-zA-Z|@]+)\)__/i',$conf->global->MAIN_MOTD_SETUPPAGE,$reg) && $i < 100) + while (preg_match('/__\(([a-zA-Z|@]+)\)__/i', $conf->global->MAIN_MOTD_SETUPPAGE, $reg) && $i < 100) { - $tmp=explode('|',$reg[1]); + $tmp=explode('|', $reg[1]); if (! empty($tmp[1])) $langs->load($tmp[1]); - $conf->global->MAIN_MOTD_SETUPPAGE=preg_replace('/__\('.preg_quote($reg[1]).'\)__/i',$langs->trans($tmp[0]),$conf->global->MAIN_MOTD_SETUPPAGE); + $conf->global->MAIN_MOTD_SETUPPAGE=preg_replace('/__\('.preg_quote($reg[1]).'\)__/i', $langs->trans($tmp[0]), $conf->global->MAIN_MOTD_SETUPPAGE); $i++; } @@ -76,7 +76,7 @@ print '
'; // Show info setup company if (empty($conf->global->MAIN_INFO_SOCIETE_NOM) || empty($conf->global->MAIN_INFO_SOCIETE_COUNTRY)) $setupcompanynotcomplete=1; -print img_picto('','puce').' '.$langs->trans("SetupDescription3", DOL_URL_ROOT.'/admin/company.php?mainmenu=home'.(empty($setupcompanynotcomplete)?'':'&action=edit'), $langs->transnoentities("Setup"), $langs->transnoentities("MenuCompanySetup")); +print img_picto('', 'puce').' '.$langs->trans("SetupDescription3", DOL_URL_ROOT.'/admin/company.php?mainmenu=home'.(empty($setupcompanynotcomplete)?'':'&action=edit'), $langs->transnoentities("Setup"), $langs->transnoentities("MenuCompanySetup")); if (! empty($setupcompanynotcomplete)) { $langs->load("errors"); @@ -88,7 +88,7 @@ print '
'; print '
'; // Show info setup module -print img_picto('','puce').' '.$langs->trans("SetupDescription4", DOL_URL_ROOT.'/admin/modules.php?mainmenu=home', $langs->transnoentities("Setup"), $langs->transnoentities("Modules")); +print img_picto('', 'puce').' '.$langs->trans("SetupDescription4", DOL_URL_ROOT.'/admin/modules.php?mainmenu=home', $langs->transnoentities("Setup"), $langs->transnoentities("Modules")); /* $nbofactivatedmodules=count($conf->modules); @@ -110,7 +110,7 @@ print '
'; // Add hook to add information $parameters=array(); -$reshook=$hookmanager->executeHooks('addHomeSetup',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks +$reshook=$hookmanager->executeHooks('addHomeSetup', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks print $hookmanager->resPrint; if (empty($reshook)) { diff --git a/htdocs/admin/ldap.php b/htdocs/admin/ldap.php index dc21ca36daa..f110c32e441 100644 --- a/htdocs/admin/ldap.php +++ b/htdocs/admin/ldap.php @@ -37,7 +37,7 @@ $langs->load("admin"); if (!$user->admin) accessforbidden(); -$action = GETPOST('action','aZ09'); +$action = GETPOST('action', 'aZ09'); // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager->initHooks(array('adminldap','globaladmin')); @@ -47,7 +47,7 @@ $hookmanager->initHooks(array('adminldap','globaladmin')); */ $parameters=array(); -$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks +$reshook=$hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); if (empty($reshook)) @@ -57,19 +57,19 @@ if (empty($reshook)) $error=0; $db->begin(); - if (! dolibarr_set_const($db, 'LDAP_SERVER_TYPE',GETPOST("type"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_SERVER_PROTOCOLVERSION',GETPOST("LDAP_SERVER_PROTOCOLVERSION"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_SERVER_HOST',GETPOST("host"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_SERVER_HOST_SLAVE',GETPOST("slave"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_SERVER_PORT',GETPOST("port"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_SERVER_DN',GETPOST("dn"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_ADMIN_DN',GETPOST("admin"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_ADMIN_PASS',GETPOST("pass"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_SERVER_USE_TLS',GETPOST("usetls"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_SYNCHRO_ACTIVE',GETPOST("activesynchro"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_CONTACT_ACTIVE',GETPOST("activecontact"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_MEMBER_ACTIVE',GETPOST("activemembers"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_MEMBER_TYPE_ACTIVE',GETPOST("activememberstypes"),'chaine',0,'',$conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_SERVER_TYPE', GETPOST("type"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_SERVER_PROTOCOLVERSION', GETPOST("LDAP_SERVER_PROTOCOLVERSION"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_SERVER_HOST', GETPOST("host"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_SERVER_HOST_SLAVE', GETPOST("slave"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_SERVER_PORT', GETPOST("port"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_SERVER_DN', GETPOST("dn"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_ADMIN_DN', GETPOST("admin"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_ADMIN_PASS', GETPOST("pass"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_SERVER_USE_TLS', GETPOST("usetls"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_SYNCHRO_ACTIVE', GETPOST("activesynchro"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_CONTACT_ACTIVE', GETPOST("activecontact"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_MEMBER_ACTIVE', GETPOST("activemembers"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_MEMBER_TYPE_ACTIVE', GETPOST("activememberstypes"), 'chaine', 0, '', $conf->entity)) $error++; if (! $error) { @@ -88,11 +88,11 @@ if (empty($reshook)) * View */ -llxHeader('',$langs->trans("LDAPSetup"),'EN:Module_LDAP_En|FR:Module_LDAP|ES:Módulo_LDAP'); +llxHeader('', $langs->trans("LDAPSetup"), 'EN:Module_LDAP_En|FR:Module_LDAP|ES:Módulo_LDAP'); $linkback=''.$langs->trans("BackToModuleList").''; -print load_fiche_titre($langs->trans("LDAPSetup"),$linkback,'title_setup'); +print load_fiche_titre($langs->trans("LDAPSetup"), $linkback, 'title_setup'); $head = ldap_prepare_head(); @@ -125,7 +125,7 @@ $arraylist=array(); $arraylist['0']=$langs->trans("No"); $arraylist['ldap2dolibarr']=$langs->trans("LDAPToDolibarr"); $arraylist['dolibarr2ldap']=$langs->trans("DolibarrToLDAP"); -print $form->selectarray('activesynchro',$arraylist,$conf->global->LDAP_SYNCHRO_ACTIVE); +print $form->selectarray('activesynchro', $arraylist, $conf->global->LDAP_SYNCHRO_ACTIVE); print '
'; } @@ -152,7 +152,7 @@ if (! empty($conf->adherent->enabled)) $arraylist['0']=$langs->trans("No"); $arraylist['1']=$langs->trans("DolibarrToLDAP"); $arraylist['ldap2dolibarr']=$langs->trans("LDAPToDolibarr").' ('.$langs->trans("SupportedForLDAPImportScriptOnly").')'; - print $form->selectarray('activemembers',$arraylist,$conf->global->LDAP_MEMBER_ACTIVE); + print $form->selectarray('activemembers', $arraylist, $conf->global->LDAP_MEMBER_ACTIVE); print ''; } @@ -164,13 +164,13 @@ if (! empty($conf->adherent->enabled)) $arraylist['0']=$langs->trans("No"); $arraylist['1']=$langs->trans("DolibarrToLDAP"); $arraylist['ldap2dolibarr']=$langs->trans("LDAPToDolibarr").' ('.$langs->trans("SupportedForLDAPImportScriptOnly").')'; - print $form->selectarray('activememberstypes',$arraylist,$conf->global->LDAP_MEMBER_TYPE_ACTIVE); + print $form->selectarray('activememberstypes', $arraylist, $conf->global->LDAP_MEMBER_TYPE_ACTIVE); print ''; } // Fields from hook $parameters=array(); -$reshook=$hookmanager->executeHooks('addAdminLdapOptions',$parameters); // Note that $action and $object may have been modified by hook +$reshook=$hookmanager->executeHooks('addAdminLdapOptions', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; print ''; @@ -185,7 +185,7 @@ $arraylist=array(); $arraylist['activedirectory']='Active Directory'; $arraylist['openldap']='OpenLdap'; $arraylist['egroupware']='Egroupware'; -print $form->selectarray('type',$arraylist,$conf->global->LDAP_SERVER_TYPE); +print $form->selectarray('type', $arraylist, $conf->global->LDAP_SERVER_TYPE); print ''; // Version @@ -193,7 +193,7 @@ print ''; // Serveur primaire @@ -230,7 +230,7 @@ print ''; print ''; @@ -283,22 +283,22 @@ if (function_exists("ldap_connect")) if ($result > 0) { // Test ldap connect and bind - print img_picto('','info').' '; - print ''.$langs->trans("LDAPTCPConnectOK",$conf->global->LDAP_SERVER_HOST,$conf->global->LDAP_SERVER_PORT).''; + print img_picto('', 'info').' '; + print ''.$langs->trans("LDAPTCPConnectOK", $conf->global->LDAP_SERVER_HOST, $conf->global->LDAP_SERVER_PORT).''; print '
'; if ($conf->global->LDAP_ADMIN_DN && ! empty($conf->global->LDAP_ADMIN_PASS)) { if ($result == 2) { - print img_picto('','info').' '; - print ''.$langs->trans("LDAPBindOK",$conf->global->LDAP_SERVER_HOST,$conf->global->LDAP_SERVER_PORT,$conf->global->LDAP_ADMIN_DN,preg_replace('/./i','*',$conf->global->LDAP_ADMIN_PASS)).''; + print img_picto('', 'info').' '; + print ''.$langs->trans("LDAPBindOK", $conf->global->LDAP_SERVER_HOST, $conf->global->LDAP_SERVER_PORT, $conf->global->LDAP_ADMIN_DN, preg_replace('/./i', '*', $conf->global->LDAP_ADMIN_PASS)).''; print '
'; } else { - print img_picto('','error').' '; - print ''.$langs->trans("LDAPBindKO",$conf->global->LDAP_SERVER_HOST,$conf->global->LDAP_SERVER_PORT,$conf->global->LDAP_ADMIN_DN,preg_replace('/./i','*',$conf->global->LDAP_ADMIN_PASS)).''; + print img_picto('', 'error').' '; + print ''.$langs->trans("LDAPBindKO", $conf->global->LDAP_SERVER_HOST, $conf->global->LDAP_SERVER_PORT, $conf->global->LDAP_ADMIN_DN, preg_replace('/./i', '*', $conf->global->LDAP_ADMIN_PASS)).''; print '
'; print $langs->trans("Error").' '.$ldap->error; print '
'; @@ -306,7 +306,7 @@ if (function_exists("ldap_connect")) } else { - print img_picto('','warning').' '; + print img_picto('', 'warning').' '; print ''.$langs->trans("LDAPNoUserOrPasswordProvidedAccessIsReadOnly").''; print '
'; } @@ -315,13 +315,13 @@ if (function_exists("ldap_connect")) // Test ldap_getversion if (($ldap->getVersion() == 3)) { - print img_picto('','info').' '; + print img_picto('', 'info').' '; print ''.$langs->trans("LDAPSetupForVersion3").''; print '
'; } else { - print img_picto('','info').' '; + print img_picto('', 'info').' '; print ''.$langs->trans("LDAPSetupForVersion2").''; print '
'; } @@ -330,8 +330,8 @@ if (function_exists("ldap_connect")) } else { - print img_picto('','error').' '; - print ''.$langs->trans("LDAPTCPConnectKO",$conf->global->LDAP_SERVER_HOST,$conf->global->LDAP_SERVER_PORT).''; + print img_picto('', 'error').' '; + print ''.$langs->trans("LDAPTCPConnectKO", $conf->global->LDAP_SERVER_HOST, $conf->global->LDAP_SERVER_PORT).''; print '
'; print $langs->trans("Error").' '.$ldap->error; print '
'; diff --git a/htdocs/admin/ldap_contacts.php b/htdocs/admin/ldap_contacts.php index cb4972e84b3..47945173aef 100644 --- a/htdocs/admin/ldap_contacts.php +++ b/htdocs/admin/ldap_contacts.php @@ -38,7 +38,7 @@ $langs->loadLangs(array("admin","errors")); if (!$user->admin) accessforbidden(); -$action = GETPOST('action','aZ09'); +$action = GETPOST('action', 'aZ09'); /* * Actions @@ -50,29 +50,29 @@ if ($action == 'setvalue' && $user->admin) $db->begin(); - if (! dolibarr_set_const($db, 'LDAP_CONTACT_DN',GETPOST("contactdn"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_CONTACT_OBJECT_CLASS',GETPOST("objectclass"),'chaine',0,'',$conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_CONTACT_DN', GETPOST("contactdn"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_CONTACT_OBJECT_CLASS', GETPOST("objectclass"), 'chaine', 0, '', $conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_CONTACT_FIELD_FULLNAME',GETPOST("fieldfullname"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_CONTACT_FIELD_NAME',GETPOST("fieldname"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_CONTACT_FIELD_FIRSTNAME',GETPOST("fieldfirstname"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_CONTACT_FIELD_COMPANY',GETPOST("fieldcompany"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_CONTACT_FIELD_MAIL',GETPOST("fieldmail"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_CONTACT_FIELD_PHONE',GETPOST("fieldphone"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_CONTACT_FIELD_HOMEPHONE',GETPOST("fieldhomephone"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_CONTACT_FIELD_MOBILE',GETPOST("fieldmobile"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_CONTACT_FIELD_SKYPE',GETPOST("fieldskype"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_CONTACT_FIELD_FAX',GETPOST("fieldfax"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_CONTACT_FIELD_ADDRESS',GETPOST("fieldaddress"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_CONTACT_FIELD_ZIP',GETPOST("fieldzip"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_CONTACT_FIELD_TOWN',GETPOST("fieldtown"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_CONTACT_FIELD_COUNTRY',GETPOST("fieldcountry"),'chaine',0,'',$conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_CONTACT_FIELD_FULLNAME', GETPOST("fieldfullname"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_CONTACT_FIELD_NAME', GETPOST("fieldname"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_CONTACT_FIELD_FIRSTNAME', GETPOST("fieldfirstname"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_CONTACT_FIELD_COMPANY', GETPOST("fieldcompany"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_CONTACT_FIELD_MAIL', GETPOST("fieldmail"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_CONTACT_FIELD_PHONE', GETPOST("fieldphone"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_CONTACT_FIELD_HOMEPHONE', GETPOST("fieldhomephone"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_CONTACT_FIELD_MOBILE', GETPOST("fieldmobile"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_CONTACT_FIELD_SKYPE', GETPOST("fieldskype"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_CONTACT_FIELD_FAX', GETPOST("fieldfax"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_CONTACT_FIELD_ADDRESS', GETPOST("fieldaddress"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_CONTACT_FIELD_ZIP', GETPOST("fieldzip"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_CONTACT_FIELD_TOWN', GETPOST("fieldtown"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_CONTACT_FIELD_COUNTRY', GETPOST("fieldcountry"), 'chaine', 0, '', $conf->entity)) $error++; // This one must be after the others $valkey=''; $key=GETPOST("key"); if ($key) $valkey=$conf->global->$key; - if (! dolibarr_set_const($db, 'LDAP_KEY_CONTACTS',$valkey,'chaine',0,'',$conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_KEY_CONTACTS', $valkey, 'chaine', 0, '', $conf->entity)) $error++; if (! $error) { @@ -94,10 +94,10 @@ if ($action == 'setvalue' && $user->admin) $form=new Form($db); -llxHeader('',$langs->trans("LDAPSetup"),'EN:Module_LDAP_En|FR:Module_LDAP|ES:Módulo_LDAP'); +llxHeader('', $langs->trans("LDAPSetup"), 'EN:Module_LDAP_En|FR:Module_LDAP|ES:Módulo_LDAP'); $linkback=''.$langs->trans("BackToModuleList").''; -print load_fiche_titre($langs->trans("LDAPSetup"),$linkback,'title_setup'); +print load_fiche_titre($langs->trans("LDAPSetup"), $linkback, 'title_setup'); $head = ldap_prepare_head(); @@ -264,7 +264,7 @@ $key=$conf->global->LDAP_KEY_CONTACTS; $dn=$conf->global->LDAP_CONTACT_DN; $objectclass=$conf->global->LDAP_CONTACT_OBJECT_CLASS; -show_ldap_test_button($butlabel,$testlabel,$key,$dn,$objectclass); +show_ldap_test_button($butlabel, $testlabel, $key, $dn, $objectclass); if (function_exists("ldap_connect")) @@ -285,35 +285,35 @@ if (function_exists("ldap_connect")) $dn=$object->_load_ldap_dn($info); $result1=$ldap->delete($dn); // To be sure to delete existing records - $result2=$ldap->add($dn,$info,$user); // Now the test + $result2=$ldap->add($dn, $info, $user); // Now the test $result3=$ldap->delete($dn); // Clean what we did if ($result2 > 0) { - print img_picto('','info').' '; + print img_picto('', 'info').' '; print ''.$langs->trans("LDAPSynchroOK").'
'; } else { - print img_picto('','error').' '; + print img_picto('', 'error').' '; print ''.$langs->trans("LDAPSynchroKOMayBePermissions"); print ': '.$ldap->error; print '
'; - print $langs->trans("ErrorLDAPMakeManualTest",$conf->ldap->dir_temp).'
'; + print $langs->trans("ErrorLDAPMakeManualTest", $conf->ldap->dir_temp).'
'; } print "
\n"; print "LDAP input file used for test:

\n"; - print nl2br($ldap->dump_content($dn,$info)); + print nl2br($ldap->dump_content($dn, $info)); print "\n
"; } else { - print img_picto('','error').' '; + print img_picto('', 'error').' '; print ''.$langs->trans("LDAPSynchroKO"); print ': '.$ldap->error; print '
'; - print $langs->trans("ErrorLDAPMakeManualTest",$conf->ldap->dir_temp).'
'; + print $langs->trans("ErrorLDAPMakeManualTest", $conf->ldap->dir_temp).'
'; } } } diff --git a/htdocs/admin/ldap_groups.php b/htdocs/admin/ldap_groups.php index 43f66147123..450fec88ad0 100644 --- a/htdocs/admin/ldap_groups.php +++ b/htdocs/admin/ldap_groups.php @@ -39,7 +39,7 @@ $langs->loadLangs(array("admin","errors")); if (!$user->admin) accessforbidden(); -$action = GETPOST('action','aZ09'); +$action = GETPOST('action', 'aZ09'); /* @@ -51,19 +51,19 @@ if ($action == 'setvalue' && $user->admin) $error=0; $db->begin(); - if (! dolibarr_set_const($db, 'LDAP_GROUP_DN',GETPOST("group"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_GROUP_OBJECT_CLASS',GETPOST("objectclass"),'chaine',0,'',$conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_GROUP_DN', GETPOST("group"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_GROUP_OBJECT_CLASS', GETPOST("objectclass"), 'chaine', 0, '', $conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_GROUP_FIELD_FULLNAME',GETPOST("fieldfullname"),'chaine',0,'',$conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_GROUP_FIELD_FULLNAME', GETPOST("fieldfullname"), 'chaine', 0, '', $conf->entity)) $error++; //if (! dolibarr_set_const($db, 'LDAP_GROUP_FIELD_NAME',$_POST["fieldname"],'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_GROUP_FIELD_DESCRIPTION',GETPOST("fielddescription"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_GROUP_FIELD_GROUPMEMBERS',GETPOST("fieldgroupmembers"),'chaine',0,'',$conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_GROUP_FIELD_DESCRIPTION', GETPOST("fielddescription"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_GROUP_FIELD_GROUPMEMBERS', GETPOST("fieldgroupmembers"), 'chaine', 0, '', $conf->entity)) $error++; // This one must be after the others $valkey=''; $key=GETPOST("key"); if ($key) $valkey=$conf->global->$key; - if (! dolibarr_set_const($db, 'LDAP_KEY_GROUPS',$valkey,'chaine',0,'',$conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_KEY_GROUPS', $valkey, 'chaine', 0, '', $conf->entity)) $error++; if (! $error) { @@ -83,10 +83,10 @@ if ($action == 'setvalue' && $user->admin) * View */ -llxHeader('',$langs->trans("LDAPSetup"),'EN:Module_LDAP_En|FR:Module_LDAP|ES:Módulo_LDAP'); +llxHeader('', $langs->trans("LDAPSetup"), 'EN:Module_LDAP_En|FR:Module_LDAP|ES:Módulo_LDAP'); $linkback=''.$langs->trans("BackToModuleList").''; -print load_fiche_titre($langs->trans("LDAPSetup"),$linkback,'title_setup'); +print load_fiche_titre($langs->trans("LDAPSetup"), $linkback, 'title_setup'); $head = ldap_prepare_head(); @@ -192,7 +192,7 @@ if ($conf->global->LDAP_SYNCHRO_ACTIVE == 'dolibarr2ldap') $dn=$conf->global->LDAP_GROUP_DN; $objectclass=$conf->global->LDAP_GROUP_OBJECT_CLASS; - show_ldap_test_button($butlabel,$testlabel,$key,$dn,$objectclass); + show_ldap_test_button($butlabel, $testlabel, $key, $dn, $objectclass); } if (function_exists("ldap_connect")) @@ -213,40 +213,40 @@ if (function_exists("ldap_connect")) $dn=$object->_load_ldap_dn($info); // Get a gid number for objectclass PosixGroup - if (in_array('posixGroup',$info['objectclass'])) { + if (in_array('posixGroup', $info['objectclass'])) { $info['gidNumber'] = $ldap->getNextGroupGid('LDAP_KEY_GROUPS'); } $result1=$ldap->delete($dn); // To be sure to delete existing records - $result2=$ldap->add($dn,$info,$user); // Now the test + $result2=$ldap->add($dn, $info, $user); // Now the test $result3=$ldap->delete($dn); // Clean what we did if ($result2 > 0) { - print img_picto('','info').' '; + print img_picto('', 'info').' '; print ''.$langs->trans("LDAPSynchroOK").'
'; } else { - print img_picto('','error').' '; + print img_picto('', 'error').' '; print ''.$langs->trans("LDAPSynchroKOMayBePermissions"); print ': '.$ldap->error; print '
'; - print $langs->trans("ErrorLDAPMakeManualTest",$conf->ldap->dir_temp).'
'; + print $langs->trans("ErrorLDAPMakeManualTest", $conf->ldap->dir_temp).'
'; } print "
\n"; print "LDAP input file used for test:

\n"; - print nl2br($ldap->dump_content($dn,$info)); + print nl2br($ldap->dump_content($dn, $info)); print "\n
"; } else { - print img_picto('','error').' '; + print img_picto('', 'error').' '; print ''.$langs->trans("LDAPSynchroKO"); print ': '.$ldap->error; print '
'; - print $langs->trans("ErrorLDAPMakeManualTest",$conf->ldap->dir_temp).'
'; + print $langs->trans("ErrorLDAPMakeManualTest", $conf->ldap->dir_temp).'
'; } } } diff --git a/htdocs/admin/ldap_members.php b/htdocs/admin/ldap_members.php index 48d2aace5d7..94c9a32d9e0 100644 --- a/htdocs/admin/ldap_members.php +++ b/htdocs/admin/ldap_members.php @@ -39,7 +39,7 @@ $langs->loadLangs(array('admin', 'errors')); if (!$user->admin) accessforbidden(); -$action = GETPOST('action','aZ09'); +$action = GETPOST('action', 'aZ09'); /* * Actions @@ -51,45 +51,45 @@ if ($action == 'setvalue' && $user->admin) $db->begin(); - if (! dolibarr_set_const($db, 'LDAP_MEMBER_DN',GETPOST("user"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_MEMBER_OBJECT_CLASS',GETPOST("objectclass"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_MEMBER_FILTER',GETPOST("filterconnection"),'chaine',0,'',$conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_MEMBER_DN', GETPOST("user"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_MEMBER_OBJECT_CLASS', GETPOST("objectclass"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_MEMBER_FILTER', GETPOST("filterconnection"), 'chaine', 0, '', $conf->entity)) $error++; // Members - if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_FULLNAME',GETPOST("fieldfullname"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_LOGIN',GETPOST("fieldlogin"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_LOGIN_SAMBA',GETPOST("fieldloginsamba"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_PASSWORD',GETPOST("fieldpassword"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_PASSWORD_CRYPTED',GETPOST("fieldpasswordcrypted"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_NAME',GETPOST("fieldname"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_FIRSTNAME',GETPOST("fieldfirstname"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_MAIL',GETPOST("fieldmail"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_PHONE',GETPOST("fieldphone"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_PHONE_PERSO',GETPOST("fieldphoneperso"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_MOBILE',GETPOST("fieldmobile"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_SKYPE',GETPOST("fieldskype"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_FAX',GETPOST("fieldfax"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_COMPANY',GETPOST("fieldcompany"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_ADDRESS',GETPOST("fieldaddress"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_ZIP',GETPOST("fieldzip"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_TOWN',GETPOST("fieldtown"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_COUNTRY',GETPOST("fieldcountry"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_DESCRIPTION',GETPOST("fielddescription"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_NOTE_PUBLIC',GETPOST("fieldnotepublic"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_BIRTHDATE',GETPOST("fieldbirthdate"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_FIELD_MEMBER_STATUS',GETPOST("fieldstatus"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_FIELD_MEMBER_END_LASTSUBSCRIPTION', GETPOST("fieldendlastsubscription"),'chaine',0,'',$conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_FULLNAME', GETPOST("fieldfullname"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_LOGIN', GETPOST("fieldlogin"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_LOGIN_SAMBA', GETPOST("fieldloginsamba"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_PASSWORD', GETPOST("fieldpassword"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_PASSWORD_CRYPTED', GETPOST("fieldpasswordcrypted"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_NAME', GETPOST("fieldname"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_FIRSTNAME', GETPOST("fieldfirstname"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_MAIL', GETPOST("fieldmail"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_PHONE', GETPOST("fieldphone"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_PHONE_PERSO', GETPOST("fieldphoneperso"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_MOBILE', GETPOST("fieldmobile"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_SKYPE', GETPOST("fieldskype"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_FAX', GETPOST("fieldfax"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_COMPANY', GETPOST("fieldcompany"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_ADDRESS', GETPOST("fieldaddress"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_ZIP', GETPOST("fieldzip"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_TOWN', GETPOST("fieldtown"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_COUNTRY', GETPOST("fieldcountry"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_DESCRIPTION', GETPOST("fielddescription"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_NOTE_PUBLIC', GETPOST("fieldnotepublic"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_BIRTHDATE', GETPOST("fieldbirthdate"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_FIELD_MEMBER_STATUS', GETPOST("fieldstatus"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_FIELD_MEMBER_END_LASTSUBSCRIPTION', GETPOST("fieldendlastsubscription"), 'chaine', 0, '', $conf->entity)) $error++; // Subscriptions - if (! dolibarr_set_const($db, 'LDAP_FIELD_MEMBER_FIRSTSUBSCRIPTION_DATE', GETPOST("fieldfirstsubscriptiondate"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_FIELD_MEMBER_FIRSTSUBSCRIPTION_AMOUNT',GETPOST("fieldfirstsubscriptionamount"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_FIELD_MEMBER_LASTSUBSCRIPTION_DATE', GETPOST("fieldlastsubscriptiondate"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_FIELD_MEMBER_LASTSUBSCRIPTION_AMOUNT', GETPOST("fieldlastsubscriptionamount"),'chaine',0,'',$conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_FIELD_MEMBER_FIRSTSUBSCRIPTION_DATE', GETPOST("fieldfirstsubscriptiondate"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_FIELD_MEMBER_FIRSTSUBSCRIPTION_AMOUNT', GETPOST("fieldfirstsubscriptionamount"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_FIELD_MEMBER_LASTSUBSCRIPTION_DATE', GETPOST("fieldlastsubscriptiondate"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_FIELD_MEMBER_LASTSUBSCRIPTION_AMOUNT', GETPOST("fieldlastsubscriptionamount"), 'chaine', 0, '', $conf->entity)) $error++; // This one must be after the others $valkey=''; $key=GETPOST("key"); if ($key) $valkey=$conf->global->$key; - if (! dolibarr_set_const($db, 'LDAP_KEY_MEMBERS',$valkey,'chaine',0,'',$conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_KEY_MEMBERS', $valkey, 'chaine', 0, '', $conf->entity)) $error++; if (! $error) { @@ -111,10 +111,10 @@ if ($action == 'setvalue' && $user->admin) $form=new Form($db); -llxHeader('',$langs->trans("LDAPSetup"),'EN:Module_LDAP_En|FR:Module_LDAP|ES:Módulo_LDAP'); +llxHeader('', $langs->trans("LDAPSetup"), 'EN:Module_LDAP_En|FR:Module_LDAP|ES:Módulo_LDAP'); $linkback=''.$langs->trans("BackToModuleList").''; -print load_fiche_titre($langs->trans("LDAPSetup"),$linkback,'title_setup'); +print load_fiche_titre($langs->trans("LDAPSetup"), $linkback, 'title_setup'); $head = ldap_prepare_head(); @@ -387,7 +387,7 @@ if (! empty($conf->global->LDAP_MEMBER_ACTIVE)) $dn=$conf->global->LDAP_MEMBER_DN; $objectclass=$conf->global->LDAP_MEMBER_OBJECT_CLASS; - show_ldap_test_button($butlabel,$testlabel,$key,$dn,$objectclass); + show_ldap_test_button($butlabel, $testlabel, $key, $dn, $objectclass); } if (function_exists("ldap_connect")) @@ -408,35 +408,35 @@ if (function_exists("ldap_connect")) $dn=$object->_load_ldap_dn($info); $result1=$ldap->delete($dn); // To be sure to delete existing records - $result2=$ldap->add($dn,$info,$user); // Now the test + $result2=$ldap->add($dn, $info, $user); // Now the test $result3=$ldap->delete($dn); // Clean what we did if ($result2 > 0) { - print img_picto('','info').' '; + print img_picto('', 'info').' '; print ''.$langs->trans("LDAPSynchroOK").'
'; } else { - print img_picto('','error').' '; + print img_picto('', 'error').' '; print ''.$langs->trans("LDAPSynchroKOMayBePermissions"); print ': '.$ldap->error; print '
'; - print $langs->trans("ErrorLDAPMakeManualTest",$conf->ldap->dir_temp).'
'; + print $langs->trans("ErrorLDAPMakeManualTest", $conf->ldap->dir_temp).'
'; } print "
\n"; print "LDAP input file used for test:

\n"; - print nl2br($ldap->dump_content($dn,$info)); + print nl2br($ldap->dump_content($dn, $info)); print "\n
"; } else { - print img_picto('','error').' '; + print img_picto('', 'error').' '; print ''.$langs->trans("LDAPSynchroKO"); print ': '.$ldap->error; print '
'; - print $langs->trans("ErrorLDAPMakeManualTest",$conf->ldap->dir_temp).'
'; + print $langs->trans("ErrorLDAPMakeManualTest", $conf->ldap->dir_temp).'
'; } } } diff --git a/htdocs/admin/ldap_members_types.php b/htdocs/admin/ldap_members_types.php index b07bf0b1484..94d1355dd67 100644 --- a/htdocs/admin/ldap_members_types.php +++ b/htdocs/admin/ldap_members_types.php @@ -39,7 +39,7 @@ $langs->loadLangs(array('admin', 'errors')); if (!$user->admin) accessforbidden(); -$action = GETPOST('action','aZ09'); +$action = GETPOST('action', 'aZ09'); /* @@ -51,18 +51,18 @@ if ($action == 'setvalue' && $user->admin) $error=0; $db->begin(); - if (! dolibarr_set_const($db, 'LDAP_MEMBER_TYPE_DN',GETPOST("membertype"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_MEMBER_TYPE_OBJECT_CLASS',GETPOST("objectclass"),'chaine',0,'',$conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_MEMBER_TYPE_DN', GETPOST("membertype"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_MEMBER_TYPE_OBJECT_CLASS', GETPOST("objectclass"), 'chaine', 0, '', $conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_MEMBER_TYPE_FIELD_FULLNAME',GETPOST("fieldfullname"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_MEMBER_TYPE_FIELD_DESCRIPTION',GETPOST("fielddescription"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_MEMBER_TYPE_FIELD_GROUPMEMBERS',GETPOST("fieldmembertypemembers"),'chaine',0,'',$conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_MEMBER_TYPE_FIELD_FULLNAME', GETPOST("fieldfullname"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_MEMBER_TYPE_FIELD_DESCRIPTION', GETPOST("fielddescription"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_MEMBER_TYPE_FIELD_GROUPMEMBERS', GETPOST("fieldmembertypemembers"), 'chaine', 0, '', $conf->entity)) $error++; // This one must be after the others $valkey=''; $key=GETPOST("key"); if ($key) $valkey=$conf->global->$key; - if (! dolibarr_set_const($db, 'LDAP_KEY_MEMBERS_TYPES',$valkey,'chaine',0,'',$conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_KEY_MEMBERS_TYPES', $valkey, 'chaine', 0, '', $conf->entity)) $error++; if (! $error) { @@ -82,10 +82,10 @@ if ($action == 'setvalue' && $user->admin) * View */ -llxHeader('',$langs->trans("LDAPSetup"),'EN:Module_LDAP_En|FR:Module_LDAP|ES:Módulo_LDAP'); +llxHeader('', $langs->trans("LDAPSetup"), 'EN:Module_LDAP_En|FR:Module_LDAP|ES:Módulo_LDAP'); $linkback=''.$langs->trans("BackToModuleList").''; -print load_fiche_titre($langs->trans("LDAPSetup"),$linkback,'title_setup'); +print load_fiche_titre($langs->trans("LDAPSetup"), $linkback, 'title_setup'); $head = ldap_prepare_head(); @@ -182,7 +182,7 @@ if ($conf->global->LDAP_MEMBER_TYPE_ACTIVE == '1') $dn=$conf->global->LDAP_MEMBER_TYPE_DN; $objectclass=$conf->global->LDAP_MEMBER_TYPE_OBJECT_CLASS; - show_ldap_test_button($butlabel,$testlabel,$key,$dn,$objectclass); + show_ldap_test_button($butlabel, $testlabel, $key, $dn, $objectclass); } if (function_exists("ldap_connect")) @@ -203,40 +203,40 @@ if (function_exists("ldap_connect")) $dn=$object->_load_ldap_dn($info); // Get a gid number for objectclass PosixGroup - if (in_array('posixGroup',$info['objectclass'])) { + if (in_array('posixGroup', $info['objectclass'])) { $info['gidNumber'] = $ldap->getNextGroupGid('LDAP_KEY_MEMBERS_TYPES'); } $result1=$ldap->delete($dn); // To be sure to delete existing records - $result2=$ldap->add($dn,$info,$user); // Now the test + $result2=$ldap->add($dn, $info, $user); // Now the test $result3=$ldap->delete($dn); // Clean what we did if ($result2 > 0) { - print img_picto('','info').' '; + print img_picto('', 'info').' '; print ''.$langs->trans("LDAPSynchroOK").'
'; } else { - print img_picto('','error').' '; + print img_picto('', 'error').' '; print ''.$langs->trans("LDAPSynchroKOMayBePermissions"); print ': '.$ldap->error; print '
'; - print $langs->trans("ErrorLDAPMakeManualTest",$conf->ldap->dir_temp).'
'; + print $langs->trans("ErrorLDAPMakeManualTest", $conf->ldap->dir_temp).'
'; } print "
\n"; print "LDAP input file used for test:

\n"; - print nl2br($ldap->dump_content($dn,$info)); + print nl2br($ldap->dump_content($dn, $info)); print "\n
"; } else { - print img_picto('','error').' '; + print img_picto('', 'error').' '; print ''.$langs->trans("LDAPSynchroKO"); print ': '.$ldap->error; print '
'; - print $langs->trans("ErrorLDAPMakeManualTest",$conf->ldap->dir_temp).'
'; + print $langs->trans("ErrorLDAPMakeManualTest", $conf->ldap->dir_temp).'
'; } } } diff --git a/htdocs/admin/ldap_users.php b/htdocs/admin/ldap_users.php index 124bec14f6d..4148d81f438 100644 --- a/htdocs/admin/ldap_users.php +++ b/htdocs/admin/ldap_users.php @@ -39,7 +39,7 @@ $langs->loadLangs(array('admin', 'errors')); if (!$user->admin) accessforbidden(); -$action = GETPOST('action','aZ09'); +$action = GETPOST('action', 'aZ09'); /* * Actions @@ -50,35 +50,35 @@ if ($action == 'setvalue' && $user->admin) $error=0; $db->begin(); - if (! dolibarr_set_const($db, 'LDAP_USER_DN',GETPOST("user"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_USER_OBJECT_CLASS',GETPOST("objectclass"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_FILTER_CONNECTION',GETPOST("filterconnection"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_FIELD_FULLNAME',GETPOST("fieldfullname"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_FIELD_LOGIN',GETPOST("fieldlogin"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_FIELD_LOGIN_SAMBA',GETPOST("fieldloginsamba"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_FIELD_PASSWORD',GETPOST("fieldpassword"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_FIELD_PASSWORD_CRYPTED',GETPOST("fieldpasswordcrypted"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_FIELD_NAME',GETPOST("fieldname"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_FIELD_FIRSTNAME',GETPOST("fieldfirstname"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_FIELD_MAIL',GETPOST("fieldmail"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_FIELD_PHONE',GETPOST("fieldphone"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_FIELD_MOBILE',GETPOST("fieldmobile"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_FIELD_SKYPE',GETPOST("fieldskype"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_FIELD_FAX',GETPOST("fieldfax"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_FIELD_COMPANY',GETPOST("fieldcompany"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_FIELD_ADDRESS',GETPOST("fieldaddress"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_FIELD_ZIP',GETPOST("fieldzip"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_FIELD_TOWN',GETPOST("fieldtown"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_FIELD_COUNTRY',GETPOST("fieldcountry"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_FIELD_DESCRIPTION',GETPOST("fielddescription"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_FIELD_SID',GETPOST("fieldsid"),'chaine',0,'',$conf->entity)) $error++; - if (! dolibarr_set_const($db, 'LDAP_FIELD_TITLE',GETPOST("fieldtitle"),'chaine',0,'',$conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_USER_DN', GETPOST("user"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_USER_OBJECT_CLASS', GETPOST("objectclass"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_FILTER_CONNECTION', GETPOST("filterconnection"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_FIELD_FULLNAME', GETPOST("fieldfullname"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_FIELD_LOGIN', GETPOST("fieldlogin"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_FIELD_LOGIN_SAMBA', GETPOST("fieldloginsamba"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_FIELD_PASSWORD', GETPOST("fieldpassword"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_FIELD_PASSWORD_CRYPTED', GETPOST("fieldpasswordcrypted"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_FIELD_NAME', GETPOST("fieldname"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_FIELD_FIRSTNAME', GETPOST("fieldfirstname"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_FIELD_MAIL', GETPOST("fieldmail"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_FIELD_PHONE', GETPOST("fieldphone"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_FIELD_MOBILE', GETPOST("fieldmobile"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_FIELD_SKYPE', GETPOST("fieldskype"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_FIELD_FAX', GETPOST("fieldfax"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_FIELD_COMPANY', GETPOST("fieldcompany"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_FIELD_ADDRESS', GETPOST("fieldaddress"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_FIELD_ZIP', GETPOST("fieldzip"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_FIELD_TOWN', GETPOST("fieldtown"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_FIELD_COUNTRY', GETPOST("fieldcountry"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_FIELD_DESCRIPTION', GETPOST("fielddescription"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_FIELD_SID', GETPOST("fieldsid"), 'chaine', 0, '', $conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_FIELD_TITLE', GETPOST("fieldtitle"), 'chaine', 0, '', $conf->entity)) $error++; // This one must be after the others $valkey=''; $key=GETPOST("key"); if ($key) $valkey=$conf->global->$key; - if (! dolibarr_set_const($db, 'LDAP_KEY_USERS',$valkey,'chaine',0,'',$conf->entity)) $error++; + if (! dolibarr_set_const($db, 'LDAP_KEY_USERS', $valkey, 'chaine', 0, '', $conf->entity)) $error++; if (! $error) { @@ -100,10 +100,10 @@ if ($action == 'setvalue' && $user->admin) $form=new Form($db); -llxHeader('',$langs->trans("LDAPSetup"),'EN:Module_LDAP_En|FR:Module_LDAP|ES:Módulo_LDAP'); +llxHeader('', $langs->trans("LDAPSetup"), 'EN:Module_LDAP_En|FR:Module_LDAP|ES:Módulo_LDAP'); $linkback=''.$langs->trans("BackToModuleList").''; -print load_fiche_titre($langs->trans("LDAPSetup"),$linkback,'title_setup'); +print load_fiche_titre($langs->trans("LDAPSetup"), $linkback, 'title_setup'); $head = ldap_prepare_head(); @@ -323,7 +323,7 @@ if ($conf->global->LDAP_SYNCHRO_ACTIVE == 'dolibarr2ldap') $dn=$conf->global->LDAP_USER_DN; $objectclass=$conf->global->LDAP_USER_OBJECT_CLASS; - show_ldap_test_button($butlabel,$testlabel,$key,$dn,$objectclass); + show_ldap_test_button($butlabel, $testlabel, $key, $dn, $objectclass); } elseif ($conf->global->LDAP_SYNCHRO_ACTIVE == 'ldap2dolibarr') { @@ -332,7 +332,7 @@ elseif ($conf->global->LDAP_SYNCHRO_ACTIVE == 'ldap2dolibarr') $key=$conf->global->LDAP_KEY_USERS; $dn=$conf->global->LDAP_USER_DN; $objectclass=$conf->global->LDAP_USER_OBJECT_CLASS; - show_ldap_test_button($butlabel,$testlabel,$key,$dn,$objectclass); + show_ldap_test_button($butlabel, $testlabel, $key, $dn, $objectclass); } if (function_exists("ldap_connect")) @@ -355,35 +355,35 @@ if (function_exists("ldap_connect")) $dn=$object->_load_ldap_dn($info); $result1=$ldap->delete($dn); // To be sure to delete existing records - $result2=$ldap->add($dn,$info,$user); // Now the test + $result2=$ldap->add($dn, $info, $user); // Now the test $result3=$ldap->delete($dn); // Clean what we did if ($result2 > 0) { - print img_picto('','info').' '; + print img_picto('', 'info').' '; print ''.$langs->trans("LDAPSynchroOK").'
'; } else { - print img_picto('','error').' '; + print img_picto('', 'error').' '; print ''.$langs->trans("LDAPSynchroKOMayBePermissions"); print ': '.$ldap->error; print '
'; - print $langs->trans("ErrorLDAPMakeManualTest",$conf->ldap->dir_temp).'
'; + print $langs->trans("ErrorLDAPMakeManualTest", $conf->ldap->dir_temp).'
'; } print "
\n"; print "LDAP input file used for test:

\n"; - print nl2br($ldap->dump_content($dn,$info)); + print nl2br($ldap->dump_content($dn, $info)); print "\n
"; } else { - print img_picto('','error').' '; + print img_picto('', 'error').' '; print ''.$langs->trans("LDAPSynchroKO"); print ': '.$ldap->error; print '
'; - print $langs->trans("ErrorLDAPMakeManualTest",$conf->ldap->dir_temp).'
'; + print $langs->trans("ErrorLDAPMakeManualTest", $conf->ldap->dir_temp).'
'; } } @@ -454,17 +454,17 @@ if (function_exists("ldap_connect")) print "search: *
\n"; print "userDN: ".$conf->global->LDAP_USER_DN."
\n"; print "useridentifier: ".$conf->global->LDAP_KEY_USERS."
\n"; - print "required_fields: ".implode(',',$required_fields)."
\n"; + print "required_fields: ".implode(',', $required_fields)."
\n"; print "=> ".count($liste)." records
\n"; print "\n
"; } else { - print img_picto('','error').' '; + print img_picto('', 'error').' '; print ''.$langs->trans("LDAPSynchroKO"); print ': '.$ldap->error; print '
'; - print $langs->trans("ErrorLDAPMakeManualTest",$conf->ldap->dir_temp).'
'; + print $langs->trans("ErrorLDAPMakeManualTest", $conf->ldap->dir_temp).'
'; } } } diff --git a/htdocs/admin/limits.php b/htdocs/admin/limits.php index ad41d7bd945..a43f86d0e28 100644 --- a/htdocs/admin/limits.php +++ b/htdocs/admin/limits.php @@ -31,7 +31,7 @@ $langs->loadLangs(array('companies', 'products', 'admin')); if (! $user->admin) accessforbidden(); -$action = GETPOST('action','alpha'); +$action = GETPOST('action', 'alpha'); if ($action == 'update') { @@ -42,7 +42,7 @@ if ($action == 'update') || $_POST["MAIN_MAX_DECIMALS_SHOWN"] > $MAXDEC) { $error++; - setEventMessages($langs->trans("ErrorDecimalLargerThanAreForbidden",$MAXDEC), null, 'errors'); + setEventMessages($langs->trans("ErrorDecimalLargerThanAreForbidden", $MAXDEC), null, 'errors'); } if ($_POST["MAIN_MAX_DECIMALS_UNIT"] < 0 @@ -56,7 +56,7 @@ if ($action == 'update') if ($_POST["MAIN_ROUNDING_RULE_TOT"]) { - if ($_POST["MAIN_ROUNDING_RULE_TOT"] * pow(10,$_POST["MAIN_MAX_DECIMALS_TOT"]) < 1) + if ($_POST["MAIN_ROUNDING_RULE_TOT"] * pow(10, $_POST["MAIN_MAX_DECIMALS_TOT"]) < 1) { $langs->load("errors"); $error++; @@ -66,11 +66,11 @@ if ($action == 'update') if (! $error) { - dolibarr_set_const($db, "MAIN_MAX_DECIMALS_UNIT", $_POST["MAIN_MAX_DECIMALS_UNIT"],'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_MAX_DECIMALS_TOT", $_POST["MAIN_MAX_DECIMALS_TOT"],'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_MAX_DECIMALS_SHOWN", $_POST["MAIN_MAX_DECIMALS_SHOWN"],'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_MAX_DECIMALS_UNIT", $_POST["MAIN_MAX_DECIMALS_UNIT"], 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_MAX_DECIMALS_TOT", $_POST["MAIN_MAX_DECIMALS_TOT"], 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_MAX_DECIMALS_SHOWN", $_POST["MAIN_MAX_DECIMALS_SHOWN"], 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_ROUNDING_RULE_TOT", $_POST["MAIN_ROUNDING_RULE_TOT"],'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_ROUNDING_RULE_TOT", $_POST["MAIN_ROUNDING_RULE_TOT"], 'chaine', 0, '', $conf->entity); header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup"); exit; @@ -87,7 +87,7 @@ $form=new Form($db); llxHeader(); -print load_fiche_titre($langs->trans("LimitsSetup"),'','title_setup'); +print load_fiche_titre($langs->trans("LimitsSetup"), '', 'title_setup'); print $langs->trans("LimitsDesc")."
\n"; @@ -106,12 +106,12 @@ if ($action == 'edit') print ''; print ''; @@ -119,7 +119,7 @@ if ($action == 'edit') print ''; print '
'.$langs->trans("Parameter").''; diff --git a/htdocs/admin/geoipmaxmind.php b/htdocs/admin/geoipmaxmind.php index 98ab10a988e..fc55b27d7e1 100644 --- a/htdocs/admin/geoipmaxmind.php +++ b/htdocs/admin/geoipmaxmind.php @@ -34,7 +34,7 @@ accessforbidden(); // Load translation files required by the page $langs->loadLangs(array("admin","errors")); -$action = GETPOST('action','aZ09'); +$action = GETPOST('action', 'aZ09'); /* * Actions @@ -47,13 +47,13 @@ if ($action == 'set') if (! $gimcdf && ! file_exists($gimcdf)) { - setEventMessages($langs->trans("ErrorFileNotFound",$gimcdf), null, 'errors'); + setEventMessages($langs->trans("ErrorFileNotFound", $gimcdf), null, 'errors'); $error++; } if (! $error) { - $res = dolibarr_set_const($db,"GEOIPMAXMIND_COUNTRY_DATAFILE",$gimcdf,'chaine',0,'',$conf->entity); + $res = dolibarr_set_const($db, "GEOIPMAXMIND_COUNTRY_DATAFILE", $gimcdf, 'chaine', 0, '', $conf->entity); if (! $res > 0) $error++; if (! $error) @@ -77,14 +77,14 @@ $form=new Form($db); llxHeader(); $linkback=''.$langs->trans("BackToModuleList").''; -print load_fiche_titre($langs->trans("GeoIPMaxmindSetup"),$linkback,'title_setup'); +print load_fiche_titre($langs->trans("GeoIPMaxmindSetup"), $linkback, 'title_setup'); print '
'; $version=''; $geoip=''; if (! empty($conf->global->GEOIPMAXMIND_COUNTRY_DATAFILE)) { - $geoip=new DolGeoIP('country',$conf->global->GEOIPMAXMIND_COUNTRY_DATAFILE); + $geoip=new DolGeoIP('country', $conf->global->GEOIPMAXMIND_COUNTRY_DATAFILE); //if ($geoip->error) print dol_htmloutput_errors($geoip->errorlabel,'',1); if ($geoip->gi == 'NOGI') $geointernal=true; else $geointernal=false; @@ -126,21 +126,21 @@ print '
'; print $langs->trans("NoteOnPathLocation").'
'; $url1='http://www.maxmind.com/en/city?rId=awstats'; -print $langs->trans("YouCanDownloadFreeDatFileTo",''.$url1.''); +print $langs->trans("YouCanDownloadFreeDatFileTo", ''.$url1.''); print '
'; $url2='http://www.maxmind.com/en/city?rId=awstats'; -print $langs->trans("YouCanDownloadAdvancedDatFileTo",''.$url2.''); +print $langs->trans("YouCanDownloadAdvancedDatFileTo", ''.$url2.''); if ($geoip) { print '

'; - print '
'.$langs->trans("TestGeoIPResult",$ip).':'; + print '
'.$langs->trans("TestGeoIPResult", $ip).':'; $ip='24.24.24.24'; print '
'.$ip.' -> '; - $result=dol_print_ip($ip,1); + $result=dol_print_ip($ip, 1); if ($result) print $result; else print $langs->trans("Error"); @@ -158,14 +158,14 @@ if ($geoip) if ($isip == 1) { print '
'.$ip.' -> '; - $result=dol_print_ip($ip,1); + $result=dol_print_ip($ip, 1); if ($result) print $result; else print $langs->trans("Error"); } else { print '
'.$ip.' -> '; - $result=dol_print_ip($ip,1); + $result=dol_print_ip($ip, 1); if ($result) print $result; else print $langs->trans("NotAPublicIp"); } diff --git a/htdocs/admin/holiday.php b/htdocs/admin/holiday.php index c687a6fbc2d..f02f85b4bee 100644 --- a/htdocs/admin/holiday.php +++ b/htdocs/admin/holiday.php @@ -35,10 +35,10 @@ $langs->loadLangs(array("admin", "errors", "holiday")); if (!$user->admin) accessforbidden(); -$action = GETPOST('action','alpha'); -$value = GETPOST('value','alpha'); -$label = GETPOST('label','alpha'); -$scandir = GETPOST('scan_dir','alpha'); +$action = GETPOST('action', 'alpha'); +$value = GETPOST('value', 'alpha'); +$label = GETPOST('label', 'alpha'); +$scandir = GETPOST('scan_dir', 'alpha'); $type='contract'; if (empty($conf->global->HOLIDAY_ADDON)) @@ -55,9 +55,9 @@ include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php'; if ($action == 'updateMask') { - $maskconst = GETPOST('maskconstholidaty','alpha'); - $maskvalue = GETPOST('maskholiday','alpha'); - if ($maskconst) $res = dolibarr_set_const($db,$maskconst,$maskvalue,'chaine',0,'',$conf->entity); + $maskconst = GETPOST('maskconstholidaty', 'alpha'); + $maskvalue = GETPOST('maskholiday', 'alpha'); + if ($maskconst) $res = dolibarr_set_const($db, $maskconst, $maskvalue, 'chaine', 0, '', $conf->entity); if (! $res > 0) $error++; @@ -73,17 +73,17 @@ if ($action == 'updateMask') else if ($action == 'specimen') // For contract { - $modele= GETPOST('module','alpha'); + $modele= GETPOST('module', 'alpha'); $holiday = new Holiday($db); $holiday->initAsSpecimen(); // Search template files $file=''; $classname=''; $filefound=0; - $dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']); + $dirmodels=array_merge(array('/'), (array) $conf->modules_parts['models']); foreach($dirmodels as $reldir) { - $file=dol_buildpath($reldir."core/modules/holiday/doc/pdf_".$modele.".modules.php",0); + $file=dol_buildpath($reldir."core/modules/holiday/doc/pdf_".$modele.".modules.php", 0); if (file_exists($file)) { $filefound=1; @@ -98,7 +98,7 @@ else if ($action == 'specimen') // For contract $module = new $classname($db); - if ($module->write_file($holiday,$langs) > 0) + if ($module->write_file($holiday, $langs) > 0) { header("Location: ".DOL_URL_ROOT."/document.php?modulepart=holiday&file=SPECIMEN.pdf"); return; @@ -127,14 +127,14 @@ else if ($action == 'del') $ret = delDocumentModel($value, $type); if ($ret > 0) { - if ($conf->global->HOLIDAY_ADDON_PDF == "$value") dolibarr_del_const($db, 'HOLIDAY_ADDON_PDF',$conf->entity); + if ($conf->global->HOLIDAY_ADDON_PDF == "$value") dolibarr_del_const($db, 'HOLIDAY_ADDON_PDF', $conf->entity); } } // Set default model else if ($action == 'setdoc') { - if (dolibarr_set_const($db, "HOLIDAY_ADDON_PDF",$value,'chaine',0,'',$conf->entity)) + if (dolibarr_set_const($db, "HOLIDAY_ADDON_PDF", $value, 'chaine', 0, '', $conf->entity)) { // La constante qui a ete lue en avant du nouveau set // on passe donc par une variable pour avoir un affichage coherent @@ -154,16 +154,16 @@ else if ($action == 'setmod') // TODO Verifier si module numerotation choisi peut etre active // par appel methode canBeActivated - dolibarr_set_const($db, "HOLIDAY_ADDON",$value,'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "HOLIDAY_ADDON", $value, 'chaine', 0, '', $conf->entity); } else if ($action == 'set_other') { - $freetext= GETPOST('HOLIDAY_FREE_TEXT','none'); // No alpha here, we want exact string - $res1 = dolibarr_set_const($db, "HOLIDAY_FREE_TEXT",$freetext,'chaine',0,'',$conf->entity); + $freetext= GETPOST('HOLIDAY_FREE_TEXT', 'none'); // No alpha here, we want exact string + $res1 = dolibarr_set_const($db, "HOLIDAY_FREE_TEXT", $freetext, 'chaine', 0, '', $conf->entity); - $draft= GETPOST('HOLIDAY_DRAFT_WATERMARK','alpha'); - $res2 = dolibarr_set_const($db, "HOLIDAY_DRAFT_WATERMARK",trim($draft),'chaine',0,'',$conf->entity); + $draft= GETPOST('HOLIDAY_DRAFT_WATERMARK', 'alpha'); + $res2 = dolibarr_set_const($db, "HOLIDAY_DRAFT_WATERMARK", trim($draft), 'chaine', 0, '', $conf->entity); if (! $res1 > 0 || ! $res2 > 0) $error++; @@ -182,14 +182,14 @@ else if ($action == 'set_other') * View */ -$dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']); +$dirmodels=array_merge(array('/'), (array) $conf->modules_parts['models']); llxHeader(); $form=new Form($db); $linkback=''.$langs->trans("BackToModuleList").''; -print load_fiche_titre($langs->trans("HolidaySetup"),$linkback,'title_setup'); +print load_fiche_titre($langs->trans("HolidaySetup"), $linkback, 'title_setup'); $head=holiday_admin_prepare_head(); @@ -199,7 +199,7 @@ dol_fiche_head($head, 'holiday', $langs->trans("Holidays"), -1, 'holiday'); * Holiday Numbering model */ -print load_fiche_titre($langs->trans("HolidaysNumberingModules"),'',''); +print load_fiche_titre($langs->trans("HolidaysNumberingModules"), '', ''); print ''; print ''; @@ -245,7 +245,7 @@ foreach ($dirmodels as $reldir) // Show example of numbering model print ''."\n"; @@ -253,12 +253,12 @@ foreach ($dirmodels as $reldir) print ''; @@ -269,11 +269,11 @@ foreach ($dirmodels as $reldir) // Info $htmltooltip=''; $htmltooltip.=''.$langs->trans("Version").': '.$module->getVersion().'
'; - $nextval=$module->getNextValue($mysoc,$holiday); + $nextval=$module->getNextValue($mysoc, $holiday); if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval $htmltooltip.=''.$langs->trans("NextValue").': '; if ($nextval) { - if (preg_match('/^Error/',$nextval) || $nextval=='NotConfigured') + if (preg_match('/^Error/', $nextval) || $nextval=='NotConfigured') $nextval = $langs->trans($nextval); $htmltooltip.=$nextval.'
'; } else { @@ -282,7 +282,7 @@ foreach ($dirmodels as $reldir) } print ''; print ''; @@ -305,7 +305,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) * Documents models for Holidays */ -print load_fiche_titre($langs->trans("TemplatePDFHolidays"),'',''); +print load_fiche_titre($langs->trans("TemplatePDFHolidays"), '', ''); // Defined model definition table $def = array(); @@ -363,7 +363,7 @@ foreach ($dirmodels as $reldir) foreach($filelist as $file) { - if (preg_match('/\.modules\.php$/i',$file) && preg_match('/^(pdf_|doc_)/',$file)) + if (preg_match('/\.modules\.php$/i', $file) && preg_match('/^(pdf_|doc_)/', $file)) { if (file_exists($dir.'/'.$file)) @@ -383,7 +383,7 @@ foreach ($dirmodels as $reldir) print ''; @@ -392,14 +392,14 @@ foreach ($dirmodels as $reldir) { print ''; } else { print '"; } @@ -407,11 +407,11 @@ foreach ($dirmodels as $reldir) print ''; @@ -423,26 +423,26 @@ foreach ($dirmodels as $reldir) $htmltooltip.='
'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur; } $htmltooltip.='

'.$langs->trans("FeaturesSupported").':'; - $htmltooltip.='
'.$langs->trans("Logo").': '.yn($module->option_logo,1,1); - $htmltooltip.='
'.$langs->trans("PaymentMode").': '.yn($module->option_modereg,1,1); - $htmltooltip.='
'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg,1,1); - $htmltooltip.='
'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang,1,1); - $htmltooltip.='
'.$langs->trans("WatermarkOnDraftOrders").': '.yn($module->option_draft_watermark,1,1); + $htmltooltip.='
'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1); + $htmltooltip.='
'.$langs->trans("PaymentMode").': '.yn($module->option_modereg, 1, 1); + $htmltooltip.='
'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg, 1, 1); + $htmltooltip.='
'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang, 1, 1); + $htmltooltip.='
'.$langs->trans("WatermarkOnDraftOrders").': '.yn($module->option_draft_watermark, 1, 1); print ''; // Preview print ''; @@ -468,7 +468,7 @@ print ''; print ''; print ''; -print load_fiche_titre($langs->trans("OtherOptions"),'',''); +print load_fiche_titre($langs->trans("OtherOptions"), '', ''); print '
'; $tmp=$module->getExample(); - if (preg_match('/^Error/',$tmp)) { $langs->load("errors"); print '
'.$langs->trans($tmp).'
'; } + if (preg_match('/^Error/', $tmp)) { $langs->load("errors"); print '
'.$langs->trans($tmp).'
'; } elseif ($tmp=='NotConfigured') print $langs->trans($tmp); else print $tmp; print '
'; if ($conf->global->HOLIDAY_ADDON == "$file") { - print img_picto($langs->trans("Activated"),'switch_on'); + print img_picto($langs->trans("Activated"), 'switch_on'); } else { print ''; - print img_picto($langs->trans("Disabled"),'switch_off'); + print img_picto($langs->trans("Disabled"), 'switch_off'); print ''; } print ''; - print $form->textwithpicto('',$htmltooltip,1,0); + print $form->textwithpicto('', $htmltooltip, 1, 0); print '
'; print (empty($module->name)?$name:$module->name); print "\n"; - if (method_exists($module,'info')) print $module->info($langs); + if (method_exists($module, 'info')) print $module->info($langs); else print $module->description; print ''."\n"; print ''; - print img_picto($langs->trans("Enabled"),'switch_on'); + print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; print ''."\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').''; + print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print "'; if ($conf->global->HOLIDAY_ADDON_PDF == $name) { - print img_picto($langs->trans("Default"),'on'); + print img_picto($langs->trans("Default"), 'on'); } else { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').''; + print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; - print $form->textwithpicto('',$htmltooltip,1,0); + print $form->textwithpicto('', $htmltooltip, 1, 0); print ''; if ($module->type == 'pdf') { - print ''.img_object($langs->trans("Preview"),'contract').''; + print ''.img_object($langs->trans("Preview"), 'contract').''; } else { - print img_object($langs->trans("PreviewNotAvailable"),'generic'); + print img_object($langs->trans("PreviewNotAvailable"), 'generic'); } print '
'; print ''; print ''; @@ -492,7 +492,7 @@ if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) else { include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor=new DolEditor($variablename, $conf->global->$variablename,'',80,'dolibarr_notes'); + $doleditor=new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes'); print $doleditor->Create(); } print ''."\n"; diff --git a/htdocs/admin/ihm.php b/htdocs/admin/ihm.php index e2168ec2d76..f5ad4bcfb9f 100644 --- a/htdocs/admin/ihm.php +++ b/htdocs/admin/ihm.php @@ -38,10 +38,10 @@ $langs->loadLangs(array('admin', 'languages', 'other', 'companies', 'products', if (! $user->admin) accessforbidden(); -$action = GETPOST('action','aZ09'); -$contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'adminihm'; // To manage different context of search +$action = GETPOST('action', 'aZ09'); +$contextpage=GETPOST('contextpage', 'aZ')?GETPOST('contextpage', 'aZ'):'adminihm'; // To manage different context of search -if (! defined("MAIN_MOTD")) define("MAIN_MOTD",""); +if (! defined("MAIN_MOTD")) define("MAIN_MOTD", ""); @@ -50,10 +50,10 @@ if (! defined("MAIN_MOTD")) define("MAIN_MOTD",""); */ $parameters=array(); -$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks +$reshook=$hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); -if (GETPOST('cancel','alpha')) +if (GETPOST('cancel', 'alpha')) { $action=''; } @@ -64,7 +64,7 @@ if ($action == 'removebackgroundlogin' && ! empty($conf->global->MAIN_LOGIN_BACK $logofile=$conf->mycompany->dir_output.'/logos/'.$conf->global->MAIN_LOGIN_BACKGROUND; dol_delete_file($logofile); - dolibarr_del_const($db, "MAIN_LOGIN_BACKGROUND",$conf->entity); + dolibarr_del_const($db, "MAIN_LOGIN_BACKGROUND", $conf->entity); $mysoc->logo=''; /*$logosmallfile=$conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_small; @@ -80,56 +80,56 @@ if ($action == 'removebackgroundlogin' && ! empty($conf->global->MAIN_LOGIN_BACK if ($action == 'update') { - dolibarr_set_const($db, "MAIN_LANG_DEFAULT", $_POST["MAIN_LANG_DEFAULT"],'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_MULTILANGS", $_POST["MAIN_MULTILANGS"],'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_LANG_DEFAULT", $_POST["MAIN_LANG_DEFAULT"], 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_MULTILANGS", $_POST["MAIN_MULTILANGS"], 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_THEME", $_POST["main_theme"],'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_THEME", $_POST["main_theme"], 'chaine', 0, '', $conf->entity); $val=GETPOST('THEME_TOPMENU_DISABLE_IMAGE'); if (! $val) dolibarr_del_const($db, 'THEME_TOPMENU_DISABLE_IMAGE', $conf->entity); - else dolibarr_set_const($db, 'THEME_TOPMENU_DISABLE_IMAGE', GETPOST('THEME_TOPMENU_DISABLE_IMAGE'),'chaine',0,'',$conf->entity); + else dolibarr_set_const($db, 'THEME_TOPMENU_DISABLE_IMAGE', GETPOST('THEME_TOPMENU_DISABLE_IMAGE'), 'chaine', 0, '', $conf->entity); - $val=(implode(',',(colorStringToArray(GETPOST('THEME_ELDY_BACKBODY'),array())))); + $val=(implode(',', (colorStringToArray(GETPOST('THEME_ELDY_BACKBODY'), array())))); if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_BACKBODY', $conf->entity); - else dolibarr_set_const($db, 'THEME_ELDY_BACKBODY', $val,'chaine',0,'',$conf->entity); + else dolibarr_set_const($db, 'THEME_ELDY_BACKBODY', $val, 'chaine', 0, '', $conf->entity); - $val=(implode(',',(colorStringToArray(GETPOST('THEME_ELDY_TOPMENU_BACK1'),array())))); + $val=(implode(',', (colorStringToArray(GETPOST('THEME_ELDY_TOPMENU_BACK1'), array())))); if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_TOPMENU_BACK1', $conf->entity); - else dolibarr_set_const($db, 'THEME_ELDY_TOPMENU_BACK1', $val,'chaine',0,'',$conf->entity); + else dolibarr_set_const($db, 'THEME_ELDY_TOPMENU_BACK1', $val, 'chaine', 0, '', $conf->entity); - $val=(implode(',',(colorStringToArray(GETPOST('THEME_ELDY_VERMENU_BACK1'),array())))); + $val=(implode(',', (colorStringToArray(GETPOST('THEME_ELDY_VERMENU_BACK1'), array())))); if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_VERMENU_BACK1', $conf->entity); - else dolibarr_set_const($db, 'THEME_ELDY_VERMENU_BACK1', $val,'chaine',0,'',$conf->entity); + else dolibarr_set_const($db, 'THEME_ELDY_VERMENU_BACK1', $val, 'chaine', 0, '', $conf->entity); - $val=(implode(',',(colorStringToArray(GETPOST('THEME_ELDY_TEXTTITLENOTAB'),array())))); + $val=(implode(',', (colorStringToArray(GETPOST('THEME_ELDY_TEXTTITLENOTAB'), array())))); if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_TEXTTITLENOTAB', $conf->entity); - else dolibarr_set_const($db, 'THEME_ELDY_TEXTTITLENOTAB', $val,'chaine',0,'',$conf->entity); + else dolibarr_set_const($db, 'THEME_ELDY_TEXTTITLENOTAB', $val, 'chaine', 0, '', $conf->entity); - $val=(implode(',',(colorStringToArray(GETPOST('THEME_ELDY_BACKTITLE1'),array())))); + $val=(implode(',', (colorStringToArray(GETPOST('THEME_ELDY_BACKTITLE1'), array())))); if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_BACKTITLE1', $conf->entity); - else dolibarr_set_const($db, 'THEME_ELDY_BACKTITLE1', $val,'chaine',0,'',$conf->entity); + else dolibarr_set_const($db, 'THEME_ELDY_BACKTITLE1', $val, 'chaine', 0, '', $conf->entity); - $val=(implode(',',(colorStringToArray(GETPOST('THEME_ELDY_TEXTTITLE'),array())))); + $val=(implode(',', (colorStringToArray(GETPOST('THEME_ELDY_TEXTTITLE'), array())))); if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_TEXTTITLE', $conf->entity); - else dolibarr_set_const($db, 'THEME_ELDY_TEXTTITLE', $val,'chaine',0,'',$conf->entity); + else dolibarr_set_const($db, 'THEME_ELDY_TEXTTITLE', $val, 'chaine', 0, '', $conf->entity); - $val=(implode(',',(colorStringToArray(GETPOST('THEME_ELDY_LINEIMPAIR1'),array())))); + $val=(implode(',', (colorStringToArray(GETPOST('THEME_ELDY_LINEIMPAIR1'), array())))); if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_LINEIMPAIR1', $conf->entity); - else dolibarr_set_const($db, 'THEME_ELDY_LINEIMPAIR1', $val,'chaine',0,'',$conf->entity); - $val=(implode(',',(colorStringToArray(GETPOST('THEME_ELDY_LINEIMPAIR1'),array())))); + else dolibarr_set_const($db, 'THEME_ELDY_LINEIMPAIR1', $val, 'chaine', 0, '', $conf->entity); + $val=(implode(',', (colorStringToArray(GETPOST('THEME_ELDY_LINEIMPAIR1'), array())))); if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_LINEIMPAIR2', $conf->entity); - else dolibarr_set_const($db, 'THEME_ELDY_LINEIMPAIR2', $val,'chaine',0,'',$conf->entity); + else dolibarr_set_const($db, 'THEME_ELDY_LINEIMPAIR2', $val, 'chaine', 0, '', $conf->entity); - $val=(implode(',',(colorStringToArray(GETPOST('THEME_ELDY_LINEPAIR1'),array())))); + $val=(implode(',', (colorStringToArray(GETPOST('THEME_ELDY_LINEPAIR1'), array())))); if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_LINEPAIR1', $conf->entity); - else dolibarr_set_const($db, 'THEME_ELDY_LINEPAIR1', $val,'chaine',0,'',$conf->entity); - $val=(implode(',',(colorStringToArray(GETPOST('THEME_ELDY_LINEPAIR1'),array())))); + else dolibarr_set_const($db, 'THEME_ELDY_LINEPAIR1', $val, 'chaine', 0, '', $conf->entity); + $val=(implode(',', (colorStringToArray(GETPOST('THEME_ELDY_LINEPAIR1'), array())))); if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_LINEPAIR2', $conf->entity); - else dolibarr_set_const($db, 'THEME_ELDY_LINEPAIR2', $val,'chaine',0,'',$conf->entity); + else dolibarr_set_const($db, 'THEME_ELDY_LINEPAIR2', $val, 'chaine', 0, '', $conf->entity); - $val=(implode(',',(colorStringToArray(GETPOST('THEME_ELDY_TEXTLINK'),array())))); + $val=(implode(',', (colorStringToArray(GETPOST('THEME_ELDY_TEXTLINK'), array())))); if ($val == '') dolibarr_del_const($db, 'THEME_ELDY_TEXTLINK', $conf->entity); - else dolibarr_set_const($db, 'THEME_ELDY_TEXTLINK', $val,'chaine',0,'',$conf->entity); + else dolibarr_set_const($db, 'THEME_ELDY_TEXTLINK', $val, 'chaine', 0, '', $conf->entity); if (GETPOST('THEME_ELDY_USE_HOVER') == '') dolibarr_set_const($db, "THEME_ELDY_USE_HOVER", '0', 'chaine', 0, '', $conf->entity); // If empty, we set to '0' ('000000' is for black) else dolibarr_set_const($db, "THEME_ELDY_USE_HOVER", $_POST["THEME_ELDY_USE_HOVER"], 'chaine', 0, '', $conf->entity); @@ -137,26 +137,26 @@ if ($action == 'update') if (GETPOST('THEME_ELDY_USE_CHECKED') == '') dolibarr_set_const($db, "THEME_ELDY_USE_CHECKED", '0', 'chaine', 0, '', $conf->entity); else dolibarr_set_const($db, "THEME_ELDY_USE_CHECKED", $_POST["THEME_ELDY_USE_CHECKED"], 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_SIZE_LISTE_LIMIT", $_POST["main_size_liste_limit"],'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_SIZE_SHORTLIST_LIMIT", $_POST["main_size_shortliste_limit"],'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_DISABLE_JAVASCRIPT", $_POST["main_disable_javascript"],'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_BUTTON_HIDE_UNAUTHORIZED", $_POST["MAIN_BUTTON_HIDE_UNAUTHORIZED"],'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_START_WEEK", $_POST["MAIN_START_WEEK"],'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_DEFAULT_WORKING_DAYS", $_POST["MAIN_DEFAULT_WORKING_DAYS"],'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_DEFAULT_WORKING_HOURS", $_POST["MAIN_DEFAULT_WORKING_HOURS"],'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_SHOW_LOGO", $_POST["MAIN_SHOW_LOGO"],'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_FIRSTNAME_NAME_POSITION", $_POST["MAIN_FIRSTNAME_NAME_POSITION"],'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_SIZE_LISTE_LIMIT", $_POST["main_size_liste_limit"], 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_SIZE_SHORTLIST_LIMIT", $_POST["main_size_shortliste_limit"], 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_DISABLE_JAVASCRIPT", $_POST["main_disable_javascript"], 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_BUTTON_HIDE_UNAUTHORIZED", $_POST["MAIN_BUTTON_HIDE_UNAUTHORIZED"], 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_START_WEEK", $_POST["MAIN_START_WEEK"], 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_DEFAULT_WORKING_DAYS", $_POST["MAIN_DEFAULT_WORKING_DAYS"], 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_DEFAULT_WORKING_HOURS", $_POST["MAIN_DEFAULT_WORKING_HOURS"], 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_SHOW_LOGO", $_POST["MAIN_SHOW_LOGO"], 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_FIRSTNAME_NAME_POSITION", $_POST["MAIN_FIRSTNAME_NAME_POSITION"], 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_HELPCENTER_DISABLELINK", $_POST["MAIN_HELPCENTER_DISABLELINK"],'chaine',0,'',0); // Param for all entities - dolibarr_set_const($db, "MAIN_MOTD", dol_htmlcleanlastbr($_POST["main_motd"]),'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_HOME", dol_htmlcleanlastbr($_POST["main_home"]),'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_HELP_DISABLELINK", $_POST["MAIN_HELP_DISABLELINK"],'chaine',0,'',0); // Param for all entities - dolibarr_set_const($db, "MAIN_BUGTRACK_ENABLELINK", $_POST["MAIN_BUGTRACK_ENABLELINK"],'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_HELPCENTER_DISABLELINK", $_POST["MAIN_HELPCENTER_DISABLELINK"], 'chaine', 0, '', 0); // Param for all entities + dolibarr_set_const($db, "MAIN_MOTD", dol_htmlcleanlastbr($_POST["main_motd"]), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_HOME", dol_htmlcleanlastbr($_POST["main_home"]), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_HELP_DISABLELINK", $_POST["MAIN_HELP_DISABLELINK"], 'chaine', 0, '', 0); // Param for all entities + dolibarr_set_const($db, "MAIN_BUGTRACK_ENABLELINK", $_POST["MAIN_BUGTRACK_ENABLELINK"], 'chaine', 0, '', $conf->entity); $varforimage='imagebackground'; $dirforimage=$conf->mycompany->dir_output.'/logos/'; if ($_FILES[$varforimage]["tmp_name"]) { - if (preg_match('/([^\\/:]+)$/i',$_FILES[$varforimage]["name"],$reg)) + if (preg_match('/([^\\/:]+)$/i', $_FILES[$varforimage]["name"], $reg)) { $original_file=$reg[1]; @@ -168,17 +168,17 @@ if ($action == 'update') { dol_mkdir($dirforimage); } - $result=dol_move_uploaded_file($_FILES[$varforimage]["tmp_name"],$dirforimage.$original_file,1,0,$_FILES[$varforimage]['error']); + $result=dol_move_uploaded_file($_FILES[$varforimage]["tmp_name"], $dirforimage.$original_file, 1, 0, $_FILES[$varforimage]['error']); if ($result > 0) { - dolibarr_set_const($db, "MAIN_LOGIN_BACKGROUND",$original_file,'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_LOGIN_BACKGROUND", $original_file, 'chaine', 0, '', $conf->entity); } - else if (preg_match('/^ErrorFileIsInfectedWithAVirus/',$result)) + else if (preg_match('/^ErrorFileIsInfectedWithAVirus/', $result)) { $error++; $langs->load("errors"); - $tmparray=explode(':',$result); - setEventMessages($langs->trans('ErrorFileIsInfectedWithAVirus',$tmparray[1]), null, 'errors'); + $tmparray=explode(':', $result); + setEventMessages($langs->trans('ErrorFileIsInfectedWithAVirus', $tmparray[1]), null, 'errors'); } else { @@ -209,13 +209,13 @@ if ($action == 'update') */ $wikihelp='EN:First_setup|FR:Premiers_paramétrages|ES:Primeras_configuraciones'; -llxHeader('',$langs->trans("Setup"),$wikihelp); +llxHeader('', $langs->trans("Setup"), $wikihelp); $form=new Form($db); $formother=new FormOther($db); $formadmin=new FormAdmin($db); -print load_fiche_titre($langs->trans("GUISetup"),'','title_setup'); +print load_fiche_titre($langs->trans("GUISetup"), '', 'title_setup'); print $langs->trans("DisplayDesc")."
\n"; print "
\n"; @@ -247,7 +247,7 @@ if ($action == 'edit') // Edit // Multilingual GUI print ''; print ''; print ''; @@ -255,7 +255,7 @@ if ($action == 'edit') // Edit print '
'.$langs->trans("Parameter").'
'.$langs->trans("EnableMultilangInterface").''; - print $form->selectyesno('MAIN_MULTILANGS',$conf->global->MAIN_MULTILANGS,1); + print $form->selectyesno('MAIN_MULTILANGS', $conf->global->MAIN_MULTILANGS, 1); print ' 

'."\n"; // Themes and themes options - show_theme(null,1); + show_theme(null, 1); print '
'; // Other @@ -285,14 +285,14 @@ if ($action == 'edit') // Edit // Disable javascript and ajax print '
'.$langs->trans("DisableJavascript").''; - print $form->selectyesno('main_disable_javascript',isset($conf->global->MAIN_DISABLE_JAVASCRIPT)?$conf->global->MAIN_DISABLE_JAVASCRIPT:0,1); + print $form->selectyesno('main_disable_javascript', isset($conf->global->MAIN_DISABLE_JAVASCRIPT)?$conf->global->MAIN_DISABLE_JAVASCRIPT:0, 1); print ' 
'.$langs->trans("WeekStartOnDay").''; - print $formother->select_dayofweek((isset($conf->global->MAIN_START_WEEK)?$conf->global->MAIN_START_WEEK:'1'),'MAIN_START_WEEK',0); + print $formother->select_dayofweek((isset($conf->global->MAIN_START_WEEK)?$conf->global->MAIN_START_WEEK:'1'), 'MAIN_START_WEEK', 0); print ' 
'.$langs->trans("ButtonHideUnauthorized").''; - print $form->selectyesno('MAIN_BUTTON_HIDE_UNAUTHORIZED',isset($conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED)?$conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED:0,1); + print $form->selectyesno('MAIN_BUTTON_HIDE_UNAUTHORIZED', isset($conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED)?$conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED:0, 1); print ' 
'.$langs->trans("EnableShowLogo").''; - print $form->selectyesno('MAIN_SHOW_LOGO',$conf->global->MAIN_SHOW_LOGO,1); + print $form->selectyesno('MAIN_SHOW_LOGO', $conf->global->MAIN_SHOW_LOGO, 1); print ' 
'.$langs->trans("ShowBugTrackLink", $langs->transnoentitiesnoconv("FindBug")).''; - print $form->selectyesno('MAIN_BUGTRACK_ENABLELINK',$conf->global->MAIN_BUGTRACK_ENABLELINK,1); + print $form->selectyesno('MAIN_BUGTRACK_ENABLELINK', $conf->global->MAIN_BUGTRACK_ENABLELINK, 1); print ' 
'.$langs->trans("DisableLinkToHelp",$pictohelp).''; - print $form->selectyesno('MAIN_HELP_DISABLELINK', isset($conf->global->MAIN_HELP_DISABLELINK)?$conf->global->MAIN_HELP_DISABLELINK:0,1); + print '
'.$langs->trans("DisableLinkToHelp", $pictohelp).''; + print $form->selectyesno('MAIN_HELP_DISABLELINK', isset($conf->global->MAIN_HELP_DISABLELINK)?$conf->global->MAIN_HELP_DISABLELINK:0, 1); print ' 
'.$langs->trans("DisableLinkToHelpCenter").''; - print $form->selectyesno('MAIN_HELPCENTER_DISABLELINK',isset($conf->global->MAIN_HELPCENTER_DISABLELINK)?$conf->global->MAIN_HELPCENTER_DISABLELINK:0,1); + print $form->selectyesno('MAIN_HELPCENTER_DISABLELINK', isset($conf->global->MAIN_HELPCENTER_DISABLELINK)?$conf->global->MAIN_HELPCENTER_DISABLELINK:0, 1); print ' 
'; - if ($user->admin && $conf->global->MAIN_LANG_DEFAULT!='auto') print info_admin($langs->trans("SubmitTranslation".($conf->global->MAIN_LANG_DEFAULT=='en_US'?'ENUS':''),$conf->global->MAIN_LANG_DEFAULT),1); + if ($user->admin && $conf->global->MAIN_LANG_DEFAULT!='auto') print info_admin($langs->trans("SubmitTranslation".($conf->global->MAIN_LANG_DEFAULT=='en_US'?'ENUS':''), $conf->global->MAIN_LANG_DEFAULT), 1); print '
'.$langs->trans("ButtonHideUnauthorized").''; - print yn((isset($conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED)?$conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED:0),1); + print yn((isset($conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED)?$conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED:0), 1); print '
'.$langs->trans("DisableLinkToHelp",$pictohelp).''; - print yn((isset($conf->global->MAIN_HELP_DISABLELINK)?$conf->global->MAIN_HELP_DISABLELINK:0),1); + print '
'.$langs->trans("DisableLinkToHelp", $pictohelp).''; + print yn((isset($conf->global->MAIN_HELP_DISABLELINK)?$conf->global->MAIN_HELP_DISABLELINK:0), 1); print '
'.$langs->trans("DisableLinkToHelpCenter").''; - print yn((isset($conf->global->MAIN_HELPCENTER_DISABLELINK)?$conf->global->MAIN_HELPCENTER_DISABLELINK:0),1); + print yn((isset($conf->global->MAIN_HELPCENTER_DISABLELINK)?$conf->global->MAIN_HELPCENTER_DISABLELINK:0), 1); print '
'.$langs->trans("LDAPDnSynchroActiveExample"); if ($conf->global->LDAP_SYNCHRO_ACTIVE && ! $conf->global->LDAP_USER_DN) { @@ -140,7 +140,7 @@ if (! empty($conf->societe->enabled)) $arraylist=array(); $arraylist['0']=$langs->trans("No"); $arraylist['1']=$langs->trans("DolibarrToLDAP"); - print $form->selectarray('activecontact',$arraylist,$conf->global->LDAP_CONTACT_ACTIVE); + print $form->selectarray('activecontact', $arraylist, $conf->global->LDAP_CONTACT_ACTIVE); print ''.$langs->trans("LDAPDnContactActiveExample").'
'.$langs->trans("LDAPDnMemberActiveExample").'
'.$langs->trans("LDAPDnMemberTypeActiveExample").'
 
'.$langs->trans("Version").''; $arraylist=array(); $arraylist['3']='Version 3'; $arraylist['2']='Version 2'; -print $form->selectarray('LDAP_SERVER_PROTOCOLVERSION',$arraylist,$conf->global->LDAP_SERVER_PROTOCOLVERSION); +print $form->selectarray('LDAP_SERVER_PROTOCOLVERSION', $arraylist, $conf->global->LDAP_SERVER_PROTOCOLVERSION); print ''.$langs->trans("LDAPServerProtocolVersion").'
'.$langs->trans("LDAPServerUseTLS").''; $arraylist=array(); $arraylist['0']=$langs->trans("No"); $arraylist['1']=$langs->trans("Yes"); -print $form->selectarray('usetls',$arraylist,$conf->global->LDAP_SERVER_USE_TLS); +print $form->selectarray('usetls', $arraylist, $conf->global->LDAP_SERVER_USE_TLS); print ''.$langs->trans("LDAPServerUseTLSExample").'
'; - print $form->textwithpicto($langs->trans("MAIN_MAX_DECIMALS_UNIT"),$langs->trans("ParameterActiveForNextInputOnly")); + print $form->textwithpicto($langs->trans("MAIN_MAX_DECIMALS_UNIT"), $langs->trans("ParameterActiveForNextInputOnly")); print '
'; - print $form->textwithpicto($langs->trans("MAIN_MAX_DECIMALS_TOT"),$langs->trans("ParameterActiveForNextInputOnly")); + print $form->textwithpicto($langs->trans("MAIN_MAX_DECIMALS_TOT"), $langs->trans("ParameterActiveForNextInputOnly")); print '
'; - print $form->textwithpicto($langs->trans("MAIN_ROUNDING_RULE_TOT"),$langs->trans("ParameterActiveForNextInputOnly")); + print $form->textwithpicto($langs->trans("MAIN_ROUNDING_RULE_TOT"), $langs->trans("ParameterActiveForNextInputOnly")); print '
'; @@ -138,12 +138,12 @@ else print ''; - print $form->textwithpicto($langs->trans("MAIN_MAX_DECIMALS_UNIT"),$langs->trans("ParameterActiveForNextInputOnly")); + print $form->textwithpicto($langs->trans("MAIN_MAX_DECIMALS_UNIT"), $langs->trans("ParameterActiveForNextInputOnly")); print ''.$conf->global->MAIN_MAX_DECIMALS_UNIT.''; print ''; - print $form->textwithpicto($langs->trans("MAIN_MAX_DECIMALS_TOT"),$langs->trans("ParameterActiveForNextInputOnly")); + print $form->textwithpicto($langs->trans("MAIN_MAX_DECIMALS_TOT"), $langs->trans("ParameterActiveForNextInputOnly")); print ''.$conf->global->MAIN_MAX_DECIMALS_TOT.''; @@ -151,7 +151,7 @@ else print ''; - print $form->textwithpicto($langs->trans("MAIN_ROUNDING_RULE_TOT"),$langs->trans("ParameterActiveForNextInputOnly")); + print $form->textwithpicto($langs->trans("MAIN_ROUNDING_RULE_TOT"), $langs->trans("ParameterActiveForNextInputOnly")); print ''.$conf->global->MAIN_ROUNDING_RULE_TOT.''; print ''; @@ -176,22 +176,22 @@ else // Always show vat rates with vat 0 $s=2/7;$qty=1;$vat=0; - $tmparray=calcul_price_total(1,$qty*price2num($s,'MU'),0,$vat,0,0,0,'HT',0,0,$mysoc); - print $langs->trans("UnitPriceOfProduct").": ".price2num($s,'MU'); + $tmparray=calcul_price_total(1, $qty*price2num($s, 'MU'), 0, $vat, 0, 0, 0, 'HT', 0, 0, $mysoc); + print $langs->trans("UnitPriceOfProduct").": ".price2num($s, 'MU'); print " x ".$langs->trans("Quantity").": ".$qty; print " - ".$langs->trans("VAT").": ".$vat.'%'; print "   ->   ".$langs->trans("TotalPriceAfterRounding").": ".$tmparray[0].' / '.$tmparray[1].' / '.$tmparray[2]."
\n"; $s=10/3;$qty=1;$vat=0; - $tmparray=calcul_price_total(1,$qty*price2num($s,'MU'),0,$vat,0,0,0,'HT',0,0,$mysoc); - print $langs->trans("UnitPriceOfProduct").": ".price2num($s,'MU'); + $tmparray=calcul_price_total(1, $qty*price2num($s, 'MU'), 0, $vat, 0, 0, 0, 'HT', 0, 0, $mysoc); + print $langs->trans("UnitPriceOfProduct").": ".price2num($s, 'MU'); print " x ".$langs->trans("Quantity").": ".$qty; print " - ".$langs->trans("VAT").": ".$vat.'%'; print "   ->   ".$langs->trans("TotalPriceAfterRounding").": ".$tmparray[0].' / '.$tmparray[1].' / '.$tmparray[2]."
\n"; $s=10/3;$qty=2;$vat=0; - $tmparray=calcul_price_total(1,$qty*price2num($s,'MU'),0,$vat,0,0,0,'HT',0, 0,$mysoc); - print $langs->trans("UnitPriceOfProduct").": ".price2num($s,'MU'); + $tmparray=calcul_price_total(1, $qty*price2num($s, 'MU'), 0, $vat, 0, 0, 0, 'HT', 0, 0, $mysoc); + print $langs->trans("UnitPriceOfProduct").": ".price2num($s, 'MU'); print " x ".$langs->trans("Quantity").": ".$qty; print " - ".$langs->trans("VAT").": ".$vat.'%'; print "   ->   ".$langs->trans("TotalPriceAfterRounding").": ".$tmparray[0].' / '.$tmparray[1].' / '.$tmparray[2]."
\n"; @@ -226,8 +226,8 @@ else for ($qty=1; $qty<=2; $qty++) { $s=10/3; - $tmparray=calcul_price_total(1,$qty*price2num($s,'MU'),0,$vat,0,0,0,'HT',0, 0,$mysoc); - print $langs->trans("UnitPriceOfProduct").": ".price2num($s,'MU'); + $tmparray=calcul_price_total(1, $qty*price2num($s, 'MU'), 0, $vat, 0, 0, 0, 'HT', 0, 0, $mysoc); + print $langs->trans("UnitPriceOfProduct").": ".price2num($s, 'MU'); print " x ".$langs->trans("Quantity").": ".$qty; print " - ".$langs->trans("VAT").": ".$vat.'%'; print "   ->   ".$langs->trans("TotalPriceAfterRounding").": ".$tmparray[0].' / '.$tmparray[1].' / '.$tmparray[2]."
\n"; @@ -241,15 +241,15 @@ else // were calculated to show all possible cases of rounding. If we change this, examples becomes useless or show the same rounding rule. $s=10/3;$qty=1;$vat=10; - $tmparray=calcul_price_total(1,$qty*price2num($s,'MU'),0,$vat,0,0,0,'HT',0, 0,$mysoc); - print $langs->trans("UnitPriceOfProduct").": ".price2num($s,'MU'); + $tmparray=calcul_price_total(1, $qty*price2num($s, 'MU'), 0, $vat, 0, 0, 0, 'HT', 0, 0, $mysoc); + print $langs->trans("UnitPriceOfProduct").": ".price2num($s, 'MU'); print " x ".$langs->trans("Quantity").": ".$qty; print " - ".$langs->trans("VAT").": ".$vat.'%'; print "   ->   ".$langs->trans("TotalPriceAfterRounding").": ".$tmparray[0].' / '.$tmparray[1].' / '.$tmparray[2]."
\n"; $s=10/3;$qty=2;$vat=10; - $tmparray=calcul_price_total(1,$qty*price2num($s,'MU'),0,$vat,0,0,0,'HT',0, 0,$mysoc); - print $langs->trans("UnitPriceOfProduct").": ".price2num($s,'MU'); + $tmparray=calcul_price_total(1, $qty*price2num($s, 'MU'), 0, $vat, 0, 0, 0, 'HT', 0, 0, $mysoc); + print $langs->trans("UnitPriceOfProduct").": ".price2num($s, 'MU'); print " x ".$langs->trans("Quantity").": ".$qty; print " - ".$langs->trans("VAT").": ".$vat.'%'; print "   ->   ".$langs->trans("TotalPriceAfterRounding").": ".$tmparray[0].' / '.$tmparray[1].' / '.$tmparray[2]."
\n"; diff --git a/htdocs/admin/livraison.php b/htdocs/admin/livraison.php index a7c38a95e1f..37b7d7d8408 100644 --- a/htdocs/admin/livraison.php +++ b/htdocs/admin/livraison.php @@ -39,10 +39,10 @@ $langs->loadLangs(array("admin", "sendings", "deliveries", "other")); if (!$user->admin) accessforbidden(); -$action = GETPOST('action','alpha'); -$value = GETPOST('value','alpha'); -$label = GETPOST('label','alpha'); -$scandir = GETPOST('scan_dir','alpha'); +$action = GETPOST('action', 'alpha'); +$value = GETPOST('value', 'alpha'); +$label = GETPOST('label', 'alpha'); +$scandir = GETPOST('scan_dir', 'alpha'); $type='delivery'; @@ -54,9 +54,9 @@ include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php'; if ($action == 'updateMask') { - $maskconstdelivery=GETPOST('maskconstdelivery','alpha'); - $maskdelivery=GETPOST('maskdelivery','alpha'); - if ($maskconstdelivery) $res = dolibarr_set_const($db,$maskconstdelivery,$maskdelivery,'chaine',0,'',$conf->entity); + $maskconstdelivery=GETPOST('maskconstdelivery', 'alpha'); + $maskdelivery=GETPOST('maskdelivery', 'alpha'); + if ($maskconstdelivery) $res = dolibarr_set_const($db, $maskconstdelivery, $maskdelivery, 'chaine', 0, '', $conf->entity); if (! $res > 0) $error++; @@ -72,8 +72,8 @@ if ($action == 'updateMask') if ($action == 'set_DELIVERY_FREE_TEXT') { - $free=GETPOST('DELIVERY_FREE_TEXT','none'); // No alpha here, we want exact string - $res=dolibarr_set_const($db, "DELIVERY_FREE_TEXT",$free,'chaine',0,'',$conf->entity); + $free=GETPOST('DELIVERY_FREE_TEXT', 'none'); // No alpha here, we want exact string + $res=dolibarr_set_const($db, "DELIVERY_FREE_TEXT", $free, 'chaine', 0, '', $conf->entity); if (! $res > 0) $error++; @@ -89,17 +89,17 @@ if ($action == 'set_DELIVERY_FREE_TEXT') if ($action == 'specimen') { - $modele=GETPOST('module','alpha'); + $modele=GETPOST('module', 'alpha'); $sending = new Livraison($db); $sending->initAsSpecimen(); // Search template files $file=''; $classname=''; $filefound=0; - $dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']); + $dirmodels=array_merge(array('/'), (array) $conf->modules_parts['models']); foreach($dirmodels as $reldir) { - $file=dol_buildpath($reldir."core/modules/livraison/doc/pdf_".$modele.".modules.php",0); + $file=dol_buildpath($reldir."core/modules/livraison/doc/pdf_".$modele.".modules.php", 0); if (file_exists($file)) { $filefound=1; @@ -114,7 +114,7 @@ if ($action == 'specimen') $module = new $classname($db); - if ($module->write_file($sending,$langs) > 0) + if ($module->write_file($sending, $langs) > 0) { header("Location: ".DOL_URL_ROOT."/document.php?modulepart=livraison&file=SPECIMEN.pdf"); return; @@ -142,13 +142,13 @@ if ($action == 'del') $ret = delDocumentModel($value, $type); if ($ret > 0) { - if ($conf->global->LIVRAISON_ADDON_PDF == "$value") dolibarr_del_const($db, 'LIVRAISON_ADDON_PDF',$conf->entity); + if ($conf->global->LIVRAISON_ADDON_PDF == "$value") dolibarr_del_const($db, 'LIVRAISON_ADDON_PDF', $conf->entity); } } if ($action == 'setdoc') { - if (dolibarr_set_const($db, "LIVRAISON_ADDON_PDF",$value,'chaine',0,'',$conf->entity)) + if (dolibarr_set_const($db, "LIVRAISON_ADDON_PDF", $value, 'chaine', 0, '', $conf->entity)) { // La constante qui a ete lue en avant du nouveau set // on passe donc par une variable pour avoir un affichage coherent @@ -168,7 +168,7 @@ if ($action == 'setmod') // TODO Verifier si module numerotation choisi peut etre active // par appel methode canBeActivated - dolibarr_set_const($db, "LIVRAISON_ADDON_NUMBER",$value,'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "LIVRAISON_ADDON_NUMBER", $value, 'chaine', 0, '', $conf->entity); } @@ -176,14 +176,14 @@ if ($action == 'setmod') * View */ -$dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']); +$dirmodels=array_merge(array('/'), (array) $conf->modules_parts['models']); -llxHeader("",""); +llxHeader("", ""); $form=new Form($db); $linkback=''.$langs->trans("BackToModuleList").''; -print load_fiche_titre($langs->trans("SendingsSetup"),$linkback,'title_setup'); +print load_fiche_titre($langs->trans("SendingsSetup"), $linkback, 'title_setup'); print '
'; $head = expedition_admin_prepare_head(); @@ -192,7 +192,7 @@ dol_fiche_head($head, 'receivings', $langs->trans("Receivings"), -1, 'sending'); // Delivery numbering model -print load_fiche_titre($langs->trans("DeliveryOrderNumberingModules"),'',''); +print load_fiche_titre($langs->trans("DeliveryOrderNumberingModules"), '', ''); print ''; print ''; @@ -238,7 +238,7 @@ foreach ($dirmodels as $reldir) // Show example of numbering module print ''; @@ -262,11 +262,11 @@ foreach ($dirmodels as $reldir) // Info $htmltooltip=''; $htmltooltip.=''.$langs->trans("Version").': '.$module->getVersion().'
'; - $nextval=$module->getNextValue($mysoc,$livraison); + $nextval=$module->getNextValue($mysoc, $livraison); if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval $htmltooltip.=''.$langs->trans("NextValue").': '; if ($nextval) { - if (preg_match('/^Error/',$nextval) || $nextval=='NotConfigured') + if (preg_match('/^Error/', $nextval) || $nextval=='NotConfigured') $nextval = $langs->trans($nextval); $htmltooltip.=$nextval.'
'; } else { @@ -275,7 +275,7 @@ foreach ($dirmodels as $reldir) } print ''; print ''; @@ -294,7 +294,7 @@ print '
'; $tmp=$module->getExample(); - if (preg_match('/^Error/',$tmp)) { + if (preg_match('/^Error/', $tmp)) { $langs->load("errors"); print '
'.$langs->trans($tmp).'
'; } elseif ($tmp=='NotConfigured') print $langs->trans($tmp); @@ -248,11 +248,11 @@ foreach ($dirmodels as $reldir) print '
'; if ($conf->global->LIVRAISON_ADDON_NUMBER == "$file") { - print img_picto($langs->trans("Activated"),'switch_on'); + print img_picto($langs->trans("Activated"), 'switch_on'); } else { - print ''.img_picto($langs->trans("Disabled"),'switch_off').''; + print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; } print ''; - print $form->textwithpicto('',$htmltooltip,1,0); + print $form->textwithpicto('', $htmltooltip, 1, 0); print '
'; * Documents Models for delivery */ print '
'; -print load_fiche_titre($langs->trans("DeliveryOrderModel"),'',''); +print load_fiche_titre($langs->trans("DeliveryOrderModel"), '', ''); // Defini tableau def de modele $type="delivery"; @@ -352,7 +352,7 @@ foreach ($dirmodels as $reldir) foreach($filelist as $file) { - if (preg_match('/\.modules\.php$/i',$file) && preg_match('/^(pdf_|doc_)/',$file)) + if (preg_match('/\.modules\.php$/i', $file) && preg_match('/^(pdf_|doc_)/', $file)) { if (file_exists($dir.'/'.$file)) { @@ -373,7 +373,7 @@ foreach ($dirmodels as $reldir) print ''; print (empty($module->name)?$name:$module->name); print "\n"; - if (method_exists($module,'info')) print $module->info($langs); + if (method_exists($module, 'info')) print $module->info($langs); else print $module->description; print ''; @@ -382,14 +382,14 @@ foreach ($dirmodels as $reldir) { print "\n"; print 'scandir.'&label='.urlencode($module->name).'">'; - print img_picto($langs->trans("Enabled"),'switch_on'); + print img_picto($langs->trans("Enabled"), 'switch_on'); print ''; print ""; } else { print "\n"; - print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').''; + print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; print ""; } @@ -397,11 +397,11 @@ foreach ($dirmodels as $reldir) print ""; if ($conf->global->LIVRAISON_ADDON_PDF == "$name") { - print img_picto($langs->trans("Default"),'on'); + print img_picto($langs->trans("Default"), 'on'); } else { - print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').''; + print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; } print ''; @@ -409,20 +409,20 @@ foreach ($dirmodels as $reldir) $htmltooltip = ''.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown")); $htmltooltip.='
'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur; $htmltooltip.='

'.$langs->trans("FeaturesSupported").':'; - $htmltooltip.='
'.$langs->trans("Logo").': '.yn($module->option_logo,1,1); + $htmltooltip.='
'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1); print ''; - print $form->textwithpicto('',$htmltooltip,1,0); + print $form->textwithpicto('', $htmltooltip, 1, 0); print ''; // Preview print ''; if ($module->type == 'pdf') { - print ''.img_object($langs->trans("Preview"),'sending').''; + print ''.img_object($langs->trans("Preview"), 'sending').''; } else { - print img_object($langs->trans("PreviewNotAvailable"),'generic'); + print img_object($langs->trans("PreviewNotAvailable"), 'generic'); } print ''; @@ -440,7 +440,7 @@ print ''; * Autres Options */ print "
"; -print load_fiche_titre($langs->trans("OtherOptions"),'',''); +print load_fiche_titre($langs->trans("OtherOptions"), '', ''); print ''; print ''; @@ -468,7 +468,7 @@ if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) else { include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor=new DolEditor($variablename, $conf->global->$variablename,'',80,'dolibarr_notes'); + $doleditor=new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes'); print $doleditor->Create(); } print ''; // Force e-mail recipient @@ -273,7 +273,7 @@ if ($action == 'edit') //Add user to select destinaries list print ''; // Separator @@ -285,14 +285,14 @@ if ($action == 'edit') // SuperAdministrator access only if ((empty($conf->global->MAIN_MODULE_MULTICOMPANY)) || ($user->admin && !$user->entity)) { - print $form->selectarray('MAIN_MAIL_SENDMODE',$listofmethods,$conf->global->MAIN_MAIL_SENDMODE); + print $form->selectarray('MAIN_MAIL_SENDMODE', $listofmethods, $conf->global->MAIN_MAIL_SENDMODE); } else { $text = $listofmethods[$conf->global->MAIN_MAIL_SENDMODE]; if (empty($text)) $text = $langs->trans("Undefined"); $htmltext = $langs->trans("ContactSuperAdminForChange"); - print $form->textwithpicto($text,$htmltext,1,'superadmin'); + print $form->textwithpicto($text, $htmltext, 1, 'superadmin'); print ''; } print ''; @@ -310,7 +310,7 @@ if ($action == 'edit') $mainserver = (! empty($conf->global->MAIN_MAIL_SMTP_SERVER)?$conf->global->MAIN_MAIL_SMTP_SERVER:''); $smtpserver = ini_get('SMTP')?ini_get('SMTP'):$langs->transnoentities("Undefined"); if ($linuxlike) print $langs->trans("MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike"); - else print $langs->trans("MAIN_MAIL_SMTP_SERVER",$smtpserver); + else print $langs->trans("MAIN_MAIL_SMTP_SERVER", $smtpserver); print ''; @@ -395,7 +395,7 @@ if ($action == 'edit') else { $htmltext = $langs->trans("ContactSuperAdminForChange"); - print $form->textwithpicto($conf->global->MAIN_MAIL_SMTPS_PW,$htmltext,1,'superadmin'); + print $form->textwithpicto($conf->global->MAIN_MAIL_SMTPS_PW, $htmltext, 1, 'superadmin'); print ''; } print ''; @@ -407,7 +407,7 @@ if ($action == 'edit') { if (function_exists('openssl_open')) { - print $form->selectyesno('MAIN_MAIL_EMAIL_TLS',(! empty($conf->global->MAIN_MAIL_EMAIL_TLS)?$conf->global->MAIN_MAIL_EMAIL_TLS:0),1); + print $form->selectyesno('MAIN_MAIL_EMAIL_TLS', (! empty($conf->global->MAIN_MAIL_EMAIL_TLS)?$conf->global->MAIN_MAIL_EMAIL_TLS:0), 1); } else print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')'; } @@ -420,7 +420,7 @@ if ($action == 'edit') { if (function_exists('openssl_open')) { - print $form->selectyesno('MAIN_MAIL_EMAIL_STARTTLS',(! empty($conf->global->MAIN_MAIL_EMAIL_STARTTLS)?$conf->global->MAIN_MAIL_EMAIL_STARTTLS:0),1); + print $form->selectyesno('MAIN_MAIL_EMAIL_STARTTLS', (! empty($conf->global->MAIN_MAIL_EMAIL_STARTTLS)?$conf->global->MAIN_MAIL_EMAIL_STARTTLS:0), 1); } else print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')'; } @@ -433,7 +433,7 @@ if ($action == 'edit') { if (function_exists('openssl_open')) { - print $form->selectyesno('MAIN_MAIL_EMAIL_DKIM_ENABLED',(! empty($conf->global->MAIN_MAIL_EMAIL_DKIM_ENABLED)?$conf->global->MAIN_MAIL_EMAIL_DKIM_ENABLED:0),1); + print $form->selectyesno('MAIN_MAIL_EMAIL_DKIM_ENABLED', (! empty($conf->global->MAIN_MAIL_EMAIL_DKIM_ENABLED)?$conf->global->MAIN_MAIL_EMAIL_DKIM_ENABLED:0), 1); } else print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')'; } @@ -459,7 +459,7 @@ if ($action == 'edit') print ''; // From - print ''; + print ''; print ''; @@ -553,7 +553,7 @@ else } else { - print ''; + print ''; } // Port @@ -563,7 +563,7 @@ else } else { - print ''; + print ''; } // SMTPS ID @@ -575,7 +575,7 @@ else // SMTPS PW if (isset($conf->global->MAIN_MAIL_SENDMODE) && in_array($conf->global->MAIN_MAIL_SENDMODE, array('smtps', 'swiftmailer'))) { - print ''; + print ''; } // TLS @@ -640,7 +640,7 @@ else print ''; // From - print ''; + print ''; print ''; @@ -785,12 +785,12 @@ else print load_fiche_titre($langs->trans("DoTestServerAvailability")); include_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; - $mail = new CMailFile('','','',''); - $result=$mail->check_server_port($server,$port); - if ($result) print '
'.$langs->trans("ServerAvailableOnIPOrPort",$server,$port).'
'; + $mail = new CMailFile('', '', '', ''); + $result=$mail->check_server_port($server, $port); + if ($result) print '
'.$langs->trans("ServerAvailableOnIPOrPort", $server, $port).'
'; else { - $errormsg = $langs->trans("ServerNotAvailableOnIPOrPort",$server,$port); + $errormsg = $langs->trans("ServerNotAvailableOnIPOrPort", $server, $port); if ($mail->error) { $errormsg .= ' - '.$mail->error; @@ -848,7 +848,7 @@ else $formmail->clear_attached_files(); } - print $formmail->get_form('addfile','removefile'); + print $formmail->get_form('addfile', 'removefile'); dol_fiche_end(); } diff --git a/htdocs/admin/mails_emailing.php b/htdocs/admin/mails_emailing.php index b8a4a85026b..4ce8d8c0b72 100644 --- a/htdocs/admin/mails_emailing.php +++ b/htdocs/admin/mails_emailing.php @@ -30,7 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; // Load translation files required by the page $langs->loadLangs(array('companies', 'products', 'admin', 'mails', 'other', 'errors')); -$action=GETPOST('action','alpha'); +$action=GETPOST('action', 'alpha'); if (! $user->admin) accessforbidden(); @@ -61,13 +61,13 @@ complete_substitutions_array($substitutionarrayfortest, $langs); if ($action == 'update' && empty($_POST["cancel"])) { // Send mode parameters - dolibarr_set_const($db, "MAIN_MAIL_SENDMODE_EMAILING", GETPOST("MAIN_MAIL_SENDMODE_EMAILING"),'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_MAIL_SMTP_PORT_EMAILING", GETPOST("MAIN_MAIL_SMTP_PORT_EMAILING"),'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_MAIL_SMTP_SERVER_EMAILING", GETPOST("MAIN_MAIL_SMTP_SERVER_EMAILING"),'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_MAIL_SMTPS_ID_EMAILING", GETPOST("MAIN_MAIL_SMTPS_ID_EMAILING"), 'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_MAIL_SMTPS_PW_EMAILING", GETPOST("MAIN_MAIL_SMTPS_PW_EMAILING"), 'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_MAIL_EMAIL_TLS_EMAILING", GETPOST("MAIN_MAIL_EMAIL_TLS_EMAILING"),'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_MAIL_EMAIL_STARTTLS_EMAILING", GETPOST("MAIN_MAIL_EMAIL_STARTTLS_EMAILING"),'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_MAIL_SENDMODE_EMAILING", GETPOST("MAIN_MAIL_SENDMODE_EMAILING"), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_MAIL_SMTP_PORT_EMAILING", GETPOST("MAIN_MAIL_SMTP_PORT_EMAILING"), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_MAIL_SMTP_SERVER_EMAILING", GETPOST("MAIN_MAIL_SMTP_SERVER_EMAILING"), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_MAIL_SMTPS_ID_EMAILING", GETPOST("MAIN_MAIL_SMTPS_ID_EMAILING"), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_MAIL_SMTPS_PW_EMAILING", GETPOST("MAIN_MAIL_SMTPS_PW_EMAILING"), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_MAIL_EMAIL_TLS_EMAILING", GETPOST("MAIN_MAIL_EMAIL_TLS_EMAILING"), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_MAIL_EMAIL_STARTTLS_EMAILING", GETPOST("MAIN_MAIL_EMAIL_STARTTLS_EMAILING"), 'chaine', 0, '', $conf->entity); header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup"); exit; @@ -95,8 +95,8 @@ if ($action == 'presend' && GETPOST('trackid') == 'testhtml') $action='testhtm */ $linuxlike=1; -if (preg_match('/^win/i',PHP_OS)) $linuxlike=0; -if (preg_match('/^mac/i',PHP_OS)) $linuxlike=0; +if (preg_match('/^win/i', PHP_OS)) $linuxlike=0; +if (preg_match('/^mac/i', PHP_OS)) $linuxlike=0; if (empty($conf->global->MAIN_MAIL_SENDMODE_EMAILING)) $conf->global->MAIN_MAIL_SENDMODE_EMAILING='default'; $port=! empty($conf->global->MAIN_MAIL_SMTP_PORT_EMAILING)?$conf->global->MAIN_MAIL_SMTP_PORT_EMAILING:ini_get('smtp_port'); @@ -106,9 +106,9 @@ if (! $server) $server='127.0.0.1'; $wikihelp='EN:Setup_EMails|FR:Paramétrage_EMails|ES:Configuración_EMails'; -llxHeader('',$langs->trans("Setup"),$wikihelp); +llxHeader('', $langs->trans("Setup"), $wikihelp); -print load_fiche_titre($langs->trans("EMailsSetup"),'','title_setup'); +print load_fiche_titre($langs->trans("EMailsSetup"), '', 'title_setup'); $head = email_admin_prepare_head(); @@ -235,14 +235,14 @@ if ($action == 'edit') // SuperAdministrator access only if ((empty($conf->global->MAIN_MODULE_MULTICOMPANY)) || ($user->admin && !$user->entity)) { - print $form->selectarray('MAIN_MAIL_SENDMODE_EMAILING',$listofmethods,$conf->global->MAIN_MAIL_SENDMODE_EMAILING); + print $form->selectarray('MAIN_MAIL_SENDMODE_EMAILING', $listofmethods, $conf->global->MAIN_MAIL_SENDMODE_EMAILING); } else { $text = $listofmethods[$conf->global->MAIN_MAIL_SENDMODE_EMAILING]; if (empty($text)) $text = $langs->trans("Undefined"); $htmltext = $langs->trans("ContactSuperAdminForChange"); - print $form->textwithpicto($text,$htmltext,1,'superadmin'); + print $form->textwithpicto($text, $htmltext, 1, 'superadmin'); print ''; } print ''; @@ -261,7 +261,7 @@ if ($action == 'edit') $mainserver = (! empty($conf->global->MAIN_MAIL_SMTP_SERVER_EMAILING)?$conf->global->MAIN_MAIL_SMTP_SERVER_EMAILING:''); $smtpserver = ini_get('SMTP')?ini_get('SMTP'):$langs->transnoentities("Undefined"); if ($linuxlike) print $langs->trans("MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike"); - else print $langs->trans("MAIN_MAIL_SMTP_SERVER",$smtpserver); + else print $langs->trans("MAIN_MAIL_SMTP_SERVER", $smtpserver); print ''; @@ -346,7 +346,7 @@ if ($action == 'edit') else { $htmltext = $langs->trans("ContactSuperAdminForChange"); - print $form->textwithpicto($conf->global->MAIN_MAIL_SMTPS_PW_EMAILING,$htmltext,1,'superadmin'); + print $form->textwithpicto($conf->global->MAIN_MAIL_SMTPS_PW_EMAILING, $htmltext, 1, 'superadmin'); print ''; } print ''; @@ -359,7 +359,7 @@ if ($action == 'edit') { if (function_exists('openssl_open')) { - print $form->selectyesno('MAIN_MAIL_EMAIL_TLS_EMAILING',(! empty($conf->global->MAIN_MAIL_EMAIL_TLS_EMAILING)?$conf->global->MAIN_MAIL_EMAIL_TLS_EMAILING:0),1); + print $form->selectyesno('MAIN_MAIL_EMAIL_TLS_EMAILING', (! empty($conf->global->MAIN_MAIL_EMAIL_TLS_EMAILING)?$conf->global->MAIN_MAIL_EMAIL_TLS_EMAILING:0), 1); } else print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')'; } @@ -373,7 +373,7 @@ if ($action == 'edit') { if (function_exists('openssl_open')) { - print $form->selectyesno('MAIN_MAIL_EMAIL_STARTTLS_EMAILING',(! empty($conf->global->MAIN_MAIL_EMAIL_STARTTLS_EMAILING)?$conf->global->MAIN_MAIL_EMAIL_STARTTLS_EMAILING:0),1); + print $form->selectyesno('MAIN_MAIL_EMAIL_STARTTLS_EMAILING', (! empty($conf->global->MAIN_MAIL_EMAIL_STARTTLS_EMAILING)?$conf->global->MAIN_MAIL_EMAIL_STARTTLS_EMAILING:0), 1); } else print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')'; } @@ -418,7 +418,7 @@ else } else { - print ''; + print ''; } // Port @@ -428,7 +428,7 @@ else } else { - print ''; + print ''; } // SMTPS ID @@ -440,7 +440,7 @@ else // SMTPS PW if (isset($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && in_array($conf->global->MAIN_MAIL_SENDMODE_EMAILING, array('smtps', 'swiftmailer'))) { - print ''; + print ''; } // TLS @@ -535,12 +535,12 @@ else print load_fiche_titre($langs->trans("DoTestServerAvailability")); include_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; - $mail = new CMailFile('','','',''); - $result=$mail->check_server_port($server,$port); - if ($result) print '
'.$langs->trans("ServerAvailableOnIPOrPort",$server,$port).'
'; + $mail = new CMailFile('', '', '', ''); + $result=$mail->check_server_port($server, $port); + if ($result) print '
'.$langs->trans("ServerAvailableOnIPOrPort", $server, $port).'
'; else { - $errormsg = $langs->trans("ServerNotAvailableOnIPOrPort",$server,$port); + $errormsg = $langs->trans("ServerNotAvailableOnIPOrPort", $server, $port); if ($mail->error) { $errormsg .= ' - '.$mail->error; @@ -595,7 +595,7 @@ else $formmail->clear_attached_files(); } - print $formmail->get_form('addfile','removefile'); + print $formmail->get_form('addfile', 'removefile'); dol_fiche_end(); } diff --git a/htdocs/admin/mails_senderprofile_list.php b/htdocs/admin/mails_senderprofile_list.php index 12703d5d38a..35366d09697 100644 --- a/htdocs/admin/mails_senderprofile_list.php +++ b/htdocs/admin/mails_senderprofile_list.php @@ -32,23 +32,23 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/emailsenderprofile.class.php'; // Load translation files required by the page $langs->loadLangs(array("errors","admin","mails","languages")); -$action = GETPOST('action','alpha')?GETPOST('action','alpha'):'view'; // The action 'add', 'create', 'edit', 'update', 'view', ... -$massaction = GETPOST('massaction','alpha'); // The bulk action (combo box choice into lists) -$show_files = GETPOST('show_files','int'); // Show files area generated by bulk actions ? -$confirm = GETPOST('confirm','alpha'); // Result of a confirmation +$action = GETPOST('action', 'alpha')?GETPOST('action', 'alpha'):'view'; // The action 'add', 'create', 'edit', 'update', 'view', ... +$massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists) +$show_files = GETPOST('show_files', 'int'); // Show files area generated by bulk actions ? +$confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation $cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button $toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list -$contextpage= GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'emailsenderprofilelist'; // To manage different context of search -$backtopage = GETPOST('backtopage','alpha'); // Go back to a dedicated page -$optioncss = GETPOST('optioncss','aZ'); // Option for the css output (always '' except when 'print') +$contextpage= GETPOST('contextpage', 'aZ')?GETPOST('contextpage', 'aZ'):'emailsenderprofilelist'; // To manage different context of search +$backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page +$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') -$id = GETPOST('id','int'); +$id = GETPOST('id', 'int'); // Load variable for pagination -$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit; -$sortfield = GETPOST('sortfield','alpha'); -$sortorder = GETPOST('sortorder','alpha'); -$page = GETPOST('page','int'); +$limit = GETPOST('limit', 'int')?GETPOST('limit', 'int'):$conf->liste_limit; +$sortfield = GETPOST('sortfield', 'alpha'); +$sortorder = GETPOST('sortorder', 'alpha'); +$page = GETPOST('page', 'int'); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 $offset = $limit * $page; $pageprev = $page - 1; @@ -61,7 +61,7 @@ $diroutputmassaction=$conf->admin->dir_output . '/temp/massgeneration/'.$user->i $hookmanager->initHooks(array('emailsenderprofilelist')); // Note that conf->hooks_modules contains array // Fetch optionals attributes and labels $extralabels = $extrafields->fetch_name_optionals_label('emailsenderprofile'); -$search_array_options=$extrafields->getOptionalsFromPost($object->table_element,'','search_'); +$search_array_options=$extrafields->getOptionalsFromPost($object->table_element, '', 'search_'); // Default sort order (if not yet defined by previous GETPOST) if (! $sortfield) $sortfield="t.".key($object->fields); // Set here default search field. By default 1st field in definition. @@ -76,11 +76,11 @@ if ($user->societe_id > 0) } // Initialize array of search criterias -$search_all=trim(GETPOST("search_all",'alpha')); +$search_all=trim(GETPOST("search_all", 'alpha')); $search=array(); foreach($object->fields as $key => $val) { - if (GETPOST('search_'.$key,'alpha')) $search[$key]=GETPOST('search_'.$key,'alpha'); + if (GETPOST('search_'.$key, 'alpha')) $search[$key]=GETPOST('search_'.$key, 'alpha'); } // List of fields to search into when doing a "search in all" @@ -113,8 +113,8 @@ if (is_array($extrafields->attribute_label) && count($extrafields->attribute_lab * Actions */ -if (GETPOST('cancel','alpha')) { $action='list'; $massaction=''; } -if (! GETPOST('confirmmassaction','alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; } +if (GETPOST('cancel', 'alpha')) { $action='list'; $massaction=''; } +if (! GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; } $parameters=array(); $reshook=$hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks @@ -126,7 +126,7 @@ if (empty($reshook)) include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; // Purge search criteria - if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') ||GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers + if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') ||GETPOST('button_removefilter', 'alpha')) // All tests are required to be compatible with all browsers { foreach($object->fields as $key => $val) { @@ -135,8 +135,8 @@ if (empty($reshook)) $toselect=''; $search_array_options=array(); } - if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha') - || GETPOST('button_search_x','alpha') || GETPOST('button_search.x','alpha') || GETPOST('button_search','alpha')) + if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha') + || GETPOST('button_search_x', 'alpha') || GETPOST('button_search.x', 'alpha') || GETPOST('button_search', 'alpha')) { $massaction=''; // Protection to avoid mass action if we force a new search during a mass action confirmation } @@ -171,7 +171,7 @@ $titre=$langs->trans("EMailsSetup"); $linkback=''; $titlepicto='title_setup'; -print load_fiche_titre($titre,$linkback,$titlepicto); +print load_fiche_titre($titre, $linkback, $titlepicto); $head = email_admin_prepare_head(); @@ -190,7 +190,7 @@ foreach ($extrafields->attribute_label as $key => $val) $sql.=($extrafields->att $parameters=array(); $reshook=$hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook $sql.=$hookmanager->resPrint; -$sql=preg_replace('/, $/','', $sql); +$sql=preg_replace('/, $/', '', $sql); $sql.= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t"; if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."myobject_extrafields as ef on (t.rowid = ef.fk_object)"; if ($object->ismultientitymanaged == 1) $sql.= " WHERE t.entity IN (".getEntity('emailsenderprofile').")"; @@ -222,7 +222,7 @@ $reshook=$hookmanager->executeHooks('printFieldListGroupBy',$parameters); // $sql.=$hookmanager->resPrint; */ -$sql.=$db->order($sortfield,$sortorder); +$sql.=$db->order($sortfield, $sortorder); // Count total nb of records $nbtotalofrecords = ''; @@ -381,7 +381,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; $parameters=array('arrayfields'=>$arrayfields,'param'=>$param,'sortfield'=>$sortfield,'sortorder'=>$sortorder); $reshook=$hookmanager->executeHooks('printFieldListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; -print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"],"",'','','align="center"',$sortfield,$sortorder,'maxwidthsearch ')."\n"; +print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], "", '', '', 'align="center"', $sortfield, $sortorder, 'maxwidthsearch ')."\n"; print ''."\n"; @@ -389,7 +389,7 @@ print ''."\n"; $needToFetchEachLine=0; foreach ($extrafields->attribute_computed as $key => $val) { - if (preg_match('/\$object/',$val)) $needToFetchEachLine++; // There is at least one compute field that use $object + if (preg_match('/\$object/', $val)) $needToFetchEachLine++; // There is at least one compute field that use $object } @@ -496,7 +496,7 @@ print ''."\n"; print ''."\n"; -if (in_array('builddoc',$arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) +if (in_array('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) { require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; $formfile = new FormFile($db); @@ -506,13 +506,13 @@ if (in_array('builddoc',$arrayofmassactions) && ($nbtotalofrecords === '' || $nb // Show list of available documents $urlsource=$_SERVER['PHP_SELF'].'?sortfield='.$sortfield.'&sortorder='.$sortorder; - $urlsource.=str_replace('&','&',$param); + $urlsource.=str_replace('&', '&', $param); $filedir=$diroutputmassaction; $genallowed=$user->rights->monmodule->read; $delallowed=$user->rights->monmodule->create; - print $formfile->showdocuments('massfilesarea_monmodule','',$filedir,$urlsource,0,$delallowed,'',1,1,0,48,1,$param,$title,'','','',null,$hidegeneratedfilelistifempty); + print $formfile->showdocuments('massfilesarea_monmodule', '', $filedir, $urlsource, 0, $delallowed, '', 1, 1, 0, 48, 1, $param, $title, '', '', '', null, $hidegeneratedfilelistifempty); } dol_fiche_end(); diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php index da31a794374..62134a954d3 100644 --- a/htdocs/admin/mails_templates.php +++ b/htdocs/admin/mails_templates.php @@ -45,31 +45,31 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php'; // Load translation files required by the page $langs->loadLangs(array("errors","admin","mails","languages")); -$action = GETPOST('action','alpha')?GETPOST('action','alpha'):'view'; -$confirm = GETPOST('confirm','alpha'); // Result of a confirmation +$action = GETPOST('action', 'alpha')?GETPOST('action', 'alpha'):'view'; +$confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation -$id = GETPOST('id','int'); -$rowid = GETPOST('rowid','alpha'); -$search_label=GETPOST('search_label','alpha'); -$search_type_template=GETPOST('search_type_template','alpha'); -$search_lang=GETPOST('search_lang','alpha'); -$search_fk_user=GETPOST('search_fk_user','intcomma'); -$search_topic=GETPOST('search_topic','alpha'); +$id = GETPOST('id', 'int'); +$rowid = GETPOST('rowid', 'alpha'); +$search_label=GETPOST('search_label', 'alpha'); +$search_type_template=GETPOST('search_type_template', 'alpha'); +$search_lang=GETPOST('search_lang', 'alpha'); +$search_fk_user=GETPOST('search_fk_user', 'intcomma'); +$search_topic=GETPOST('search_topic', 'alpha'); if (! empty($user->socid)) accessforbidden(); $acts[0] = "activate"; $acts[1] = "disable"; -$actl[0] = img_picto($langs->trans("Disabled"),'switch_off'); -$actl[1] = img_picto($langs->trans("Activated"),'switch_on'); +$actl[0] = img_picto($langs->trans("Disabled"), 'switch_off'); +$actl[1] = img_picto($langs->trans("Activated"), 'switch_on'); -$listoffset=GETPOST('listoffset','alpha'); -$listlimit =GETPOST('listlimit','alpha')>0?GETPOST('listlimit','alpha'):1000; +$listoffset=GETPOST('listoffset', 'alpha'); +$listlimit =GETPOST('listlimit', 'alpha')>0?GETPOST('listlimit', 'alpha'):1000; $active = 1; -$sortfield = GETPOST("sortfield",'alpha'); -$sortorder = GETPOST("sortorder",'alpha'); -$page = GETPOST("page",'int'); +$sortfield = GETPOST("sortfield", 'alpha'); +$sortorder = GETPOST("sortorder", 'alpha'); +$page = GETPOST("page", 'int'); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 $offset = $listlimit * $page ; $pageprev = $page - 1; @@ -169,7 +169,7 @@ if ($conf->projet->enabled) $elementList['project']=$langs->trans('Ma $elementList['user']=$langs->trans('MailToUser'); $parameters=array('elementList'=>$elementList); -$reshook=$hookmanager->executeHooks('emailElementlist',$parameters); // Note that $action and $object may have been modified by some hooks +$reshook=$hookmanager->executeHooks('emailElementlist', $parameters); // Note that $action and $object may have been modified by some hooks if ($reshook == 0) { foreach ($hookmanager->resArray as $item => $value) { $elementList[$item] = $value; @@ -189,17 +189,17 @@ $id = 25; * Actions */ -if (GETPOST('cancel','alpha')) { $action='list'; $massaction=''; } -if (! GETPOST('confirmmassaction','alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; } +if (GETPOST('cancel', 'alpha')) { $action='list'; $massaction=''; } +if (! GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; } $parameters=array(); -$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks +$reshook=$hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); if (empty($reshook)) { // Purge search criteria - if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') ||GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers + if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') ||GETPOST('button_removefilter', 'alpha')) // All tests are required to be compatible with all browsers { $search_label=''; $search_type_template=''; @@ -211,12 +211,12 @@ if (empty($reshook)) } // Actions add or modify an entry into a dictionary - if (GETPOST('actionadd','alpha') || GETPOST('actionmodify','alpha')) + if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha')) { - $listfield=explode(',', str_replace(' ', '',$tabfield[$id])); - $listfieldinsert=explode(',',$tabfieldinsert[$id]); - $listfieldmodify=explode(',',$tabfieldinsert[$id]); - $listfieldvalue=explode(',',$tabfieldvalue[$id]); + $listfield=explode(',', str_replace(' ', '', $tabfield[$id])); + $listfieldinsert=explode(',', $tabfieldinsert[$id]); + $listfieldmodify=explode(',', $tabfieldinsert[$id]); + $listfieldvalue=explode(',', $tabfieldvalue[$id]); // Check that all fields are filled $ok=1; @@ -227,7 +227,7 @@ if (empty($reshook)) if ($value == 'content') continue; if ($value == 'content_lines') continue; - if (GETPOST('actionmodify','alpha') && $value == 'topic') $_POST['topic']=$_POST['topic-'.$rowid]; + if (GETPOST('actionmodify', 'alpha') && $value == 'topic') $_POST['topic']=$_POST['topic-'.$rowid]; if ((! isset($_POST[$value]) || $_POST[$value]=='' || $_POST[$value]=='-1') && $value != 'lang' && $value != 'fk_user' && $value != 'position') { @@ -405,7 +405,7 @@ $titre=$langs->trans("EMailsSetup"); $linkback=''; $titlepicto='title_setup'; -print load_fiche_titre($titre,$linkback,$titlepicto); +print load_fiche_titre($titre, $linkback, $titlepicto); $head = email_admin_prepare_head(); @@ -414,7 +414,7 @@ dol_fiche_head($head, 'templates', '', -1); // Confirmation de la suppression de la ligne if ($action == 'delete') { - print $form->formconfirm($_SERVER["PHP_SELF"].'?'.($page?'page='.$page.'&':'').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.$rowid.'&code='.$code.'&id='.$id, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_delete','',0,1); + print $form->formconfirm($_SERVER["PHP_SELF"].'?'.($page?'page='.$page.'&':'').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.$rowid.'&code='.$code.'&id='.$id, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_delete', '', 0, 1); } //var_dump($elementList); @@ -438,16 +438,16 @@ if ($search_fk_user != '' && $search_fk_user != '-1') $sql.=natural_search('fk_u if ($search_topic) $sql.=natural_search('topic', $search_topic); // If sort order is "country", we use country_code instead if ($sortfield == 'country') $sortfield='country_code'; -$sql.=$db->order($sortfield,$sortorder); -$sql.=$db->plimit($listlimit+1,$offset); +$sql.=$db->order($sortfield, $sortorder); +$sql.=$db->plimit($listlimit+1, $offset); //print $sql; -$fieldlist=explode(',',$tabfield[$id]); +$fieldlist=explode(',', $tabfield[$id]); // Form to add a new line print ''; print ''; -print ''; +print ''; print '
'; print '
'; diff --git a/htdocs/admin/livraison_extrafields.php b/htdocs/admin/livraison_extrafields.php index 31144581564..a7bd8929cad 100644 --- a/htdocs/admin/livraison_extrafields.php +++ b/htdocs/admin/livraison_extrafields.php @@ -68,10 +68,10 @@ require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php'; $textobject=$langs->transnoentitiesnoconv("Receivings"); -llxHeader('',$langs->trans("SendingsSetup")); +llxHeader('', $langs->trans("SendingsSetup")); $linkback=''.$langs->trans("BackToModuleList").''; -print load_fiche_titre($langs->trans("SendingsSetup"),$linkback,'title_setup'); +print load_fiche_titre($langs->trans("SendingsSetup"), $linkback, 'title_setup'); print "
\n"; $head = expedition_admin_prepare_head(); diff --git a/htdocs/admin/livraisondet_extrafields.php b/htdocs/admin/livraisondet_extrafields.php index 32000c67642..50f34f9d133 100644 --- a/htdocs/admin/livraisondet_extrafields.php +++ b/htdocs/admin/livraisondet_extrafields.php @@ -69,10 +69,10 @@ require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php'; $textobject=$langs->transnoentitiesnoconv("Receivings"); -llxHeader('',$langs->trans("SendingsSetup")); +llxHeader('', $langs->trans("SendingsSetup")); $linkback=''.$langs->trans("BackToModuleList").''; -print load_fiche_titre($langs->trans("SendingsSetup"),$linkback,'title_setup'); +print load_fiche_titre($langs->trans("SendingsSetup"), $linkback, 'title_setup'); print "
\n"; $head = expedition_admin_prepare_head(); diff --git a/htdocs/admin/loan.php b/htdocs/admin/loan.php index 419f6efbee9..2ea1a4c3f04 100644 --- a/htdocs/admin/loan.php +++ b/htdocs/admin/loan.php @@ -80,7 +80,7 @@ $form = new Form($db); if (! empty($conf->accounting->enabled)) $formaccounting = new FormAccounting($db); $linkback=''.$langs->trans("BackToModuleList").''; -print load_fiche_titre($langs->trans('ConfigLoan'),$linkback,'title_setup'); +print load_fiche_titre($langs->trans('ConfigLoan'), $linkback, 'title_setup'); print ''; print ''; diff --git a/htdocs/admin/mailing.php b/htdocs/admin/mailing.php index d5b866d9d20..d10e0e9a497 100644 --- a/htdocs/admin/mailing.php +++ b/htdocs/admin/mailing.php @@ -32,7 +32,7 @@ $langs->loadLangs(array("admin", "mails")); if (!$user->admin) accessforbidden(); -$action = GETPOST('action','alpha'); +$action = GETPOST('action', 'alpha'); @@ -44,21 +44,21 @@ if ($action == 'setvalue') { $db->begin(); - $mailfrom = GETPOST('MAILING_EMAIL_FROM','alpha'); - $mailerror = GETPOST('MAILING_EMAIL_ERRORSTO','alpha'); - $checkread = GETPOST('value','alpha'); - $checkread_key = GETPOST('MAILING_EMAIL_UNSUBSCRIBE_KEY','alpha'); + $mailfrom = GETPOST('MAILING_EMAIL_FROM', 'alpha'); + $mailerror = GETPOST('MAILING_EMAIL_ERRORSTO', 'alpha'); + $checkread = GETPOST('value', 'alpha'); + $checkread_key = GETPOST('MAILING_EMAIL_UNSUBSCRIBE_KEY', 'alpha'); $mailingdelay = GETPOST('MAILING_DELAY', 'int'); - $res=dolibarr_set_const($db, "MAILING_EMAIL_FROM",$mailfrom,'chaine',0,'',$conf->entity); + $res=dolibarr_set_const($db, "MAILING_EMAIL_FROM", $mailfrom, 'chaine', 0, '', $conf->entity); if (! $res > 0) $error++; - $res=dolibarr_set_const($db, "MAILING_EMAIL_ERRORSTO",$mailerror,'chaine',0,'',$conf->entity); + $res=dolibarr_set_const($db, "MAILING_EMAIL_ERRORSTO", $mailerror, 'chaine', 0, '', $conf->entity); if (! $res > 0) $error++; - $res=dolibarr_set_const($db, "MAILING_DELAY",$mailingdelay,'chaine',0,'',$conf->entity); + $res=dolibarr_set_const($db, "MAILING_DELAY", $mailingdelay, 'chaine', 0, '', $conf->entity); if (! $res > 0) $error++; // Create temporary encryption key if nedded - $res=dolibarr_set_const($db, "MAILING_EMAIL_UNSUBSCRIBE_KEY",$checkread_key,'chaine',0,'',$conf->entity); + $res=dolibarr_set_const($db, "MAILING_EMAIL_UNSUBSCRIBE_KEY", $checkread_key, 'chaine', 0, '', $conf->entity); if (! $res > 0) $error++; if (! $error) @@ -78,10 +78,10 @@ if ($action == 'setvalue') * View */ -llxHeader('',$langs->trans("MailingSetup")); +llxHeader('', $langs->trans("MailingSetup")); $linkback=''.$langs->trans("BackToModuleList").''; -print load_fiche_titre($langs->trans("MailingSetup"),$linkback,'title_setup'); +print load_fiche_titre($langs->trans("MailingSetup"), $linkback, 'title_setup'); if (! empty($conf->use_javascript_ajax)) { diff --git a/htdocs/admin/mailman.php b/htdocs/admin/mailman.php index 65c7f5e8d68..50688e5a491 100644 --- a/htdocs/admin/mailman.php +++ b/htdocs/admin/mailman.php @@ -40,7 +40,7 @@ if (! $user->admin) accessforbidden(); $type=array('yesno','texte','chaine'); -$action = GETPOST('action','aZ09'); +$action = GETPOST('action', 'aZ09'); $testsubscribeemail = GETPOST("testsubscribeemail"); $testunsubscribeemail = GETPOST("testunsubscribeemail"); @@ -57,7 +57,7 @@ if ($action == 'update' || $action == 'add') $constvalue=$_POST["constvalue"][$key]; $consttype=$_POST["consttype"][$key]; $constnote=$_POST["constnote"][$key]; - $res=dolibarr_set_const($db,$constname,$constvalue,$type[$consttype],0,$constnote,$conf->entity); + $res=dolibarr_set_const($db, $constname, $constvalue, $type[$consttype], 0, $constnote, $conf->entity); if (! $res > 0) $error++; } @@ -98,7 +98,7 @@ if (($action == 'testsubscribe' || $action == 'testunsubscribe') && ! empty($con if (! isValidEmail($email)) { $langs->load("errors"); - setEventMessages($langs->trans("ErrorBadEMail",$email), null, 'errors'); + setEventMessages($langs->trans("ErrorBadEMail", $email), null, 'errors'); } else { @@ -117,7 +117,7 @@ if (($action == 'testsubscribe' || $action == 'testunsubscribe') && ! empty($con if ($result < 0) { $error++; - setEventMessages($mailmanspip->error,$mailmanspip->errors,'errors'); + setEventMessages($mailmanspip->error, $mailmanspip->errors, 'errors'); } else { @@ -130,7 +130,7 @@ if (($action == 'testsubscribe' || $action == 'testunsubscribe') && ! empty($con if ($result < 0) { $error++; - setEventMessages($mailmanspip->error,$mailmanspip->errors,'errors'); + setEventMessages($mailmanspip->error, $mailmanspip->errors, 'errors'); } else { @@ -147,11 +147,11 @@ if (($action == 'testsubscribe' || $action == 'testunsubscribe') && ! empty($con $help_url=''; -llxHeader('',$langs->trans("MailmanSpipSetup"),$help_url); +llxHeader('', $langs->trans("MailmanSpipSetup"), $help_url); $linkback=''.$langs->trans("BackToModuleList").''; -print load_fiche_titre($langs->trans("MailmanSpipSetup"),$linkback,'title_setup'); +print load_fiche_titre($langs->trans("MailmanSpipSetup"), $linkback, 'title_setup'); $head = mailmanspip_admin_prepare_head(); @@ -164,7 +164,7 @@ if (! empty($conf->global->ADHERENT_USE_MAILMAN)) //$link=img_picto($langs->trans("Active"),'tick').' '; $link=''; //$link.=$langs->trans("Disable"); - $link.=img_picto($langs->trans("Activated"),'switch_on'); + $link.=img_picto($langs->trans("Activated"), 'switch_on'); $link.=''; // Edition des varibales globales $constantes=array( @@ -174,7 +174,7 @@ if (! empty($conf->global->ADHERENT_USE_MAILMAN)) 'ADHERENT_MAILMAN_LISTS' ); - print load_fiche_titre($langs->trans('MailmanTitle'), $link,''); + print load_fiche_titre($langs->trans('MailmanTitle'), $link, ''); print '
'; @@ -199,7 +199,7 @@ if (! empty($conf->global->ADHERENT_USE_MAILMAN)) }); '; - form_constantes($constantes,2); + form_constantes($constantes, 2); print '*'.$langs->trans("FollowingConstantsWillBeSubstituted").'
'; print '%LISTE%, %MAILMAN_ADMINPW%, %EMAIL%
'; @@ -216,9 +216,9 @@ else $link=''; //$link.=img_$langs->trans("Activate") - $link.=img_picto($langs->trans("Disabled"),'switch_off'); + $link.=img_picto($langs->trans("Disabled"), 'switch_off'); $link.=''; - print load_fiche_titre($langs->trans('MailmanTitle'), $link,''); + print load_fiche_titre($langs->trans('MailmanTitle'), $link, ''); dol_fiche_end(); } diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php index 33b6d83e0da..1f72b084d1e 100644 --- a/htdocs/admin/mails.php +++ b/htdocs/admin/mails.php @@ -30,7 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; // Load translation files required by the page $langs->loadLangs(array("companies", "products", "admin", "mails", "other", "errors")); -$action=GETPOST('action','alpha'); +$action=GETPOST('action', 'alpha'); if (! $user->admin) accessforbidden(); @@ -84,7 +84,7 @@ if ($action == 'update' && empty($_POST["cancel"])) // Content parameters dolibarr_set_const($db, "MAIN_MAIL_EMAIL_FROM", GETPOST("MAIN_MAIL_EMAIL_FROM"), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_MAIL_ERRORS_TO", GETPOST("MAIN_MAIL_ERRORS_TO"), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_MAIL_AUTOCOPY_TO", GETPOST("MAIN_MAIL_AUTOCOPY_TO"),'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_MAIL_AUTOCOPY_TO", GETPOST("MAIN_MAIL_AUTOCOPY_TO"), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, 'MAIN_MAIL_DEFAULT_FROMTYPE', GETPOST('MAIN_MAIL_DEFAULT_FROMTYPE'), 'chaine', 0, '', $conf->entity); header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup"); @@ -112,8 +112,8 @@ if ($action == 'presend' && GETPOST('trackid') == 'testhtml') $action='testhtm */ $linuxlike=1; -if (preg_match('/^win/i',PHP_OS)) $linuxlike=0; -if (preg_match('/^mac/i',PHP_OS)) $linuxlike=0; +if (preg_match('/^win/i', PHP_OS)) $linuxlike=0; +if (preg_match('/^mac/i', PHP_OS)) $linuxlike=0; if (empty($conf->global->MAIN_MAIL_SENDMODE)) $conf->global->MAIN_MAIL_SENDMODE='mail'; $port=! empty($conf->global->MAIN_MAIL_SMTP_PORT)?$conf->global->MAIN_MAIL_SMTP_PORT:ini_get('smtp_port'); @@ -123,9 +123,9 @@ if (! $server) $server='127.0.0.1'; $wikihelp='EN:Setup_EMails|FR:Paramétrage_EMails|ES:Configuración_EMails'; -llxHeader('',$langs->trans("Setup"),$wikihelp); +llxHeader('', $langs->trans("Setup"), $wikihelp); -print load_fiche_titre($langs->trans("EMailsSetup"),'','title_setup'); +print load_fiche_titre($langs->trans("EMailsSetup"), '', 'title_setup'); $head = email_admin_prepare_head(); @@ -262,7 +262,7 @@ if ($action == 'edit') // Disable print '
'.$langs->trans("MAIN_DISABLE_ALL_MAILS").''; - print $form->selectyesno('MAIN_DISABLE_ALL_MAILS',$conf->global->MAIN_DISABLE_ALL_MAILS,1); + print $form->selectyesno('MAIN_DISABLE_ALL_MAILS', $conf->global->MAIN_DISABLE_ALL_MAILS, 1); print '
'.$langs->trans("MAIN_MAIL_ENABLED_USER_DEST_SELECT").''; - print $form->selectyesno('MAIN_MAIL_ENABLED_USER_DEST_SELECT',$conf->global->MAIN_MAIL_ENABLED_USER_DEST_SELECT,1); + print $form->selectyesno('MAIN_MAIL_ENABLED_USER_DEST_SELECT', $conf->global->MAIN_MAIL_ENABLED_USER_DEST_SELECT, 1); print '
'; // SuperAdministrator access only if (empty($conf->multicompany->enabled) || ($user->admin && ! $user->entity)) @@ -323,7 +323,7 @@ if ($action == 'edit') { $text = ! empty($mainserver) ? $mainserver : $smtpserver; $htmltext = $langs->trans("ContactSuperAdminForChange"); - print $form->textwithpicto($text,$htmltext,1,'superadmin'); + print $form->textwithpicto($text, $htmltext, 1, 'superadmin'); print ''; } } @@ -342,7 +342,7 @@ if ($action == 'edit') $mainport = (! empty($conf->global->MAIN_MAIL_SMTP_PORT) ? $conf->global->MAIN_MAIL_SMTP_PORT : ''); $smtpport = ini_get('smtp_port')?ini_get('smtp_port'):$langs->transnoentities("Undefined"); if ($linuxlike) print $langs->trans("MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike"); - else print $langs->trans("MAIN_MAIL_SMTP_PORT",$smtpport); + else print $langs->trans("MAIN_MAIL_SMTP_PORT", $smtpport); print ''; // SuperAdministrator access only if (empty($conf->multicompany->enabled) || ($user->admin && ! $user->entity)) @@ -355,7 +355,7 @@ if ($action == 'edit') { $text = (! empty($mainport) ? $mainport : $smtpport); $htmltext = $langs->trans("ContactSuperAdminForChange"); - print $form->textwithpicto($text,$htmltext,1,'superadmin'); + print $form->textwithpicto($text, $htmltext, 1, 'superadmin'); print ''; } } @@ -375,7 +375,7 @@ if ($action == 'edit') else { $htmltext = $langs->trans("ContactSuperAdminForChange"); - print $form->textwithpicto($conf->global->MAIN_MAIL_SMTPS_ID,$htmltext,1,'superadmin'); + print $form->textwithpicto($conf->global->MAIN_MAIL_SMTPS_ID, $htmltext, 1, 'superadmin'); print ''; } print '
 
'.$langs->trans("MAIN_MAIL_EMAIL_FROM",ini_get('sendmail_from')?ini_get('sendmail_from'):$langs->transnoentities("Undefined")).'
'.$langs->trans("MAIN_MAIL_EMAIL_FROM", ini_get('sendmail_from')?ini_get('sendmail_from'):$langs->transnoentities("Undefined")).'
'.$langs->trans("MAIN_MAIL_SMTP_SERVER",ini_get('SMTP')?ini_get('SMTP'):$langs->transnoentities("Undefined")).''.(! empty($conf->global->MAIN_MAIL_SMTP_SERVER)?$conf->global->MAIN_MAIL_SMTP_SERVER:'').'
'.$langs->trans("MAIN_MAIL_SMTP_SERVER", ini_get('SMTP')?ini_get('SMTP'):$langs->transnoentities("Undefined")).''.(! empty($conf->global->MAIN_MAIL_SMTP_SERVER)?$conf->global->MAIN_MAIL_SMTP_SERVER:'').'
'.$langs->trans("MAIN_MAIL_SMTP_PORT",ini_get('smtp_port')?ini_get('smtp_port'):$langs->transnoentities("Undefined")).''.(! empty($conf->global->MAIN_MAIL_SMTP_PORT)?$conf->global->MAIN_MAIL_SMTP_PORT:'').'
'.$langs->trans("MAIN_MAIL_SMTP_PORT", ini_get('smtp_port')?ini_get('smtp_port'):$langs->transnoentities("Undefined")).''.(! empty($conf->global->MAIN_MAIL_SMTP_PORT)?$conf->global->MAIN_MAIL_SMTP_PORT:'').'
'.$langs->trans("MAIN_MAIL_SMTPS_PW").''.preg_replace('/./','*',$conf->global->MAIN_MAIL_SMTPS_PW).'
'.$langs->trans("MAIN_MAIL_SMTPS_PW").''.preg_replace('/./', '*', $conf->global->MAIN_MAIL_SMTPS_PW).'
 
'.$langs->trans("MAIN_MAIL_EMAIL_FROM",ini_get('sendmail_from')?ini_get('sendmail_from'):$langs->transnoentities("Undefined")).'
'.$langs->trans("MAIN_MAIL_EMAIL_FROM", ini_get('sendmail_from')?ini_get('sendmail_from'):$langs->transnoentities("Undefined")).''.$conf->global->MAIN_MAIL_EMAIL_FROM; if (! empty($conf->global->MAIN_MAIL_EMAIL_FROM) && ! isValidEmail($conf->global->MAIN_MAIL_EMAIL_FROM)) print img_warning($langs->trans("ErrorBadEMail")); print '
'; // SuperAdministrator access only if (empty($conf->multicompany->enabled) || ($user->admin && ! $user->entity)) @@ -274,7 +274,7 @@ if ($action == 'edit') { $text = ! empty($mainserver) ? $mainserver : $smtpserver; $htmltext = $langs->trans("ContactSuperAdminForChange"); - print $form->textwithpicto($text,$htmltext,1,'superadmin'); + print $form->textwithpicto($text, $htmltext, 1, 'superadmin'); print ''; } } @@ -294,7 +294,7 @@ if ($action == 'edit') $mainport = (! empty($conf->global->MAIN_MAIL_SMTP_PORT_EMAILING) ? $conf->global->MAIN_MAIL_SMTP_PORT_EMAILING : ''); $smtpport = ini_get('smtp_port')?ini_get('smtp_port'):$langs->transnoentities("Undefined"); if ($linuxlike) print $langs->trans("MAIN_MAIL_SMTP_PORT_NotAvailableOnLinuxLike"); - else print $langs->trans("MAIN_MAIL_SMTP_PORT",$smtpport); + else print $langs->trans("MAIN_MAIL_SMTP_PORT", $smtpport); print ''; // SuperAdministrator access only if (empty($conf->multicompany->enabled) || ($user->admin && ! $user->entity)) @@ -307,7 +307,7 @@ if ($action == 'edit') { $text = (! empty($mainport) ? $mainport : $smtpport); $htmltext = $langs->trans("ContactSuperAdminForChange"); - print $form->textwithpicto($text,$htmltext,1,'superadmin'); + print $form->textwithpicto($text, $htmltext, 1, 'superadmin'); print ''; } } @@ -327,7 +327,7 @@ if ($action == 'edit') else { $htmltext = $langs->trans("ContactSuperAdminForChange"); - print $form->textwithpicto($conf->global->MAIN_MAIL_SMTPS_ID_EMAILING,$htmltext,1,'superadmin'); + print $form->textwithpicto($conf->global->MAIN_MAIL_SMTPS_ID_EMAILING, $htmltext, 1, 'superadmin'); print ''; } print '
'.$langs->trans("MAIN_MAIL_SMTP_SERVER",ini_get('SMTP')?ini_get('SMTP'):$langs->transnoentities("Undefined")).''.(! empty($conf->global->MAIN_MAIL_SMTP_SERVER_EMAILING)?$conf->global->MAIN_MAIL_SMTP_SERVER_EMAILING:'').'
'.$langs->trans("MAIN_MAIL_SMTP_SERVER", ini_get('SMTP')?ini_get('SMTP'):$langs->transnoentities("Undefined")).''.(! empty($conf->global->MAIN_MAIL_SMTP_SERVER_EMAILING)?$conf->global->MAIN_MAIL_SMTP_SERVER_EMAILING:'').'
'.$langs->trans("MAIN_MAIL_SMTP_PORT",ini_get('smtp_port')?ini_get('smtp_port'):$langs->transnoentities("Undefined")).''.(! empty($conf->global->MAIN_MAIL_SMTP_PORT_EMAILING)?$conf->global->MAIN_MAIL_SMTP_PORT_EMAILING:'').'
'.$langs->trans("MAIN_MAIL_SMTP_PORT", ini_get('smtp_port')?ini_get('smtp_port'):$langs->transnoentities("Undefined")).''.(! empty($conf->global->MAIN_MAIL_SMTP_PORT_EMAILING)?$conf->global->MAIN_MAIL_SMTP_PORT_EMAILING:'').'
'.$langs->trans("MAIN_MAIL_SMTPS_PW").''.preg_replace('/./','*',$conf->global->MAIN_MAIL_SMTPS_PW_EMAILING).'
'.$langs->trans("MAIN_MAIL_SMTPS_PW").''.preg_replace('/./', '*', $conf->global->MAIN_MAIL_SMTPS_PW_EMAILING).'
'; @@ -478,7 +478,7 @@ foreach ($fieldlist as $field => $value) if ($valuetoshow != '') { print ''; print '"; print ''; diff --git a/htdocs/admin/modulehelp.php b/htdocs/admin/modulehelp.php index 781f1fd380b..8d8bf531443 100644 --- a/htdocs/admin/modulehelp.php +++ b/htdocs/admin/modulehelp.php @@ -21,7 +21,7 @@ * \brief Page to activate/disable all modules */ -if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1'); // If there is no need to load and show top and left menu +if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; @@ -32,7 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; $langs->loadLangs(array('errors', 'admin')); $mode=GETPOST('mode', 'alpha'); -$action=GETPOST('action','alpha'); +$action=GETPOST('action', 'alpha'); $id = GETPOST('id', 'int'); if (empty($mode)) $mode='desc'; @@ -55,7 +55,7 @@ if (! $user->admin) $form = new Form($db); $help_url='EN:First_setup|FR:Premiers_paramétrages|ES:Primeras_configuraciones'; -llxHeader('',$langs->trans("Setup"),$help_url); +llxHeader('', $langs->trans("Setup"), $help_url); print ''."\n".''."\n"; diff --git a/htdocs/website/websiteaccount_card.php b/htdocs/website/websiteaccount_card.php index 24f87678505..dfe189f2a74 100644 --- a/htdocs/website/websiteaccount_card.php +++ b/htdocs/website/websiteaccount_card.php @@ -46,14 +46,14 @@ $diroutputmassaction=$conf->website->dir_output . '/temp/massgeneration/'.$user- $hookmanager->initHooks(array('websiteaccountcard')); // Note that conf->hooks_modules contains array // Fetch optionals attributes and labels $extralabels = $extrafields->fetch_name_optionals_label('societeaccount'); -$search_array_options=$extrafields->getOptionalsFromPost($object->table_element,'','search_'); +$search_array_options=$extrafields->getOptionalsFromPost($object->table_element, '', 'search_'); // Initialize array of search criterias -$search_all=trim(GETPOST("search_all",'alpha')); +$search_all=trim(GETPOST("search_all", 'alpha')); $search=array(); foreach($object->fields as $key => $val) { - if (GETPOST('search_'.$key,'alpha')) $search[$key]=GETPOST('search_'.$key,'alpha'); + if (GETPOST('search_'.$key, 'alpha')) $search[$key]=GETPOST('search_'.$key, 'alpha'); } if (empty($action) && empty($id) && empty($ref)) $action='view'; @@ -76,7 +76,7 @@ include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be inclu */ $parameters=array(); -$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks +$reshook=$hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); if (empty($reshook)) @@ -85,7 +85,7 @@ if (empty($reshook)) $permissiontoadd = $user->rights->website->write; $permissiontodelete = $user->rights->website->delete; - $backurlforlist = dol_buildpath('/website/websiteaccount_list.php',1); + $backurlforlist = dol_buildpath('/website/websiteaccount_list.php', 1); // Actions cancel, add, update or delete include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php'; @@ -108,7 +108,7 @@ if (empty($reshook)) $form=new Form($db); $formfile=new FormFile($db); -llxHeader('','WebsiteAccount',''); +llxHeader('', 'WebsiteAccount', ''); // Example : Adding jquery code print ' - +
-
+
@@ -415,6 +415,13 @@ $( document ).ready(function() {
global->CASHDESK_ID_THIRDPARTY) or empty($conf->global->CASHDESK_ID_BANKACCOUNT_CASH) or empty($conf->global->CASHDESK_ID_BANKACCOUNT_CB)) { + setEventMessages($langs->trans("ErrorModuleSetupNotComplete"), null, 'errors'); +} +if (count($maincategories)==0){ + setEventMessages($langs->trans("TakeposNeedsCategories"), null, 'errors'); +} // User menu and external TakePOS modules $menus = array(); $r=0; From 273d68381c8b7174fa746913abf56d8cf90bdc50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 3 Feb 2019 15:21:21 +0100 Subject: [PATCH 13/15] psr2 end file new line none found --- dev/setup/codesniffer/ruleset.xml | 2 +- htdocs/admin/perms.php | 2 +- htdocs/blockedlog/ajax/check_signature.php | 2 +- htdocs/compta/cashcontrol/class/cashcontrol.class.php | 2 +- htdocs/core/actions_comments.inc.php | 2 +- htdocs/core/class/emailsenderprofile.class.php | 2 +- htdocs/core/lib/fiscalyear.lib.php | 2 +- htdocs/core/modules/modDon.class.php | 2 +- htdocs/core/modules/modSupplierProposal.class.php | 2 +- .../modules/reception/doc/doc_generic_reception_odt.modules.php | 2 +- htdocs/core/modules/reception/mod_reception_beryl.php | 2 +- htdocs/core/modules/reception/mod_reception_moonstone.php | 2 +- htdocs/core/modules/syslog/logHandler.php | 2 +- htdocs/core/modules/syslog/logHandlerInterface.php | 2 +- htdocs/core/modules/syslog/mod_syslog_syslog.php | 2 +- htdocs/core/tpl/advtarget.tpl.php | 2 +- htdocs/core/tpl/extrafields_list_search_input.tpl.php | 2 +- htdocs/core/tpl/extrafields_list_search_title.tpl.php | 2 +- htdocs/datapolicy/class/datapolicycron.class.php | 2 +- htdocs/reception/class/reception.class.php | 2 +- htdocs/takepos/ajax.php | 2 +- htdocs/variants/ajax/get_attribute_values.php | 2 +- htdocs/variants/class/ProductAttribute.class.php | 2 +- htdocs/variants/class/ProductAttributeValue.class.php | 2 +- htdocs/variants/class/ProductCombination2ValuePair.class.php | 2 +- 25 files changed, 25 insertions(+), 25 deletions(-) diff --git a/dev/setup/codesniffer/ruleset.xml b/dev/setup/codesniffer/ruleset.xml index b5c1ae5b6a9..2ce66d75739 100644 --- a/dev/setup/codesniffer/ruleset.xml +++ b/dev/setup/codesniffer/ruleset.xml @@ -432,5 +432,5 @@ - + diff --git a/htdocs/admin/perms.php b/htdocs/admin/perms.php index e7cf64d768e..e3ef8417dca 100644 --- a/htdocs/admin/perms.php +++ b/htdocs/admin/perms.php @@ -220,4 +220,4 @@ dol_fiche_end(); // End of page llxFooter(); -$db->close(); \ No newline at end of file +$db->close(); diff --git a/htdocs/blockedlog/ajax/check_signature.php b/htdocs/blockedlog/ajax/check_signature.php index 9617e6cd1ef..51a98244c40 100644 --- a/htdocs/blockedlog/ajax/check_signature.php +++ b/htdocs/blockedlog/ajax/check_signature.php @@ -57,4 +57,4 @@ $url = $conf->global->BLOCKEDLOG_AUTHORITY_URL.'/blockedlog/ajax/authority.php?s $res = file_get_contents($url); //echo $url; -echo $res; \ No newline at end of file +echo $res; diff --git a/htdocs/compta/cashcontrol/class/cashcontrol.class.php b/htdocs/compta/cashcontrol/class/cashcontrol.class.php index 946658208df..492d8b79875 100644 --- a/htdocs/compta/cashcontrol/class/cashcontrol.class.php +++ b/htdocs/compta/cashcontrol/class/cashcontrol.class.php @@ -426,4 +426,4 @@ class CashControl extends CommonObject return $result; } -} \ No newline at end of file +} diff --git a/htdocs/core/actions_comments.inc.php b/htdocs/core/actions_comments.inc.php index ee45a035043..83af2cd53cb 100644 --- a/htdocs/core/actions_comments.inc.php +++ b/htdocs/core/actions_comments.inc.php @@ -73,4 +73,4 @@ if ($action == 'deletecomment') $action=''; } } -} \ No newline at end of file +} diff --git a/htdocs/core/class/emailsenderprofile.class.php b/htdocs/core/class/emailsenderprofile.class.php index 3ce9623a05d..b99a5e708d3 100644 --- a/htdocs/core/class/emailsenderprofile.class.php +++ b/htdocs/core/class/emailsenderprofile.class.php @@ -447,4 +447,4 @@ class EmailSenderProfileLine // @var mixed Sample line property 2 public $prop2; } -*/ \ No newline at end of file +*/ diff --git a/htdocs/core/lib/fiscalyear.lib.php b/htdocs/core/lib/fiscalyear.lib.php index 6ea24bfacc2..3fb57dd55eb 100644 --- a/htdocs/core/lib/fiscalyear.lib.php +++ b/htdocs/core/lib/fiscalyear.lib.php @@ -53,4 +53,4 @@ function fiscalyear_prepare_head(Fiscalyear $object) complete_head_from_modules($conf,$langs,$object,$head,$h,'fiscalyear','remove'); return $head; -} \ No newline at end of file +} diff --git a/htdocs/core/modules/modDon.class.php b/htdocs/core/modules/modDon.class.php index f92c1cea2a5..d30b93a0410 100644 --- a/htdocs/core/modules/modDon.class.php +++ b/htdocs/core/modules/modDon.class.php @@ -162,4 +162,4 @@ class modDon extends DolibarrModules return $this->_init($sql,$options); } -} \ No newline at end of file +} diff --git a/htdocs/core/modules/modSupplierProposal.class.php b/htdocs/core/modules/modSupplierProposal.class.php index 43d42d7b8c3..c61289e2cbf 100644 --- a/htdocs/core/modules/modSupplierProposal.class.php +++ b/htdocs/core/modules/modSupplierProposal.class.php @@ -257,4 +257,4 @@ class modSupplierProposal extends DolibarrModules return $this->_remove($sql, $options); } -} \ No newline at end of file +} diff --git a/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php b/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php index e9b616cb0e2..35271ca7f7d 100644 --- a/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php +++ b/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php @@ -519,4 +519,4 @@ class doc_generic_reception_odt extends ModelePdfReception return -1; } -} \ No newline at end of file +} diff --git a/htdocs/core/modules/reception/mod_reception_beryl.php b/htdocs/core/modules/reception/mod_reception_beryl.php index 071c7f732c3..7665079fd0b 100644 --- a/htdocs/core/modules/reception/mod_reception_beryl.php +++ b/htdocs/core/modules/reception/mod_reception_beryl.php @@ -143,4 +143,4 @@ class mod_reception_beryl extends ModelNumRefReception // phpcs:enable return $this->getNextValue($objsoc,$objforref); } -} \ No newline at end of file +} diff --git a/htdocs/core/modules/reception/mod_reception_moonstone.php b/htdocs/core/modules/reception/mod_reception_moonstone.php index ae4c4b42b48..a91dcaf5729 100644 --- a/htdocs/core/modules/reception/mod_reception_moonstone.php +++ b/htdocs/core/modules/reception/mod_reception_moonstone.php @@ -134,4 +134,4 @@ class mod_reception_moonstone extends ModelNumRefReception // phpcs:enable return $this->getNextValue($objsoc,$objforref); } -} \ No newline at end of file +} diff --git a/htdocs/core/modules/syslog/logHandler.php b/htdocs/core/modules/syslog/logHandler.php index fa013f4b083..b2e50933b87 100644 --- a/htdocs/core/modules/syslog/logHandler.php +++ b/htdocs/core/modules/syslog/logHandler.php @@ -97,4 +97,4 @@ class LogHandler { $this->ident+=$ident; } -} \ No newline at end of file +} diff --git a/htdocs/core/modules/syslog/logHandlerInterface.php b/htdocs/core/modules/syslog/logHandlerInterface.php index 6f59482a1c0..76764a5c8a3 100644 --- a/htdocs/core/modules/syslog/logHandlerInterface.php +++ b/htdocs/core/modules/syslog/logHandlerInterface.php @@ -83,4 +83,4 @@ interface LogHandlerInterface * @return void */ public function export($content); -} \ No newline at end of file +} diff --git a/htdocs/core/modules/syslog/mod_syslog_syslog.php b/htdocs/core/modules/syslog/mod_syslog_syslog.php index 1f2f499fbac..26232e91ed5 100644 --- a/htdocs/core/modules/syslog/mod_syslog_syslog.php +++ b/htdocs/core/modules/syslog/mod_syslog_syslog.php @@ -124,4 +124,4 @@ class mod_syslog_syslog extends LogHandler implements LogHandlerInterface syslog($content['level'], $content['message']); closelog(); } -} \ No newline at end of file +} diff --git a/htdocs/core/tpl/advtarget.tpl.php b/htdocs/core/tpl/advtarget.tpl.php index af8c99c3fc7..268a971b51c 100644 --- a/htdocs/core/tpl/advtarget.tpl.php +++ b/htdocs/core/tpl/advtarget.tpl.php @@ -527,4 +527,4 @@ print '
'; - if (! empty($tabhelp[$id][$value]) && preg_match('/^http(s*):/i',$tabhelp[$id][$value])) print ''.$valuetoshow.' '.img_help(1,$valuetoshow).''; + if (! empty($tabhelp[$id][$value]) && preg_match('/^http(s*):/i', $tabhelp[$id][$value])) print ''.$valuetoshow.' '.img_help(1, $valuetoshow).''; else if (! empty($tabhelp[$id][$value])) { if (in_array($value, array('topic'))) print $form->textwithpicto($valuetoshow, $tabhelp[$id][$value], 1, 'help', '', 0, 2, $value); // Tooltip on click @@ -593,7 +593,7 @@ print '
'; print ''; print ''; -print ''; +print ''; print '
'; print ''; @@ -616,7 +616,7 @@ if ($resql) $paramwithsearch = $param; if ($sortorder) $paramwithsearch.= '&sortorder='.urlencode($sortorder); if ($sortfield) $paramwithsearch.= '&sortfield='.urlencode($sortfield); - if (GETPOST('from','alpha')) $paramwithsearch.= '&from='.urlencode(GETPOST('from','alpha')); + if (GETPOST('from', 'alpha')) $paramwithsearch.= '&from='.urlencode(GETPOST('from', 'alpha')); // There is several pages if ($num > $listlimit) @@ -724,11 +724,11 @@ if ($resql) $tmpaction='edit'; $parameters=array('fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]); - $reshook=$hookmanager->executeHooks('editEmailTemplateFieldlist',$parameters,$obj, $tmpaction); // Note that $action and $object may have been modified by some hooks + $reshook=$hookmanager->executeHooks('editEmailTemplateFieldlist', $parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks $error=$hookmanager->error; $errors=$hookmanager->errors; // Show fields - if (empty($reshook)) fieldList($fieldlist,$obj,$tabname[$id],'edit'); + if (empty($reshook)) fieldList($fieldlist, $obj, $tabname[$id], 'edit'); print ''; print ''; // Perms print ''; print '
'; @@ -801,7 +801,7 @@ if ($resql) $tmpaction = 'view'; $parameters=array('var'=>$var, 'fieldlist'=>$fieldlist, 'tabname'=>$tabname[$id]); - $reshook=$hookmanager->executeHooks('viewEmailTemplateFieldlist',$parameters,$obj, $tmpaction); // Note that $action and $object may have been modified by some hooks + $reshook=$hookmanager->executeHooks('viewEmailTemplateFieldlist', $parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks $error=$hookmanager->error; $errors=$hookmanager->errors; diff --git a/htdocs/admin/menus.php b/htdocs/admin/menus.php index 6037304350a..f18b09b7d05 100644 --- a/htdocs/admin/menus.php +++ b/htdocs/admin/menus.php @@ -27,8 +27,8 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php'; -$action=GETPOST('action','aZ09'); -$cancel=GETPOST('cancel','alpha'); +$action=GETPOST('action', 'aZ09'); +$cancel=GETPOST('cancel', 'alpha'); // Load translation files required by the page $langs->loadLangs(array("companies","products","admin","users","other")); @@ -38,7 +38,7 @@ if (! $user->admin) accessforbidden(); $dirstandard = array(); $dirsmartphone = array(); -$dirmenus=array_merge(array("/core/menus/"),(array) $conf->modules_parts['menus']); +$dirmenus=array_merge(array("/core/menus/"), (array) $conf->modules_parts['menus']); foreach($dirmenus as $dirmenu) { $dirstandard[]=$dirmenu.'standard'; @@ -64,24 +64,24 @@ if ($action == 'update' && ! $cancel) { $_SESSION["mainmenu"]="home"; // Le gestionnaire de menu a pu changer - dolibarr_set_const($db, "MAIN_MENU_STANDARD", GETPOST('MAIN_MENU_STANDARD','alpha'),'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_MENU_SMARTPHONE", GETPOST('MAIN_MENU_SMARTPHONE','alpha'),'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_MENU_STANDARD", GETPOST('MAIN_MENU_STANDARD', 'alpha'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_MENU_SMARTPHONE", GETPOST('MAIN_MENU_SMARTPHONE', 'alpha'), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_MENUFRONT_STANDARD", GETPOST('MAIN_MENUFRONT_STANDARD','alpha'),'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "MAIN_MENUFRONT_SMARTPHONE", GETPOST('MAIN_MENUFRONT_SMARTPHONE','alpha'),'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_MENUFRONT_STANDARD", GETPOST('MAIN_MENUFRONT_STANDARD', 'alpha'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_MENUFRONT_SMARTPHONE", GETPOST('MAIN_MENUFRONT_SMARTPHONE', 'alpha'), 'chaine', 0, '', $conf->entity); // Define list of menu handlers to initialize $listofmenuhandler=array(); - $listofmenuhandler[preg_replace('/(_backoffice|_frontoffice|_menu)?\.php/i','',GETPOST('MAIN_MENU_STANDARD','alpha'))]=1; - $listofmenuhandler[preg_replace('/(_backoffice|_frontoffice|_menu)?\.php/i','',GETPOST('MAIN_MENUFRONT_STANDARD','alpha'))]=1; - if (GETPOST('MAIN_MENU_SMARTPHONE','alpha')) $listofmenuhandler[preg_replace('/(_backoffice|_frontoffice|_menu)?\.php/i','',GETPOST('MAIN_MENU_SMARTPHONE','alpha'))]=1; - if (GETPOST('MAIN_MENUFRONT_SMARTPHONE','alpha')) $listofmenuhandler[preg_replace('/(_backoffice|_frontoffice|_menu)?\.php/i','',GETPOST('MAIN_MENUFRONT_SMARTPHONE','alpha'))]=1; + $listofmenuhandler[preg_replace('/(_backoffice|_frontoffice|_menu)?\.php/i', '', GETPOST('MAIN_MENU_STANDARD', 'alpha'))]=1; + $listofmenuhandler[preg_replace('/(_backoffice|_frontoffice|_menu)?\.php/i', '', GETPOST('MAIN_MENUFRONT_STANDARD', 'alpha'))]=1; + if (GETPOST('MAIN_MENU_SMARTPHONE', 'alpha')) $listofmenuhandler[preg_replace('/(_backoffice|_frontoffice|_menu)?\.php/i', '', GETPOST('MAIN_MENU_SMARTPHONE', 'alpha'))]=1; + if (GETPOST('MAIN_MENUFRONT_SMARTPHONE', 'alpha')) $listofmenuhandler[preg_replace('/(_backoffice|_frontoffice|_menu)?\.php/i', '', GETPOST('MAIN_MENUFRONT_SMARTPHONE', 'alpha'))]=1; // Initialize menu handlers foreach ($listofmenuhandler as $key => $val) { // Load sql init_menu_handler.sql file - $dirmenus=array_merge(array("/core/menus/"),(array) $conf->modules_parts['menus']); + $dirmenus=array_merge(array("/core/menus/"), (array) $conf->modules_parts['menus']); foreach($dirmenus as $dirmenu) { $file='init_menu_'.$key.'.sql'; @@ -92,7 +92,7 @@ if ($action == 'update' && ! $cancel) { $db->begin(); - $result=run_sql($fullpath,1,'',1,$key,'none'); + $result=run_sql($fullpath, 1, '', 1, $key, 'none'); if ($result > 0) { $db->commit(); @@ -126,9 +126,9 @@ $form=new Form($db); $formadmin=new FormAdmin($db); $wikihelp='EN:First_setup|FR:Premiers_paramétrages|ES:Primeras_configuraciones'; -llxHeader('',$langs->trans("Setup"),$wikihelp); +llxHeader('', $langs->trans("Setup"), $wikihelp); -print load_fiche_titre($langs->trans("Menus"),'','title_setup'); +print load_fiche_titre($langs->trans("Menus"), '', 'title_setup'); $h = 0; @@ -167,10 +167,10 @@ if ($action == 'edit') print ''; print ''; print ''; print ''; print ''; @@ -187,10 +187,10 @@ if ($action == 'edit') // Menu smartphone print ''; print ''; print ''; print ''; @@ -202,21 +202,21 @@ else print '
'.$langs->trans("Menu").''; - print $form->textwithpicto($langs->trans("InternalUsers"),$langs->trans("InternalExternalDesc")); + print $form->textwithpicto($langs->trans("InternalUsers"), $langs->trans("InternalExternalDesc")); print ''; - print $form->textwithpicto($langs->trans("ExternalUsers"),$langs->trans("InternalExternalDesc")); + print $form->textwithpicto($langs->trans("ExternalUsers"), $langs->trans("InternalExternalDesc")); print '
'.$langs->trans("DefaultMenuSmartphoneManager").''; - $formadmin->select_menu(empty($conf->global->MAIN_MENU_SMARTPHONE_FORCED)?$conf->global->MAIN_MENU_SMARTPHONE:$conf->global->MAIN_MENU_SMARTPHONE_FORCED, 'MAIN_MENU_SMARTPHONE', array_merge($dirstandard,$dirsmartphone), empty($conf->global->MAIN_MENU_SMARTPHONE_FORCED)?'':' disabled'); + $formadmin->select_menu(empty($conf->global->MAIN_MENU_SMARTPHONE_FORCED)?$conf->global->MAIN_MENU_SMARTPHONE:$conf->global->MAIN_MENU_SMARTPHONE_FORCED, 'MAIN_MENU_SMARTPHONE', array_merge($dirstandard, $dirsmartphone), empty($conf->global->MAIN_MENU_SMARTPHONE_FORCED)?'':' disabled'); print ''; - $formadmin->select_menu(empty($conf->global->MAIN_MENUFRONT_SMARTPHONE_FORCED)?$conf->global->MAIN_MENUFRONT_SMARTPHONE:$conf->global->MAIN_MENUFRONT_SMARTPHONE_FORCED, 'MAIN_MENUFRONT_SMARTPHONE', array_merge($dirstandard,$dirsmartphone), empty($conf->global->MAIN_MENUFRONT_SMARTPHONE_FORCED)?'':' disabled'); + $formadmin->select_menu(empty($conf->global->MAIN_MENUFRONT_SMARTPHONE_FORCED)?$conf->global->MAIN_MENUFRONT_SMARTPHONE:$conf->global->MAIN_MENUFRONT_SMARTPHONE_FORCED, 'MAIN_MENUFRONT_SMARTPHONE', array_merge($dirstandard, $dirsmartphone), empty($conf->global->MAIN_MENUFRONT_SMARTPHONE_FORCED)?'':' disabled'); print '
'; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; @@ -225,19 +225,19 @@ else print ''; print ''; print ''; print ''; print ''; print ''; @@ -388,10 +388,10 @@ if ($action == 'create') print ''; // Title - print ''; + print ''; // URL - print ''; + print ''; // Langs print ''; @@ -406,10 +406,10 @@ if ($action == 'create') print ''; // Enabled - print ''; + print ''; // Perms - print ''; + print ''; print '
'.$langs->trans("Menu").''; - print $form->textwithpicto($langs->trans("InternalUsers"),$langs->trans("InternalExternalDesc")); + print $form->textwithpicto($langs->trans("InternalUsers"), $langs->trans("InternalExternalDesc")); print ''; - print $form->textwithpicto($langs->trans("ExternalUsers"),$langs->trans("InternalExternalDesc")); + print $form->textwithpicto($langs->trans("ExternalUsers"), $langs->trans("InternalExternalDesc")); print '
'.$langs->trans("DefaultMenuManager").''; - $filelib=preg_replace('/.php$/i','',(empty($conf->global->MAIN_MENU_STANDARD_FORCED)?$conf->global->MAIN_MENU_STANDARD:$conf->global->MAIN_MENU_STANDARD_FORCED)); + $filelib=preg_replace('/.php$/i', '', (empty($conf->global->MAIN_MENU_STANDARD_FORCED)?$conf->global->MAIN_MENU_STANDARD:$conf->global->MAIN_MENU_STANDARD_FORCED)); print $filelib; print ''; - $filelib=preg_replace('/.php$/i','',(empty($conf->global->MAIN_MENUFRONT_STANDARD_FORCED)?$conf->global->MAIN_MENUFRONT_STANDARD:$conf->global->MAIN_MENUFRONT_STANDARD_FORCED)); + $filelib=preg_replace('/.php$/i', '', (empty($conf->global->MAIN_MENUFRONT_STANDARD_FORCED)?$conf->global->MAIN_MENUFRONT_STANDARD:$conf->global->MAIN_MENUFRONT_STANDARD_FORCED)); print $filelib; print '
'.$langs->trans("DefaultMenuSmartphoneManager").''; - $filelib=preg_replace('/.php$/i','',(empty($conf->global->MAIN_MENU_SMARTPHONE_FORCED)?$conf->global->MAIN_MENU_SMARTPHONE:$conf->global->MAIN_MENU_SMARTPHONE_FORCED)); + $filelib=preg_replace('/.php$/i', '', (empty($conf->global->MAIN_MENU_SMARTPHONE_FORCED)?$conf->global->MAIN_MENU_SMARTPHONE:$conf->global->MAIN_MENU_SMARTPHONE_FORCED)); print $filelib; if (! empty($conf->global->MAIN_MENU_SMARTPHONE_FORCED) && preg_match('/smartphone/', $conf->global->MAIN_MENU_SMARTPHONE_FORCED) - || (empty($conf->global->MAIN_MENU_SMARTPHONE_FORCED) && ! empty($conf->global->MAIN_MENU_SMARTPHONE) && preg_match('/smartphone/',$conf->global->MAIN_MENU_SMARTPHONE))) + || (empty($conf->global->MAIN_MENU_SMARTPHONE_FORCED) && ! empty($conf->global->MAIN_MENU_SMARTPHONE) && preg_match('/smartphone/', $conf->global->MAIN_MENU_SMARTPHONE))) { print ' '.img_warning($langs->transnoentitiesnoconv("ThisForceAlsoTheme")); } print ''; - $filelib=preg_replace('/.php$/i','',(empty($conf->global->MAIN_MENUFRONT_SMARTPHONE_FORCED)?$conf->global->MAIN_MENUFRONT_SMARTPHONE:$conf->global->MAIN_MENUFRONT_SMARTPHONE_FORCED)); + $filelib=preg_replace('/.php$/i', '', (empty($conf->global->MAIN_MENUFRONT_SMARTPHONE_FORCED)?$conf->global->MAIN_MENUFRONT_SMARTPHONE:$conf->global->MAIN_MENUFRONT_SMARTPHONE_FORCED)); print $filelib; - if (! empty($conf->global->MAIN_MENU_SMARTPHONE_FORCED) && preg_match('/smartphone/',$conf->global->MAIN_MENUFRONT_SMARTPHONE_FORCED) - || (empty($conf->global->MAIN_MENUFRONT_SMARTPHONE_FORCED) && ! empty($conf->global->MAIN_MENU_SMARTPHONE) && preg_match('/smartphone/',$conf->global->MAIN_MENUFRONT_SMARTPHONE))) + if (! empty($conf->global->MAIN_MENU_SMARTPHONE_FORCED) && preg_match('/smartphone/', $conf->global->MAIN_MENUFRONT_SMARTPHONE_FORCED) + || (empty($conf->global->MAIN_MENUFRONT_SMARTPHONE_FORCED) && ! empty($conf->global->MAIN_MENU_SMARTPHONE) && preg_match('/smartphone/', $conf->global->MAIN_MENUFRONT_SMARTPHONE))) { print ' '.img_warning($langs->transnoentitiesnoconv("ThisForceAlsoTheme")); } diff --git a/htdocs/admin/menus/edit.php b/htdocs/admin/menus/edit.php index b16e9047b26..71a335c371c 100644 --- a/htdocs/admin/menus/edit.php +++ b/htdocs/admin/menus/edit.php @@ -35,21 +35,21 @@ if (! $user->admin) accessforbidden(); $dirstandard = array(); $dirsmartphone = array(); -$dirmenus=array_merge(array("/core/menus/"),(array) $conf->modules_parts['menus']); +$dirmenus=array_merge(array("/core/menus/"), (array) $conf->modules_parts['menus']); foreach($dirmenus as $dirmenu) { $dirstandard[]=$dirmenu.'standard'; $dirsmartphone[]=$dirmenu.'smartphone'; } -$action=GETPOST('action','aZ09'); +$action=GETPOST('action', 'aZ09'); $menu_handler_top=$conf->global->MAIN_MENU_STANDARD; $menu_handler_smartphone=$conf->global->MAIN_MENU_SMARTPHONE; -$menu_handler_top=preg_replace('/_backoffice.php/i','',$menu_handler_top); -$menu_handler_top=preg_replace('/_frontoffice.php/i','',$menu_handler_top); -$menu_handler_smartphone=preg_replace('/_backoffice.php/i','',$menu_handler_smartphone); -$menu_handler_smartphone=preg_replace('/_frontoffice.php/i','',$menu_handler_smartphone); +$menu_handler_top=preg_replace('/_backoffice.php/i', '', $menu_handler_top); +$menu_handler_top=preg_replace('/_frontoffice.php/i', '', $menu_handler_top); +$menu_handler_smartphone=preg_replace('/_backoffice.php/i', '', $menu_handler_smartphone); +$menu_handler_smartphone=preg_replace('/_frontoffice.php/i', '', $menu_handler_smartphone); $menu_handler=$menu_handler_top; @@ -69,16 +69,16 @@ if ($action == 'update') $leftmenu=''; $mainmenu=''; if (! empty($_POST['menuIdParent']) && ! is_numeric($_POST['menuIdParent'])) { - $tmp=explode('&',$_POST['menuIdParent']); + $tmp=explode('&', $_POST['menuIdParent']); foreach($tmp as $s) { - if (preg_match('/fk_mainmenu=/',$s)) + if (preg_match('/fk_mainmenu=/', $s)) { - $mainmenu=preg_replace('/fk_mainmenu=/','',$s); + $mainmenu=preg_replace('/fk_mainmenu=/', '', $s); } - if (preg_match('/fk_leftmenu=/',$s)) + if (preg_match('/fk_leftmenu=/', $s)) { - $leftmenu=preg_replace('/fk_leftmenu=/','',$s); + $leftmenu=preg_replace('/fk_leftmenu=/', '', $s); } } } @@ -89,21 +89,21 @@ if ($action == 'update') { $menu->titre=GETPOST('titre', 'alpha'); $menu->leftmenu=GETPOST('leftmenu', 'aZ09'); - $menu->url=GETPOST('url','alpha'); - $menu->langs=GETPOST('langs','alpha'); - $menu->position=GETPOST('position','int'); - $menu->enabled=GETPOST('enabled','alpha'); - $menu->perms=GETPOST('perms','alpha'); - $menu->target=GETPOST('target','alpha'); - $menu->user=GETPOST('user','alpha'); - $menu->mainmenu=GETPOST('propertymainmenu','alpha'); - if (is_numeric(GETPOST('menuIdParent','alpha'))) + $menu->url=GETPOST('url', 'alpha'); + $menu->langs=GETPOST('langs', 'alpha'); + $menu->position=GETPOST('position', 'int'); + $menu->enabled=GETPOST('enabled', 'alpha'); + $menu->perms=GETPOST('perms', 'alpha'); + $menu->target=GETPOST('target', 'alpha'); + $menu->user=GETPOST('user', 'alpha'); + $menu->mainmenu=GETPOST('propertymainmenu', 'alpha'); + if (is_numeric(GETPOST('menuIdParent', 'alpha'))) { - $menu->fk_menu=GETPOST('menuIdParent','alpha'); + $menu->fk_menu=GETPOST('menuIdParent', 'alpha'); } else { - if (GETPOST('type','alpha') == 'top') $menu->fk_menu=0; + if (GETPOST('type', 'alpha') == 'top') $menu->fk_menu=0; else $menu->fk_menu=-1; $menu->fk_mainmenu=$mainmenu; $menu->fk_leftmenu=$leftmenu; @@ -144,18 +144,18 @@ if ($action == 'add') } $leftmenu=''; $mainmenu=''; - if (GETPOST('menuId','int') && ! is_numeric(GETPOST('menuId','int'))) + if (GETPOST('menuId', 'int') && ! is_numeric(GETPOST('menuId', 'int'))) { - $tmp=explode('&',GETPOST('menuId','int')); + $tmp=explode('&', GETPOST('menuId', 'int')); foreach($tmp as $s) { - if (preg_match('/fk_mainmenu=/',$s)) + if (preg_match('/fk_mainmenu=/', $s)) { - $mainmenu=preg_replace('/fk_mainmenu=/','',$s); + $mainmenu=preg_replace('/fk_mainmenu=/', '', $s); } - if (preg_match('/fk_leftmenu=/',$s)) + if (preg_match('/fk_leftmenu=/', $s)) { - $leftmenu=preg_replace('/fk_leftmenu=/','',$s); + $leftmenu=preg_replace('/fk_leftmenu=/', '', $s); } } } @@ -203,24 +203,24 @@ if ($action == 'add') if (! $error) { $menu = new Menubase($db); - $menu->menu_handler=preg_replace('/_menu$/','',GETPOST('menu_handler','aZ09')); - $menu->type=GETPOST('type','alpha'); - $menu->titre=GETPOST('titre','alpha'); - $menu->url=GETPOST('url','alpha'); - $menu->langs=GETPOST('langs','alpha'); - $menu->position=GETPOST('position','int'); - $menu->enabled=GETPOST('enabled','alpha'); - $menu->perms=GETPOST('perms','alpha'); - $menu->target=GETPOST('target','alpha'); - $menu->user=GETPOST('user','alpha'); - $menu->mainmenu=GETPOST('propertymainmenu','alpha'); - if (is_numeric(GETPOST('menuId','int'))) + $menu->menu_handler=preg_replace('/_menu$/', '', GETPOST('menu_handler', 'aZ09')); + $menu->type=GETPOST('type', 'alpha'); + $menu->titre=GETPOST('titre', 'alpha'); + $menu->url=GETPOST('url', 'alpha'); + $menu->langs=GETPOST('langs', 'alpha'); + $menu->position=GETPOST('position', 'int'); + $menu->enabled=GETPOST('enabled', 'alpha'); + $menu->perms=GETPOST('perms', 'alpha'); + $menu->target=GETPOST('target', 'alpha'); + $menu->user=GETPOST('user', 'alpha'); + $menu->mainmenu=GETPOST('propertymainmenu', 'alpha'); + if (is_numeric(GETPOST('menuId', 'int'))) { - $menu->fk_menu=GETPOST('menuId','int'); + $menu->fk_menu=GETPOST('menuId', 'int'); } else { - if (GETPOST('type','alpha') == 'top') $menu->fk_menu=0; + if (GETPOST('type', 'alpha') == 'top') $menu->fk_menu=0; else $menu->fk_menu=-1; $menu->fk_mainmenu=$mainmenu; $menu->fk_leftmenu=$leftmenu; @@ -229,7 +229,7 @@ if ($action == 'add') $result=$menu->create($user); if ($result > 0) { - header("Location: ".DOL_URL_ROOT."/admin/menus/index.php?menu_handler=".GETPOST('menu_handler','aZ09')); + header("Location: ".DOL_URL_ROOT."/admin/menus/index.php?menu_handler=".GETPOST('menu_handler', 'aZ09')); exit; } else @@ -275,7 +275,7 @@ if ($action == 'confirm_delete' && $_POST["confirm"] == 'yes') $form=new Form($db); $formadmin=new FormAdmin($db); -llxHeader('',$langs->trans("Menu")); +llxHeader('', $langs->trans("Menu")); if ($action == 'create') @@ -304,7 +304,7 @@ if ($action == 'create') }); '; - print load_fiche_titre($langs->trans("NewMenu"),'','title_setup'); + print load_fiche_titre($langs->trans("NewMenu"), '', 'title_setup'); print ''; print ''; @@ -336,7 +336,7 @@ if ($action == 'create') // Handler print '
'.$langs->trans('MenuHandler').''; - $formadmin->select_menu_families($menu_handler.(preg_match('/_menu/',$menu_handler)?'':'_menu'),'menu_handler',array_merge($dirstandard,$dirsmartphone)); + $formadmin->select_menu_families($menu_handler.(preg_match('/_menu/', $menu_handler)?'':'_menu'), 'menu_handler', array_merge($dirstandard, $dirsmartphone)); print ''.$langs->trans('DetailMenuHandler').'
'.$langs->trans('Title').''.$langs->trans('DetailTitre').'
'.$langs->trans('Title').''.$langs->trans('DetailTitre').'
'.$langs->trans('URL').''.$langs->trans('DetailUrl').'
'.$langs->trans('URL').''.$langs->trans('DetailUrl').'
'.$langs->trans('LangFile').''.$langs->trans('DetailLangs').'
'.$langs->trans('DetailTarget').'
'.$langs->trans('Enabled').''.$langs->trans('DetailEnabled').'
'.$langs->trans('Enabled').''.$langs->trans('DetailEnabled').'
'.$langs->trans('Rights').''.$langs->trans('DetailRight').'
'.$langs->trans('Rights').''.$langs->trans('DetailRight').'
'; @@ -426,7 +426,7 @@ if ($action == 'create') } elseif ($action == 'edit') { - print load_fiche_titre($langs->trans("ModifMenu"),'','title_setup'); + print load_fiche_titre($langs->trans("ModifMenu"), '', 'title_setup'); print '
'; print ''; @@ -514,12 +514,12 @@ elseif ($action == 'edit') // Enabled print '
'.$langs->trans('Enabled').''.$langs->trans('DetailEnabled'); - if (! empty($menu->enabled)) print ' ('.$langs->trans("ConditionIsCurrently").': '.yn(dol_eval($menu->enabled,1)).')'; + if (! empty($menu->enabled)) print ' ('.$langs->trans("ConditionIsCurrently").': '.yn(dol_eval($menu->enabled, 1)).')'; print '
'.$langs->trans('Rights').''.$langs->trans('DetailRight'); - if (! empty($menu->perms)) print ' ('.$langs->trans("ConditionIsCurrently").': '.yn(dol_eval($menu->perms,1)).')'; + if (! empty($menu->perms)) print ' ('.$langs->trans("ConditionIsCurrently").': '.yn(dol_eval($menu->perms, 1)).')'; print '
'; diff --git a/htdocs/admin/menus/index.php b/htdocs/admin/menus/index.php index a7a11068256..dc3b715fc21 100644 --- a/htdocs/admin/menus/index.php +++ b/htdocs/admin/menus/index.php @@ -34,29 +34,29 @@ if (! $user->admin) accessforbidden(); $dirstandard = array(); $dirsmartphone = array(); -$dirmenus=array_merge(array("/core/menus/"),(array) $conf->modules_parts['menus']); +$dirmenus=array_merge(array("/core/menus/"), (array) $conf->modules_parts['menus']); foreach($dirmenus as $dirmenu) { $dirstandard[]=$dirmenu.'standard'; $dirsmartphone[]=$dirmenu.'smartphone'; } -$action=GETPOST('action','alpha'); -$confirm=GETPOST('confirm','alpha'); +$action=GETPOST('action', 'alpha'); +$confirm=GETPOST('confirm', 'alpha'); $menu_handler_top=$conf->global->MAIN_MENU_STANDARD; $menu_handler_smartphone=$conf->global->MAIN_MENU_SMARTPHONE; -$menu_handler_top=preg_replace('/(_backoffice\.php|_menu\.php)/i','',$menu_handler_top); -$menu_handler_top=preg_replace('/(_frontoffice\.php|_menu\.php)/i','',$menu_handler_top); -$menu_handler_smartphone=preg_replace('/(_backoffice\.php|_menu\.php)/i','',$menu_handler_smartphone); -$menu_handler_smartphone=preg_replace('/(_frontoffice\.php|_menu\.php)/i','',$menu_handler_smartphone); +$menu_handler_top=preg_replace('/(_backoffice\.php|_menu\.php)/i', '', $menu_handler_top); +$menu_handler_top=preg_replace('/(_frontoffice\.php|_menu\.php)/i', '', $menu_handler_top); +$menu_handler_smartphone=preg_replace('/(_backoffice\.php|_menu\.php)/i', '', $menu_handler_smartphone); +$menu_handler_smartphone=preg_replace('/(_frontoffice\.php|_menu\.php)/i', '', $menu_handler_smartphone); $menu_handler=$menu_handler_top; if (GETPOST("handler_origine")) $menu_handler=GETPOST("handler_origine"); if (GETPOST("menu_handler")) $menu_handler=GETPOST("menu_handler"); -$menu_handler_to_search=preg_replace('/(_backoffice|_frontoffice|_menu)?(\.php)?/i','',$menu_handler); +$menu_handler_to_search=preg_replace('/(_backoffice|_frontoffice|_menu)?(\.php)?/i', '', $menu_handler); /* @@ -71,7 +71,7 @@ if ($action == 'up') // Get current position $sql = "SELECT m.rowid, m.position, m.type, m.fk_menu"; $sql.= " FROM ".MAIN_DB_PREFIX."menu as m"; - $sql.= " WHERE m.rowid = ".GETPOST("menuId","int"); + $sql.= " WHERE m.rowid = ".GETPOST("menuId", "int"); dol_syslog("admin/menus/index.php ".$sql); $result = $db->query($sql); $num = $db->num_rows($result); @@ -89,7 +89,7 @@ if ($action == 'up') // Menu before $sql = "SELECT m.rowid, m.position"; $sql.= " FROM ".MAIN_DB_PREFIX."menu as m"; - $sql.= " WHERE (m.position < ".($current['order'])." OR (m.position = ".($current['order'])." AND rowid < ".GETPOST("menuId","int")."))"; + $sql.= " WHERE (m.position < ".($current['order'])." OR (m.position = ".($current['order'])." AND rowid < ".GETPOST("menuId", "int")."))"; $sql.= " AND m.menu_handler='".$db->escape($menu_handler_to_search)."'"; $sql.= " AND m.entity = ".$conf->entity; $sql.= " AND m.type = '".$db->escape($current['type'])."'"; @@ -127,7 +127,7 @@ elseif ($action == 'down') // Get current position $sql = "SELECT m.rowid, m.position, m.type, m.fk_menu"; $sql.= " FROM ".MAIN_DB_PREFIX."menu as m"; - $sql.= " WHERE m.rowid = ".GETPOST("menuId","int"); + $sql.= " WHERE m.rowid = ".GETPOST("menuId", "int"); dol_syslog("admin/menus/index.php ".$sql); $result = $db->query($sql); $num = $db->num_rows($result); @@ -145,7 +145,7 @@ elseif ($action == 'down') // Menu after $sql = "SELECT m.rowid, m.position"; $sql.= " FROM ".MAIN_DB_PREFIX."menu as m"; - $sql.= " WHERE (m.position > ".($current['order'])." OR (m.position = ".($current['order'])." AND rowid > ".GETPOST("menuId","int")."))"; + $sql.= " WHERE (m.position > ".($current['order'])." OR (m.position = ".($current['order'])." AND rowid > ".GETPOST("menuId", "int")."))"; $sql.= " AND m.menu_handler='".$db->escape($menu_handler_to_search)."'"; $sql.= " AND m.entity = ".$conf->entity; $sql.= " AND m.type = '".$db->escape($current['type'])."'"; @@ -180,7 +180,7 @@ elseif ($action == 'confirm_delete' && $confirm == 'yes') $db->begin(); $sql = "DELETE FROM ".MAIN_DB_PREFIX."menu"; - $sql.= " WHERE rowid = ".GETPOST('menuId','int'); + $sql.= " WHERE rowid = ".GETPOST('menuId', 'int'); $resql=$db->query($sql); if ($resql) { @@ -211,10 +211,10 @@ $formadmin=new FormAdmin($db); $arrayofjs=array('/includes/jquery/plugins/jquerytreeview/jquery.treeview.js', '/includes/jquery/plugins/jquerytreeview/lib/jquery.cookie.js'); $arrayofcss=array('/includes/jquery/plugins/jquerytreeview/jquery.treeview.css'); -llxHeader('',$langs->trans("Menus"),'','',0,0,$arrayofjs,$arrayofcss); +llxHeader('', $langs->trans("Menus"), '', '', 0, 0, $arrayofjs, $arrayofcss); -print load_fiche_titre($langs->trans("Menus"),'','title_setup'); +print load_fiche_titre($langs->trans("Menus"), '', 'title_setup'); $h = 0; @@ -245,18 +245,18 @@ if ($action == 'delete') { $sql = "SELECT m.titre"; $sql.= " FROM ".MAIN_DB_PREFIX."menu as m"; - $sql.= " WHERE m.rowid = ".GETPOST('menuId','int'); + $sql.= " WHERE m.rowid = ".GETPOST('menuId', 'int'); $result = $db->query($sql); $obj = $db->fetch_object($result); - print $form->formconfirm("index.php?menu_handler=".$menu_handler."&menuId=".GETPOST('menuId','int'),$langs->trans("DeleteMenu"),$langs->trans("ConfirmDeleteMenu",$obj->titre),"confirm_delete"); + print $form->formconfirm("index.php?menu_handler=".$menu_handler."&menuId=".GETPOST('menuId', 'int'), $langs->trans("DeleteMenu"), $langs->trans("ConfirmDeleteMenu", $obj->titre), "confirm_delete"); } print ''; print ''; print $langs->trans("MenuHandler").': '; -print $formadmin->select_menu_families($menu_handler.(preg_match('/_menu/',$menu_handler)?'':'_menu'),'menu_handler',array_merge($dirstandard,$dirsmartphone)); +print $formadmin->select_menu_families($menu_handler.(preg_match('/_menu/', $menu_handler)?'':'_menu'), 'menu_handler', array_merge($dirstandard, $dirsmartphone)); print '   '; print ''; @@ -266,8 +266,8 @@ print ''; print ''; print ''; -print ''; +print ''; print ''; print ''; @@ -327,17 +327,17 @@ if ($conf->use_javascript_ajax) 'entry'=>'
'.$langs->trans("TreeMenuPersonalized").'
'. '   '.$titre.''. ''. - ''.img_edit('default',0,'class="menuEdit" id="edit'.$menu['rowid'].'"').' '. + ''.img_edit('default', 0, 'class="menuEdit" id="edit'.$menu['rowid'].'"').' '. ''.img_edit_add('default').' '. ''.img_delete('default').' '. '     '. - ''.img_picto("Up","1uparrow").''.img_picto("Down","1downarrow").''. + ''.img_picto("Up", "1uparrow").''.img_picto("Down", "1downarrow").''. '
', - 'buttons'=>''.img_edit('default',0,'class="menuEdit" id="edit'.$menu['rowid'].'"').' '. + 'buttons'=>''.img_edit('default', 0, 'class="menuEdit" id="edit'.$menu['rowid'].'"').' '. ''.img_edit_add('default').' '. ''.img_delete('default').' '. '     '. - ''.img_picto("Up","1uparrow").''.img_picto("Down","1downarrow").'' + ''.img_picto("Up", "1uparrow").''.img_picto("Down", "1downarrow").'' ); $i++; } diff --git a/htdocs/admin/menus/other.php b/htdocs/admin/menus/other.php index 6e5f0d77b4b..925cbd5b93a 100644 --- a/htdocs/admin/menus/other.php +++ b/htdocs/admin/menus/other.php @@ -29,7 +29,7 @@ $langs->loadLangs(array("user","other","admin")); if (! $user->admin) accessforbidden(); -$action=GETPOST('action','alpha'); +$action=GETPOST('action', 'alpha'); /* @@ -38,13 +38,13 @@ $action=GETPOST('action','alpha'); if ($action == 'activate_hidemenu') { - dolibarr_set_const($db, "MAIN_MENU_HIDE_UNAUTHORIZED", '1','chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_MENU_HIDE_UNAUTHORIZED", '1', 'chaine', 0, '', $conf->entity); header("Location: ".$_SERVER["PHP_SELF"]); exit; } else if ($action == 'disable_hidemenu') { - dolibarr_del_const($db, "MAIN_MENU_HIDE_UNAUTHORIZED",$conf->entity); + dolibarr_del_const($db, "MAIN_MENU_HIDE_UNAUTHORIZED", $conf->entity); header("Location: ".$_SERVER["PHP_SELF"]); exit; } @@ -54,9 +54,9 @@ else if ($action == 'disable_hidemenu') * View */ -llxHeader('',$langs->trans("Setup")); +llxHeader('', $langs->trans("Setup")); -print load_fiche_titre($langs->trans("Menus"),'','title_setup'); +print load_fiche_titre($langs->trans("Menus"), '', 'title_setup'); $h = 0; @@ -93,11 +93,11 @@ print '
'.$langs->trans("HideUnauthorizedMenu").''; if (empty($conf->global->MAIN_MENU_HIDE_UNAUTHORIZED)) { - print ''.img_picto($langs->trans("Disabled"),'switch_off').''; + print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; } else { - print ''.img_picto($langs->trans("Enabled"),'switch_on').''; + print ''.img_picto($langs->trans("Enabled"), 'switch_on').''; } print "