From 86d854f3f4918e001ba26c361f3a1b2a6cc8e445 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 24 Oct 2018 23:04:26 +0200 Subject: [PATCH 01/51] Squiz.WhiteSpace.ControlStructureSpacing.SpacingBeforeClose --- dev/initdata/generate-invoice.php | 3 -- dev/initdata/generate-proposal.php | 2 -- dev/setup/codesniffer/ruleset.xml | 1 + htdocs/accountancy/admin/accountmodel.php | 1 - htdocs/accountancy/admin/categories_list.php | 1 - htdocs/accountancy/admin/journals_list.php | 1 - htdocs/accountancy/admin/productaccount.php | 1 - htdocs/accountancy/bookkeeping/balance.php | 1 - htdocs/accountancy/bookkeeping/list.php | 1 - .../accountancy/class/bookkeeping.class.php | 1 - htdocs/accountancy/customer/lines.php | 1 - htdocs/accountancy/journal/sellsjournal.php | 1 - htdocs/adherents/card.php | 3 -- htdocs/adherents/cartes/carte.php | 1 - htdocs/adherents/class/adherent.class.php | 2 -- htdocs/adherents/class/subscription.class.php | 1 - htdocs/adherents/note.php | 1 - htdocs/adherents/type.php | 1 - htdocs/admin/barcode.php | 1 - htdocs/admin/chequereceipts.php | 1 - htdocs/admin/delais.php | 8 ----- htdocs/admin/dict.php | 1 - .../class/PSWebServiceLibrary.class.php | 1 - htdocs/admin/facture.php | 3 -- htdocs/admin/ldap.php | 1 - htdocs/admin/ldap_members.php | 1 - htdocs/admin/ldap_users.php | 1 - htdocs/admin/limits.php | 1 - htdocs/admin/modules.php | 6 ---- htdocs/admin/oauth.php | 1 - htdocs/admin/oauthlogintokens.php | 3 -- htdocs/admin/payment.php | 2 -- htdocs/admin/pdf.php | 1 - htdocs/admin/receiptprinter.php | 1 - htdocs/admin/supplier_payment.php | 1 - htdocs/admin/syslog.php | 2 -- htdocs/admin/tools/eaccelerator.php | 1 - htdocs/admin/tools/listsessions.php | 1 - htdocs/admin/translation.php | 1 - htdocs/admin/website.php | 1 - htdocs/asset/class/asset.class.php | 1 - htdocs/asset/type.php | 3 -- htdocs/blockedlog/admin/blockedlog_list.php | 2 -- htdocs/blockedlog/ajax/authority.php | 2 -- htdocs/blockedlog/ajax/check_signature.php | 1 - htdocs/blockedlog/class/authority.class.php | 4 --- htdocs/blockedlog/class/blockedlog.class.php | 3 -- htdocs/bookmarks/card.php | 1 - htdocs/cashdesk/class/Facturation.class.php | 32 ------------------- htdocs/cashdesk/facturation.php | 1 - htdocs/cashdesk/facturation_dhtml.php | 1 - htdocs/cashdesk/facturation_verif.php | 2 -- htdocs/cashdesk/tpl/facturation1.tpl.php | 1 - htdocs/cashdesk/tpl/liste_articles.tpl.php | 2 -- htdocs/cashdesk/tpl/validation1.tpl.php | 5 --- htdocs/cashdesk/validation_verif.php | 1 - htdocs/categories/class/categorie.class.php | 2 -- htdocs/categories/traduction.php | 1 - htdocs/categories/viewcat.php | 1 - htdocs/comm/action/card.php | 2 -- htdocs/comm/action/class/actioncomm.class.php | 2 -- .../action/class/api_agendaevents.class.php | 1 - htdocs/comm/action/index.php | 1 - htdocs/comm/action/list.php | 2 -- htdocs/comm/action/pertype.php | 1 - htdocs/comm/action/peruser.php | 2 -- htdocs/comm/address.php | 3 -- htdocs/comm/card.php | 2 -- htdocs/comm/index.php | 2 -- htdocs/comm/mailing/advtargetemailing.php | 1 - htdocs/comm/mailing/card.php | 1 - htdocs/comm/mailing/cibles.php | 1 - .../mailing/class/advtargetemailing.class.php | 9 ------ .../html.formadvtargetemailing.class.php | 3 -- htdocs/comm/mailing/class/mailing.class.php | 2 -- htdocs/comm/mailing/index.php | 1 - htdocs/comm/multiprix.php | 1 - htdocs/comm/propal/card.php | 3 -- .../comm/propal/class/api_proposals.class.php | 1 - htdocs/comm/propal/class/propal.class.php | 3 -- htdocs/comm/propal/list.php | 1 - htdocs/commande/card.php | 1 - htdocs/commande/class/api_orders.class.php | 2 -- htdocs/commande/class/commande.class.php | 1 - htdocs/commande/list.php | 1 - htdocs/commande/orderstoinvoice.php | 5 --- htdocs/compta/bank/annuel.php | 1 - htdocs/compta/bank/card.php | 3 -- .../bank/class/paymentvarious.class.php | 1 - htdocs/compta/bank/ligne.php | 2 -- htdocs/compta/compta-files.php | 2 -- htdocs/compta/deplacement/card.php | 1 - htdocs/compta/deplacement/document.php | 1 - htdocs/compta/deplacement/index.php | 1 - htdocs/compta/facture/card.php | 13 -------- htdocs/compta/facture/class/facture.class.php | 2 -- .../facture/class/paymentterm.class.php | 2 -- htdocs/compta/facture/contact.php | 1 - htdocs/compta/facture/fiche-rec.php | 4 --- .../compta/facture/invoicetemplate_list.php | 1 - htdocs/compta/facture/list.php | 4 --- htdocs/compta/index.php | 3 -- htdocs/compta/localtax/clients.php | 2 -- htdocs/compta/paiement/card.php | 2 -- htdocs/compta/paiement/cheque/card.php | 4 --- .../cheque/class/remisecheque.class.php | 1 - .../compta/paiement/class/cpaiement.class.php | 2 -- htdocs/compta/paiement_charge.php | 1 - htdocs/compta/payment_sc/card.php | 1 - .../class/bonprelevement.class.php | 4 --- .../class/rejetprelevement.class.php | 1 - htdocs/compta/prelevement/create.php | 1 - htdocs/compta/prelevement/factures.php | 1 - htdocs/compta/prelevement/fiche-rejet.php | 1 - htdocs/compta/prelevement/fiche-stat.php | 1 - htdocs/compta/prelevement/ligne.php | 1 - htdocs/compta/resultat/index.php | 3 -- .../salaries/class/paymentsalary.class.php | 1 - htdocs/compta/salaries/document.php | 1 - .../sociales/class/cchargesociales.class.php | 2 -- .../sociales/class/chargesociales.class.php | 2 -- .../class/paymentsocialcontribution.class.php | 1 - htdocs/compta/stats/byratecountry.php | 2 -- htdocs/compta/stats/casoc.php | 1 - htdocs/compta/tva/class/tva.class.php | 1 - htdocs/contact/card.php | 2 -- htdocs/contact/class/contact.class.php | 1 - htdocs/contrat/class/api_contracts.class.php | 2 -- htdocs/contrat/class/contrat.class.php | 3 -- htdocs/contrat/contact.php | 1 - htdocs/contrat/document.php | 1 - htdocs/contrat/index.php | 5 --- htdocs/contrat/note.php | 1 - htdocs/core/actions_sendmails.inc.php | 1 - htdocs/core/ajax/ajaxdirtree.php | 1 - htdocs/core/ajax/check_notifications.php | 1 - htdocs/core/ajax/price.php | 1 - htdocs/core/boxes/box_actions.php | 1 - htdocs/core/boxes/box_factures.php | 1 - .../boxes/box_graph_invoices_permonth.php | 1 - .../box_graph_invoices_supplier_permonth.php | 1 - .../core/boxes/box_graph_orders_permonth.php | 1 - .../box_graph_orders_supplier_permonth.php | 1 - .../boxes/box_graph_propales_permonth.php | 1 - htdocs/core/boxes/box_services_expired.php | 2 -- htdocs/core/class/comment.class.php | 1 - htdocs/core/class/commonobject.class.php | 6 ---- htdocs/core/class/ctyperesource.class.php | 4 --- htdocs/core/class/dolgraph.class.php | 1 - htdocs/core/class/dolreceiptprinter.class.php | 2 -- .../core/class/emailsenderprofile.class.php | 1 - htdocs/core/class/extrafields.class.php | 3 -- htdocs/core/class/html.form.class.php | 2 -- htdocs/core/class/html.formfile.class.php | 2 -- htdocs/core/class/html.formother.class.php | 1 - htdocs/core/class/notify.class.php | 2 -- htdocs/core/class/rssparser.class.php | 4 --- htdocs/core/class/utils.class.php | 1 - htdocs/core/db/mssql.class.php | 2 -- htdocs/core/db/sqlite3.class.php | 2 -- htdocs/core/lib/admin.lib.php | 1 - htdocs/core/lib/company.lib.php | 1 - htdocs/core/lib/emailing.lib.php | 1 - htdocs/core/lib/fichinter.lib.php | 1 - htdocs/core/lib/files.lib.php | 1 - htdocs/core/lib/functions.lib.php | 6 ---- htdocs/core/lib/xcal.lib.php | 1 - htdocs/core/login/functions_ldap.php | 1 - htdocs/core/menus/standard/eldy.lib.php | 6 ---- htdocs/core/menus/standard/eldy_menu.php | 2 -- htdocs/core/menus/standard/empty.php | 2 -- htdocs/core/modules/DolibarrModules.class.php | 4 --- .../modules/cheque/modules_chequereceipts.php | 1 - .../commande/doc/pdf_einstein.modules.php | 1 - .../commande/doc/pdf_eratosthene.modules.php | 3 -- .../expedition/doc/pdf_rouget.modules.php | 2 -- .../doc/pdf_standard.modules.php | 1 - .../modules/facture/doc/pdf_crabe.modules.php | 4 --- .../facture/doc/pdf_sponge.modules.php | 5 --- .../modules/import/import_csv.modules.php | 1 - .../modules/import/import_xlsx.modules.php | 1 - .../thirdparties_services_expired.modules.php | 1 - htdocs/core/modules/modStock.class.php | 1 - .../doc/doc_generic_project_odt.modules.php | 1 - .../task/doc/doc_generic_task_odt.modules.php | 1 - .../modules/propale/doc/pdf_azur.modules.php | 1 - .../modules/propale/doc/pdf_cyan.modules.php | 3 -- .../modGeneratePassStandard.class.php | 1 - .../stock/doc/pdf_stdmovement.modules.php | 1 - .../pdf/pdf_canelle.modules.php | 1 - .../pdf/pdf_muscadet.modules.php | 1 - .../doc/pdf_aurore.modules.php | 1 - htdocs/core/tpl/card_presend.tpl.php | 1 - htdocs/core/tpl/resource_view.tpl.php | 1 - .../interface_80_modStripe_Stripe.class.php | 1 - htdocs/cron/card.php | 1 - htdocs/datapolicy/admin/setup.php | 2 -- htdocs/datapolicy/class/datapolicy.class.php | 2 -- .../datapolicy/class/datapolicycron.class.php | 2 -- htdocs/datapolicy/mailing.php | 2 -- htdocs/don/card.php | 1 - htdocs/don/document.php | 1 - htdocs/don/payment/card.php | 2 -- htdocs/ecm/class/ecmdirectory.class.php | 1 - htdocs/ecm/dir_add_card.php | 1 - htdocs/ecm/dir_card.php | 1 - htdocs/ecm/file_card.php | 1 - htdocs/ecm/index_auto.php | 1 - htdocs/expedition/card.php | 9 ------ .../expedition/class/api_shipments.class.php | 1 - htdocs/expedition/class/expedition.class.php | 4 --- htdocs/expedition/contact.php | 1 - htdocs/expedition/list.php | 1 - htdocs/expedition/shipment.php | 3 -- htdocs/expensereport/card.php | 7 ---- .../class/api_expensereports.class.php | 1 - .../class/expensereport.class.php | 2 -- .../class/paymentexpensereport.class.php | 1 - htdocs/expensereport/document.php | 1 - htdocs/expensereport/export_csv.php | 4 --- htdocs/expensereport/index.php | 1 - htdocs/expensereport/payment/card.php | 2 -- htdocs/expensereport/payment/payment.php | 1 - htdocs/exports/export.php | 4 --- htdocs/fichinter/card-rec.php | 5 --- htdocs/fichinter/card.php | 8 ----- htdocs/fichinter/class/fichinter.class.php | 1 - htdocs/fichinter/contact.php | 1 - htdocs/fichinter/document.php | 1 - .../class/fournisseur.commande.class.php | 5 --- .../fournisseur.commande.dispatch.class.php | 2 -- .../fourn/class/fournisseur.facture.class.php | 2 -- htdocs/fourn/class/paiementfourn.class.php | 1 - htdocs/fourn/commande/card.php | 10 ------ htdocs/fourn/commande/contact.php | 1 - htdocs/fourn/commande/document.php | 1 - htdocs/fourn/commande/list.php | 1 - htdocs/fourn/commande/orderstoinvoice.php | 2 -- htdocs/fourn/contact.php | 1 - htdocs/fourn/facture/card.php | 9 ------ htdocs/fourn/facture/contact.php | 1 - htdocs/fourn/facture/document.php | 1 - htdocs/fourn/facture/impayees.php | 1 - htdocs/fourn/facture/list.php | 1 - htdocs/fourn/paiement/card.php | 3 -- htdocs/ftp/index.php | 5 --- htdocs/holiday/card.php | 5 --- htdocs/holiday/class/holiday.class.php | 2 -- htdocs/holiday/list.php | 1 - htdocs/holiday/month_report.php | 1 - htdocs/holiday/view_log.php | 1 - htdocs/hrm/admin/admin_establishment.php | 1 - htdocs/hrm/establishment/card.php | 1 - htdocs/hrm/index.php | 3 -- htdocs/imports/import.php | 4 --- htdocs/install/check.php | 2 -- htdocs/install/lib/repair.lib.php | 1 - htdocs/install/repair.php | 1 - htdocs/install/step2.php | 1 - htdocs/install/step4.php | 1 - htdocs/install/upgrade2.php | 4 --- htdocs/livraison/card.php | 3 -- htdocs/loan/class/loanschedule.class.php | 2 -- htdocs/loan/class/paymentloan.class.php | 1 - htdocs/margin/productMargins.php | 2 -- .../template/class/actions_mymodule.class.php | 1 - .../template/class/myobject.class.php | 1 - htdocs/opensurvey/results.php | 1 - htdocs/printing/admin/printing.php | 2 -- htdocs/product/admin/price_rules.php | 1 - htdocs/product/admin/product.php | 1 - htdocs/product/admin/product_tools.php | 1 - htdocs/product/card.php | 2 -- htdocs/product/class/product.class.php | 3 -- .../class/propalmergepdfproduct.class.php | 6 ---- htdocs/product/composition/card.php | 2 -- htdocs/product/document.php | 1 - htdocs/product/index.php | 2 -- .../inventory/class/inventory.class.php | 1 - .../product/inventory/tpl/inventory.tpl.php | 1 - htdocs/product/price.php | 2 -- htdocs/product/reassort.php | 2 -- htdocs/product/reassortlot.php | 1 - htdocs/product/stock/card.php | 3 -- htdocs/product/stock/class/entrepot.class.php | 2 -- .../stock/class/mouvementstock.class.php | 1 - .../class/productstockentrepot.class.php | 2 -- htdocs/product/stock/index.php | 1 - htdocs/product/stock/product.php | 8 ----- htdocs/product/stock/productlot_card.php | 2 -- htdocs/product/stock/productlot_document.php | 3 -- htdocs/product/stock/valo.php | 2 -- htdocs/product/traduction.php | 1 - htdocs/projet/activity/index.php | 3 -- htdocs/projet/card.php | 1 - htdocs/projet/class/api_projects.class.php | 1 - htdocs/projet/class/api_tasks.class.php | 1 - htdocs/projet/class/project.class.php | 2 -- htdocs/projet/class/projectstats.class.php | 1 - htdocs/projet/class/task.class.php | 1 - htdocs/projet/document.php | 1 - htdocs/projet/element.php | 1 - htdocs/projet/list.php | 1 - htdocs/projet/tasks.php | 1 - htdocs/projet/tasks/comment.php | 1 - htdocs/projet/tasks/contact.php | 1 - htdocs/public/cron/cron_run_jobs.php | 1 - htdocs/public/donations/donateurs_code.php | 1 - htdocs/public/emailing/mailing-read.php | 1 - htdocs/public/members/public_card.php | 1 - htdocs/public/onlinesign/newonlinesign.php | 3 -- htdocs/public/payment/newpayment.php | 1 - htdocs/public/stripe/ipn.php | 5 --- htdocs/resource/card.php | 1 - htdocs/resource/class/dolresource.class.php | 2 -- htdocs/resource/document.php | 1 - htdocs/resource/element_resource.php | 1 - htdocs/societe/admin/societe.php | 4 --- .../canvas/actions_card_common.class.php | 1 - .../company/actions_card_company.class.php | 1 - htdocs/societe/card.php | 7 ---- htdocs/societe/class/address.class.php | 2 -- .../societe/class/api_thirdparties.class.php | 2 -- .../class/companybankaccount.class.php | 1 - .../class/companypaymentmode.class.php | 1 - htdocs/societe/class/societe.class.php | 4 --- htdocs/societe/class/societeaccount.class.php | 1 - htdocs/societe/consumption.php | 1 - htdocs/societe/price.php | 1 - htdocs/stripe/charge.php | 1 - htdocs/stripe/class/actions_stripe.class.php | 1 - htdocs/stripe/class/stripe.class.php | 1 - htdocs/stripe/payment.php | 1 - htdocs/supplier_proposal/card.php | 1 - .../class/api_supplier_proposals.class.php | 1 - .../class/supplier_proposal.class.php | 4 --- htdocs/supplier_proposal/contact.php | 1 - htdocs/ticket/list.php | 1 - htdocs/user/card.php | 2 -- htdocs/user/class/user.class.php | 2 -- htdocs/user/clicktodial.php | 1 - htdocs/user/param_ihm.php | 2 -- htdocs/variants/admin/admin.php | 1 - htdocs/variants/card.php | 1 - .../class/ProductCombination.class.php | 1 - htdocs/variants/combinations.php | 4 --- htdocs/variants/generator.php | 1 - htdocs/webservices/server_actioncomm.php | 1 - htdocs/webservices/server_category.php | 2 -- htdocs/webservices/server_invoice.php | 2 -- htdocs/webservices/server_order.php | 6 ---- .../webservices/server_productorservice.php | 5 --- htdocs/webservices/server_thirdparty.php | 1 - htdocs/webservices/server_user.php | 1 - htdocs/website/index.php | 2 -- scripts/cron/cron_run_jobs.php | 1 - scripts/emailings/mailing-send.php | 2 -- .../members/sync_members_ldap2dolibarr.php | 1 - scripts/product/migrate_picture_path.php | 1 - test/phpunit/CodingSqlTest.php | 3 -- 360 files changed, 1 insertion(+), 720 deletions(-) diff --git a/dev/initdata/generate-invoice.php b/dev/initdata/generate-invoice.php index 4064336cbab..280518bd4e3 100755 --- a/dev/initdata/generate-invoice.php +++ b/dev/initdata/generate-invoice.php @@ -185,7 +185,4 @@ while ($i < GEN_NUMBER_FACTURE && $result >= 0) { dol_print_error($db,$object->error); } - } - - diff --git a/dev/initdata/generate-proposal.php b/dev/initdata/generate-proposal.php index 631b734fc9e..eb2bfe15a00 100755 --- a/dev/initdata/generate-proposal.php +++ b/dev/initdata/generate-proposal.php @@ -218,6 +218,4 @@ while ($i < GEN_NUMBER_PROPAL && $result >= 0) { dol_print_error($db,$object->error); } - } - diff --git a/dev/setup/codesniffer/ruleset.xml b/dev/setup/codesniffer/ruleset.xml index 79b16bdbf55..67bf58e51ed 100644 --- a/dev/setup/codesniffer/ruleset.xml +++ b/dev/setup/codesniffer/ruleset.xml @@ -173,6 +173,7 @@ 0 + diff --git a/htdocs/accountancy/admin/accountmodel.php b/htdocs/accountancy/admin/accountmodel.php index efa23a6a586..d3843763732 100644 --- a/htdocs/accountancy/admin/accountmodel.php +++ b/htdocs/accountancy/admin/accountmodel.php @@ -247,7 +247,6 @@ if (GETPOST('actionadd','alpha') || GETPOST('actionmodify','alpha')) { $obj = $db->fetch_object($result); $newid=($obj->newid + 1); - } else { dol_print_error($db); } diff --git a/htdocs/accountancy/admin/categories_list.php b/htdocs/accountancy/admin/categories_list.php index 14a6b56512d..9f6b0bf14fe 100644 --- a/htdocs/accountancy/admin/categories_list.php +++ b/htdocs/accountancy/admin/categories_list.php @@ -202,7 +202,6 @@ if (GETPOST('actionadd','alpha') || GETPOST('actionmodify','alpha')) { $obj = $db->fetch_object($result); $newid=($obj->newid + 1); - } else { dol_print_error($db); } diff --git a/htdocs/accountancy/admin/journals_list.php b/htdocs/accountancy/admin/journals_list.php index ae254788b08..3511ae431ec 100644 --- a/htdocs/accountancy/admin/journals_list.php +++ b/htdocs/accountancy/admin/journals_list.php @@ -202,7 +202,6 @@ if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha')) { $obj = $db->fetch_object($result); $newid=($obj->newid + 1); - } else { dol_print_error($db); } diff --git a/htdocs/accountancy/admin/productaccount.php b/htdocs/accountancy/admin/productaccount.php index 0babd9aab5f..a84e2f6fcab 100644 --- a/htdocs/accountancy/admin/productaccount.php +++ b/htdocs/accountancy/admin/productaccount.php @@ -173,7 +173,6 @@ if ($action == 'update') { $cpt++; } - } if ($ko) setEventMessages($langs->trans("XLineFailedToBeBinded", $ko), null, 'errors'); diff --git a/htdocs/accountancy/bookkeeping/balance.php b/htdocs/accountancy/bookkeeping/balance.php index 161e3346b9c..9feb2a7c234 100644 --- a/htdocs/accountancy/bookkeeping/balance.php +++ b/htdocs/accountancy/bookkeeping/balance.php @@ -315,7 +315,6 @@ if ($action != 'export_csv') print ""; print ''; - } // End of page diff --git a/htdocs/accountancy/bookkeeping/list.php b/htdocs/accountancy/bookkeeping/list.php index 4a4630edfa5..46575c21143 100644 --- a/htdocs/accountancy/bookkeeping/list.php +++ b/htdocs/accountancy/bookkeeping/list.php @@ -760,7 +760,6 @@ if ($num > 0) else print ''; } print ''; - } } diff --git a/htdocs/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php index 0ce49e76f51..b07f76a22df 100644 --- a/htdocs/accountancy/class/bookkeeping.class.php +++ b/htdocs/accountancy/class/bookkeeping.class.php @@ -1841,7 +1841,6 @@ class BookKeeping extends CommonObject } return $obj->label; - } else { $this->error = "Error " . $this->db->lasterror(); dol_syslog(__METHOD__ . " " . $this->error, LOG_ERR); diff --git a/htdocs/accountancy/customer/lines.php b/htdocs/accountancy/customer/lines.php index af80d70f043..7d8599b683c 100644 --- a/htdocs/accountancy/customer/lines.php +++ b/htdocs/accountancy/customer/lines.php @@ -135,7 +135,6 @@ if (is_array($changeaccount) && count($changeaccount) > 0) { $account_parent = ''; // Protection to avoid to mass apply it a second time } - } diff --git a/htdocs/accountancy/journal/sellsjournal.php b/htdocs/accountancy/journal/sellsjournal.php index 10cb339c2d6..ee7d45d6c66 100644 --- a/htdocs/accountancy/journal/sellsjournal.php +++ b/htdocs/accountancy/journal/sellsjournal.php @@ -500,7 +500,6 @@ if ($action == 'writebookkeeping') { break; // Break in the foreach } } - } $tabpay = $tabfac; diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index 908a46c91d1..e7b36b77ad9 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -789,7 +789,6 @@ if (empty($reshook)) $mode='emailfrommember'; $trackid='mem'.$object->id; include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php'; - } @@ -1320,7 +1319,6 @@ else print ''; print ''; - } if ($id > 0 && $action != 'edit') @@ -1858,7 +1856,6 @@ else print '\n"; } } - } } print ''; diff --git a/htdocs/adherents/cartes/carte.php b/htdocs/adherents/cartes/carte.php index ff7e9c3be2e..c50de6f8c81 100644 --- a/htdocs/adherents/cartes/carte.php +++ b/htdocs/adherents/cartes/carte.php @@ -208,7 +208,6 @@ if ((! empty($foruserid) || ! empty($foruserlogin) || ! empty($mode)) && ! $mesg $mesg=$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("DescADHERENT_CARD_TYPE")); } if (! $mesg) $result=members_card_pdf_create($db, $arrayofmembers, $model, $outputlangs); - } elseif ($mode == 'label') { diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 317d7697231..3df36ef3eda 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -2509,7 +2509,6 @@ class Adherent extends CommonObject } $this->db->free($result); - } else { @@ -2738,7 +2737,6 @@ class Adherent extends CommonObject $nbok++; // TODO Add event email sent for member - } } else diff --git a/htdocs/adherents/class/subscription.class.php b/htdocs/adherents/class/subscription.class.php index 562b34af2b1..7b8f453c94c 100644 --- a/htdocs/adherents/class/subscription.class.php +++ b/htdocs/adherents/class/subscription.class.php @@ -416,7 +416,6 @@ class Subscription extends CommonObject } $this->db->free($result); - } else { diff --git a/htdocs/adherents/note.php b/htdocs/adherents/note.php index 8cd12cd6ca2..c12c45de8b7 100644 --- a/htdocs/adherents/note.php +++ b/htdocs/adherents/note.php @@ -116,7 +116,6 @@ if ($id) dol_fiche_end(); - } // End of page diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php index e9ad0b91498..7e69d4fbc98 100644 --- a/htdocs/adherents/type.php +++ b/htdocs/adherents/type.php @@ -694,7 +694,6 @@ if ($rowid > 0) { dol_print_error($db); } - } /* ************************************************************************** */ diff --git a/htdocs/admin/barcode.php b/htdocs/admin/barcode.php index 519f2b42938..6a356843d6b 100644 --- a/htdocs/admin/barcode.php +++ b/htdocs/admin/barcode.php @@ -75,7 +75,6 @@ else if ($action == 'update') else if ($action == 'updateengine') { // TODO Update engines. - } if ($action && $action != 'setcoder' && $action != 'setModuleOptions') diff --git a/htdocs/admin/chequereceipts.php b/htdocs/admin/chequereceipts.php index 82b0ed3848c..f85018c03b8 100644 --- a/htdocs/admin/chequereceipts.php +++ b/htdocs/admin/chequereceipts.php @@ -217,7 +217,6 @@ foreach ($dirmodels as $reldir) print ''; print "\n"; - } } } diff --git a/htdocs/admin/delais.php b/htdocs/admin/delais.php index 19fa67abcff..add4e2aec80 100644 --- a/htdocs/admin/delais.php +++ b/htdocs/admin/delais.php @@ -155,7 +155,6 @@ if ($action == 'update') 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); } - } @@ -254,7 +253,6 @@ else print ''; print ''; - } print '
'; @@ -272,7 +270,6 @@ if($action == 'edit') { print ''; print '

'; - } else { if(empty($conf->global->MAIN_USE_METEO_WITH_PERCENTAGE)) print $langs->trans('MeteoStdModEnabled'); else print $langs->trans('MeteoPercentageModEnabled'); @@ -362,7 +359,6 @@ if ($action == 'edit') { global->MAIN_USE_METEO_WITH_PERCENTAGE)) { @@ -385,7 +381,6 @@ if ($action == 'edit') { print '> '.$conf->global->MAIN_METEO_PERCENTAGE_LEVEL3.' %'; print ''; print ''; - } else { print '
'; @@ -406,7 +401,6 @@ if ($action == 'edit') { print '> '.$level3; print '
'; print ''; - } } @@ -416,13 +410,11 @@ if($action == 'edit') { print '
'; print '
'; - } else { // Boutons d'action print '
'; - } // End of page diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 0b5b63d35d6..4d5471b1aa8 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -705,7 +705,6 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) { $obj = $db->fetch_object($result); $newid=($obj->newid + 1); - } else { dol_print_error($db); } diff --git a/htdocs/admin/dolistore/class/PSWebServiceLibrary.class.php b/htdocs/admin/dolistore/class/PSWebServiceLibrary.class.php index 4617481d04d..c8fcd061689 100644 --- a/htdocs/admin/dolistore/class/PSWebServiceLibrary.class.php +++ b/htdocs/admin/dolistore/class/PSWebServiceLibrary.class.php @@ -177,7 +177,6 @@ class PrestaShopWebservice { $this->printDebug('HTTP REQUEST HEADER', curl_getinfo($session, CURLINFO_HEADER_OUT)); $this->printDebug('HTTP RESPONSE HEADER', $header); - } $status_code = curl_getinfo($session, CURLINFO_HTTP_CODE); if ($status_code === 0) diff --git a/htdocs/admin/facture.php b/htdocs/admin/facture.php index cd84dbf65a5..5cb093cc443 100644 --- a/htdocs/admin/facture.php +++ b/htdocs/admin/facture.php @@ -261,8 +261,6 @@ if ($action == 'setDefaultPDFModulesByType') setEventMessages($langs->trans("Error"), null, 'errors'); } } - - } @@ -436,7 +434,6 @@ foreach ($dirmodels as $reldir) print ''; print "\n"; - } } } diff --git a/htdocs/admin/ldap.php b/htdocs/admin/ldap.php index 052b2f38988..1f7b803a50e 100644 --- a/htdocs/admin/ldap.php +++ b/htdocs/admin/ldap.php @@ -336,7 +336,6 @@ if (function_exists("ldap_connect")) print $langs->trans("Error").' '.$ldap->error; print '
'; } - } } diff --git a/htdocs/admin/ldap_members.php b/htdocs/admin/ldap_members.php index 2f36f239257..61da334a90d 100644 --- a/htdocs/admin/ldap_members.php +++ b/htdocs/admin/ldap_members.php @@ -439,7 +439,6 @@ if (function_exists("ldap_connect")) print $langs->trans("ErrorLDAPMakeManualTest",$conf->ldap->dir_temp).'
'; } } - } // End of page diff --git a/htdocs/admin/ldap_users.php b/htdocs/admin/ldap_users.php index 513aa63f035..87df901cfa9 100644 --- a/htdocs/admin/ldap_users.php +++ b/htdocs/admin/ldap_users.php @@ -443,7 +443,6 @@ if (function_exists("ldap_connect")) } $liste[$key] = $label; } - } else { diff --git a/htdocs/admin/limits.php b/htdocs/admin/limits.php index f9fe219afef..ca4b8fca512 100644 --- a/htdocs/admin/limits.php +++ b/htdocs/admin/limits.php @@ -253,7 +253,6 @@ else print " x ".$langs->trans("Quantity").": ".$qty; print " - ".$langs->trans("VAT").": ".$vat.'%'; print "   ->   ".$langs->trans("TotalPriceAfterRounding").": ".$tmparray[0].' / '.$tmparray[1].' / '.$tmparray[2]."
\n"; - } // Important: can debug rounding, to simulate the rounded total diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index c089e9ef204..81eec5a4247 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -433,9 +433,7 @@ if ($action == 'reset_confirm' && $user->admin) $form = new Form($db); $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?value='.$value.'&mode='.$mode.$param, $langs->trans('ConfirmUnactivation'), $langs->trans(GETPOST('confirm_message_code')), 'reset', '', 'no', 1); - } - } print $formconfirm; @@ -711,16 +709,13 @@ if ($mode == 'common') print 'warnings_unactivation[$mysoc->country_code].'&value=' . $modName . '&mode=' . $mode . $param . '">'; print img_picto($langs->trans("Activated"),'switch_on'); print ''; - } else { print ''; print img_picto($langs->trans("Activated"),'switch_on'); print ''; - } - } print ''."\n"; @@ -775,7 +770,6 @@ if ($mode == 'common') { print ''.img_picto($langs->trans("NothingToSetup"),"setup",'class="opacitytransp" style="padding-right: 6px"').''; } - } else // Module not yet activated { diff --git a/htdocs/admin/oauth.php b/htdocs/admin/oauth.php index d18608feaf4..16827306bda 100644 --- a/htdocs/admin/oauth.php +++ b/htdocs/admin/oauth.php @@ -139,7 +139,6 @@ foreach ($list as $key) print ''; print ''; print ''; - } print ''."\n"; diff --git a/htdocs/admin/oauthlogintokens.php b/htdocs/admin/oauthlogintokens.php index fb9f2dd374e..f29c49e9f38 100644 --- a/htdocs/admin/oauthlogintokens.php +++ b/htdocs/admin/oauthlogintokens.php @@ -327,7 +327,6 @@ if ($mode == 'setup' && $user->admin) print ''; } - } if ($mode == 'test' && $user->admin) @@ -352,11 +351,9 @@ if ($mode == 'test' && $user->admin) else { print $langs->trans('PleaseConfigureDriverfromList'); } - } print ''; - } if ($mode == 'userconf' && $user->admin) diff --git a/htdocs/admin/payment.php b/htdocs/admin/payment.php index 4ca9411e105..816ab8344ce 100644 --- a/htdocs/admin/payment.php +++ b/htdocs/admin/payment.php @@ -83,7 +83,6 @@ if ($action == 'setparams') { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } - } @@ -217,7 +216,6 @@ foreach ($dirmodels as $reldir) print ''; print "\n"; - } } } diff --git a/htdocs/admin/pdf.php b/htdocs/admin/pdf.php index 0dba6ea6700..50d8fb5b927 100644 --- a/htdocs/admin/pdf.php +++ b/htdocs/admin/pdf.php @@ -517,7 +517,6 @@ else // Show $text.= yn($conf->global->MAIN_PDF_MAIN_HIDE_THIRD_TAX,1); $text.= ''; } - } // Sales TAX / VAT information diff --git a/htdocs/admin/receiptprinter.php b/htdocs/admin/receiptprinter.php index 9205d49deae..b8d92687d84 100644 --- a/htdocs/admin/receiptprinter.php +++ b/htdocs/admin/receiptprinter.php @@ -438,7 +438,6 @@ if ($mode == 'template' && $user->admin) print ''; dol_fiche_end(); - } // to remove after test diff --git a/htdocs/admin/supplier_payment.php b/htdocs/admin/supplier_payment.php index 55fb311ccda..77f2a95070e 100644 --- a/htdocs/admin/supplier_payment.php +++ b/htdocs/admin/supplier_payment.php @@ -301,7 +301,6 @@ foreach ($dirmodels as $reldir) print ''; print "\n"; - } } } diff --git a/htdocs/admin/syslog.php b/htdocs/admin/syslog.php index e163fc83de5..d9ab678faa8 100644 --- a/htdocs/admin/syslog.php +++ b/htdocs/admin/syslog.php @@ -132,9 +132,7 @@ if ($action == 'set') { $db->rollback(); setEventMessages($error, $errors, 'errors'); - } - } // Set level diff --git a/htdocs/admin/tools/eaccelerator.php b/htdocs/admin/tools/eaccelerator.php index a3205c11a27..c6209cd7c34 100644 --- a/htdocs/admin/tools/eaccelerator.php +++ b/htdocs/admin/tools/eaccelerator.php @@ -168,7 +168,6 @@ function create_script_table($list) default: $sortby = "file"; ($order == "asc" ? uasort($list, 'compare') : uasort($list, 'revcompare')); - } foreach($list as $script) { diff --git a/htdocs/admin/tools/listsessions.php b/htdocs/admin/tools/listsessions.php index 643269bfacd..8ddc1d65525 100644 --- a/htdocs/admin/tools/listsessions.php +++ b/htdocs/admin/tools/listsessions.php @@ -170,7 +170,6 @@ if ($savehandler == 'files') print ''.$langs->trans("NoSessionFound",$savepath,$openbasedir).''; } print ""; - } else { diff --git a/htdocs/admin/translation.php b/htdocs/admin/translation.php index 4c215e9ae52..da26d6648cd 100644 --- a/htdocs/admin/translation.php +++ b/htdocs/admin/translation.php @@ -384,7 +384,6 @@ if ($mode == 'overwrite') print ''; print ''; - } if ($mode == 'searchkey') diff --git a/htdocs/admin/website.php b/htdocs/admin/website.php index fcdeee79249..e36b8d59df3 100644 --- a/htdocs/admin/website.php +++ b/htdocs/admin/website.php @@ -167,7 +167,6 @@ if (GETPOST('actionadd','alpha') || GETPOST('actionmodify','alpha')) { $obj = $db->fetch_object($result); $newid=($obj->newid + 1); - } else { dol_print_error($db); } diff --git a/htdocs/asset/class/asset.class.php b/htdocs/asset/class/asset.class.php index 8eeacdc1964..22e24703bc3 100644 --- a/htdocs/asset/class/asset.class.php +++ b/htdocs/asset/class/asset.class.php @@ -463,7 +463,6 @@ class Asset extends CommonObject } $this->db->free($result); - } else { diff --git a/htdocs/asset/type.php b/htdocs/asset/type.php index 001912f7de3..9e06c4a765d 100644 --- a/htdocs/asset/type.php +++ b/htdocs/asset/type.php @@ -356,7 +356,6 @@ if ($action == 'create') print ''; print $formaccounting->select_account($object->accountancy_code_depreciation_expense, 'accountancy_code_depreciation_expense', 1, '', 1, 1); print ''; - } else // For external software { @@ -732,7 +731,6 @@ if ($rowid > 0) { dol_print_error($db); } - } /* ************************************************************************** */ @@ -782,7 +780,6 @@ if ($rowid > 0) print ''; print $formaccounting->select_account($object->accountancy_code_depreciation_expense, 'accountancy_code_depreciation_expense', 1, '', 1, 1); print ''; - } else // For external software { diff --git a/htdocs/blockedlog/admin/blockedlog_list.php b/htdocs/blockedlog/admin/blockedlog_list.php index cd558c020a6..734e9d31f67 100644 --- a/htdocs/blockedlog/admin/blockedlog_list.php +++ b/htdocs/blockedlog/admin/blockedlog_list.php @@ -444,7 +444,6 @@ if (! empty($conf->global->BLOCKEDLOG_SCAN_ALL_FOR_LOWERIDINERROR)) // TODO Make a full scan of table in reverse order of id of $block, so we can use the parameter $previoushash into checkSignature to save requests // to find the $loweridinerror. - } else { @@ -538,7 +537,6 @@ if (is_array($blocks)) print ''; print ''; - } } } diff --git a/htdocs/blockedlog/ajax/authority.php b/htdocs/blockedlog/ajax/authority.php index 7bde15aa879..1104eeb3c02 100644 --- a/htdocs/blockedlog/ajax/authority.php +++ b/htdocs/blockedlog/ajax/authority.php @@ -53,7 +53,6 @@ if($auth->fetch(0, $signature)<=0) { if(!empty($hash)) { echo $auth->checkBlockchain($hash) ? 'hashisok' : 'hashisjunk'; - } elseif(!empty($newblock)){ if($auth->checkBlock($newblock)) { @@ -65,7 +64,6 @@ elseif(!empty($newblock)){ else{ echo 'blockalreadyadded'; - } } else{ diff --git a/htdocs/blockedlog/ajax/check_signature.php b/htdocs/blockedlog/ajax/check_signature.php index 199f9051e07..9617e6cd1ef 100644 --- a/htdocs/blockedlog/ajax/check_signature.php +++ b/htdocs/blockedlog/ajax/check_signature.php @@ -49,7 +49,6 @@ $auth->signature = $block_static->getSignature(); foreach($blocks as &$b) { $auth->blockchain.=$b->signature; - } $hash = $auth->getBlockchainHash(); diff --git a/htdocs/blockedlog/class/authority.class.php b/htdocs/blockedlog/class/authority.class.php index 0102a5d88d6..0d0fc183b6c 100644 --- a/htdocs/blockedlog/class/authority.class.php +++ b/htdocs/blockedlog/class/authority.class.php @@ -73,7 +73,6 @@ class BlockedLogAuthority foreach($blocks as &$b) { $this->blockchain.=$b->signature; - } return $this->blockchain; @@ -319,15 +318,12 @@ class BlockedLogAuthority if($res === 'blockalreadyadded' || $res === 'blockadded') { $block->setCertified(); - } else { $this->error = $langs->trans('ImpossibleToContactAuthority ',$url); return -1; } - - } return 1; diff --git a/htdocs/blockedlog/class/blockedlog.class.php b/htdocs/blockedlog/class/blockedlog.class.php index eb2070d703a..46766277669 100644 --- a/htdocs/blockedlog/class/blockedlog.class.php +++ b/htdocs/blockedlog/class/blockedlog.class.php @@ -947,17 +947,14 @@ class BlockedLog $sql="SELECT rowid FROM ".MAIN_DB_PREFIX."blockedlog WHERE entity=".$conf->entity; - } else if ($element=='not_certified') { $sql="SELECT rowid FROM ".MAIN_DB_PREFIX."blockedlog WHERE entity=".$conf->entity." AND certified = 0"; - } else if ($element=='just_certified') { $sql="SELECT rowid FROM ".MAIN_DB_PREFIX."blockedlog WHERE entity=".$conf->entity." AND certified = 1"; - } else{ $sql="SELECT rowid FROM ".MAIN_DB_PREFIX."blockedlog diff --git a/htdocs/bookmarks/card.php b/htdocs/bookmarks/card.php index b82c2b11b6c..1d10dc7ca34 100644 --- a/htdocs/bookmarks/card.php +++ b/htdocs/bookmarks/card.php @@ -333,7 +333,6 @@ if ($id > 0 && ! preg_match('/^add/i',$action)) } print ''; - } // End of page diff --git a/htdocs/cashdesk/class/Facturation.class.php b/htdocs/cashdesk/class/Facturation.class.php index 3051035813a..18487619a76 100644 --- a/htdocs/cashdesk/class/Facturation.class.php +++ b/htdocs/cashdesk/class/Facturation.class.php @@ -290,19 +290,16 @@ class Facturation if ( !$aId ) { return $this->id; - } else if ( $aId == 'RESET' ) { $this->id = null; - } else { $this->id = $aId; - } } @@ -410,15 +407,12 @@ class Facturation if (is_null($aMontantRemise)) { return $this->montant_remise; - } else if ( $aMontantRemise == 'RESET' ) { $this->montant_remise = null; - } else { $this->montant_remise = $aMontantRemise; - } } @@ -434,15 +428,12 @@ class Facturation if (is_null($aPrix)) { return $this->prix; - } else if ( $aPrix == 'RESET' ) { $this->prix = null; - } else { $this->prix = $aPrix; - } } @@ -457,15 +448,12 @@ class Facturation if (is_null($aTva)) { return $this->tva; - } else if ( $aTva == 'RESET' ) { $this->tva = null; - } else { $this->tva = $aTva; - } } @@ -480,15 +468,12 @@ class Facturation if (is_null($aNumFacture)) { return $this->num_facture; - } else if ( $aNumFacture == 'RESET' ) { $this->num_facture = null; - } else { $this->num_facture = $aNumFacture; - } } @@ -504,15 +489,12 @@ class Facturation if (is_null($aModeReglement)) { return $this->mode_reglement; - } else if ( $aModeReglement == 'RESET' ) { $this->mode_reglement = null; - } else { $this->mode_reglement = $aModeReglement; - } } @@ -528,15 +510,12 @@ class Facturation if (is_null($aMontantEncaisse)) { return $this->montant_encaisse; - } else if ( $aMontantEncaisse == 'RESET' ) { $this->montant_encaisse = null; - } else { $this->montant_encaisse = $aMontantEncaisse; - } } @@ -555,11 +534,9 @@ class Facturation } else if ( $aMontantRendu == 'RESET' ) { $this->montant_rendu = null; - } else { $this->montant_rendu = $aMontantRendu; - } } @@ -574,15 +551,12 @@ class Facturation if (is_null($aPaiementLe)) { return $this->paiement_le; - } else if ( $aPaiementLe == 'RESET' ) { $this->paiement_le = null; - } else { $this->paiement_le = $aPaiementLe; - } } @@ -597,15 +571,12 @@ class Facturation if (is_null($aTotalHt)) { return $this->prix_total_ht; - } else if ( $aTotalHt == 'RESET' ) { $this->prix_total_ht = null; - } else { $this->prix_total_ht = $aTotalHt; - } } @@ -620,15 +591,12 @@ class Facturation if (is_null($aMontantTva)) { return $this->montant_tva; - } else if ( $aMontantTva == 'RESET' ) { $this->montant_tva = null; - } else { $this->montant_tva = $aMontantTva; - } } diff --git a/htdocs/cashdesk/facturation.php b/htdocs/cashdesk/facturation.php index 6a2889f6e71..4ca8a562659 100644 --- a/htdocs/cashdesk/facturation.php +++ b/htdocs/cashdesk/facturation.php @@ -137,7 +137,6 @@ if ( $nbr_enreg > 1 ) { $top_liste_produits = '----- '.$nbr_enreg.' '.$langs->transnoentitiesnoconv("CashDeskProducts").' '.$langs->trans("CashDeskOn").' '.$nbr_enreg.' -----'; } - } else if ( $nbr_enreg == 1 ) { diff --git a/htdocs/cashdesk/facturation_dhtml.php b/htdocs/cashdesk/facturation_dhtml.php index e1a1dcc6bc8..bcfc1e82f82 100644 --- a/htdocs/cashdesk/facturation_dhtml.php +++ b/htdocs/cashdesk/facturation_dhtml.php @@ -108,5 +108,4 @@ if (dol_strlen($search) >= 0) // If search criteria is on char length at least print ''; } } - } diff --git a/htdocs/cashdesk/facturation_verif.php b/htdocs/cashdesk/facturation_verif.php index cdeeaf6c424..6aa81d991df 100644 --- a/htdocs/cashdesk/facturation_verif.php +++ b/htdocs/cashdesk/facturation_verif.php @@ -216,7 +216,6 @@ switch($action) $obj_facturation->remisePercent($_POST['txtRemise']); $obj_facturation->ajoutArticle(); // This add an entry into $_SESSION['poscart'] // We update prixTotalTtc - } $redirection = DOL_URL_ROOT.'/cashdesk/affIndex.php?menutpl=facturation'; @@ -227,7 +226,6 @@ switch($action) $redirection = DOL_URL_ROOT.'/cashdesk/affIndex.php?menutpl=facturation'; break; - } // We saved object obj_facturation diff --git a/htdocs/cashdesk/tpl/facturation1.tpl.php b/htdocs/cashdesk/tpl/facturation1.tpl.php index 4ddafd17c44..2ff71e2a359 100644 --- a/htdocs/cashdesk/tpl/facturation1.tpl.php +++ b/htdocs/cashdesk/tpl/facturation1.tpl.php @@ -89,7 +89,6 @@ $langs->loadLangs(array("main","bills","cashdesk")); print ''."\n"; - } ?> diff --git a/htdocs/cashdesk/tpl/liste_articles.tpl.php b/htdocs/cashdesk/tpl/liste_articles.tpl.php index 266c5e5840b..53209d735c4 100644 --- a/htdocs/cashdesk/tpl/liste_articles.tpl.php +++ b/htdocs/cashdesk/tpl/liste_articles.tpl.php @@ -60,11 +60,9 @@ else if ( $tab[$i]['remise_percent'] > 0 ) { $remise_percent = ' -'.$tab[$i]['remise_percent'].'%'; - } else { $remise_percent = ''; - } $remise = $tab[$i]['remise']; diff --git a/htdocs/cashdesk/tpl/validation1.tpl.php b/htdocs/cashdesk/tpl/validation1.tpl.php index 957d2d6b843..750831cead8 100644 --- a/htdocs/cashdesk/tpl/validation1.tpl.php +++ b/htdocs/cashdesk/tpl/validation1.tpl.php @@ -41,13 +41,11 @@ $langs->loadLangs(array("main","bills","banks")); if ( $obj_facturation->montantTva() ) { echo (''.$langs->trans("VAT").''.price(price2num($obj_facturation->montantTva(),'MT'),0,$langs,0,0,-1,$conf->currency).''); - } else { echo (''.$langs->trans("VAT").''.$langs->trans("NoVAT").''); - } ?> trans("TotalTTC"); ?> prixTotalTtc(),'MT'),0,$langs,0,0,-1,$conf->currency); ?> @@ -91,18 +89,15 @@ $langs->loadLangs(array("main","bills","banks")); if ( $obj_facturation->getsetPaymentMode() == 'DIF' ) { echo (''.$langs->trans("DateDue").''.$obj_facturation->paiementLe().''); - } else { echo (''.$langs->trans("Received").''.price(price2num($obj_facturation->montantEncaisse(),'MT'),0,$langs,0,0,-1,$conf->currency).''); - } // Affichage du montant rendu (reglement en especes) if ( $obj_facturation->montantRendu() ) { echo (''.$langs->trans("Change").''.price(price2num($obj_facturation->montantRendu(),'MT'),0,$langs,0,0,-1,$conf->currency).''); - } ?> diff --git a/htdocs/cashdesk/validation_verif.php b/htdocs/cashdesk/validation_verif.php index b42bc90d8fb..be1f201a8fe 100644 --- a/htdocs/cashdesk/validation_verif.php +++ b/htdocs/cashdesk/validation_verif.php @@ -328,7 +328,6 @@ switch ($action) $result=$invoice->set_paid($user); //print 'set paid';exit; } - } } else diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index a7ddab761e0..480edb83390 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -665,7 +665,6 @@ class Categorie extends CommonObject $this->db->rollback(); return -2; } - } else { @@ -1810,7 +1809,6 @@ class Categorie extends CommonObject { $this->label = $obj->label; $this->description = $obj->description; - } $this->multilangs["$obj->lang"]["label"] = $obj->label; $this->multilangs["$obj->lang"]["description"] = $obj->description; diff --git a/htdocs/categories/traduction.php b/htdocs/categories/traduction.php index dbcfca198d2..d3287703695 100644 --- a/htdocs/categories/traduction.php +++ b/htdocs/categories/traduction.php @@ -269,7 +269,6 @@ if ($action == 'edit') print ''; print ''; - } else if ($action != 'add') { diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php index ba3580cea87..560cb4613be 100644 --- a/htdocs/categories/viewcat.php +++ b/htdocs/categories/viewcat.php @@ -168,7 +168,6 @@ if ($type == Categorie::TYPE_PRODUCT && $elemid && $action == 'addintocategory' setEventMessages($object->error,$object->errors,'errors'); } } - } diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index fd0a4a2b430..4e8b87eb591 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -597,7 +597,6 @@ if (GETPOST('actionmove','alpha') == 'mupdate') { $action=''; } - } // Actions to delete doc @@ -873,7 +872,6 @@ if ($action == 'create') } else { print $form->select_company('', 'socid', '', 'SelectThirdParty', 1, 0, $events, 0, 'minwidth300'); } - } print ''; diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 4a6cec809fe..92af9fef6da 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -401,7 +401,6 @@ class ActionComm extends CommonObject $error++; $this->errors[]=$this->db->lasterror(); } - } } } @@ -937,7 +936,6 @@ class ActionComm extends CommonObject $error++; $this->errors[]=$this->db->lasterror(); } - } } } diff --git a/htdocs/comm/action/class/api_agendaevents.class.php b/htdocs/comm/action/class/api_agendaevents.class.php index 677e477cd89..1e9dde34bde 100644 --- a/htdocs/comm/action/class/api_agendaevents.class.php +++ b/htdocs/comm/action/class/api_agendaevents.class.php @@ -309,7 +309,6 @@ class AgendaEvents extends DolibarrApi if (!isset($data[$field])) throw new RestException(400, "$field field missing"); $event[$field] = $data[$field]; - } return $event; } diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 4ffa4298d20..0bc022956b1 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -666,7 +666,6 @@ if ($resql) //print ' startincalendar='.dol_print_date($event->date_start_in_calendar).'-endincalendar='.dol_print_date($event->date_end_in_calendar).') was added in '.$j.' different index key of array
'; } $i++; - } } else diff --git a/htdocs/comm/action/list.php b/htdocs/comm/action/list.php index 5628e65c6d9..02d3a16c7f3 100644 --- a/htdocs/comm/action/list.php +++ b/htdocs/comm/action/list.php @@ -643,7 +643,6 @@ if ($resql) print " "; } print ''; - } // Extra fields @@ -668,7 +667,6 @@ if ($resql) print ''; $db->free($resql); - } else { diff --git a/htdocs/comm/action/pertype.php b/htdocs/comm/action/pertype.php index 31f22420cb8..0347f73a453 100644 --- a/htdocs/comm/action/pertype.php +++ b/htdocs/comm/action/pertype.php @@ -543,7 +543,6 @@ if ($resql) //print ' startincalendar='.dol_print_date($event->date_start_in_calendar).'-endincalendar='.dol_print_date($event->date_end_in_calendar).') was added in '.$j.' different index key of array
'; } $i++; - } } else diff --git a/htdocs/comm/action/peruser.php b/htdocs/comm/action/peruser.php index 7b02857becf..b145dfa54ed 100644 --- a/htdocs/comm/action/peruser.php +++ b/htdocs/comm/action/peruser.php @@ -571,7 +571,6 @@ if ($resql) //print ' startincalendar='.dol_print_date($event->date_start_in_calendar).'-endincalendar='.dol_print_date($event->date_end_in_calendar).') was added in '.$j.' different index key of array
'; } $i++; - } $db->free($resql); } @@ -798,7 +797,6 @@ while($currentdaytoshow<$lastdaytoshow) { echo "
"; $currentdaytoshow = dol_time_plus_duree($currentdaytoshow, 7, 'd'); - } echo ''; diff --git a/htdocs/comm/address.php b/htdocs/comm/address.php index 9c8b275d198..4b32eea153a 100644 --- a/htdocs/comm/address.php +++ b/htdocs/comm/address.php @@ -151,7 +151,6 @@ if ($action == 'add' || $action == 'update') $action= "edit"; } } - } else if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->societe->supprimer) @@ -291,7 +290,6 @@ if ($action == 'create') print ''."\n"; print ''."\n"; - } } elseif ($action == 'edit') @@ -486,7 +484,6 @@ else } print ''; } - } diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index 596c3cb3c5b..d11a81f5bdb 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -1301,7 +1301,6 @@ if ($object->id > 0) if ($object->client != 0 && $object->client != 2) print ''; else print ''; - } } } @@ -1344,7 +1343,6 @@ if ($object->id > 0) // List of done actions show_actions_done($conf,$langs,$db,$object); } - } else { diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php index 92757dcac36..cb384408e91 100644 --- a/htdocs/comm/index.php +++ b/htdocs/comm/index.php @@ -521,7 +521,6 @@ if (! empty($conf->societe->enabled) && $user->rights->societe->lire) print ''.dol_print_date($db->jdate($objp->tms),'day').""; print ''; $i++; - } $db->free($resql); @@ -580,7 +579,6 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->societe->lire) $i++; } - } else { diff --git a/htdocs/comm/mailing/advtargetemailing.php b/htdocs/comm/mailing/advtargetemailing.php index 72058578db7..8aa14a45b85 100644 --- a/htdocs/comm/mailing/advtargetemailing.php +++ b/htdocs/comm/mailing/advtargetemailing.php @@ -467,7 +467,6 @@ if ($object->fetch($id) >= 0) { if ($object->statut == 0 && $user->rights->mailing->creer) { include DOL_DOCUMENT_ROOT . '/core/tpl/advtarget.tpl.php'; - } } diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php index a2e63da99cc..28e49e9d171 100644 --- a/htdocs/comm/mailing/card.php +++ b/htdocs/comm/mailing/card.php @@ -1165,7 +1165,6 @@ else print ''; dol_fiche_end(); - } else { diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php index f07f308e74a..761a2bcc41d 100644 --- a/htdocs/comm/mailing/cibles.php +++ b/htdocs/comm/mailing/cibles.php @@ -643,7 +643,6 @@ if ($object->fetch($id) >= 0) } print "\n\n"; - } // End of page diff --git a/htdocs/comm/mailing/class/advtargetemailing.class.php b/htdocs/comm/mailing/class/advtargetemailing.class.php index c862b8392fd..baf48447bad 100644 --- a/htdocs/comm/mailing/class/advtargetemailing.class.php +++ b/htdocs/comm/mailing/class/advtargetemailing.class.php @@ -240,7 +240,6 @@ class AdvanceTargetingMailing extends CommonObject $this->datec = $this->db->jdate($obj->datec); $this->fk_user_mod = $obj->fk_user_mod; $this->tms = $this->db->jdate($obj->tms); - } $this->db->free($resql); @@ -304,7 +303,6 @@ class AdvanceTargetingMailing extends CommonObject $this->datec = $this->db->jdate($obj->datec); $this->fk_user_mod = $obj->fk_user_mod; $this->tms = $this->db->jdate($obj->tms); - } $this->db->free($resql); @@ -372,7 +370,6 @@ class AdvanceTargetingMailing extends CommonObject $this->datec = $this->db->jdate($obj->datec); $this->fk_user_mod = $obj->fk_user_mod; $this->tms = $this->db->jdate($obj->tms); - } $this->db->free($resql); @@ -664,14 +661,10 @@ class AdvanceTargetingMailing extends CommonObject $sqlwhere[]= " (te.".$key." LIKE '".$arrayquery['options_'.$key]."')"; } } - } - - } if (count($sqlwhere)>0) $sql.= " WHERE ".implode(" AND ",$sqlwhere); - } @@ -803,7 +796,6 @@ class AdvanceTargetingMailing extends CommonObject $sqlwhere[]= " (te.".$key." LIKE '".$arrayquery['options_'.$key.'_cnct']."')"; } } - } if (! empty($withThirdpartyFilter)) { @@ -969,7 +961,6 @@ class AdvanceTargetingMailing extends CommonObject if (count($return_sql_not_like)>0) { $return_sql_criteria .= ' AND (' . implode (' AND ', $return_sql_not_like).')'; } - }else { $return_sql_criteria .= $column_to_test . ' LIKE \''.$this->db->escape($criteria).'\''; } diff --git a/htdocs/comm/mailing/class/html.formadvtargetemailing.class.php b/htdocs/comm/mailing/class/html.formadvtargetemailing.class.php index 3fdcd6178b0..19b1ce3e9b4 100644 --- a/htdocs/comm/mailing/class/html.formadvtargetemailing.class.php +++ b/htdocs/comm/mailing/class/html.formadvtargetemailing.class.php @@ -178,7 +178,6 @@ class FormAdvTargetEmailing extends Form $label = $obj_usr->firstname . " " . $obj_usr->name . " (" . $obj_usr->login . ')'; $options_array [$obj_usr->rowid] = $label; - } $this->db->free ( $resql_usr ); } else { @@ -323,7 +322,6 @@ class FormAdvTargetEmailing extends Form $i++; } } - } else { @@ -411,7 +409,6 @@ class FormAdvTargetEmailing extends Form $i++; } } - } else { diff --git a/htdocs/comm/mailing/class/mailing.class.php b/htdocs/comm/mailing/class/mailing.class.php index bb6ac93d1c2..bc6f3beabd2 100644 --- a/htdocs/comm/mailing/class/mailing.class.php +++ b/htdocs/comm/mailing/class/mailing.class.php @@ -362,7 +362,6 @@ class Mailing extends CommonObject 'source_id'=>$obj->source_id, 'source_type'=>$obj->source_type); } - } } else @@ -373,7 +372,6 @@ class Mailing extends CommonObject $mailing_target->add_to_target($object->id, $target_array); } - } unset($object->context['createfromclone']); diff --git a/htdocs/comm/mailing/index.php b/htdocs/comm/mailing/index.php index 9cd1e8546d0..f1745b406fd 100644 --- a/htdocs/comm/mailing/index.php +++ b/htdocs/comm/mailing/index.php @@ -182,7 +182,6 @@ if ($result) print ''; $i++; } - } else { diff --git a/htdocs/comm/multiprix.php b/htdocs/comm/multiprix.php index 55f49c44cfd..7bbf727a517 100644 --- a/htdocs/comm/multiprix.php +++ b/htdocs/comm/multiprix.php @@ -174,7 +174,6 @@ if ($_socid > 0) { dol_print_error($db); } - } // End of page diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 1e6df0b014f..f07a5cdfac8 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -1364,7 +1364,6 @@ if (empty($reshook)) $upload_dir = $conf->propal->multidir_output[$object->entity]; $permissioncreate=$usercancreate; include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php'; - } @@ -1777,7 +1776,6 @@ if ($action == 'create') print ''; } - } elseif ($object->id > 0) { /* * Show object in view mode @@ -1825,7 +1823,6 @@ if ($action == 'create') } $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('SetAcceptedRefused'), $text, 'setstatut', $formquestion, '', 1, 250); - } // Confirm delete diff --git a/htdocs/comm/propal/class/api_proposals.class.php b/htdocs/comm/propal/class/api_proposals.class.php index fc721912462..a03624f3122 100644 --- a/htdocs/comm/propal/class/api_proposals.class.php +++ b/htdocs/comm/propal/class/api_proposals.class.php @@ -700,7 +700,6 @@ class Proposals extends DolibarrApi if (!isset($data[$field])) throw new RestException(400, "$field field missing"); $propal[$field] = $data[$field]; - } return $propal; } diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 16a19d1b41f..e11f62bb446 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -3127,11 +3127,8 @@ class Propal extends CommonObject $cluser->fetch($obj->fk_user_cloture); $this->user_cloture = $cluser; } - - } $this->db->free($result); - } else { diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index bc45d022e4d..b0cc04702db 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -227,7 +227,6 @@ if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x', $toselect=''; $search_array_options=array(); $search_categ_cus=0; - } if ($object_statut != '') $viewstatut=$object_statut; diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 75b949ff203..f468bd4b146 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -423,7 +423,6 @@ if (empty($reshook)) // modified by hook if ($reshook < 0) $error++; - } else { setEventMessages($object->error, $object->errors, 'errors'); $error++; diff --git a/htdocs/commande/class/api_orders.class.php b/htdocs/commande/class/api_orders.class.php index 60011592afe..1135a5c2502 100644 --- a/htdocs/commande/class/api_orders.class.php +++ b/htdocs/commande/class/api_orders.class.php @@ -297,7 +297,6 @@ class Orders extends DolibarrApi if ($updateRes > 0) { return $updateRes; - } else { throw new RestException(400, $this->commande->error); } @@ -793,7 +792,6 @@ class Orders extends DolibarrApi if (!isset($data[$field])) throw new RestException(400, $field ." field missing"); $commande[$field] = $data[$field]; - } return $commande; } diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 1925b71992e..2428e6052eb 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -3616,7 +3616,6 @@ class Commande extends CommonOrder } $this->db->free($result); - } else { diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 0e851c78cff..2a9e215faa4 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -214,7 +214,6 @@ if (empty($reshook)) $uploaddir = $conf->commande->dir_output; $trigger_name='ORDER_SENTBYMAIL'; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; - } diff --git a/htdocs/commande/orderstoinvoice.php b/htdocs/commande/orderstoinvoice.php index 3335cf93276..a8da25e07f9 100644 --- a/htdocs/commande/orderstoinvoice.php +++ b/htdocs/commande/orderstoinvoice.php @@ -118,7 +118,6 @@ if (($action == 'create' || $action == 'add') && !$error) $originid=$orders_id[0]; $_GET['originid']=$orders_id[0]; - } if (isset($_POST['orders_to_invoice'])) { @@ -128,7 +127,6 @@ if (($action == 'create' || $action == 'add') && !$error) $originid=$orders_id[0]; $_POST['originid']=$orders_id[0]; - } $projectid = GETPOST('projectid','int')?GETPOST('projectid','int'):0; @@ -531,8 +529,6 @@ if ($action == 'create' && !$error) print ''; print "\n"; - - } // Mode liste @@ -737,7 +733,6 @@ if (($action != 'create' && $action != 'add') || ($action == 'create' && $error) { dol_print_error($db); } - } // End of page diff --git a/htdocs/compta/bank/annuel.php b/htdocs/compta/bank/annuel.php index 5e1a10390e2..47f31eac308 100644 --- a/htdocs/compta/bank/annuel.php +++ b/htdocs/compta/bank/annuel.php @@ -339,7 +339,6 @@ else $i++; } $db->free($resql); - } else { diff --git a/htdocs/compta/bank/card.php b/htdocs/compta/bank/card.php index 2325d30a26a..6d2fa406ea7 100644 --- a/htdocs/compta/bank/card.php +++ b/htdocs/compta/bank/card.php @@ -576,7 +576,6 @@ else if ($action == 'delete') { $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id,$langs->trans("DeleteAccount"),$langs->trans("ConfirmDeleteAccount"),"confirm_delete"); - } // Print form confirm @@ -766,7 +765,6 @@ else } print ''; - } /* ************************************************************************** */ @@ -1033,7 +1031,6 @@ else print ''; } - } // End of page diff --git a/htdocs/compta/bank/class/paymentvarious.class.php b/htdocs/compta/bank/class/paymentvarious.class.php index c997ff1a4f7..47edacb2410 100644 --- a/htdocs/compta/bank/class/paymentvarious.class.php +++ b/htdocs/compta/bank/class/paymentvarious.class.php @@ -452,7 +452,6 @@ class PaymentVarious extends CommonObject $result=$this->call_trigger('PAYMENT_VARIOUS_CREATE',$user); if ($result < 0) $error++; // End call triggers - } else $error++; diff --git a/htdocs/compta/bank/ligne.php b/htdocs/compta/bank/ligne.php index 85cd839fd44..1587c5c10e8 100644 --- a/htdocs/compta/bank/ligne.php +++ b/htdocs/compta/bank/ligne.php @@ -451,7 +451,6 @@ if ($result) $receipt=new RemiseCheque($db); $receipt->fetch($objp->receiptid); print '     '.$langs->trans("CheckReceipt").': '.$receipt->getNomUrl(2); - } print ''; } @@ -682,7 +681,6 @@ if ($result) print ''; } - } $db->free($result); diff --git a/htdocs/compta/compta-files.php b/htdocs/compta/compta-files.php index 9e00bf10ae0..d8f4885a3b2 100644 --- a/htdocs/compta/compta-files.php +++ b/htdocs/compta/compta-files.php @@ -184,7 +184,6 @@ if(($action=="searchfiles"||$action=="dl" ) && $date_start && $date_stop){ } } $db->free($resd); - } /* * cleanup of old ZIP @@ -293,7 +292,6 @@ if ($result) print ''; print "\n"; } - } print ""; print '
'."\n\t\t\t"; diff --git a/htdocs/compta/deplacement/card.php b/htdocs/compta/deplacement/card.php index 861ee6e897f..383ff1c571a 100644 --- a/htdocs/compta/deplacement/card.php +++ b/htdocs/compta/deplacement/card.php @@ -421,7 +421,6 @@ else if ($id) if ($action == 'delete') { print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$id,$langs->trans("DeleteTrip"),$langs->trans("ConfirmDeleteTrip"),"confirm_delete"); - } $soc = new Societe($db); diff --git a/htdocs/compta/deplacement/document.php b/htdocs/compta/deplacement/document.php index e34a2aedb21..7ec837c81f2 100644 --- a/htdocs/compta/deplacement/document.php +++ b/htdocs/compta/deplacement/document.php @@ -122,7 +122,6 @@ if ($object->id) $permission = $user->rights->deplacement->creer; $param = '&id=' . $object->id; include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_post_headers.tpl.php'; - } else { diff --git a/htdocs/compta/deplacement/index.php b/htdocs/compta/deplacement/index.php index 98c939965a3..84c0c718c70 100644 --- a/htdocs/compta/deplacement/index.php +++ b/htdocs/compta/deplacement/index.php @@ -191,7 +191,6 @@ if ($result) $i++; } - } else { diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index a9fe72da41f..050f8786c3a 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -744,7 +744,6 @@ if (empty($reshook)) { $error++; } - } if ($object->type == Facture::TYPE_CREDIT_NOTE || $object->type == Facture::TYPE_DEPOSIT) { @@ -765,7 +764,6 @@ if (empty($reshook)) break; } } - } if (empty($error)) @@ -1000,15 +998,11 @@ if (empty($reshook)) $line->multicurrency_total_ht = $line->multicurrency_total_ht - $prevLine->multicurrency_total_ht; $line->multicurrency_total_tva = $line->multicurrency_total_tva - $prevLine->multicurrency_total_tva; $line->multicurrency_total_ttc = $line->multicurrency_total_ttc - $prevLine->multicurrency_total_ttc; - - } } // prorata $line->situation_percent = $maxPrevSituationPercent - $line->situation_percent; - - } } @@ -1040,7 +1034,6 @@ if (empty($reshook)) $object->update_price(1); } - } if(GETPOST('invoiceAvoirWithPaymentRestAmount', 'int')==1 && $id>0) @@ -1342,7 +1335,6 @@ if (empty($reshook)) $subprice_diff = $object->lines[0]->subprice - $diff / (1 + $object->lines[0]->tva_tx / 100); $object->updateline($object->lines[0]->id, $object->lines[0]->desc, $subprice_diff, $object->lines[0]->qty, $object->lines[0]->remise_percent, $object->lines[0]->date_start, $object->lines[0]->date_end, $object->lines[0]->tva_tx, 0, 0, 'HT', $object->lines[0]->info_bits, $object->lines[0]->product_type, 0, 0, 0, $object->lines[0]->pa_ht, $object->lines[0]->label, 0, array(), 100); } - } else { @@ -1489,7 +1481,6 @@ if (empty($reshook)) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); $error++; } - } else { setEventMessages($object->error, $object->errors, 'errors'); $error++; @@ -2363,7 +2354,6 @@ if (empty($reshook)) $line->situation_percent = $line->situation_percent - $maxPrevSituationPercent; if($line->update()<0) $errors++; - } } } @@ -2693,7 +2683,6 @@ if ($action == 'create') print ajax_combobox('fac_replacement'); print ajax_combobox('fac_avoir'); print ajax_combobox('situations'); - } if ($origin == 'contrat') @@ -3660,7 +3649,6 @@ else if ($id > 0 || ! empty($ref)) { $payment_id = GETPOST('paiement_id'); $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&paiement_id='.$payment_id, $langs->trans('DeletePayment'), $langs->trans('ConfirmDeletePayment'), 'confirm_delete_paiement', '', 'no', 1); - } // Confirmation de la suppression d'une ligne produit @@ -4236,7 +4224,6 @@ else if ($id > 0 || ! empty($ref)) print '' . price($next_invoice->total_ttc) . ''; print '' . $next_invoice->getLibStatut(3, $totalpaye) . ''; print ''; - } $total_global_ht += $total_next_ht; diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 20983ebd3c9..3d98271bb26 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -2465,7 +2465,6 @@ class Facture extends CommonInvoice else $this->situation_final = 1; $this->setFinal($user); - } } } @@ -4713,7 +4712,6 @@ class FactureLigne extends CommonInvoiceLine $this->db->commit(); return $this->id; - } else { diff --git a/htdocs/compta/facture/class/paymentterm.class.php b/htdocs/compta/facture/class/paymentterm.class.php index 31e362445f0..a3168db40d2 100644 --- a/htdocs/compta/facture/class/paymentterm.class.php +++ b/htdocs/compta/facture/class/paymentterm.class.php @@ -211,8 +211,6 @@ class PaymentTerm // extends CommonObject $this->type_cdr = $obj->type_cdr; $this->nbjour = $obj->nbjour; $this->decalage = $obj->decalage; - - } $this->db->free($resql); diff --git a/htdocs/compta/facture/contact.php b/htdocs/compta/facture/contact.php index ab96700fc53..948056fe404 100644 --- a/htdocs/compta/facture/contact.php +++ b/htdocs/compta/facture/contact.php @@ -206,7 +206,6 @@ if ($id > 0 || ! empty($ref)) $res=@include dol_buildpath($reldir.'/contacts.tpl.php'); if ($res) break; } - } else { diff --git a/htdocs/compta/facture/fiche-rec.php b/htdocs/compta/facture/fiche-rec.php index a8eadd76a93..d9ce0137f04 100644 --- a/htdocs/compta/facture/fiche-rec.php +++ b/htdocs/compta/facture/fiche-rec.php @@ -263,7 +263,6 @@ if (empty($reshook)) if ($action == 'setconditions' && $user->rights->facture->creer) { $result=$object->setPaymentTerms(GETPOST('cond_reglement_id', 'int')); - } // Set mode elseif ($action == 'setmode' && $user->rights->facture->creer) @@ -629,12 +628,10 @@ if (empty($reshook)) $tmptxt .= $langs->transnoentitiesnoconv("CountryOrigin") . ': ' . getCountry($prod->country_code, 0, $db, $langs, 0); $tmptxt .= ')'; $desc = dol_concatdesc($desc, $tmptxt); - } $type = $prod->type; $fk_unit = $prod->fk_unit; - } else { @@ -1730,7 +1727,6 @@ else print ''; - } } diff --git a/htdocs/compta/facture/invoicetemplate_list.php b/htdocs/compta/facture/invoicetemplate_list.php index cf41f864f05..c61836e1b1b 100644 --- a/htdocs/compta/facture/invoicetemplate_list.php +++ b/htdocs/compta/facture/invoicetemplate_list.php @@ -190,7 +190,6 @@ if (empty($reshook)) $permtodelete = $user->rights->mymodule->delete; $uploaddir = $conf->mymodule->dir_output; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';*/ - } diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 35338722353..553c6c9028a 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -230,7 +230,6 @@ if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter','a $toselect=''; $search_array_options=array(); $search_categ_cus=0; - } if (empty($reshook)) @@ -310,7 +309,6 @@ if ($massaction == 'withdrawrequest') else { $listofbills[] = $objecttmp; // $listofbills will only contains invoices with good payment method and no request already done } - } } @@ -340,7 +338,6 @@ if ($massaction == 'withdrawrequest') } } } - } @@ -1229,7 +1226,6 @@ if ($resql) else print ''; } print ''; - } } diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php index eec0c640b67..692849d2fa6 100644 --- a/htdocs/compta/index.php +++ b/htdocs/compta/index.php @@ -204,7 +204,6 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire) print ''; $tot_ttc+=$obj->total_ttc; $i++; - } print ''.$langs->trans("Total").''; @@ -596,7 +595,6 @@ if (! empty($conf->don->enabled) && $user->rights->societe->lire) $i++; } - } else { @@ -789,7 +787,6 @@ if (! empty($conf->facture->enabled) && ! empty($conf->commande->enabled) && $us //print "x".$tot_ttc."z".$obj->tot_fttc; $tot_tobill += ($obj->total_ttc-$obj->tot_fttc); $i++; - } print ''.$langs->trans("Total").'   ('.$langs->trans("RemainderToBill").': '.price($tot_tobill).') '; diff --git a/htdocs/compta/localtax/clients.php b/htdocs/compta/localtax/clients.php index 8f986697a01..ff89a95414e 100644 --- a/htdocs/compta/localtax/clients.php +++ b/htdocs/compta/localtax/clients.php @@ -299,7 +299,6 @@ if($calc ==0 || $calc == 1){ print ''; print ''; - } else { @@ -322,7 +321,6 @@ if($calc ==0){ print ''.$langs->trans("TotalToPay").($q?', '.$langs->trans("Quadri").' '.$q:'').''; print ''.price(price2num($diff,'MT'))."\n"; print "\n"; - } print ''; diff --git a/htdocs/compta/paiement/card.php b/htdocs/compta/paiement/card.php index 31c557373d0..1475cfd6e45 100644 --- a/htdocs/compta/paiement/card.php +++ b/htdocs/compta/paiement/card.php @@ -197,7 +197,6 @@ dol_fiche_head($head, 'payment', $langs->trans("PaymentCustomerInvoice"), -1, 'p if ($action == 'delete') { print $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id, $langs->trans("DeletePayment"), $langs->trans("ConfirmDeletePayment"), 'confirm_delete','',0,2); - } /* @@ -207,7 +206,6 @@ if ($action == 'valide') { $facid = $_GET['facid']; print $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id.'&facid='.$facid, $langs->trans("ValidatePayment"), $langs->trans("ConfirmValidatePayment"), 'confirm_valide','',0,2); - } $linkback = '' . $langs->trans("BackToList") . ''; diff --git a/htdocs/compta/paiement/cheque/card.php b/htdocs/compta/paiement/cheque/card.php index 1f7b344f62d..9f42ef9b16c 100644 --- a/htdocs/compta/paiement/cheque/card.php +++ b/htdocs/compta/paiement/cheque/card.php @@ -340,7 +340,6 @@ else if ($action == 'delete') { print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans("DeleteCheckReceipt"), $langs->trans("ConfirmDeleteCheckReceipt"), 'confirm_delete','','',1); - } /* @@ -349,7 +348,6 @@ else if ($action == 'valide') { print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans("ValidateCheckReceipt"), $langs->trans("ConfirmValidateCheckReceipt"), 'confirm_valide','','',1); - } /* @@ -553,7 +551,6 @@ if ($action == 'new') print '
'; print '
'; } - } else { @@ -787,7 +784,6 @@ if ($user->societe_id == 0 && ! empty($object->id) && $object->statut == 0 && $u if ($user->societe_id == 0 && ! empty($object->id) && $user->rights->banque->cheque) { print ''.$langs->trans('Delete').''; - } print ''; diff --git a/htdocs/compta/paiement/cheque/class/remisecheque.class.php b/htdocs/compta/paiement/cheque/class/remisecheque.class.php index 64d0f8601fa..d190beffae2 100644 --- a/htdocs/compta/paiement/cheque/class/remisecheque.class.php +++ b/htdocs/compta/paiement/cheque/class/remisecheque.class.php @@ -121,7 +121,6 @@ class RemiseCheque extends CommonObject { $this->ref = $obj->ref; } - } $this->db->free($resql); diff --git a/htdocs/compta/paiement/class/cpaiement.class.php b/htdocs/compta/paiement/class/cpaiement.class.php index 1f0175bd370..26d4ea0510e 100644 --- a/htdocs/compta/paiement/class/cpaiement.class.php +++ b/htdocs/compta/paiement/class/cpaiement.class.php @@ -200,8 +200,6 @@ class Cpaiement $this->active = $obj->active; $this->accountancy_code = $obj->accountancy_code; $this->module = $obj->module; - - } $this->db->free($resql); diff --git a/htdocs/compta/paiement_charge.php b/htdocs/compta/paiement_charge.php index 9b605e68929..38cee6b8434 100644 --- a/htdocs/compta/paiement_charge.php +++ b/htdocs/compta/paiement_charge.php @@ -147,7 +147,6 @@ if ($action == 'add_payment' || ($action == 'confirm_paiement' && $confirm=='yes } } } - } diff --git a/htdocs/compta/payment_sc/card.php b/htdocs/compta/payment_sc/card.php index b4a21e198de..12cd2a0aa0e 100644 --- a/htdocs/compta/payment_sc/card.php +++ b/htdocs/compta/payment_sc/card.php @@ -146,7 +146,6 @@ dol_fiche_head($head, $hselected, $langs->trans("PaymentSocialContribution"), -1 if ($action == 'delete') { print $form->formconfirm('card.php?id='.$object->id, $langs->trans("DeletePayment"), $langs->trans("ConfirmDeletePayment"), 'confirm_delete','',0,2); - } /* diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index 7b93966aa8b..9d2b828b3eb 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -247,7 +247,6 @@ class BonPrelevement extends CommonObject dol_syslog(get_class($this)."::addline Error -2"); $result = -2; } - } return $result; @@ -515,7 +514,6 @@ class BonPrelevement extends CommonObject dol_syslog(get_class($this)."::set_infocredit Update lines Error"); $error++; } - } else { @@ -1058,10 +1056,8 @@ class BonPrelevement extends CommonObject $error++; dol_syslog(__METHOD__."::Update Orders::Error=".$this->db->error(), LOG_ERR); } - } } - } if (!$error) diff --git a/htdocs/compta/prelevement/class/rejetprelevement.class.php b/htdocs/compta/prelevement/class/rejetprelevement.class.php index 6e3cfe499a8..ebe76a6aab3 100644 --- a/htdocs/compta/prelevement/class/rejetprelevement.class.php +++ b/htdocs/compta/prelevement/class/rejetprelevement.class.php @@ -175,7 +175,6 @@ class RejetPrelevement $error++; dol_syslog("RejetPrelevement::Create Error payment validation"); } - } //Tag invoice as unpaid dol_syslog("RejetPrelevement::Create set_unpaid fac ".$fac->ref); diff --git a/htdocs/compta/prelevement/create.php b/htdocs/compta/prelevement/create.php index 3dccc0ff912..dff5ab39f3d 100644 --- a/htdocs/compta/prelevement/create.php +++ b/htdocs/compta/prelevement/create.php @@ -161,7 +161,6 @@ if ($nb) { } else { print '' . $langs->trans("CreateAll") . "\n"; } - } else { diff --git a/htdocs/compta/prelevement/factures.php b/htdocs/compta/prelevement/factures.php index df71dcb3f31..a53db70544b 100644 --- a/htdocs/compta/prelevement/factures.php +++ b/htdocs/compta/prelevement/factures.php @@ -134,7 +134,6 @@ if ($prev_id > 0 || $ref) print ''; dol_fiche_end(); - } else { diff --git a/htdocs/compta/prelevement/fiche-rejet.php b/htdocs/compta/prelevement/fiche-rejet.php index 3819c145851..7cb862389d7 100644 --- a/htdocs/compta/prelevement/fiche-rejet.php +++ b/htdocs/compta/prelevement/fiche-rejet.php @@ -135,7 +135,6 @@ if ($prev_id > 0 || $ref) print ''; dol_fiche_end(); - } else { diff --git a/htdocs/compta/prelevement/fiche-stat.php b/htdocs/compta/prelevement/fiche-stat.php index a3a1d06e322..731bc1dc81d 100644 --- a/htdocs/compta/prelevement/fiche-stat.php +++ b/htdocs/compta/prelevement/fiche-stat.php @@ -132,7 +132,6 @@ if ($prev_id > 0 || $ref) print ''; dol_fiche_end(); - } else { diff --git a/htdocs/compta/prelevement/ligne.php b/htdocs/compta/prelevement/ligne.php index 8dd1c87069a..30cc21ae977 100644 --- a/htdocs/compta/prelevement/ligne.php +++ b/htdocs/compta/prelevement/ligne.php @@ -89,7 +89,6 @@ if ($action == 'confirm_rejet') header("Location: ligne.php?id=".$id); exit; } - } else { diff --git a/htdocs/compta/resultat/index.php b/htdocs/compta/resultat/index.php index 5fc58955b60..1e2719eac81 100644 --- a/htdocs/compta/resultat/index.php +++ b/htdocs/compta/resultat/index.php @@ -688,7 +688,6 @@ if (! empty($conf->expensereport->enabled) && ($modecompta == 'CREANCES-DETTES' $column='p.date_valid'; if (! empty($date_start) && ! empty($date_end)) $sql.= " AND ".$column." >= '".$db->idate($date_start)."' AND ".$column." <= '".$db->idate($date_end)."'"; - } elseif ($modecompta == 'RECETTES-DEPENSES') { $sql = "SELECT date_format(pe.datep,'%Y-%m') as dm, sum(p.total_ht) as amount_ht,sum(p.total_ttc) as amount_ttc"; $sql.= " FROM ".MAIN_DB_PREFIX."expensereport as p"; @@ -721,7 +720,6 @@ if (! empty($conf->expensereport->enabled) && ($modecompta == 'CREANCES-DETTES' if (! isset($decaiss_ttc[$obj->dm])) $decaiss_ttc[$obj->dm]=0; $decaiss_ttc[$obj->dm] += $obj->amount_ttc; - } } } @@ -729,7 +727,6 @@ if (! empty($conf->expensereport->enabled) && ($modecompta == 'CREANCES-DETTES' { dol_print_error($db); } - } elseif ($modecompta == 'BOOKKEEPING') { // Nothing from this table diff --git a/htdocs/compta/salaries/class/paymentsalary.class.php b/htdocs/compta/salaries/class/paymentsalary.class.php index 4da78cb492d..0be0f4f3694 100644 --- a/htdocs/compta/salaries/class/paymentsalary.class.php +++ b/htdocs/compta/salaries/class/paymentsalary.class.php @@ -487,7 +487,6 @@ class PaymentSalary extends CommonObject $result=$this->call_trigger('PAYMENT_SALARY_CREATE',$user); if ($result < 0) $error++; // End call triggers - } else $error++; diff --git a/htdocs/compta/salaries/document.php b/htdocs/compta/salaries/document.php index 59ca8389193..1059c765df3 100644 --- a/htdocs/compta/salaries/document.php +++ b/htdocs/compta/salaries/document.php @@ -127,7 +127,6 @@ if ($object->id) $permission = $user->rights->salaries->write; $param = '&id=' . $object->id; include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_post_headers.tpl.php'; - } else { diff --git a/htdocs/compta/sociales/class/cchargesociales.class.php b/htdocs/compta/sociales/class/cchargesociales.class.php index a8f5c430691..710bea7def2 100644 --- a/htdocs/compta/sociales/class/cchargesociales.class.php +++ b/htdocs/compta/sociales/class/cchargesociales.class.php @@ -201,8 +201,6 @@ class Cchargesociales $this->fk_pays = $obj->fk_pays; $this->module = $obj->module; $this->accountancy_code = $obj->accountancy_code; - - } $this->db->free($resql); diff --git a/htdocs/compta/sociales/class/chargesociales.class.php b/htdocs/compta/sociales/class/chargesociales.class.php index e44d02f83e2..cca5a4d7dd2 100644 --- a/htdocs/compta/sociales/class/chargesociales.class.php +++ b/htdocs/compta/sociales/class/chargesociales.class.php @@ -368,7 +368,6 @@ class ChargeSociales extends CommonObject { return 0; } - } else { @@ -627,7 +626,6 @@ class ChargeSociales extends CommonObject } $this->db->free($result); - } else { diff --git a/htdocs/compta/sociales/class/paymentsocialcontribution.class.php b/htdocs/compta/sociales/class/paymentsocialcontribution.class.php index b6ff4a49337..d3c265150d4 100644 --- a/htdocs/compta/sociales/class/paymentsocialcontribution.class.php +++ b/htdocs/compta/sociales/class/paymentsocialcontribution.class.php @@ -195,7 +195,6 @@ class PaymentSocialContribution extends CommonObject { $error++; } - } $result = $this->call_trigger('PAYMENTSOCIALCONTRIBUTION_CREATE',$user); diff --git a/htdocs/compta/stats/byratecountry.php b/htdocs/compta/stats/byratecountry.php index 5c9366037ed..99d6bb8b49d 100644 --- a/htdocs/compta/stats/byratecountry.php +++ b/htdocs/compta/stats/byratecountry.php @@ -322,7 +322,6 @@ if ($resql) { } print '' . price($totalpermonth['total']) . ''; print ''; - } else { print $db->lasterror(); // Show last sql error } @@ -406,7 +405,6 @@ if ($resql2) { print $db->lasterror(); // Show last sql error } print "\n"; - } else { // $modecompta != 'CREANCES-DETTES' // "Calculation of part of each product for accountancy in this mode is not possible. When a partial payment (for example 5 euros) is done on an diff --git a/htdocs/compta/stats/casoc.php b/htdocs/compta/stats/casoc.php index 309737111f5..fb53989fe74 100644 --- a/htdocs/compta/stats/casoc.php +++ b/htdocs/compta/stats/casoc.php @@ -313,7 +313,6 @@ if ($result) { $catotal_ht+=$obj->amount; $catotal+=$obj->amount_ttc; $i++; - } } else { dol_print_error($db); diff --git a/htdocs/compta/tva/class/tva.class.php b/htdocs/compta/tva/class/tva.class.php index c78e0d8dd7a..33d48de8bfc 100644 --- a/htdocs/compta/tva/class/tva.class.php +++ b/htdocs/compta/tva/class/tva.class.php @@ -800,7 +800,6 @@ class Tva extends CommonObject } $this->db->free($result); - } else { diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index babc7e1453a..a43127c9a32 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -1113,7 +1113,6 @@ else else $text.=$langs->trans("UserWillBeInternalUser"); } print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id,$langs->trans("CreateDolibarrLogin"),$text,"confirm_create_user",$formquestion,'yes'); - } $linkback = ''.$langs->trans("BackToList").''; @@ -1282,7 +1281,6 @@ else } print ""; - } } diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index b5d17676d8d..b1d83abac77 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -1246,7 +1246,6 @@ class Contact extends CommonObject { if ($statut==0 || $statut==5) return img_picto($langs->trans('Disabled'),'statut5', 'class="pictostatus"').' '.$langs->trans('Disabled'); elseif ($statut==1 || $statut==4) return img_picto($langs->trans('Enabled'),'statut4', 'class="pictostatus"').' '.$langs->trans('Enabled'); - } elseif ($mode == 3) { diff --git a/htdocs/contrat/class/api_contracts.class.php b/htdocs/contrat/class/api_contracts.class.php index 04252433824..35ec5842e4b 100644 --- a/htdocs/contrat/class/api_contracts.class.php +++ b/htdocs/contrat/class/api_contracts.class.php @@ -287,7 +287,6 @@ class Contracts extends DolibarrApi if ($updateRes > 0) { return $updateRes; - } return false; } @@ -673,7 +672,6 @@ class Contracts extends DolibarrApi if (!isset($data[$field])) throw new RestException(400, "$field field missing"); $contrat[$field] = $data[$field]; - } return $contrat; } diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 7e0c2d13ca5..8d2194bb60a 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -2006,7 +2006,6 @@ class Contrat extends CommonObject } $this->db->free($result); - } else { @@ -2476,7 +2475,6 @@ class Contrat extends CommonObject if ($reshook < 0) $error ++; } - } unset($this->context['createfromclone']); @@ -2860,7 +2858,6 @@ class ContratLigne extends CommonObjectLine $marginInfos = getMarginInfos($obj->subprice, $obj->remise_percent, $obj->tva_tx, $obj->localtax1_tx, $obj->localtax2_tx, $this->fk_fournprice, $obj->pa_ht); $this->pa_ht = $marginInfos[0]; $this->fk_unit = $obj->fk_unit; - } $this->db->free($resql); diff --git a/htdocs/contrat/contact.php b/htdocs/contrat/contact.php index f34eb1b5bdb..b659aa01aab 100644 --- a/htdocs/contrat/contact.php +++ b/htdocs/contrat/contact.php @@ -240,7 +240,6 @@ if ($id > 0 || ! empty($ref)) // Contacts lines include DOL_DOCUMENT_ROOT.'/core/tpl/contacts.tpl.php'; - } else { print "ErrorRecordNotFound"; } diff --git a/htdocs/contrat/document.php b/htdocs/contrat/document.php index 4b7a9b4faf5..cd98f787ff6 100644 --- a/htdocs/contrat/document.php +++ b/htdocs/contrat/document.php @@ -192,7 +192,6 @@ if ($object->id) $permtoedit = $user->rights->contrat->creer; $param = '&id=' . $object->id; include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_post_headers.tpl.php'; - } else { diff --git a/htdocs/contrat/index.php b/htdocs/contrat/index.php index f348cab8234..c0404b5cf3f 100644 --- a/htdocs/contrat/index.php +++ b/htdocs/contrat/index.php @@ -279,7 +279,6 @@ if (! empty($conf->contrat->enabled) && $user->rights->contrat->lire) print ''; //$tot_ttc+=$obj->total_ttc; $i++; - } } else @@ -365,7 +364,6 @@ if ($result) $db->free($result); print ""; - } else { @@ -444,7 +442,6 @@ if ($resql) $db->free(); print ""; - } else { @@ -523,7 +520,6 @@ if ($resql) $db->free(); print ""; - } else { @@ -603,7 +599,6 @@ if ($resql) $db->free(); print ""; - } else { diff --git a/htdocs/contrat/note.php b/htdocs/contrat/note.php index a5ea40e146c..ec93d112ef4 100644 --- a/htdocs/contrat/note.php +++ b/htdocs/contrat/note.php @@ -177,7 +177,6 @@ if ($id > 0 || ! empty($ref)) include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php'; dol_fiche_end(); - } diff --git a/htdocs/core/actions_sendmails.inc.php b/htdocs/core/actions_sendmails.inc.php index 153c5ca9364..0715a78495e 100644 --- a/htdocs/core/actions_sendmails.inc.php +++ b/htdocs/core/actions_sendmails.inc.php @@ -496,5 +496,4 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO dol_syslog('Failed to read data of object id='.$object->id.' element='.$object->element); $action = 'presend'; } - } diff --git a/htdocs/core/ajax/ajaxdirtree.php b/htdocs/core/ajax/ajaxdirtree.php index a1fafa80559..749f81f1197 100644 --- a/htdocs/core/ajax/ajaxdirtree.php +++ b/htdocs/core/ajax/ajaxdirtree.php @@ -487,7 +487,6 @@ function treeOutputForAbsoluteDir($sqltree, $selecteddir, $fullpathselecteddir, } echo "\n"; - } } else print "PermissionDenied"; diff --git a/htdocs/core/ajax/check_notifications.php b/htdocs/core/ajax/check_notifications.php index 642dc1038d9..a5c73655bab 100644 --- a/htdocs/core/ajax/check_notifications.php +++ b/htdocs/core/ajax/check_notifications.php @@ -113,7 +113,6 @@ if ($time >= $_SESSION['auto_check_events_not_before']) { dol_syslog("Error sql = ".$db->lasterror(), LOG_ERR); } - } print json_encode($eventfound); diff --git a/htdocs/core/ajax/price.php b/htdocs/core/ajax/price.php index 453fdc7bc82..86073a5a409 100644 --- a/htdocs/core/ajax/price.php +++ b/htdocs/core/ajax/price.php @@ -52,7 +52,6 @@ if (! empty($output) && isset($amount) && isset($tva_tx)) $price = price2num($amount * (1 + ($tva_tx/100)), 'MU'); $return['price_ht'] = $amount; $return['price_ttc'] = (isset($price) && $price != '' ? price($price) : ''); - } else if ($output == 'price_ht') { diff --git a/htdocs/core/boxes/box_actions.php b/htdocs/core/boxes/box_actions.php index 9bcfb002bb6..05bbdba3831 100644 --- a/htdocs/core/boxes/box_actions.php +++ b/htdocs/core/boxes/box_actions.php @@ -232,7 +232,6 @@ class box_actions extends ModeleBoxes } } $out.= ''; - } $out.= ''; if ($actioncejour) diff --git a/htdocs/core/boxes/box_factures.php b/htdocs/core/boxes/box_factures.php index e281fbe5c60..36c472cfc22 100644 --- a/htdocs/core/boxes/box_factures.php +++ b/htdocs/core/boxes/box_factures.php @@ -193,7 +193,6 @@ class box_factures extends ModeleBoxes 'text' => ($db->error().' sql='.$sql), ); } - } else { $this->info_box_contents[0][0] = array( 'td' => 'align="left" class="nohover opacitymedium"', diff --git a/htdocs/core/boxes/box_graph_invoices_permonth.php b/htdocs/core/boxes/box_graph_invoices_permonth.php index c22163779a8..fd0b4e593c0 100644 --- a/htdocs/core/boxes/box_graph_invoices_permonth.php +++ b/htdocs/core/boxes/box_graph_invoices_permonth.php @@ -258,7 +258,6 @@ class box_graph_invoices_permonth extends ModeleBoxes { $this->info_box_contents[0][0] = array('tr'=>'class="oddeven nohover"', 'td' => 'align="left" class="nohover"', 'maxlength'=>500, 'text' => $mesg); } - } else { $this->info_box_contents[0][0] = array( diff --git a/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php b/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php index a7f504b2d01..f13b19259c9 100644 --- a/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php +++ b/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php @@ -257,7 +257,6 @@ class box_graph_invoices_supplier_permonth extends ModeleBoxes 'maxlength'=>500, 'text' => $mesg); } - } else { $this->info_box_contents[0][0] = array( diff --git a/htdocs/core/boxes/box_graph_orders_permonth.php b/htdocs/core/boxes/box_graph_orders_permonth.php index 329fef77fba..fefa90c5fea 100644 --- a/htdocs/core/boxes/box_graph_orders_permonth.php +++ b/htdocs/core/boxes/box_graph_orders_permonth.php @@ -256,7 +256,6 @@ class box_graph_orders_permonth extends ModeleBoxes 'maxlength'=>500, 'text' => $mesg); } - } else { $this->info_box_contents[0][0] = array( diff --git a/htdocs/core/boxes/box_graph_orders_supplier_permonth.php b/htdocs/core/boxes/box_graph_orders_supplier_permonth.php index de962149cdf..e388d226fd2 100644 --- a/htdocs/core/boxes/box_graph_orders_supplier_permonth.php +++ b/htdocs/core/boxes/box_graph_orders_supplier_permonth.php @@ -255,7 +255,6 @@ class box_graph_orders_supplier_permonth extends ModeleBoxes 'maxlength'=>500, 'text' => $mesg); } - } else { $this->info_box_contents[0][0] = array( diff --git a/htdocs/core/boxes/box_graph_propales_permonth.php b/htdocs/core/boxes/box_graph_propales_permonth.php index c19235c2fb2..f28b0ec2c99 100644 --- a/htdocs/core/boxes/box_graph_propales_permonth.php +++ b/htdocs/core/boxes/box_graph_propales_permonth.php @@ -259,7 +259,6 @@ class box_graph_propales_permonth extends ModeleBoxes 'maxlength'=>500, 'text' => $mesg); } - } else { $this->info_box_contents[0][0] = array( diff --git a/htdocs/core/boxes/box_services_expired.php b/htdocs/core/boxes/box_services_expired.php index c23e9940377..ed62e127816 100644 --- a/htdocs/core/boxes/box_services_expired.php +++ b/htdocs/core/boxes/box_services_expired.php @@ -167,8 +167,6 @@ class box_services_expired extends ModeleBoxes 'maxlength'=>500, 'text' => ($db->error().' sql='.$sql)); } - - } else { diff --git a/htdocs/core/class/comment.class.php b/htdocs/core/class/comment.class.php index 161ce438e29..b731eb77169 100644 --- a/htdocs/core/class/comment.class.php +++ b/htdocs/core/class/comment.class.php @@ -360,7 +360,6 @@ class Comment extends CommonObject $error++; $this->errors[]="Error ".$this->db->lasterror(); return -1; } - } return count($this->comments); diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 4729e11ff85..aa318a48bcc 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -1925,7 +1925,6 @@ abstract class CommonObject dol_syslog(get_class($this).'::setMulticurrencyRate no updateline defined', LOG_DEBUG); break; } - } } @@ -2815,7 +2814,6 @@ abstract class CommonObject $this->total_ttc -= $diff; $total_tva_by_vats[$obj->vatrate] -= $diff; $total_ttc_by_vats[$obj->vatrate] -= $diff; - } } @@ -4630,7 +4628,6 @@ abstract class CommonObject dol_print_error($this->db, "Error generating document for ".__CLASS__.". Error: ".$obj->error, $obj->errors); return -1; } - } else { @@ -5777,7 +5774,6 @@ abstract class CommonObject } $data[$obj->rowid]=$labeltoshow; - } else { if (! $notrans) { $translabel = $langs->trans($obj->{$InfoFieldList[1]}); @@ -5806,7 +5802,6 @@ abstract class CommonObject $this->db->free($resql); $out=$form->multiselectarray($keyprefix.$key.$keysuffix, $data, $value_arr, '', 0, '', 0, '100%'); - } else { print 'Error in request ' . $sql . ' ' . $this->db->lasterror() . '. Check setup of extra parameters.
'; } @@ -6186,7 +6181,6 @@ abstract class CommonObject } } $value='
    '.implode(' ', $toprint).'
'; - } else { dol_syslog(get_class($this) . '::showOutputField error ' . $this->db->lasterror(), LOG_WARNING); } diff --git a/htdocs/core/class/ctyperesource.class.php b/htdocs/core/class/ctyperesource.class.php index 297e48a940b..f4e74128747 100644 --- a/htdocs/core/class/ctyperesource.class.php +++ b/htdocs/core/class/ctyperesource.class.php @@ -188,8 +188,6 @@ class Ctyperesource $this->code = $obj->code; $this->label = $obj->label; $this->active = $obj->active; - - } // Retrieve all extrafields for invoice @@ -269,8 +267,6 @@ class Ctyperesource $line->code = $obj->code; $line->label = $obj->label; $line->active = $obj->active; - - } $this->db->free($resql); diff --git a/htdocs/core/class/dolgraph.class.php b/htdocs/core/class/dolgraph.class.php index ad7b900b033..1cf347af6a3 100644 --- a/htdocs/core/class/dolgraph.class.php +++ b/htdocs/core/class/dolgraph.class.php @@ -1108,7 +1108,6 @@ class DolGraph //$this->stringtoshow.=', shadowSize: 20'."\n"; TODO Uncommet this $this->stringtoshow.='});'."\n"; $this->stringtoshow.='}'."\n"; - } $this->stringtoshow.='plotWithOptions_'.$tag.'();'."\n"; diff --git a/htdocs/core/class/dolreceiptprinter.class.php b/htdocs/core/class/dolreceiptprinter.class.php index 8734c4126e7..f38afc67807 100644 --- a/htdocs/core/class/dolreceiptprinter.class.php +++ b/htdocs/core/class/dolreceiptprinter.class.php @@ -484,7 +484,6 @@ class dolReceiptPrinter extends Escpos $this->printer->cut(); //print '
'.print_r($this->connector, true).'
'; $this->printer->close(); - } catch (Exception $e) { $this->errors[] = $e->getMessage(); $error++; @@ -621,7 +620,6 @@ class dolReceiptPrinter extends Escpos // uncomment next line to see content sent to printer //print '
'.print_r($this->connector, true).'
'; $this->printer->close(); - } return $error; } diff --git a/htdocs/core/class/emailsenderprofile.class.php b/htdocs/core/class/emailsenderprofile.class.php index c5304fec31c..b30f79f0bba 100644 --- a/htdocs/core/class/emailsenderprofile.class.php +++ b/htdocs/core/class/emailsenderprofile.class.php @@ -413,7 +413,6 @@ class EmailSenderProfile extends CommonObject } $this->db->free($result); - } else { diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 3f5b515e725..9ebdbd22836 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -1392,7 +1392,6 @@ class ExtraFields } $data[$obj->rowid]=$labeltoshow; - } else { if (! $notrans) { $translabel = $langs->trans($obj->{$InfoFieldList[1]}); @@ -1421,7 +1420,6 @@ class ExtraFields $this->db->free($resql); $out=$form->multiselectarray($keyprefix.$key.$keysuffix, $data, $value_arr, '', 0, '', 0, '100%'); - } else { print 'Error in request ' . $sql . ' ' . $this->db->lasterror() . '. Check setup of extra parameters.
'; } @@ -1715,7 +1713,6 @@ class ExtraFields } } $value='
    '.implode(' ', $toprint).'
'; - } else { dol_syslog(get_class($this) . '::showOutputField error ' . $this->db->lasterror(), LOG_WARNING); } diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index d42d1dde48f..c30dcec6e01 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -4685,7 +4685,6 @@ class Form $out.= ''; } } - } $out.= ''; @@ -6958,7 +6957,6 @@ class Form $ret.=''; $ret.=''; } - } else dol_print_error('','Call of showphoto with wrong parameters modulepart='.$modulepart); diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index bfc67880a96..34f0b9ab750 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -718,7 +718,6 @@ class FormFile $reshook = $hookmanager->executeHooks('formBuilddocOptions',$parameters,$GLOBALS['object']); $out.= $hookmanager->resPrint; } - } // Get list of files @@ -848,7 +847,6 @@ class FormFile { $out.=''.$langs->trans("None").''."\n"; } - } if ($headershown) diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index f79e9eea53d..d2800ce1906 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -1212,7 +1212,6 @@ class FormOther } $boxlistb.= "\n"; - } return array('selectboxlist'=>count($boxactivated)?$selectboxlist:'', 'boxactivated'=>$boxactivated, 'boxlista'=>$boxlista, 'boxlistb'=>$boxlistb); diff --git a/htdocs/core/class/notify.class.php b/htdocs/core/class/notify.class.php index 344b8050b65..08917a8d3a3 100644 --- a/htdocs/core/class/notify.class.php +++ b/htdocs/core/class/notify.class.php @@ -519,12 +519,10 @@ class Notify if ($obj->type_target == 'touserid') { $sql = "INSERT INTO ".MAIN_DB_PREFIX."notify (daten, fk_action, fk_soc, fk_user, type, objet_type, type_target, objet_id, email)"; $sql.= " VALUES ('".$this->db->idate(dol_now())."', ".$notifcodedefid.", ".($object->socid?$object->socid:'null').", ".$obj->cid.", '".$obj->type."', '".$object_type."', '".$obj->type_target."', ".$object->id.", '".$this->db->escape($obj->email)."')"; - } else { $sql = "INSERT INTO ".MAIN_DB_PREFIX."notify (daten, fk_action, fk_soc, fk_contact, type, objet_type, type_target, objet_id, email)"; $sql.= " VALUES ('".$this->db->idate(dol_now())."', ".$notifcodedefid.", ".($object->socid?$object->socid:'null').", ".$obj->cid.", '".$obj->type."', '".$object_type."', '".$obj->type_target."', ".$object->id.", '".$this->db->escape($obj->email)."')"; - } if (! $this->db->query($sql)) { diff --git a/htdocs/core/class/rssparser.class.php b/htdocs/core/class/rssparser.class.php index bad8d7ffdca..fd37476a26e 100644 --- a/htdocs/core/class/rssparser.class.php +++ b/htdocs/core/class/rssparser.class.php @@ -545,8 +545,6 @@ class RssParser } $this->incontent = $el; - - } // if inside an Atom content construct (e.g. content or summary) field treat tags as text @@ -734,7 +732,6 @@ class RssParser elseif ($this->inchannel) { $this->concat($this->channel[ $el ], $text); } - } } } @@ -759,7 +756,6 @@ function xml2php($xml) foreach($value->attributes() as $ak=>$av) { $child[$ak] = (string) $av; - } //Let see if the new child is not in the array diff --git a/htdocs/core/class/utils.class.php b/htdocs/core/class/utils.class.php index 7904f485d6a..e3b151f9874 100644 --- a/htdocs/core/class/utils.class.php +++ b/htdocs/core/class/utils.class.php @@ -343,7 +343,6 @@ class Utils elseif (preg_match('/'.preg_quote('SET SQL_NOTES=@OLD_SQL_NOTES').'/i',$read)) $ok=1; } pclose($handlein); - } diff --git a/htdocs/core/db/mssql.class.php b/htdocs/core/db/mssql.class.php index dd1553ec12f..a8483ec1401 100644 --- a/htdocs/core/db/mssql.class.php +++ b/htdocs/core/db/mssql.class.php @@ -374,7 +374,6 @@ class DoliDBMssql extends DoliDB $query="ALTER TABLE [".$matches[1]."] ADD CONSTRAINT [".$matches[2]."] PRIMARY KEY CLUSTERED (".$matches[3].")"; } } - } if ($type=="auto" || $type='ddl') @@ -416,7 +415,6 @@ class DoliDBMssql extends DoliDB $sql='SET IDENTITY_INSERT ['.trim($matches[1]).'] ON;'; @mssql_query($sql, $this->db); $post_query='SET IDENTITY_INSERT ['.trim($matches[1]).'] OFF;'; - } } //print ""; diff --git a/htdocs/core/db/sqlite3.class.php b/htdocs/core/db/sqlite3.class.php index 6babfd881d4..97e799a2b69 100644 --- a/htdocs/core/db/sqlite3.class.php +++ b/htdocs/core/db/sqlite3.class.php @@ -260,7 +260,6 @@ class DoliDBSqlite3 extends DoliDB // Pour l'instant les contraintes ne sont pas créées dol_syslog(get_class().'::query line emptied'); $line = 'SELECT 0;'; - } //if (preg_match('/rowid\s+.*\s+PRIMARY\s+KEY,/i', $line)) { @@ -445,7 +444,6 @@ class DoliDBSqlite3 extends DoliDB // dummy statement $query="SELECT 0"; - } else { $query=$this->convertSQLFromMysql($query,$type); } diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index 4014adfc272..f92fd56a87b 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -1233,7 +1233,6 @@ function activateModulesRequiredByCountry($country_code) setEventMessages($objMod->automatic_activation[$country_code], null, 'warnings'); } - } else dol_syslog("Module ".get_class($objMod)." not qualified"); } diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 46e3922a0d0..fe9d15c8322 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -634,7 +634,6 @@ function getFormeJuridiqueLabel($code) { return $langs->trans("NotDefined"); } - } } diff --git a/htdocs/core/lib/emailing.lib.php b/htdocs/core/lib/emailing.lib.php index d9cad7f1c1e..06ceb2c96b0 100644 --- a/htdocs/core/lib/emailing.lib.php +++ b/htdocs/core/lib/emailing.lib.php @@ -46,7 +46,6 @@ function emailing_prepare_head(Mailing $object) if ($object->nbemail > 0) $head[$h][1].= ' '.$object->nbemail.''; $head[$h][2] = 'targets'; $h++; - } if (! empty($conf->global->EMAILING_USE_ADVANCED_SELECTOR)) diff --git a/htdocs/core/lib/fichinter.lib.php b/htdocs/core/lib/fichinter.lib.php index e55aaeb7516..20e257eee2f 100644 --- a/htdocs/core/lib/fichinter.lib.php +++ b/htdocs/core/lib/fichinter.lib.php @@ -76,7 +76,6 @@ function fichinter_prepare_head($object) foreach($resources as $resource_obj) { $linked_resources = $object->getElementResources('fichinter',$object->id,$resource_obj); - } } } diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 7897041ebbf..1a114c62a01 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -781,7 +781,6 @@ function dolCopyDir($srcfile, $destfile, $newmask, $overwriteifexists, $arrayrep $result=$tmpresult; } if ($result < 0) break; - } } closedir($dir_handle); diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 7888338cdc2..9efc66030d2 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -1223,7 +1223,6 @@ function dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $pi $outmore.=''.$links[$i][1].''."\n"; else $outmore.=''.$links[$i][1].''."\n"; - } else if (! empty($links[$i][1])) { @@ -3932,7 +3931,6 @@ function dol_print_error($db='',$error='',$errors=null) $out.='> '.$langs->transnoentities("RequestLastAccessInError").":\n".($db->lastqueryerror()?$db->lastqueryerror():$langs->transnoentities("ErrorNoRequestInError"))."\n"; $out.='> '.$langs->transnoentities("ReturnCodeLastAccessInError").":\n".($db->lasterrno()?$db->lasterrno():$langs->transnoentities("ErrorNoRequestInError"))."\n"; $out.='> '.$langs->transnoentities("InformationLastAccessInError").":\n".($db->lasterror()?$db->lasterror():$langs->transnoentities("ErrorNoRequestInError"))."\n"; - } $syslog.=", sql=".$db->lastquery(); $syslog.=", db_error=".$db->lasterror(); @@ -4994,7 +4992,6 @@ function getLocalTaxesFromRate($vatrate, $local, $buyer, $seller, $firstparamisi else { return array($obj->localtax1_type, get_localtax($vatrate, 1, $buyer, $seller), $obj->localtax2_type, get_localtax($vatrate, 2, $buyer, $seller), $obj->accountancy_code_sell,$obj->accountancy_code_buy); - } } @@ -5116,8 +5113,6 @@ function get_product_localtax_for_country($idprod, $local, $thirdparty_seller) else { // TODO Read default product vat according to countrycode and product - - } } @@ -5600,7 +5595,6 @@ function dolGetFirstLineOfText($text, $nboflines=1) { $firstline=preg_replace('/]*>.*$/s','',$text); // The s pattern modifier means the . can match newline characters $firstline=preg_replace('/]*>.*$/s','',$firstline); // The s pattern modifier means the . can match newline characters - } else { diff --git a/htdocs/core/lib/xcal.lib.php b/htdocs/core/lib/xcal.lib.php index 3f09bd3410a..10d68475c97 100644 --- a/htdocs/core/lib/xcal.lib.php +++ b/htdocs/core/lib/xcal.lib.php @@ -263,7 +263,6 @@ function build_calfile($format,$title,$desc,$events_array,$outputfile) $comment ['enddate'] = $enddate; fwrite($calfileh,"COMMENT:" . serialize ($comment) . "\n"); */ - } } diff --git a/htdocs/core/login/functions_ldap.php b/htdocs/core/login/functions_ldap.php index 6e13d55171c..4587dbae11b 100644 --- a/htdocs/core/login/functions_ldap.php +++ b/htdocs/core/login/functions_ldap.php @@ -203,7 +203,6 @@ function check_user_password_ldap($usertotest,$passwordtotest,$entitytotest) } unset($usertmp); } - } if ($result == 1) { diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 562ed99a020..968048a15aa 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -626,7 +626,6 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu $newmenu->add("/user/group/list.php?leftmenu=users", $langs->trans("ListOfGroups"), 2, (($conf->global->MAIN_USE_ADVANCED_PERMS?$user->rights->user->group_advance->read:$user->rights->user->user->lire) || $user->admin) && !(! empty($conf->multicompany->enabled) && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE)); } } - } @@ -807,7 +806,6 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu $newmenu->add("/fichinter/card-red.php?leftmenu=ficheinter", $langs->trans("ModelList"), 1, $user->rights->ficheinter->lire, '', '', '', 203); $newmenu->add("/fichinter/stats/index.php?leftmenu=ficheinter", $langs->trans("Statistics"), 1, $user->rights->fournisseur->commande->lire); } - } @@ -1242,7 +1240,6 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu if (preg_match('/checks/',$leftmenu)) $newmenu->add("/compta/paiement/cheque/card.php?leftmenu=checks_bis&action=new&mainmenu=bank",$langs->trans("NewChequeDeposit"),1,$user->rights->banque->cheque); if (preg_match('/checks/',$leftmenu)) $newmenu->add("/compta/paiement/cheque/list.php?leftmenu=checks_bis&mainmenu=bank",$langs->trans("List"),1,$user->rights->banque->cheque); } - } /* @@ -1349,7 +1346,6 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu if ($usemenuhider || empty($leftmenu) || $leftmenu=="sendings") $newmenu->add("/expedition/list.php?leftmenu=sendings&viewstatut=2", $langs->trans("StatusSendingProcessedShort"), 2, $user->rights->expedition->lire); $newmenu->add("/expedition/stats/index.php?leftmenu=sendings", $langs->trans("Statistics"), 1, $user->rights->expedition->lire); } - } /* @@ -1571,7 +1567,6 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu $newmenu->add("/adherents/type.php?leftmenu=setup&mainmenu=members&action=create",$langs->trans("New"),1,$user->rights->adherent->configurer); $newmenu->add("/adherents/type.php?leftmenu=setup&mainmenu=members",$langs->trans("List"),1,$user->rights->adherent->configurer); } - } // Add personalized menus and modules menus @@ -1631,7 +1626,6 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu $i++; } } - } // Build final $menu_array = $menu_array_before +$newmenu->liste + $menu_array_after diff --git a/htdocs/core/menus/standard/eldy_menu.php b/htdocs/core/menus/standard/eldy_menu.php index fa6e1b3084d..543dbd111bb 100644 --- a/htdocs/core/menus/standard/eldy_menu.php +++ b/htdocs/core/menus/standard/eldy_menu.php @@ -315,8 +315,6 @@ class MenuManager } print ''."\n"; } - - } //var_dump($submenu); print ''; diff --git a/htdocs/core/menus/standard/empty.php b/htdocs/core/menus/standard/empty.php index 172b6c483c5..4d7296b276b 100644 --- a/htdocs/core/menus/standard/empty.php +++ b/htdocs/core/menus/standard/empty.php @@ -311,8 +311,6 @@ class MenuManager } print ''."\n"; } - - } //var_dump($submenu); print ''; diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php index 9f94288809d..dfaaa6b26b4 100644 --- a/htdocs/core/modules/DolibarrModules.class.php +++ b/htdocs/core/modules/DolibarrModules.class.php @@ -1175,7 +1175,6 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it dol_syslog(get_class($this)."::insert_boxes", LOG_DEBUG); $resql=$this->db->query($sql); if (! $resql) $err++; - } if (! $err && ! preg_match('/newboxdefonly/',$option)) { @@ -1384,7 +1383,6 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it $resql=$this->db->query($sql); if (! $resql) $err++; - } if (! $err) @@ -1739,7 +1737,6 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it break; } else dol_syslog(get_class($this)."::insert_permissions record already exists", LOG_INFO); - } $this->db->free($resqlinsert); @@ -1791,7 +1788,6 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it $user->clearrights(); $user->getrights(); } - } $this->db->free($resql); } diff --git a/htdocs/core/modules/cheque/modules_chequereceipts.php b/htdocs/core/modules/cheque/modules_chequereceipts.php index 9af073267ae..f2841a7ec8e 100644 --- a/htdocs/core/modules/cheque/modules_chequereceipts.php +++ b/htdocs/core/modules/cheque/modules_chequereceipts.php @@ -209,7 +209,6 @@ function chequereceipt_pdf_create($db, $id, $message, $modele, $outputlangs) dol_print_error($db,"chequereceipt_pdf_create Error: ".$obj->error); return -1; } - } else { diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index ad77e9bea32..6047caa55b3 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -967,7 +967,6 @@ class pdf_einstein extends ModelePDFCommandes $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval, 0, $outputlangs), 0, 'R', 1); - } } } diff --git a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php index 1c85adddfcc..0bf4b91365e 100644 --- a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php @@ -402,7 +402,6 @@ class pdf_eratosthene extends ModelePDFCommandes if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs); $height_note=$posyafter-$tab_top_newpage; $pdf->Rect($this->marge_gauche, $tab_top_newpage-1, $tab_width, $height_note+1); - } else // No pagebreak { @@ -424,7 +423,6 @@ class pdf_eratosthene extends ModelePDFCommandes $posyafter = $tab_top_newpage; } - } $tab_height = $tab_height - $height_note; @@ -1028,7 +1026,6 @@ class pdf_eratosthene extends ModelePDFCommandes $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval, 0, $outputlangs), 0, 'R', 1); - } } } diff --git a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php index 5c663e61348..daa8d67e5d1 100644 --- a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php @@ -730,7 +730,6 @@ class pdf_rouget extends ModelePdfExpedition $pdf->SetXY($this->posxtotalht, $tab2_top + $tab2_hl * $index); $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxtotalht, $tab2_hl, price($object->total_ht, 0, $outputlangs), 0, 'C', 1); - } // Total Weight @@ -834,7 +833,6 @@ class pdf_rouget extends ModelePdfExpedition $pdf->SetXY($this->posxtotalht-1, $tab_top+1); $pdf->MultiCell(($this->page_largeur - $this->marge_droite - $this->posxtotalht), 2, $outputlangs->transnoentities("TotalHT"),'','C'); } - } } diff --git a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php index f05c19885da..d98801ab7e2 100644 --- a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php @@ -479,7 +479,6 @@ class pdf_standard extends ModeleExpenseReport $pagenb++; if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs); } - } // Show square diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index c4d69424cb2..797b48865c6 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -1202,7 +1202,6 @@ class pdf_crabe extends ModelePDFFactures $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval, 0, $outputlangs), 0, 'R', 1); - } } } @@ -1225,7 +1224,6 @@ class pdf_crabe extends ModelePDFFactures $this->tva[$tvakey]=$tvaval * $coef_fix_tva; } } - } foreach($this->tva as $tvakey => $tvaval) @@ -1516,9 +1514,7 @@ class pdf_crabe extends ModelePDFFactures { $pdf->MultiCell($this->postotalht-$this->posxprogress,2, $outputlangs->transnoentities("Progress"),'','C'); } - } - } if($conf->global->PRODUCT_USE_UNITS) { diff --git a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php index d03d60f50fe..439f81ab02e 100644 --- a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php @@ -487,7 +487,6 @@ class pdf_sponge extends ModelePDFFactures if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs); $height_note=$posyafter-$tab_top_newpage; $pdf->Rect($this->marge_gauche, $tab_top_newpage-1, $tab_width, $height_note+1); - } else // No pagebreak { @@ -509,7 +508,6 @@ class pdf_sponge extends ModelePDFFactures $posyafter = $tab_top_newpage; } - } $tab_height = $tab_height - $height_note; @@ -787,7 +785,6 @@ class pdf_sponge extends ModelePDFFactures $pagenb++; if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs); } - } // Show square @@ -1268,7 +1265,6 @@ class pdf_sponge extends ModelePDFFactures $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval, 0, $outputlangs), 0, 'R', 1); - } } } @@ -1291,7 +1287,6 @@ class pdf_sponge extends ModelePDFFactures $this->tva[$tvakey]=$tvaval * $coef_fix_tva; } } - } foreach($this->tva as $tvakey => $tvaval) diff --git a/htdocs/core/modules/import/import_csv.modules.php b/htdocs/core/modules/import/import_csv.modules.php index 34bff81e55c..6b2e480db86 100644 --- a/htdocs/core/modules/import/import_csv.modules.php +++ b/htdocs/core/modules/import/import_csv.modules.php @@ -466,7 +466,6 @@ class ImportCsv extends ModeleImports } } } - } elseif ($objimport->array_import_convertvalue[0][$val]['rule']=='zeroifnull') { diff --git a/htdocs/core/modules/import/import_xlsx.modules.php b/htdocs/core/modules/import/import_xlsx.modules.php index 2c37caa5d40..f8b6aa99a82 100644 --- a/htdocs/core/modules/import/import_xlsx.modules.php +++ b/htdocs/core/modules/import/import_xlsx.modules.php @@ -493,7 +493,6 @@ class ImportXlsx extends ModeleImports } } } - } elseif ($objimport->array_import_convertvalue[0][$val]['rule']=='zeroifnull') { diff --git a/htdocs/core/modules/mailings/thirdparties_services_expired.modules.php b/htdocs/core/modules/mailings/thirdparties_services_expired.modules.php index 4f6f3c4ecdb..91bd5127c1f 100644 --- a/htdocs/core/modules/mailings/thirdparties_services_expired.modules.php +++ b/htdocs/core/modules/mailings/thirdparties_services_expired.modules.php @@ -69,7 +69,6 @@ class mailing_thirdparties_services_expired extends MailingTargets $i++; $this->arrayofproducts[$i]=$obj->ref; } - } else { diff --git a/htdocs/core/modules/modStock.class.php b/htdocs/core/modules/modStock.class.php index d4f79f1efcf..01b4e9d4474 100644 --- a/htdocs/core/modules/modStock.class.php +++ b/htdocs/core/modules/modStock.class.php @@ -173,7 +173,6 @@ class modStock extends DolibarrModules $this->rights[9][3] = 0; // Permission by default for new user (0/1) $this->rights[9][4] = 'inventory_advance'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) $this->rights[9][5] = 'changePMP'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2) - } // Main menu entries diff --git a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php index a350f643e9e..bc5da5e306b 100644 --- a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php +++ b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php @@ -1144,7 +1144,6 @@ class doc_generic_project_odt extends ModelePDFProjects } $listlines->merge(); } - } } $odfHandler->mergeSegment($listlines); diff --git a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php index 7df62bec482..46f0fdacbbb 100644 --- a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php +++ b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php @@ -720,7 +720,6 @@ class doc_generic_task_odt extends ModelePDFTask //$listlines->merge(); $odfHandler->mergeSegment($listtasksfiles); - } catch(OdfException $e) { diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index adb52867a36..8c2dfd21a89 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -1146,7 +1146,6 @@ class pdf_azur extends ModelePDFPropales $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval, 0, $outputlangs), 0, 'R', 1); - } } } diff --git a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php index e43734039ca..464bef3da96 100644 --- a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php @@ -446,7 +446,6 @@ class pdf_cyan extends ModelePDFPropales if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs); $height_note=$posyafter-$tab_top_newpage; $pdf->Rect($this->marge_gauche, $tab_top_newpage-1, $tab_width, $height_note+1); - } else // No pagebreak { @@ -468,7 +467,6 @@ class pdf_cyan extends ModelePDFPropales $posyafter = $tab_top_newpage; } - } $tab_height = $tab_height - $height_note; @@ -1183,7 +1181,6 @@ class pdf_cyan extends ModelePDFPropales $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval, 0, $outputlangs), 0, 'R', 1); - } } } diff --git a/htdocs/core/modules/security/generate/modGeneratePassStandard.class.php b/htdocs/core/modules/security/generate/modGeneratePassStandard.class.php index d051c173c6d..0ecf7d7ef38 100644 --- a/htdocs/core/modules/security/generate/modGeneratePassStandard.class.php +++ b/htdocs/core/modules/security/generate/modGeneratePassStandard.class.php @@ -117,7 +117,6 @@ class modGeneratePassStandard extends ModeleGenPassword $password .= $char; $i++; } - } // done! diff --git a/htdocs/core/modules/stock/doc/pdf_stdmovement.modules.php b/htdocs/core/modules/stock/doc/pdf_stdmovement.modules.php index 2fd86069d01..3c0d62be848 100644 --- a/htdocs/core/modules/stock/doc/pdf_stdmovement.modules.php +++ b/htdocs/core/modules/stock/doc/pdf_stdmovement.modules.php @@ -713,7 +713,6 @@ class pdf_stdmovement extends ModelePDFMovement // Total Qty $pdf->SetXY($this->postotalht, $curY); $pdf->MultiCell($this->page_largeur-$this->marge_droite-$this->postotalht, 3, $totalunit, 0, 'R', 0); - } else { diff --git a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php index e7d47f67bda..dec36d5adbd 100644 --- a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php +++ b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php @@ -243,7 +243,6 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $this->error=$langs->transnoentities("ErrorCanNotCreateDir",$dir); return 0; } - } if (file_exists($dir)) diff --git a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php index 8478fd70e89..d869b5dd72d 100644 --- a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php +++ b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php @@ -291,7 +291,6 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $this->error=$langs->transnoentities("ErrorCanNotCreateDir",$dir); return 0; } - } if (file_exists($dir)) diff --git a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php index 31097dd8c34..544a1040c9f 100644 --- a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php @@ -997,7 +997,6 @@ class pdf_aurore extends ModelePDFSupplierProposal $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval, 0, $outputlangs), 0, 'R', 1); - } } } diff --git a/htdocs/core/tpl/card_presend.tpl.php b/htdocs/core/tpl/card_presend.tpl.php index 4a4301c5a5f..0d1fd84923c 100644 --- a/htdocs/core/tpl/card_presend.tpl.php +++ b/htdocs/core/tpl/card_presend.tpl.php @@ -169,7 +169,6 @@ if ($action == 'presend') $formmail->withtouser = $listeuser; $formmail->withtoccuser = $listeuser; } - } $formmail->withto = GETPOST('sendto') ? GETPOST('sendto') : $liste; diff --git a/htdocs/core/tpl/resource_view.tpl.php b/htdocs/core/tpl/resource_view.tpl.php index aff342191cb..59491c01b6f 100644 --- a/htdocs/core/tpl/resource_view.tpl.php +++ b/htdocs/core/tpl/resource_view.tpl.php @@ -98,7 +98,6 @@ if( (array) $linked_resources && count($linked_resources) > 0) print ''; } } - } else { print '
'; diff --git a/htdocs/core/triggers/interface_80_modStripe_Stripe.class.php b/htdocs/core/triggers/interface_80_modStripe_Stripe.class.php index cb03315496a..8282a09a43d 100644 --- a/htdocs/core/triggers/interface_80_modStripe_Stripe.class.php +++ b/htdocs/core/triggers/interface_80_modStripe_Stripe.class.php @@ -200,7 +200,6 @@ class InterfaceStripe if ($action == 'COMPANYPAYMENTMODE_MODIFY' && $object->type == 'card') { // For creation of credit card, we do not create in Stripe automatically - } if ($action == 'COMPANYPAYMENTMODE_MODIFY' && $object->type == 'card') { dol_syslog("Trigger '" . $this->name . "' for action '$action' launched by " . __FILE__ . ". id=" . $object->id); diff --git a/htdocs/cron/card.php b/htdocs/cron/card.php index 2d4b74a3b5a..152657e216a 100644 --- a/htdocs/cron/card.php +++ b/htdocs/cron/card.php @@ -546,7 +546,6 @@ if (($action=="create") || ($action=="edit")) print ""; print "
\n"; - } else { diff --git a/htdocs/datapolicy/admin/setup.php b/htdocs/datapolicy/admin/setup.php index 777fa6cb893..8e92e1e6231 100644 --- a/htdocs/datapolicy/admin/setup.php +++ b/htdocs/datapolicy/admin/setup.php @@ -159,7 +159,6 @@ if ($action == 'edit') print ''; print ''; } - } print ''; @@ -185,7 +184,6 @@ else print $form->textwithpicto($langs->trans($key),$langs->trans('DATAPOLICY_Tooltip_SETUP')); print '' . ($conf->global->$key == '' ? $langs->trans('None') : $valTab[$conf->global->$key]) . ''; } - } print ''; diff --git a/htdocs/datapolicy/class/datapolicy.class.php b/htdocs/datapolicy/class/datapolicy.class.php index 3bebdff9302..4914d248490 100644 --- a/htdocs/datapolicy/class/datapolicy.class.php +++ b/htdocs/datapolicy/class/datapolicy.class.php @@ -204,7 +204,6 @@ Class DataPolicy extends Contact $resultmasssend .= $langs->trans("MailSent") . ': ' . $sendto . "
"; $contact->array_options['options_datapolicy_send'] = date('Y-m-d', time()); $contact->update($contact->id); - } else { dol_print_error($db); } @@ -348,7 +347,6 @@ Class DataPolicy extends Contact $resultmasssend .= $langs->trans("MailSent") . ': ' . $sendto . "
"; $adherent->array_options['options_datapolicy_send'] = date('Y-m-d', time()); $adherent->update($user); - } else { dol_print_error($db); } diff --git a/htdocs/datapolicy/class/datapolicycron.class.php b/htdocs/datapolicy/class/datapolicycron.class.php index f6de8b9b498..ab4b55b35dc 100644 --- a/htdocs/datapolicy/class/datapolicycron.class.php +++ b/htdocs/datapolicy/class/datapolicycron.class.php @@ -488,14 +488,12 @@ class DataPolicyCron $ret = $object->delete(); } } - } $i++; } } } - } return true; } diff --git a/htdocs/datapolicy/mailing.php b/htdocs/datapolicy/mailing.php index d65b2bdced4..e3f38b269be 100644 --- a/htdocs/datapolicy/mailing.php +++ b/htdocs/datapolicy/mailing.php @@ -31,8 +31,6 @@ if(!empty($idcontact)){ $contact = new Contact($db); $contact->fetch($idcontact); DataPolicy::sendMailDataPolicyContact($contact); - - }else{ $contacts = new DataPolicy($db); diff --git a/htdocs/don/card.php b/htdocs/don/card.php index d9542dcaaf0..38465de95ca 100644 --- a/htdocs/don/card.php +++ b/htdocs/don/card.php @@ -375,7 +375,6 @@ if ($action == 'create') print ''; } print '' . "\n"; - } // Date diff --git a/htdocs/don/document.php b/htdocs/don/document.php index 177b2b82d8b..01aab513a6a 100644 --- a/htdocs/don/document.php +++ b/htdocs/don/document.php @@ -184,7 +184,6 @@ if ($object->id) $permtoedit = $user->rights->don->creer; $param = '&id=' . $object->id; include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_post_headers.tpl.php'; - } else { diff --git a/htdocs/don/payment/card.php b/htdocs/don/payment/card.php index dde03cb461d..1c3a60e7e78 100644 --- a/htdocs/don/payment/card.php +++ b/htdocs/don/payment/card.php @@ -133,7 +133,6 @@ dol_fiche_head($head, $hselected, $langs->trans("DonationPayment"), -1, 'payment if ($action == 'delete') { print $form->formconfirm('card.php?id='.$object->id, $langs->trans("DeletePayment"), $langs->trans("ConfirmDeletePayment"), 'confirm_delete','',0,2); - } /* @@ -143,7 +142,6 @@ if ($action == 'valide') { $facid = GETPOST('facid','int'); print $form->formconfirm('card.php?id='.$object->id.'&facid='.$facid, $langs->trans("ValidatePayment"), $langs->trans("ConfirmValidatePayment"), 'confirm_valide','',0,2); - } diff --git a/htdocs/ecm/class/ecmdirectory.class.php b/htdocs/ecm/class/ecmdirectory.class.php index 9038b74cb2a..d3fdd115ffa 100644 --- a/htdocs/ecm/class/ecmdirectory.class.php +++ b/htdocs/ecm/class/ecmdirectory.class.php @@ -680,7 +680,6 @@ class EcmDirectory // extends CommonObject } } $i++; - } } else diff --git a/htdocs/ecm/dir_add_card.php b/htdocs/ecm/dir_add_card.php index 5dab56b29a0..922c06f0cc2 100644 --- a/htdocs/ecm/dir_add_card.php +++ b/htdocs/ecm/dir_add_card.php @@ -290,7 +290,6 @@ if (empty($action) || $action == 'delete_section') if ($action == 'delete_section') { print $form->formconfirm($_SERVER["PHP_SELF"].'?section='.$section, $langs->trans('DeleteSection'), $langs->trans('ConfirmDeleteSection',$ecmdir->label), 'confirm_deletesection'); - } // Construit fiche rubrique diff --git a/htdocs/ecm/dir_card.php b/htdocs/ecm/dir_card.php index 982fa045d32..7c3473117fc 100644 --- a/htdocs/ecm/dir_card.php +++ b/htdocs/ecm/dir_card.php @@ -271,7 +271,6 @@ if ($action == 'update' && ! GETPOST('cancel','alpha')) $upload_dir = $conf->medias->multidir_output[$conf->entity].'/'.$relativepath; $section = $relativepath; } - } } diff --git a/htdocs/ecm/file_card.php b/htdocs/ecm/file_card.php index b1b45141f4f..959a4bc5b8d 100644 --- a/htdocs/ecm/file_card.php +++ b/htdocs/ecm/file_card.php @@ -390,7 +390,6 @@ if ($action == 'edit') if ($action == 'delete_file') { print $form->formconfirm($_SERVER["PHP_SELF"].'?section='.urlencode($section), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile',$urlfile), 'confirm_deletefile', '', 1, 1); - } if ($action != 'edit') diff --git a/htdocs/ecm/index_auto.php b/htdocs/ecm/index_auto.php index 382312e4434..ea5e5c13ff2 100644 --- a/htdocs/ecm/index_auto.php +++ b/htdocs/ecm/index_auto.php @@ -343,7 +343,6 @@ dol_fiche_head($head, 'index_auto', $langs->trans("ECMArea").' - '.$langs->trans if ($action == 'delete' && empty($conf->use_javascript_ajax)) { print $form->formconfirm($_SERVER["PHP_SELF"].'?section='.$section.'&urlfile='.urlencode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile','','',1); - } // Start container of all panels diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index 69deecdf4c0..292bf5e1de8 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -316,7 +316,6 @@ if (empty($reshook)) unset($_POST["options_" . $key]); } } - } //var_dump($batch_line[2]); @@ -859,7 +858,6 @@ if (empty($reshook)) $mode='emailfromshipment'; $trackid='shi'.$object->id; include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php'; - } @@ -1421,7 +1419,6 @@ if ($action == 'create') print ''; print '('.$stock.')'; - } else { @@ -1522,7 +1519,6 @@ if ($action == 'create') } } } - } if ($subj == 0) // Line not shown yet, we show it { @@ -1669,13 +1665,11 @@ else if ($id || $ref) } $formconfirm=$form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id,$langs->trans('ValidateSending'),$text,'confirm_valid','',0,1); - } // Confirm cancelation if ($action == 'annuler') { $formconfirm=$form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id,$langs->trans('CancelSending'),$langs->trans("ConfirmCancelSending",$object->ref),'confirm_cancel','',0,1); - } // Call Hook formConfirm @@ -1826,7 +1820,6 @@ else if ($id || $ref) print ' '; print ' '; print ''; - } else { @@ -1864,7 +1857,6 @@ else if ($id || $ref) print ' '; print ' '; print ''; - } else { @@ -2536,7 +2528,6 @@ else if ($id || $ref) { print ''.$langs->trans("Delete").''; } - } print ''; diff --git a/htdocs/expedition/class/api_shipments.class.php b/htdocs/expedition/class/api_shipments.class.php index 109b847fc62..834c0bf2bda 100644 --- a/htdocs/expedition/class/api_shipments.class.php +++ b/htdocs/expedition/class/api_shipments.class.php @@ -661,7 +661,6 @@ class Shipments extends DolibarrApi if (!isset($data[$field])) throw new RestException(400, "$field field missing"); $shipment[$field] = $data[$field]; - } return $shipment; } diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index 77df09ee276..751516fc18d 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -383,7 +383,6 @@ class Expedition extends CommonObject $this->db->rollback(); return -1*$error; } - } else { @@ -760,7 +759,6 @@ class Expedition extends CommonObject $this->error=$this->db->error(); return -2; } - } // Change status of order to "shipment in process" @@ -2129,7 +2127,6 @@ class Expedition extends CommonObject if ($result < 0) { $error++; } - } else { $error++; $this->errors[]=$this->db->lasterror; @@ -2256,7 +2253,6 @@ class Expedition extends CommonObject $error++; } } - } else { $error++; $this->errors[]=$this->db->lasterror(); diff --git a/htdocs/expedition/contact.php b/htdocs/expedition/contact.php index acc2b5e1142..ce31e760b7f 100644 --- a/htdocs/expedition/contact.php +++ b/htdocs/expedition/contact.php @@ -265,7 +265,6 @@ if ($id > 0 || ! empty($ref)) $res=@include dol_buildpath($reldir.'/contacts.tpl.php'); if ($res) break; } - } // End of page diff --git a/htdocs/expedition/list.php b/htdocs/expedition/list.php index 327a9394b77..c3632ca57fd 100644 --- a/htdocs/expedition/list.php +++ b/htdocs/expedition/list.php @@ -160,7 +160,6 @@ if (empty($reshook)) setEventMessages($langs->trans('TooManyRecordForMassAction',$maxformassaction), null, 'errors'); $error++; } - } diff --git a/htdocs/expedition/shipment.php b/htdocs/expedition/shipment.php index 33e1dd97f7b..920b5508e59 100644 --- a/htdocs/expedition/shipment.php +++ b/htdocs/expedition/shipment.php @@ -215,7 +215,6 @@ if (empty($reshook)) } include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php'; - } /* @@ -257,7 +256,6 @@ if ($id > 0 || ! empty($ref)) if ($action == 'cloture') { $formconfirm = $form->formconfirm($_SERVER['PHP_SELF']."?id=".$id,$langs->trans("CloseShipment"),$langs->trans("ConfirmCloseShipment"),"confirm_cloture"); - } // Call Hook formConfirm @@ -908,7 +906,6 @@ if ($id > 0 || ! empty($ref)) print ''; $somethingshown=1; - } else { diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index d877ad00b2f..7174e42f363 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -1160,7 +1160,6 @@ if (empty($reshook)) unset($fk_projet); unset($date); - } else { setEventMessages($object->error, $object->errors, 'errors'); } @@ -1552,7 +1551,6 @@ else $userfee->fetch($user->id); print $userfee->getNomUrl(-1); print ''; - } // Other attributes @@ -2225,17 +2223,13 @@ else print ''; dol_fiche_end(); - } // end edit or not edit - } // end of if result else { dol_print_error($db); } - } //fin si id > 0 - } /* @@ -2449,7 +2443,6 @@ if ($action != 'presend') $somethingshown = $formactions->showactions($object, 'expensereport', null); print ''; - } // Presend form diff --git a/htdocs/expensereport/class/api_expensereports.class.php b/htdocs/expensereport/class/api_expensereports.class.php index 80c22fb961a..e6475665fb8 100644 --- a/htdocs/expensereport/class/api_expensereports.class.php +++ b/htdocs/expensereport/class/api_expensereports.class.php @@ -522,7 +522,6 @@ class ExpenseReports extends DolibarrApi if (!isset($data[$field])) throw new RestException(400, "$field field missing"); $expensereport[$field] = $data[$field]; - } return $expensereport; } diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php index 6cc7b13ee7c..2b343dd0074 100644 --- a/htdocs/expensereport/class/expensereport.class.php +++ b/htdocs/expensereport/class/expensereport.class.php @@ -719,7 +719,6 @@ class ExpenseReport extends CommonObject $auser->fetch($obj->fk_user_approve); $this->user_approve = $auser; } - } $this->db->free($resql); } @@ -891,7 +890,6 @@ class ExpenseReport extends CommonObject print ''.$langs->trans("TotalTTC").' : '.price($total_TTC).''; print ' '; print ''; - } else { diff --git a/htdocs/expensereport/class/paymentexpensereport.class.php b/htdocs/expensereport/class/paymentexpensereport.class.php index 35f1fef7b5b..605affed253 100644 --- a/htdocs/expensereport/class/paymentexpensereport.class.php +++ b/htdocs/expensereport/class/paymentexpensereport.class.php @@ -165,7 +165,6 @@ class PaymentExpenseReport extends CommonObject { $error++; } - } if ($totalamount != 0 && ! $error) diff --git a/htdocs/expensereport/document.php b/htdocs/expensereport/document.php index 16db5311028..6cfb3a2f7bc 100644 --- a/htdocs/expensereport/document.php +++ b/htdocs/expensereport/document.php @@ -132,7 +132,6 @@ if ($object->id) $permtoedit = $user->rights->expensereport->creer; $param = '&id=' . $object->id; include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_post_headers.tpl.php'; - } else { diff --git a/htdocs/expensereport/export_csv.php b/htdocs/expensereport/export_csv.php index f018a23e478..3a104ca77b4 100644 --- a/htdocs/expensereport/export_csv.php +++ b/htdocs/expensereport/export_csv.php @@ -60,7 +60,6 @@ if($num < 1) { $insert.= ")"; $req = $db->query($insert); - } @@ -176,7 +175,6 @@ if (isset($_POST['action'])) $ligne.= "--->, {$objet2->rowid}, {$objet2->libelle}, {$objet2->comments}, {$objet2->total_ht}, {$objet2->total_tva}, {$objet2->total_ttc}\n"; } } - } $ligne = $outputlangs->convToOutputCharset($ligne); @@ -185,11 +183,9 @@ if (isset($_POST['action'])) fclose($open); print 'Télécharger le fichier expensereport-'.$dateselected.'.csv'; - } else { print ''.$langs->trans('NoTripsToExportCSV').''; - } } } diff --git a/htdocs/expensereport/index.php b/htdocs/expensereport/index.php index 758dd89afe2..9a947b8596e 100644 --- a/htdocs/expensereport/index.php +++ b/htdocs/expensereport/index.php @@ -219,7 +219,6 @@ if ($result) $i++; } - } else { diff --git a/htdocs/expensereport/payment/card.php b/htdocs/expensereport/payment/card.php index 88272072ada..f75a0f8bb31 100644 --- a/htdocs/expensereport/payment/card.php +++ b/htdocs/expensereport/payment/card.php @@ -129,7 +129,6 @@ dol_fiche_head($head, 'payment', $langs->trans("ExpenseReportPayment"), -1, 'pay if ($action == 'delete') { print $form->formconfirm('card.php?id='.$object->id, $langs->trans("DeletePayment"), $langs->trans("ConfirmDeletePayment"), 'confirm_delete','',0,2); - } /* @@ -139,7 +138,6 @@ if ($action == 'valide') { $facid = $_GET['facid']; print $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id.'&facid='.$facid, $langs->trans("ValidatePayment"), $langs->trans("ConfirmValidatePayment"), 'confirm_valide','',0,2); - } $linkback = ''; diff --git a/htdocs/expensereport/payment/payment.php b/htdocs/expensereport/payment/payment.php index 5136dff3cce..046bb522ae2 100644 --- a/htdocs/expensereport/payment/payment.php +++ b/htdocs/expensereport/payment/payment.php @@ -150,7 +150,6 @@ if ($action == 'add_payment') $error++; } } - } if (! $error) diff --git a/htdocs/exports/export.php b/htdocs/exports/export.php index 6d65418be3c..f0060ffd029 100644 --- a/htdocs/exports/export.php +++ b/htdocs/exports/export.php @@ -208,7 +208,6 @@ if ($action=='selectfield') // Selection of field at step 2 setEventMessages($warnings, null, 'warnings'); } - } if ($action=='unselectfield') { @@ -683,7 +682,6 @@ if ($step == 2 && $datatoexport) } print ''; - } if ($step == 3 && $datatoexport) @@ -858,7 +856,6 @@ if ($step == 3 && $datatoexport) // il n'est pas obligatoire de filtrer les champs print ''.$langs->trans("NextStep").''; print ''; - } if ($step == 4 && $datatoexport) @@ -1162,7 +1159,6 @@ if ($step == 5 && $datatoexport) if ($action == 'remove_file') { print $form->formconfirm($_SERVER["PHP_SELF"].'?step=5&datatoexport='.$datatoexport.'&file='.urlencode(GETPOST("file")), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', 0, 1); - } print '
'; diff --git a/htdocs/fichinter/card-rec.php b/htdocs/fichinter/card-rec.php index 66f693858c9..0113f7fbea6 100644 --- a/htdocs/fichinter/card-rec.php +++ b/htdocs/fichinter/card-rec.php @@ -420,7 +420,6 @@ if ($action == 'create') { $i++; } $db->free($result); - } else print $db->error(); print ""; @@ -439,7 +438,6 @@ if ($action == 'create') { } else dol_print_error('', "Error, no invoice ".$object->id); - } elseif ($action == 'selsocforcreatefrommodel') { print load_fiche_titre($langs->trans("CreateRepeatableIntervention"), '', 'title_commercial.png'); dol_fiche_head(''); @@ -574,11 +572,9 @@ if ($action == 'create') { print $contratstatic->getNomUrl(0, '', 1); } else print " "; - } print ''; print ''; - } print ""; print '
'; @@ -775,7 +771,6 @@ if ($action == 'create') { print ''; } else print $langs->trans("ErrorRecordNotFound"); - } else { /* * List mode diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index 75866d586f6..5896a5c5723 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -378,10 +378,8 @@ if (empty($reshook)) $error++; break; } - } } - } else { @@ -1099,7 +1097,6 @@ if ($action == 'create') print ''; } - } else if ($id > 0 || ! empty($ref)) { @@ -1471,8 +1468,6 @@ else if ($id > 0 || ! empty($ref)) $line->fetch_optionals(); print $line->showOptionals($extrafieldsline, 'view', array('style'=>$bc[$var], 'colspan'=>5)); - - } // Line in update mode @@ -1519,8 +1514,6 @@ else if ($id > 0 || ! empty($ref)) $line->fetch_optionals(); print $line->showOptionals($extrafieldsline, 'edit', array('style'=>$bc[$var], 'colspan'=>5)); - - } $i++; @@ -1711,7 +1704,6 @@ else if ($id > 0 || ! empty($ref)) print ''; } - } } } diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php index d8be14c298a..05a139e2a9a 100644 --- a/htdocs/fichinter/class/fichinter.class.php +++ b/htdocs/fichinter/class/fichinter.class.php @@ -882,7 +882,6 @@ class Fichinter extends CommonObject $muser->fetch($obj->fk_user_modification); $this->user_modification = $muser; } - } $this->db->free($resql); } diff --git a/htdocs/fichinter/contact.php b/htdocs/fichinter/contact.php index d3b2ea6f78e..b69aa5952fa 100644 --- a/htdocs/fichinter/contact.php +++ b/htdocs/fichinter/contact.php @@ -185,7 +185,6 @@ if ($id > 0 || ! empty($ref)) $res=@include dol_buildpath($reldir.'/contacts.tpl.php'); if ($res) break; } - } diff --git a/htdocs/fichinter/document.php b/htdocs/fichinter/document.php index d52ed81da48..42273785a61 100644 --- a/htdocs/fichinter/document.php +++ b/htdocs/fichinter/document.php @@ -168,7 +168,6 @@ if ($object->id) $permtoedit = $user->rights->ficheinter->creer; $param = '&id=' . $object->id; include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_post_headers.tpl.php'; - } else { diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index ce9665cc6c8..ced75842606 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -2132,7 +2132,6 @@ class CommandeFournisseur extends CommonOrder $this->errors[]='ErrorCantSetReceptionToTotalDoneWithReceptionToApprove'; dol_syslog('ErrorCantSetReceptionToTotalDoneWithReceptionToApprove', LOG_DEBUG); } - } if (! $error && ! empty($conf->global->SUPPLIER_ORDER_USE_DISPATCH_STATUS_NEED_APPROVE) && ($type == 'tot')) // Accept to move to reception done, only if status of all line are ok (refuse denied) { @@ -3088,7 +3087,6 @@ class CommandeFournisseur extends CommonOrder { $close++; } - } } @@ -3112,8 +3110,6 @@ class CommandeFournisseur extends CommonOrder } return 4; } - - } else {//all the products are not received @@ -3123,7 +3119,6 @@ class CommandeFournisseur extends CommonOrder } return 4; } - } else { diff --git a/htdocs/fourn/class/fournisseur.commande.dispatch.class.php b/htdocs/fourn/class/fournisseur.commande.dispatch.class.php index 2bcdce36b3c..c7b5d00c797 100644 --- a/htdocs/fourn/class/fournisseur.commande.dispatch.class.php +++ b/htdocs/fourn/class/fournisseur.commande.dispatch.class.php @@ -279,8 +279,6 @@ class CommandeFournisseurDispatch extends CommonObject $this->batch = $obj->batch; $this->eatby = $this->db->jdate($obj->eatby); $this->sellby = $this->db->jdate($obj->sellby); - - } $this->db->free($resql); diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index f4c37a1113c..58230038fcc 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -680,7 +680,6 @@ class FactureFournisseur extends CommonInvoice $this->error=$this->db->lasterror(); return -3; } - } else { @@ -3152,7 +3151,6 @@ class SupplierInvoiceLine extends CommonObjectLine $this->db->commit(); return $this->id; - } else { diff --git a/htdocs/fourn/class/paiementfourn.class.php b/htdocs/fourn/class/paiementfourn.class.php index fcf7332dbd0..a366faa0400 100644 --- a/htdocs/fourn/class/paiementfourn.class.php +++ b/htdocs/fourn/class/paiementfourn.class.php @@ -262,7 +262,6 @@ class PaiementFourn extends Paiement $this->error=$this->db->lasterror(); $error++; } - } else { diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 134856112d4..70fcaf004fb 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -221,7 +221,6 @@ if (empty($reshook)) //$newstatus=3; // Submited // TODO If there is at least one reception, we can set to Received->Received partially $newstatus=4; // Received partially - } else if ($object->statut == 6) $newstatus=2; // Canceled->Approved else if ($object->statut == 7) $newstatus=3; // Canceled->Process running @@ -700,7 +699,6 @@ if (empty($reshook)) dol_print_error($db,$object->error); exit; } - } // Remove a product line @@ -1443,7 +1441,6 @@ if ($action=='create') // Object source contacts list $srccontactslist = $objectsrc->liste_contact(- 1, 'external', 1); - } else { @@ -1700,7 +1697,6 @@ elseif (! empty($object->id)) if ($action == 'delete') { $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteOrder'), $langs->trans('ConfirmDeleteOrder'), 'confirm_delete', '', 0, 2); - } // Clone confirmation @@ -1712,7 +1708,6 @@ elseif (! empty($object->id)) ); // Paiement incomplet. On demande si motif = escompte ou autre $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id,$langs->trans('CloneOrder'),$langs->trans('ConfirmCloneOrder',$object->ref),'confirm_clone',$formquestion,'yes',1); - } // Confirmation de la validation @@ -1791,14 +1786,12 @@ elseif (! empty($object->id)) if ($action == 'refuse') { $formconfirm = $form->formconfirm($_SERVER['PHP_SELF']."?id=$object->id",$langs->trans("DenyingThisOrder"),$langs->trans("ConfirmDenyingThisOrder",$object->ref),"confirm_refuse", '', 0, 1); - } // Confirmation de l'annulation if ($action == 'cancel') { $formconfirm = $form->formconfirm($_SERVER['PHP_SELF']."?id=$object->id",$langs->trans("Cancel"),$langs->trans("ConfirmCancelThisOrder",$object->ref),"confirm_cancel", '', 0, 1); - } // Confirmation de l'envoi de la commande @@ -1806,7 +1799,6 @@ elseif (! empty($object->id)) { $date_com = dol_mktime(GETPOST('rehour'),GETPOST('remin'),GETPOST('resec'),GETPOST("remonth"),GETPOST("reday"),GETPOST("reyear")); $formconfirm = $form->formconfirm($_SERVER['PHP_SELF']."?id=".$object->id."&datecommande=".$date_com."&methode=".$_POST["methodecommande"]."&comment=".urlencode($_POST["comment"]), $langs->trans("MakeOrder"),$langs->trans("ConfirmMakeOrder",dol_print_date($date_com,'day')),"confirm_commande",'',0,2); - } // Confirmation to delete line @@ -2449,7 +2441,6 @@ elseif (! empty($object->id)) { print ''.$langs->trans("Delete").''; } - } print ""; @@ -2724,7 +2715,6 @@ elseif (! empty($object->id)) } } } - } elseif ($user_status_code == "PERMISSION_DENIED") { diff --git a/htdocs/fourn/commande/contact.php b/htdocs/fourn/commande/contact.php index 85739bdb6ef..c69c92ead29 100644 --- a/htdocs/fourn/commande/contact.php +++ b/htdocs/fourn/commande/contact.php @@ -192,7 +192,6 @@ if ($id > 0 || ! empty($ref)) // Contacts lines include DOL_DOCUMENT_ROOT.'/core/tpl/contacts.tpl.php'; - } else { diff --git a/htdocs/fourn/commande/document.php b/htdocs/fourn/commande/document.php index 8aa4da9c307..eb299d6a94d 100644 --- a/htdocs/fourn/commande/document.php +++ b/htdocs/fourn/commande/document.php @@ -175,7 +175,6 @@ if ($object->id > 0) $permtoedit = $user->rights->fournisseur->commande->creer; $param = '&id=' . $object->id; include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_post_headers.tpl.php'; - } else { diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index 06857526731..7158d7b2c0e 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -263,7 +263,6 @@ if (empty($reshook)) $res = $object->create($user); if($res > 0) $nb_bills_created++; - } if ($object->id > 0) diff --git a/htdocs/fourn/commande/orderstoinvoice.php b/htdocs/fourn/commande/orderstoinvoice.php index 9b9743f201f..5456627384e 100644 --- a/htdocs/fourn/commande/orderstoinvoice.php +++ b/htdocs/fourn/commande/orderstoinvoice.php @@ -261,7 +261,6 @@ if (($action == 'create' || $action == 'add') && ! $error) { $error++; break; } - } } @@ -270,7 +269,6 @@ if (($action == 'create' || $action == 'add') && ! $error) { header('Location: ' . DOL_URL_ROOT . '/fourn/facture/card.php?facid=' . $id); exit(); } - } else { $db->rollback(); $action = 'create'; diff --git a/htdocs/fourn/contact.php b/htdocs/fourn/contact.php index a6adb0bad27..3225ce63714 100644 --- a/htdocs/fourn/contact.php +++ b/htdocs/fourn/contact.php @@ -123,7 +123,6 @@ if ($result) } print ""; $db->free($result); - } else { diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index af7f21f3628..9df540da197 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -525,7 +525,6 @@ if (empty($reshook)) { $error++; } - } if ($object->type == FactureFournisseur::TYPE_CREDIT_NOTE || $object->type == FactureFournisseur::TYPE_DEPOSIT) { @@ -543,7 +542,6 @@ if (empty($reshook)) break; } } - } if (empty($error)) @@ -757,7 +755,6 @@ if (empty($reshook)) $object->update_price(1); } - } if(GETPOST('invoiceAvoirWithPaymentRestAmount', 'int')==1 && $id>0) @@ -1669,7 +1666,6 @@ if ($action == 'create') // Replicate extrafields $objectsrc->fetch_optionals($originid); $object->array_options = $objectsrc->array_options; - } } else @@ -2257,7 +2253,6 @@ else } $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ValidateBill'), $text, 'confirm_valid', $formquestion, 1, 1); - } // Confirmation edit (back to draft) @@ -2293,27 +2288,23 @@ else ); } $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('UnvalidateBill'), $langs->trans('ConfirmUnvalidateBill', $object->ref), 'confirm_edit', $formquestion, 1, 1); - } // Confirmation set paid if ($action == 'paid') { $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ClassifyPaid'), $langs->trans('ConfirmClassifyPaidBill', $object->ref), 'confirm_paid', '', 0, 1); - } // Confirmation de la suppression de la facture fournisseur if ($action == 'delete') { $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteBill'), $langs->trans('ConfirmDeleteBill'), 'confirm_delete', '', 0, 1); - } if ($action == 'deletepaiement') { $payment_id = GETPOST('paiement_id'); $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&paiement_id='.$payment_id, $langs->trans('DeletePayment'), $langs->trans('ConfirmDeletePayment'), 'confirm_delete_paiement', '', 0, 1); - } // Confirmation to delete line diff --git a/htdocs/fourn/facture/contact.php b/htdocs/fourn/facture/contact.php index cb17be828ca..58e5630c0d6 100644 --- a/htdocs/fourn/facture/contact.php +++ b/htdocs/fourn/facture/contact.php @@ -266,7 +266,6 @@ if ($id > 0 || ! empty($ref)) // Contacts lines include DOL_DOCUMENT_ROOT.'/core/tpl/contacts.tpl.php'; - } else { diff --git a/htdocs/fourn/facture/document.php b/htdocs/fourn/facture/document.php index 4239331d0a6..d38a7992bd8 100644 --- a/htdocs/fourn/facture/document.php +++ b/htdocs/fourn/facture/document.php @@ -157,7 +157,6 @@ if ($object->id > 0) if ($action == 'delete') { print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&urlfile='.urlencode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', 0, 1); - } print ''; diff --git a/htdocs/fourn/facture/impayees.php b/htdocs/fourn/facture/impayees.php index 2e14a5187e4..4582f403b02 100644 --- a/htdocs/fourn/facture/impayees.php +++ b/htdocs/fourn/facture/impayees.php @@ -294,7 +294,6 @@ if ($user->rights->fournisseur->facture->lire) { dol_print_error($db); } - } // End of page diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index 3fa525415bb..e1bd120b0b4 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -1132,7 +1132,6 @@ if ($resql) else print ''; } print ''; - } } diff --git a/htdocs/fourn/paiement/card.php b/htdocs/fourn/paiement/card.php index 22b3e307ab3..9cc5fb27b84 100644 --- a/htdocs/fourn/paiement/card.php +++ b/htdocs/fourn/paiement/card.php @@ -166,7 +166,6 @@ if ($result > 0) if ($action == 'delete') { print $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id, $langs->trans("DeletePayment"), $langs->trans("ConfirmDeletePayment"), 'confirm_delete'); - } /* @@ -175,7 +174,6 @@ if ($result > 0) if ($action == 'valide') { print $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id, $langs->trans("ValidatePayment"), $langs->trans("ConfirmValidatePayment"), 'confirm_valide'); - } $linkback = '' . $langs->trans("BackToList") . ''; @@ -345,7 +343,6 @@ if ($result > 0) || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->fournisseur->supplier_invoice_advance->validate))) { print ''.$langs->trans('Valid').''; - } } } diff --git a/htdocs/ftp/index.php b/htdocs/ftp/index.php index 7c9527f3a9a..64b9fb0a8ea 100644 --- a/htdocs/ftp/index.php +++ b/htdocs/ftp/index.php @@ -235,7 +235,6 @@ if ($_POST["const"] && $_POST["delete"] && $_POST["delete"] == $langs->trans("De $action=''; } } - } else { @@ -339,7 +338,6 @@ if ($action == 'download') { setEventMessages($langs->transnoentitiesnoconv('FailedToGetFile',$remotefile), null, 'errors'); } - } else { @@ -408,7 +406,6 @@ else if ($action == 'delete') { print $form->formconfirm($_SERVER["PHP_SELF"].'?numero_ftp='.$numero_ftp.'§ion='.urlencode($_REQUEST["section"]).'&file='.urlencode($_GET["file"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile','','',1); - } // Confirmation de la suppression d'une ligne categorie @@ -610,7 +607,6 @@ else $i++; $nbofentries++; } - } print "
"; @@ -808,7 +804,6 @@ function ftp_isdir($connect_id,$dir) { ftp_cdup($connect_id); return 1; - } else { diff --git a/htdocs/holiday/card.php b/htdocs/holiday/card.php index be365c52351..db5189ceac2 100644 --- a/htdocs/holiday/card.php +++ b/htdocs/holiday/card.php @@ -741,7 +741,6 @@ if ($action == 'confirm_cancel' && GETPOST('confirm') == 'yes') } } } - } @@ -1342,23 +1341,19 @@ else print ''; } - } else { print '
'; print $langs->trans('ErrorUserViewCP'); print '

'; print '
'; } - } else { print '
'; print $langs->trans('ErrorIDFicheCP'); print '

'; print '
'; } - } - } // End of page diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php index a888a4919a6..9b42655fe5f 100644 --- a/htdocs/holiday/class/holiday.class.php +++ b/htdocs/holiday/class/holiday.class.php @@ -1468,7 +1468,6 @@ class Holiday extends CommonObject $this->error="Error ".$this->db->lasterror(); return -1; } - } else { @@ -1510,7 +1509,6 @@ class Holiday extends CommonObject return -1; } } - } else { // Si faux donc return array diff --git a/htdocs/holiday/list.php b/htdocs/holiday/list.php index fcd5cc9d8b0..d4abba41c02 100644 --- a/htdocs/holiday/list.php +++ b/htdocs/holiday/list.php @@ -605,7 +605,6 @@ elseif (! empty($holiday->holiday) && !empty($mysoc->country_id)) print ''; print ''."\n"; - } } diff --git a/htdocs/holiday/month_report.php b/htdocs/holiday/month_report.php index e9b98deb1f9..53fab6a825f 100644 --- a/htdocs/holiday/month_report.php +++ b/htdocs/holiday/month_report.php @@ -189,7 +189,6 @@ else print '' . dol_escape_htmltag(dolGetFirstLineOfText($obj->description)) . ''; print ''; } - } print ''; print ''; diff --git a/htdocs/holiday/view_log.php b/htdocs/holiday/view_log.php index c9cc2e6c16f..124d26baf92 100644 --- a/htdocs/holiday/view_log.php +++ b/htdocs/holiday/view_log.php @@ -124,7 +124,6 @@ foreach($cp->logs as $logs_CP) print ''.price2num($logs_CP['prev_solde'],5).' '.$langs->trans('days').''; print ''.price2num($logs_CP['new_solde'],5).' '.$langs->trans('days').''; print ''."\n"; - } if ($log_holiday == '2') diff --git a/htdocs/hrm/admin/admin_establishment.php b/htdocs/hrm/admin/admin_establishment.php index f7ebef5e623..5b15c1fb8bc 100644 --- a/htdocs/hrm/admin/admin_establishment.php +++ b/htdocs/hrm/admin/admin_establishment.php @@ -124,7 +124,6 @@ if ($result) $i++; } - } else { diff --git a/htdocs/hrm/establishment/card.php b/htdocs/hrm/establishment/card.php index 56a6c20176a..d7f591da027 100644 --- a/htdocs/hrm/establishment/card.php +++ b/htdocs/hrm/establishment/card.php @@ -334,7 +334,6 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea if ($action == 'delete') { print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$id,$langs->trans("DeleteEstablishment"),$langs->trans("ConfirmDeleteEstablishment"),"confirm_delete"); - } diff --git a/htdocs/hrm/index.php b/htdocs/hrm/index.php index 6d1e16433cf..45d10d16d8b 100644 --- a/htdocs/hrm/index.php +++ b/htdocs/hrm/index.php @@ -236,7 +236,6 @@ if (! empty($conf->holiday->enabled) && $user->rights->holiday->read) $i++; } - } else { @@ -309,7 +308,6 @@ if (! empty($conf->deplacement->enabled) && $user->rights->deplacement->lire) $i++; } - } else { @@ -382,7 +380,6 @@ if (! empty($conf->expensereport->enabled) && $user->rights->expensereport->lire $i++; } - } else { diff --git a/htdocs/imports/import.php b/htdocs/imports/import.php index a9c1fc2317a..54aaa8a60a5 100644 --- a/htdocs/imports/import.php +++ b/htdocs/imports/import.php @@ -488,7 +488,6 @@ if ($step == 3 && $datatoimport) if ($action == 'delete') { print $form->formconfirm($_SERVER["PHP_SELF"].'?urlfile='.urlencode(GETPOST('urlfile')).'&step=3'.$param, $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', 0, 1); - } print '
'; @@ -662,7 +661,6 @@ if ($step == 4 && $datatoimport) header("Location: ".$_SERVER["PHP_SELF"].'?step=3'.$param.'&filetoimport='.urlencode($relativepath)); exit; } - } if (GETPOST('update')) { @@ -1162,7 +1160,6 @@ if ($step == 4 && $datatoimport) print ''; print ''; } - } @@ -1609,7 +1606,6 @@ if ($step == 5 && $datatoimport) print ''.$langs->trans("RunImportFile").''; } print ''; - } print ''; diff --git a/htdocs/install/check.php b/htdocs/install/check.php index f220978e4db..c2eb06bffb7 100644 --- a/htdocs/install/check.php +++ b/htdocs/install/check.php @@ -568,9 +568,7 @@ else print ''."\n"; print ''; } - } - } print ''; print ' '.$langs->trans("Link").''; - } print ''; diff --git a/htdocs/printing/admin/printing.php b/htdocs/printing/admin/printing.php index 529ad7e33ec..c4b2bb12111 100644 --- a/htdocs/printing/admin/printing.php +++ b/htdocs/printing/admin/printing.php @@ -313,7 +313,6 @@ if ($mode == 'test' && $user->admin) else { print $langs->trans('PleaseConfigureDriverfromList'); } - } else { print $langs->trans('PleaseSelectaDriverfromList'); } @@ -357,7 +356,6 @@ if ($mode == 'userconf' && $user->admin) print ''; dol_fiche_end(); - } // End of page diff --git a/htdocs/product/admin/price_rules.php b/htdocs/product/admin/price_rules.php index e0faaaf83e5..730a8fd31f2 100644 --- a/htdocs/product/admin/price_rules.php +++ b/htdocs/product/admin/price_rules.php @@ -92,7 +92,6 @@ if ($_POST) { setEventMessages($langs->trans('ErrorSavingChanges'), null, 'errors'); } } - } setEventMessages($langs->trans("RecordSaved"), null, 'mesgs'); diff --git a/htdocs/product/admin/product.php b/htdocs/product/admin/product.php index 2cdb5c1ca52..45f938431c3 100644 --- a/htdocs/product/admin/product.php +++ b/htdocs/product/admin/product.php @@ -127,7 +127,6 @@ if ($action == 'other') $res = dolibarr_set_const($db, $rule, 0, 'chaine', 0, '', $conf->entity); } } - } $value = GETPOST('PRODUIT_SOUSPRODUITS','alpha'); diff --git a/htdocs/product/admin/product_tools.php b/htdocs/product/admin/product_tools.php index a153e9f1ab6..b0c62c81d4f 100644 --- a/htdocs/product/admin/product_tools.php +++ b/htdocs/product/admin/product_tools.php @@ -267,7 +267,6 @@ if ($action == 'convert') { setEventMessages($langs->trans("Error"), null, 'errors'); } - } } diff --git a/htdocs/product/card.php b/htdocs/product/card.php index d51a4fa494c..31d2d7509c9 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -477,7 +477,6 @@ if (empty($reshook)) $action = 'edit'; } } - } } @@ -1943,7 +1942,6 @@ else dol_fiche_end(); } - } else if ($action != 'create') { diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 44222dc3c9e..805d5d214a2 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -2387,7 +2387,6 @@ class Product extends CommonObject $this->stats_commande['nb']+=$pFather->stats_commande['nb']; $this->stats_commande['rows']+=$pFather->stats_commande['rows']; $this->stats_commande['qty']+=$pFather->stats_commande['qty'] * $qtyCoef; - } } } @@ -3552,7 +3551,6 @@ class Product extends CommonObject dol_print_error($this->db); return -1; } - } else { return false; } @@ -4856,7 +4854,6 @@ class Product extends CommonObject } $this->db->free($result); - } else { diff --git a/htdocs/product/class/propalmergepdfproduct.class.php b/htdocs/product/class/propalmergepdfproduct.class.php index f2aabb86876..b5d2d639ae4 100644 --- a/htdocs/product/class/propalmergepdfproduct.class.php +++ b/htdocs/product/class/propalmergepdfproduct.class.php @@ -207,8 +207,6 @@ class Propalmergepdfproduct extends CommonObject $this->datec = $this->db->jdate($obj->datec); $this->tms = $this->db->jdate($obj->tms); $this->import_key = $obj->import_key; - - } $this->db->free($resql); @@ -283,11 +281,7 @@ class Propalmergepdfproduct extends CommonObject }else { $this->lines[$obj->file_name]=$line; } - - } - - } $this->db->free($resql); diff --git a/htdocs/product/composition/card.php b/htdocs/product/composition/card.php index 5f91a0e369e..d2ef4210e9c 100644 --- a/htdocs/product/composition/card.php +++ b/htdocs/product/composition/card.php @@ -407,7 +407,6 @@ if ($id > 0 || ! empty($ref)) { print ''; print ''; - } else{ print ''.$nb_of_subproduct.''; @@ -634,7 +633,6 @@ if ($id > 0 || ! empty($ref)) } $i++; } - } else { diff --git a/htdocs/product/document.php b/htdocs/product/document.php index 0b5b7fa6f16..d0bc7b3f9be 100644 --- a/htdocs/product/document.php +++ b/htdocs/product/document.php @@ -113,7 +113,6 @@ if (empty($reshook)) // Action submit/delete file/link include_once DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php'; - } if ($action=='filemerge') diff --git a/htdocs/product/index.php b/htdocs/product/index.php index 71cf2636661..2089193e208 100644 --- a/htdocs/product/index.php +++ b/htdocs/product/index.php @@ -152,7 +152,6 @@ if (! empty($conf->product->enabled)) $statProducts.= ''; $statProducts.= ''.$langs->trans("ProductsOnSellAndOnBuy").''.round($prodser[0][3]).''; $statProducts.= ""; - } if (! empty($conf->service->enabled)) { @@ -168,7 +167,6 @@ if (! empty($conf->service->enabled)) $statServices.= ''; $statServices.= ''.$langs->trans("ServicesOnSellAndOnBuy").''.round($prodser[1][3]).''; $statServices.= ""; - } $total=0; if ($type == '0') diff --git a/htdocs/product/inventory/class/inventory.class.php b/htdocs/product/inventory/class/inventory.class.php index 39df52a8208..1bc98d32d93 100644 --- a/htdocs/product/inventory/class/inventory.class.php +++ b/htdocs/product/inventory/class/inventory.class.php @@ -477,7 +477,6 @@ class Inventory extends CommonObject } $this->db->free($result); - } else { diff --git a/htdocs/product/inventory/tpl/inventory.tpl.php b/htdocs/product/inventory/tpl/inventory.tpl.php index 1946e63918d..30dc02a17d6 100644 --- a/htdocs/product/inventory/tpl/inventory.tpl.php +++ b/htdocs/product/inventory/tpl/inventory.tpl.php @@ -165,7 +165,6 @@ if (empty($conf) || ! is_object($conf)) global->PRODUIT_MULTIPRICES) || ! empty($conf->global->PRODUI else print vatrate($object->tva_tx . ($object->tva_npr ? '*' : ''), true);*/ print ''; } - } else { @@ -1410,7 +1409,6 @@ if ($action == 'edit_price' && $object->getRights()->creer) print '   '; print ''; print ''; - } } diff --git a/htdocs/product/reassort.php b/htdocs/product/reassort.php index 27ac0c4d522..662873b7cf8 100644 --- a/htdocs/product/reassort.php +++ b/htdocs/product/reassort.php @@ -317,7 +317,6 @@ if ($resql) foreach($warehouses_list as &$wh) { print_liste_field_titre($wh['label'], '', '','','','align="right"'); } - } } if ($virtualdiffersfromphysical) print_liste_field_titre("VirtualStock",$_SERVER["PHP_SELF"], "",$param,"",'align="right"',$sortfield,$sortorder); @@ -395,7 +394,6 @@ if ($resql) print ''; $db->free($resql); - } else { diff --git a/htdocs/product/reassortlot.php b/htdocs/product/reassortlot.php index 518a19d8407..24aa1864a02 100644 --- a/htdocs/product/reassortlot.php +++ b/htdocs/product/reassortlot.php @@ -421,7 +421,6 @@ if ($resql) print ''; $db->free($resql); - } else { diff --git a/htdocs/product/stock/card.php b/htdocs/product/stock/card.php index b24a37c4fe2..25e22faabcc 100644 --- a/htdocs/product/stock/card.php +++ b/htdocs/product/stock/card.php @@ -332,7 +332,6 @@ else print ''.$langs->trans("ParentWarehouse").''; print $e->getNomUrl(3); print ''; - } // Description @@ -567,7 +566,6 @@ else print ' '; print ' '; print ''; - } else { @@ -658,7 +656,6 @@ else print ''; print ''; - } } } diff --git a/htdocs/product/stock/class/entrepot.class.php b/htdocs/product/stock/class/entrepot.class.php index b2a78a9cd3e..3f298aed85d 100644 --- a/htdocs/product/stock/class/entrepot.class.php +++ b/htdocs/product/stock/class/entrepot.class.php @@ -416,11 +416,9 @@ class Entrepot extends CommonObject $this->date_creation = $this->db->jdate($obj->datec); $this->date_modification = $this->db->jdate($obj->datem); - } $this->db->free($result); - } else { diff --git a/htdocs/product/stock/class/mouvementstock.class.php b/htdocs/product/stock/class/mouvementstock.class.php index 395c192311f..7991477e146 100644 --- a/htdocs/product/stock/class/mouvementstock.class.php +++ b/htdocs/product/stock/class/mouvementstock.class.php @@ -469,7 +469,6 @@ class MouvementStock extends CommonObject { $fk_product_stock = $this->db->last_insert_id(MAIN_DB_PREFIX."product_stock"); } - } // Update detail stock for batch product diff --git a/htdocs/product/stock/class/productstockentrepot.class.php b/htdocs/product/stock/class/productstockentrepot.class.php index 740afcb5f04..aaae328de48 100644 --- a/htdocs/product/stock/class/productstockentrepot.class.php +++ b/htdocs/product/stock/class/productstockentrepot.class.php @@ -202,8 +202,6 @@ class ProductStockEntrepot extends CommonObject $this->seuil_stock_alerte = $obj->seuil_stock_alerte; $this->desiredstock = $obj->desiredstock; $this->import_key = $obj->import_key; - - } // Retreive all extrafield diff --git a/htdocs/product/stock/index.php b/htdocs/product/stock/index.php index 20054d8896b..c85f40ef9c2 100644 --- a/htdocs/product/stock/index.php +++ b/htdocs/product/stock/index.php @@ -97,7 +97,6 @@ if ($result) $i++; } $db->free($result); - } print ""; } diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php index 07b4f5dcac3..beb3135d9f4 100644 --- a/htdocs/product/stock/product.php +++ b/htdocs/product/stock/product.php @@ -88,7 +88,6 @@ $extralabels=$extrafields->fetch_name_optionals_label($object->table_element); if ($id > 0 || ! empty($ref)) { $result = $object->fetch($id, $ref); - } if(empty($id) && !empty($object->id)) $id = $object->id; @@ -144,7 +143,6 @@ if ($action == 'addlimitstockwarehouse' && !empty($user->rights->produit->creer) $pse->seuil_stock_alerte = $seuil_stock_alerte; $pse->desiredstock = $desiredstock; if($pse->update($user) > 0) setEventMessages($langs->trans('ProductStockWarehouseUpdated'), null, 'mesgs'); - } else { // Create @@ -153,14 +151,11 @@ if ($action == 'addlimitstockwarehouse' && !empty($user->rights->produit->creer) $pse->seuil_stock_alerte = GETPOST('seuil_stock_alerte'); $pse->desiredstock = GETPOST('desiredstock'); if($pse->create($user) > 0) setEventMessages($langs->trans('ProductStockWarehouseCreated'), null, 'mesgs'); - } - } header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id); exit; - } if($action == 'delete_productstockwarehouse' && !empty($user->rights->produit->creer)) @@ -171,7 +166,6 @@ if($action == 'delete_productstockwarehouse' && !empty($user->rights->produit->c if($pse->delete($user) > 0) setEventMessages($langs->trans('ProductStockWarehouseDeleted'), null, 'mesgs'); $action = ''; - } // Set stock limit @@ -799,7 +793,6 @@ if (empty($reshook)) print ''; } - } @@ -927,7 +920,6 @@ if (! $variants) { } } $i++; - } } else dol_print_error($db); diff --git a/htdocs/product/stock/productlot_card.php b/htdocs/product/stock/productlot_card.php index 5ee52ce337a..f72a28dbc90 100644 --- a/htdocs/product/stock/productlot_card.php +++ b/htdocs/product/stock/productlot_card.php @@ -256,7 +256,6 @@ if (empty($reshook)) $upload_dir = $conf->productbatch->multidir_output[$conf->entity]; $permissioncreate = $usercancreate; include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php'; - } @@ -414,7 +413,6 @@ if (empty($action)) $somethingshown=$formfile->numoffiles; print ''; - } // End of page diff --git a/htdocs/product/stock/productlot_document.php b/htdocs/product/stock/productlot_document.php index 6a3925c4a55..1ce4f9ba224 100644 --- a/htdocs/product/stock/productlot_document.php +++ b/htdocs/product/stock/productlot_document.php @@ -95,7 +95,6 @@ if (empty($reshook)) // Action submit/delete file/link include_once DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php'; - } $permtoedit = $user->rights->produit->creer; @@ -156,8 +155,6 @@ if ($object->id) $permission = ( $user->rights->produit->creer ); $param = '&id=' . $object->id; include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_post_headers.tpl.php'; - - } else { diff --git a/htdocs/product/stock/valo.php b/htdocs/product/stock/valo.php index 4e3a245060c..09524c5066a 100644 --- a/htdocs/product/stock/valo.php +++ b/htdocs/product/stock/valo.php @@ -128,7 +128,6 @@ if ($result) print ''.price(price2num($totalsell,'MT'),1,$langs,0,0,-1,$conf->currency).''; print ' '; print "\n"; - } $db->free($result); @@ -150,7 +149,6 @@ if ($result) $url=DOL_URL_ROOT.'/viewimage.php?modulepart=graph_stock&file='.$file; print '
'; } - } else { diff --git a/htdocs/product/traduction.php b/htdocs/product/traduction.php index 4c344786553..9f18f644e4c 100644 --- a/htdocs/product/traduction.php +++ b/htdocs/product/traduction.php @@ -276,7 +276,6 @@ if ($action == 'edit') print ''; print ''; - } else if ($action != 'add') { diff --git a/htdocs/projet/activity/index.php b/htdocs/projet/activity/index.php index 2ed1bb1498f..e43700287cb 100644 --- a/htdocs/projet/activity/index.php +++ b/htdocs/projet/activity/index.php @@ -325,7 +325,6 @@ if (! empty($conf->global->PROJECT_TASK_TIME_MONTH)) print ''; print ''.convertSecondToTime($row->nb, 'allhourmin').''; print "\n"; - } $db->free($resql); } @@ -376,7 +375,6 @@ if (! empty($conf->global->PROJECT_TASK_TIME_YEAR)) print ''; print ''.convertSecondToTime($row->nb, 'allhourmin').''; print "\n"; - } $db->free($resql); } @@ -570,7 +568,6 @@ if (empty($conf->global->PROJECT_HIDE_TASKS) && ! empty($conf->global->PROJECT_S { dol_print_error($db); } - } diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index e2632fe244e..7aaa6805189 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -333,7 +333,6 @@ if (empty($reshook)) if (GETPOST('socid','int') > 0) $object->fetch_thirdparty(GETPOST('socid','int')); else unset($object->thirdparty); } - } // Build doc diff --git a/htdocs/projet/class/api_projects.class.php b/htdocs/projet/class/api_projects.class.php index 6deacab7204..a1f2ce6d26c 100644 --- a/htdocs/projet/class/api_projects.class.php +++ b/htdocs/projet/class/api_projects.class.php @@ -598,7 +598,6 @@ class Projects extends DolibarrApi if (!isset($data[$field])) throw new RestException(400, "$field field missing"); $object[$field] = $data[$field]; - } return $object; } diff --git a/htdocs/projet/class/api_tasks.class.php b/htdocs/projet/class/api_tasks.class.php index 294c0f0faae..050e7313e95 100644 --- a/htdocs/projet/class/api_tasks.class.php +++ b/htdocs/projet/class/api_tasks.class.php @@ -610,7 +610,6 @@ class Tasks extends DolibarrApi if (!isset($data[$field])) throw new RestException(400, "$field field missing"); $object[$field] = $data[$field]; - } return $object; } diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index eaf1ad6ea67..ab47079c9d0 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -1501,7 +1501,6 @@ class Project extends CommonObject $tab_conv_child_parent[$tasktoclone->id] = $new_task_id; } } - } //Parse all clone node to be sure to update new parent @@ -1959,7 +1958,6 @@ class Project extends CommonObject } $this->db->free($result); - } else { diff --git a/htdocs/projet/class/projectstats.class.php b/htdocs/projet/class/projectstats.class.php index 472fb26eaf0..9766935d4d0 100644 --- a/htdocs/projet/class/projectstats.class.php +++ b/htdocs/projet/class/projectstats.class.php @@ -498,7 +498,6 @@ class ProjectStats extends Stats } else { $res[$key]=array($total_row[0],0); } - } // var_dump($res);print '
'; return $res; diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index a4ef7965851..c5a7a334eb0 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -1568,7 +1568,6 @@ class Task extends CommonObject { $clone_task->date_end = $now + $clone_task->date_end - $orign_project_dt_start; } - } if (!$clone_prog) diff --git a/htdocs/projet/document.php b/htdocs/projet/document.php index e585acd7d85..af9f7c2d8fc 100644 --- a/htdocs/projet/document.php +++ b/htdocs/projet/document.php @@ -152,7 +152,6 @@ if ($object->id > 0) $permission = ($userWrite > 0); $permtoedit = ($userWrite > 0); include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_post_headers.tpl.php'; - } else { diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index 489c5d04be4..2c64826853c 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -489,7 +489,6 @@ $resHook = $hookmanager->executeHooks('completeListOfReferent', $parameters, $ob if(!empty($hookmanager->resArray)) { $listofreferent = array_merge($listofreferent, $hookmanager->resArray); - } if ($action=="addelement") diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php index a93fac0edbd..5a13b16560d 100644 --- a/htdocs/projet/list.php +++ b/htdocs/projet/list.php @@ -888,7 +888,6 @@ while ($i < min($num,$limit)) if (! $i) $totalarray['nbfield']++; print "\n"; - } $i++; diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php index bffe5f4a373..d9fcc8b642a 100644 --- a/htdocs/projet/tasks.php +++ b/htdocs/projet/tasks.php @@ -524,7 +524,6 @@ if ($action == 'create' && $user->rights->projet->creer && (empty($object->third print ''; print ''; - } else if ($id > 0 || ! empty($ref)) { diff --git a/htdocs/projet/tasks/comment.php b/htdocs/projet/tasks/comment.php index 19ba461fbe4..ba54b35a59e 100644 --- a/htdocs/projet/tasks/comment.php +++ b/htdocs/projet/tasks/comment.php @@ -275,7 +275,6 @@ if ($id > 0 || ! empty($ref)) // Include comment tpl view include DOL_DOCUMENT_ROOT . '/core/tpl/bloc_comment.tpl.php'; - } } diff --git a/htdocs/projet/tasks/contact.php b/htdocs/projet/tasks/contact.php index 3272c43ad10..d86c8b469ae 100644 --- a/htdocs/projet/tasks/contact.php +++ b/htdocs/projet/tasks/contact.php @@ -518,7 +518,6 @@ if ($id > 0 || ! empty($ref)) } } print ""; - } else { diff --git a/htdocs/public/cron/cron_run_jobs.php b/htdocs/public/cron/cron_run_jobs.php index 320a8e3895a..df207e87d85 100644 --- a/htdocs/public/cron/cron_run_jobs.php +++ b/htdocs/public/cron/cron_run_jobs.php @@ -169,7 +169,6 @@ if (is_array($qualifiedjobs) && (count($qualifiedjobs)>0)) dol_syslog("cron_run_jobs.php::reprogram_jobs Error".$cronjob->error, LOG_ERR); exit; } - } } echo "Result: ".($nbofjobs)." jobs - ".($nbofjobslaunchedok+$nbofjobslaunchedko)." launched = ".$nbofjobslaunchedok." OK + ".$nbofjobslaunchedko." KO"; diff --git a/htdocs/public/donations/donateurs_code.php b/htdocs/public/donations/donateurs_code.php index 9f03f9e293e..86db4b089aa 100644 --- a/htdocs/public/donations/donateurs_code.php +++ b/htdocs/public/donations/donateurs_code.php @@ -99,7 +99,6 @@ if ($resql) $i++; } print ""; - } else { diff --git a/htdocs/public/emailing/mailing-read.php b/htdocs/public/emailing/mailing-read.php index 23511974137..0b79f656450 100644 --- a/htdocs/public/emailing/mailing-read.php +++ b/htdocs/public/emailing/mailing-read.php @@ -86,7 +86,6 @@ if (! empty($tag)) dol_syslog("public/emailing/mailing-read.php : Mail read contact : ".$sql, LOG_DEBUG); $resql=$db->query($sql); - } $db->close(); diff --git a/htdocs/public/members/public_card.php b/htdocs/public/members/public_card.php index eda1aaf2c68..bc8fd0cde17 100644 --- a/htdocs/public/members/public_card.php +++ b/htdocs/public/members/public_card.php @@ -113,7 +113,6 @@ if ($id > 0) print ''; } - } diff --git a/htdocs/public/onlinesign/newonlinesign.php b/htdocs/public/onlinesign/newonlinesign.php index e8db916ad91..277cd1ada78 100644 --- a/htdocs/public/onlinesign/newonlinesign.php +++ b/htdocs/public/onlinesign/newonlinesign.php @@ -120,7 +120,6 @@ $creditor = $mysoc->name; if ($action == 'dosign') { // TODO - } @@ -256,8 +255,6 @@ if ($source == 'proposal') print ''; print ''; print ''."\n"; - - } diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index 47cdc8bb31e..0975186eb03 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -620,7 +620,6 @@ if ($action == 'charge' && ! empty($conf->stripe->enabled)) header("Location: ".$urlok); exit; } - } diff --git a/htdocs/public/stripe/ipn.php b/htdocs/public/stripe/ipn.php index e1b160541b2..45fd6489f92 100644 --- a/htdocs/public/stripe/ipn.php +++ b/htdocs/public/stripe/ipn.php @@ -234,28 +234,23 @@ elseif ($event->type == 'payout.paid') { elseif ($event->type == 'charge.succeeded') { //TODO: create fees - } elseif ($event->type == 'customer.source.created') { //TODO: save customer's source - } elseif ($event->type == 'customer.source.updated') { //TODO: update customer's source - } elseif ($event->type == 'customer.source.delete') { //TODO: delete customer's source - } elseif ($event->type == 'charge.failed') { $subject = 'Your payment has been received: '.$event->data->object->id.''; $headers = 'From: "'.$conf->global->MAIN_INFO_SOCIETE_MAIL.'" <'.$conf->global->MAIN_INFO_SOCIETE_MAIL.'>'; - } elseif (($event->type == 'source.chargeable') && ($event->data->object->type == 'three_d_secure') && ($event->data->object->three_d_secure->authenticated==true)) { diff --git a/htdocs/resource/card.php b/htdocs/resource/card.php index 5ba98ae9f69..49cad87e990 100644 --- a/htdocs/resource/card.php +++ b/htdocs/resource/card.php @@ -171,7 +171,6 @@ if (empty($reshook)) setEventMessages($object->error, $object->errors, 'errors'); $error++; } - } else { diff --git a/htdocs/resource/class/dolresource.class.php b/htdocs/resource/class/dolresource.class.php index c6e25c4d837..ad3355e3972 100644 --- a/htdocs/resource/class/dolresource.class.php +++ b/htdocs/resource/class/dolresource.class.php @@ -384,7 +384,6 @@ class Dolresource extends CommonObject if($obj->element_id && $obj->element_type) { $this->objelement = fetchObjectByElement($obj->element_id,$obj->element_type); } - } $this->db->free($resql); @@ -646,7 +645,6 @@ class Dolresource extends CommonObject if($obj->element_id && $obj->element_type) $line->objelement = fetchObjectByElement($obj->element_id,$obj->element_type); $this->lines[] = $line; - } $this->db->free($resql); } diff --git a/htdocs/resource/document.php b/htdocs/resource/document.php index 6a32ba9f645..85ec5b96c79 100644 --- a/htdocs/resource/document.php +++ b/htdocs/resource/document.php @@ -135,7 +135,6 @@ if ($object->id) $permission = $user->rights->resource->write; include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_post_headers.tpl.php'; - } else { diff --git a/htdocs/resource/element_resource.php b/htdocs/resource/element_resource.php index adbd8eec87f..a83e37bc0b4 100644 --- a/htdocs/resource/element_resource.php +++ b/htdocs/resource/element_resource.php @@ -462,7 +462,6 @@ else if(file_exists(dol_buildpath($path.'/core/tpl/resource_'.$element_prop['element'].'_view.tpl.php'))) { $res=@include dol_buildpath($path.'/core/tpl/resource_'.$element_prop['element'].'_view.tpl.php'); - } else { diff --git a/htdocs/societe/admin/societe.php b/htdocs/societe/admin/societe.php index 49a9538e225..0166b6a233a 100644 --- a/htdocs/societe/admin/societe.php +++ b/htdocs/societe/admin/societe.php @@ -788,7 +788,6 @@ if (!empty($conf->global->SOCIETE_ADD_REF_IN_LIST)) { print ''; print img_picto($langs->trans("Activated"),'switch_on'); - } else { @@ -806,7 +805,6 @@ if (!empty($conf->global->COMPANY_SHOW_ADDRESS_SELECTLIST)) { print ''; print img_picto($langs->trans("Activated"),'switch_on'); - } else { @@ -826,7 +824,6 @@ if (!empty($conf->global->SOCIETE_ASK_FOR_SHIPPING_METHOD)) { print ''; print img_picto($langs->trans("Activated"),'switch_on'); - } else { @@ -845,7 +842,6 @@ if (!empty($conf->global->SOCIETE_DISABLE_PROSPECTSCUSTOMERS)) { print ''; print img_picto($langs->trans("Activated"),'switch_on'); - } else { diff --git a/htdocs/societe/canvas/actions_card_common.class.php b/htdocs/societe/canvas/actions_card_common.class.php index 2577f5bed5d..92d009db604 100644 --- a/htdocs/societe/canvas/actions_card_common.class.php +++ b/htdocs/societe/canvas/actions_card_common.class.php @@ -258,7 +258,6 @@ abstract class ActionsCardCommon $this->tpl['localtax'].= ''; } } - } else { diff --git a/htdocs/societe/canvas/company/actions_card_company.class.php b/htdocs/societe/canvas/company/actions_card_company.class.php index 3e18b7944f2..09172f1ea5a 100644 --- a/htdocs/societe/canvas/company/actions_card_company.class.php +++ b/htdocs/societe/canvas/company/actions_card_company.class.php @@ -181,7 +181,6 @@ class ActionsCardCompany extends ActionsCardCommon { $this->tpl['tva_intra'] = $s; } - } else { diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 1fbabc01462..e20e37e5cdc 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -371,7 +371,6 @@ if (empty($reshook)) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Supplier")), null, 'errors'); $error++; - } if (! $error) @@ -1377,7 +1376,6 @@ else print ''.$langs->transcountry("LocalTax2IsUsed",$mysoc->country_code).''; print $form->selectyesno('localtax2assuj_value',(isset($conf->global->THIRDPARTY_DEFAULT_USELOCALTAX2)?$conf->global->THIRDPARTY_DEFAULT_USELOCALTAX2:0),1); print ''; - } elseif($mysoc->localtax1_assuj=="1") { @@ -1973,7 +1971,6 @@ else print ''; } print ''; - } elseif($mysoc->localtax1_assuj=="1" && $mysoc->localtax2_assuj!="1") { @@ -1986,7 +1983,6 @@ else print ''; } print ''; - } elseif($mysoc->localtax2_assuj=="1" && $mysoc->localtax1_assuj!="1") { @@ -2380,7 +2376,6 @@ else print ''.$object->localtax1_value.''; } print ''; - } } elseif($mysoc->localtax2_assuj=="1" && $mysoc->localtax1_assuj!="1") @@ -2403,7 +2398,6 @@ else print ''.$object->localtax2_value.''; } print ''; - } } } @@ -2729,7 +2723,6 @@ else $trackid = 'thi'.$object->id; include DOL_DOCUMENT_ROOT.'/core/tpl/card_presend.tpl.php'; - } } diff --git a/htdocs/societe/class/address.class.php b/htdocs/societe/class/address.class.php index 63b23d42f9e..4f9915a844c 100644 --- a/htdocs/societe/class/address.class.php +++ b/htdocs/societe/class/address.class.php @@ -138,7 +138,6 @@ class Address $this->db->rollback(); return -2; } - } else { @@ -496,7 +495,6 @@ class Address } $this->db->free($result); - } else { diff --git a/htdocs/societe/class/api_thirdparties.class.php b/htdocs/societe/class/api_thirdparties.class.php index 365073726bc..42d1d616852 100644 --- a/htdocs/societe/class/api_thirdparties.class.php +++ b/htdocs/societe/class/api_thirdparties.class.php @@ -1070,7 +1070,6 @@ class Thirdparties extends DolibarrApi foreach($account as $key => $value) if(in_array($key, $fields)){ $object[$key] = $value; - } $returnAccounts[] = $object; } @@ -1332,7 +1331,6 @@ class Thirdparties extends DolibarrApi foreach($account as $key => $value) if(in_array($key, $fields)){ $object[$key] = $value; - } $returnAccounts[] = $object; } diff --git a/htdocs/societe/class/companybankaccount.class.php b/htdocs/societe/class/companybankaccount.class.php index 3a3b9126b7b..73210ade104 100644 --- a/htdocs/societe/class/companybankaccount.class.php +++ b/htdocs/societe/class/companybankaccount.class.php @@ -184,7 +184,6 @@ class CompanyBankAccount extends Account { return 1; } - } else { diff --git a/htdocs/societe/class/companypaymentmode.class.php b/htdocs/societe/class/companypaymentmode.class.php index 83303a3a41d..73242c9aa32 100644 --- a/htdocs/societe/class/companypaymentmode.class.php +++ b/htdocs/societe/class/companypaymentmode.class.php @@ -561,7 +561,6 @@ class CompanyPaymentMode extends CommonObject } $this->db->free($result); - } else { diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index c91593b079f..758b91aaec9 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -611,7 +611,6 @@ class Societe extends CommonObject $this->db->rollback(); return $result; } - } else { @@ -1001,7 +1000,6 @@ class Societe extends CommonObject $sql .=",localtax1_value =".$this->localtax1_value; } else $sql .=",localtax1_value =0.000"; - } else $sql .=",localtax1_value =0.000"; @@ -1012,7 +1010,6 @@ class Societe extends CommonObject $sql .=",localtax2_value =".$this->localtax2_value; } else $sql .=",localtax2_value =0.000"; - } else $sql .=",localtax2_value =0.000"; @@ -3177,7 +3174,6 @@ class Societe extends CommonObject } $this->db->free($result); - } else { diff --git a/htdocs/societe/class/societeaccount.class.php b/htdocs/societe/class/societeaccount.class.php index de228c576b5..78f934ecf2f 100644 --- a/htdocs/societe/class/societeaccount.class.php +++ b/htdocs/societe/class/societeaccount.class.php @@ -518,7 +518,6 @@ class SocieteAccount extends CommonObject } $this->db->free($result); - } else { diff --git a/htdocs/societe/consumption.php b/htdocs/societe/consumption.php index b74b66a1a44..3a3fb8507c9 100644 --- a/htdocs/societe/consumption.php +++ b/htdocs/societe/consumption.php @@ -554,7 +554,6 @@ if ($sql_select) { print (! empty($objp->description) && $objp->description!=$objp->product_label)?'
'.dol_htmlentitiesbr($objp->description):''; } - } else { if (! empty($objp->label) || ! empty($objp->description)) diff --git a/htdocs/societe/price.php b/htdocs/societe/price.php index 0fbc4368a87..a9b280a3f47 100644 --- a/htdocs/societe/price.php +++ b/htdocs/societe/price.php @@ -609,7 +609,6 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { print ""; print ""; - } } diff --git a/htdocs/stripe/charge.php b/htdocs/stripe/charge.php index 0f26bf0e11a..73c1f7b86c8 100644 --- a/htdocs/stripe/charge.php +++ b/htdocs/stripe/charge.php @@ -221,7 +221,6 @@ if (!$rowid) } elseif ($charge->paid=='1'){ print img_picto($langs->trans("".$charge->status.""),'statut4'); - } else { $label="Message: ".$charge->failure_message."
"; $label.="Réseau: ".$charge->outcome->network_status."
"; diff --git a/htdocs/stripe/class/actions_stripe.class.php b/htdocs/stripe/class/actions_stripe.class.php index f3c76be9d35..a74b2d52eef 100644 --- a/htdocs/stripe/class/actions_stripe.class.php +++ b/htdocs/stripe/class/actions_stripe.class.php @@ -109,7 +109,6 @@ class ActionsStripeconnect $this->resprints.= $langs->trans("NoStripe"); } $this->resprints.= ''; - } elseif (is_object($object) && $object->element == 'member'){ $this->resprints.= ''; diff --git a/htdocs/stripe/class/stripe.class.php b/htdocs/stripe/class/stripe.class.php index 0e9c3cbb4a8..d8e7168e5c0 100644 --- a/htdocs/stripe/class/stripe.class.php +++ b/htdocs/stripe/class/stripe.class.php @@ -284,7 +284,6 @@ class Stripe extends CommonObject $this->error = $e->getMessage(); dol_syslog($this->error, LOG_WARNING); } - } elseif ($createifnotlinkedtostripe) { diff --git a/htdocs/stripe/payment.php b/htdocs/stripe/payment.php index fbf9784a6b3..9a7ecfd5470 100644 --- a/htdocs/stripe/payment.php +++ b/htdocs/stripe/payment.php @@ -350,7 +350,6 @@ if (empty($reshook)) $facture->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref); } - } if (! $error) diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php index 2f765c6c75f..248165727cf 100644 --- a/htdocs/supplier_proposal/card.php +++ b/htdocs/supplier_proposal/card.php @@ -1303,7 +1303,6 @@ if ($action == 'create') print ''; } - } else { /* * Show object in view mode diff --git a/htdocs/supplier_proposal/class/api_supplier_proposals.class.php b/htdocs/supplier_proposal/class/api_supplier_proposals.class.php index 3d10c47f6a1..fd490902049 100644 --- a/htdocs/supplier_proposal/class/api_supplier_proposals.class.php +++ b/htdocs/supplier_proposal/class/api_supplier_proposals.class.php @@ -185,7 +185,6 @@ class Supplierproposals extends DolibarrApi if (!isset($data[$field])) throw new RestException(400, "$field field missing"); $propal[$field] = $data[$field]; - } return $propal; } diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php index adc2c8643ac..a05d0485aaf 100644 --- a/htdocs/supplier_proposal/class/supplier_proposal.class.php +++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php @@ -1730,7 +1730,6 @@ class SupplierProposal extends CommonObject { $result = $this->updateOrCreatePriceFournisseur($user); } - } if ($statut == 4) { @@ -2138,11 +2137,8 @@ class SupplierProposal extends CommonObject $cluser->fetch($obj->fk_user_cloture); $this->user_cloture = $cluser; } - - } $this->db->free($result); - } else { diff --git a/htdocs/supplier_proposal/contact.php b/htdocs/supplier_proposal/contact.php index 7be0dcbc78a..881fae4d1a7 100644 --- a/htdocs/supplier_proposal/contact.php +++ b/htdocs/supplier_proposal/contact.php @@ -193,7 +193,6 @@ if ($id > 0 || ! empty($ref)) // Contacts lines include DOL_DOCUMENT_ROOT.'/core/tpl/contacts.tpl.php'; - } else { diff --git a/htdocs/ticket/list.php b/htdocs/ticket/list.php index b1fb2d31cef..1b43d0054b7 100644 --- a/htdocs/ticket/list.php +++ b/htdocs/ticket/list.php @@ -409,7 +409,6 @@ if ($projectid > 0) { dol_fiche_end(); $object = $savobject; - } else { print "ErrorRecordNotFound"; } diff --git a/htdocs/user/card.php b/htdocs/user/card.php index 6a8e0d4f14a..a87438eda95 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -696,7 +696,6 @@ if ($action == 'create' || $action == 'adduserldap') } $liste[$key] = $label; } - } else { @@ -2593,7 +2592,6 @@ else if (! empty($conf->ldap->enabled) && ! empty($object->ldap_sid)) $ldap->close(); } - } if (! empty($conf->api->enabled) && ! empty($conf->use_javascript_ajax)) diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index d2afacce54a..d1a8cae636b 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -870,7 +870,6 @@ class User extends CommonObject // if we have already define a subperm like this $this->rights->$module->level1->level2 with llx_user_rights, we don't want override level1 because the level2 can be not define on user group if (!is_object($this->rights->$module->$perms)) $this->rights->$module->$perms = 1; } - } $i++; } @@ -2671,7 +2670,6 @@ class User extends CommonObject } $this->db->free($result); - } else { diff --git a/htdocs/user/clicktodial.php b/htdocs/user/clicktodial.php index 6719d6ca120..918d8c394ca 100644 --- a/htdocs/user/clicktodial.php +++ b/htdocs/user/clicktodial.php @@ -213,7 +213,6 @@ if ($id > 0) } print "\n"; - } // End of page diff --git a/htdocs/user/param_ihm.php b/htdocs/user/param_ihm.php index 521b0e4022e..e0e6935bc48 100644 --- a/htdocs/user/param_ihm.php +++ b/htdocs/user/param_ihm.php @@ -316,7 +316,6 @@ if ($action == 'edit') print '     '; print ''; print ''; - } else { @@ -403,7 +402,6 @@ else } print ''; - } if ($action == 'edit') diff --git a/htdocs/variants/admin/admin.php b/htdocs/variants/admin/admin.php index 0110d9db789..43700b281c7 100644 --- a/htdocs/variants/admin/admin.php +++ b/htdocs/variants/admin/admin.php @@ -41,7 +41,6 @@ if ($_POST) { } else { setEventMessages($langs->trans('CoreErrorMessage'), null, 'errors'); } - } $title = $langs->trans('ModuleSetup').' '.$langs->trans('ProductAttributes'); diff --git a/htdocs/variants/card.php b/htdocs/variants/card.php index 8cb4e13b33e..1f04e5edb87 100644 --- a/htdocs/variants/card.php +++ b/htdocs/variants/card.php @@ -88,7 +88,6 @@ if ($_POST) { header('Location: '.dol_buildpath('/variants/card.php?id='.$object->id, 2)); exit(); } - } if ($confirm == 'yes') { diff --git a/htdocs/variants/class/ProductCombination.class.php b/htdocs/variants/class/ProductCombination.class.php index a0aed832eac..ef9ec4997f3 100644 --- a/htdocs/variants/class/ProductCombination.class.php +++ b/htdocs/variants/class/ProductCombination.class.php @@ -736,7 +736,6 @@ WHERE c.fk_product_parent = ".(int) $productid." AND p.tosell = 1"; } $i++; } - } return $label; } diff --git a/htdocs/variants/combinations.php b/htdocs/variants/combinations.php index fb23921be25..79076e8ac50 100644 --- a/htdocs/variants/combinations.php +++ b/htdocs/variants/combinations.php @@ -210,12 +210,10 @@ if ($_POST) { } else { setEventMessages($langs->trans('CoreErrorMessage'), null, 'errors'); } - } else { $db->commit(); setEventMessages($langs->trans('RecordSaved'), null, 'mesgs'); } - } elseif ($valueid > 0) { @@ -286,11 +284,9 @@ if ($action === 'confirm_deletecombination') { setEventMessages($langs->trans('ErrorCopyProductCombinations'), null, 'errors'); } } - } else { setEventMessages($langs->trans('ErrorDestinationProductNotFound'), null, 'errors'); } - } diff --git a/htdocs/variants/generator.php b/htdocs/variants/generator.php index afed5c98b16..420c90147ea 100644 --- a/htdocs/variants/generator.php +++ b/htdocs/variants/generator.php @@ -123,7 +123,6 @@ if ($_POST) { } $db->rollback(); - } else { setEventMessages($langs->trans('ErrorFieldsRequired'), null, 'errors'); } diff --git a/htdocs/webservices/server_actioncomm.php b/htdocs/webservices/server_actioncomm.php index 6a581b2ca0d..a9edcb0557a 100644 --- a/htdocs/webservices/server_actioncomm.php +++ b/htdocs/webservices/server_actioncomm.php @@ -378,7 +378,6 @@ function getListActionCommType($authentication) $objectresp = array( 'result'=>array('result_code'=>'OK', 'result_label'=>''), 'actioncommtypes'=>$resultarray); - } else { diff --git a/htdocs/webservices/server_category.php b/htdocs/webservices/server_category.php index 685579c6674..a941c2aceff 100644 --- a/htdocs/webservices/server_category.php +++ b/htdocs/webservices/server_category.php @@ -250,9 +250,7 @@ function getCategory($authentication,$id) 'dir' => $pdir, 'photos' => $fille->liste_photos($dir,$nbmax=10) ); - } - } // Create diff --git a/htdocs/webservices/server_invoice.php b/htdocs/webservices/server_invoice.php index aed031fa9ca..03931701659 100644 --- a/htdocs/webservices/server_invoice.php +++ b/htdocs/webservices/server_invoice.php @@ -635,7 +635,6 @@ function createInvoice($authentication,$invoice) $errorlabel=$new_invoice->error; dol_syslog("Function: createInvoice error while creating".$errorlabel); } - } if ($error) @@ -707,7 +706,6 @@ function createInvoiceFromOrder($authentication,$id_order='', $ref_order='', $re $error++; dol_syslog("Webservice server_invoice:: invoice creation from order failed", LOG_ERR); } - } } else diff --git a/htdocs/webservices/server_order.php b/htdocs/webservices/server_order.php index 8cbe54e0b29..d41b2880210 100644 --- a/htdocs/webservices/server_order.php +++ b/htdocs/webservices/server_order.php @@ -749,7 +749,6 @@ function createOrder($authentication,$order) { dol_syslog("Webservice server_order:: order creation failed", LOG_ERR); $error++; - } if ($order['status'] == 1) // We want order to have status validated @@ -777,7 +776,6 @@ function createOrder($authentication,$order) $errorcode='KO'; $errorlabel=$newobject->error; } - } if ($error) @@ -831,7 +829,6 @@ function validOrder($authentication,$id='',$id_warehouse=0) // Define output language $outputlangs = $langs; $order->generateDocument($order->modelpdf, $outputlangs); - } else { @@ -848,7 +845,6 @@ function validOrder($authentication,$id='',$id_warehouse=0) $errorcode='KO'; $errorlabel=$newobject->error; } - } else { @@ -857,7 +853,6 @@ function validOrder($authentication,$id='',$id_warehouse=0) $errorcode='KO'; $errorlabel=$newobject->error; } - } if ($error) @@ -926,7 +921,6 @@ function updateOrder($authentication,$order) // Define output language $outputlangs = $langs; $object->generateDocument($order->modelpdf, $outputlangs); - } } if ($order['status'] == 0) $result=$object->set_reopen($fuser); diff --git a/htdocs/webservices/server_productorservice.php b/htdocs/webservices/server_productorservice.php index 2154d2d8557..1e301350063 100644 --- a/htdocs/webservices/server_productorservice.php +++ b/htdocs/webservices/server_productorservice.php @@ -617,7 +617,6 @@ function createProductOrService($authentication,$product) $errorcode='KO'; $errorlabel=$newobject->error; } - } if ($error) @@ -806,7 +805,6 @@ function updateProductOrService($authentication,$product) $errorcode='KO'; $errorlabel=$newobject->error; } - } if ($error) @@ -1105,7 +1103,6 @@ function getProductsForCategory($authentication,$id,$lang='') $iProduct++; } - } // Retour @@ -1113,14 +1110,12 @@ function getProductsForCategory($authentication,$id,$lang='') 'result'=>array('result_code'=>'OK', 'result_label'=>''), 'products'=> $products ); - } else { $errorcode='NORECORDS_FOR_ASSOCIATION'; $errorlabel='No products associated'.$sql; $objectresp = array('result'=>array('result_code' => $errorcode, 'result_label' => $errorlabel)); dol_syslog("getProductsForCategory:: ".$c->error, LOG_DEBUG); - } } else diff --git a/htdocs/webservices/server_thirdparty.php b/htdocs/webservices/server_thirdparty.php index c2236368d18..7f0b590ee9a 100644 --- a/htdocs/webservices/server_thirdparty.php +++ b/htdocs/webservices/server_thirdparty.php @@ -816,7 +816,6 @@ function deleteThirdParty($authentication,$id='',$ref='',$ref_ext='') { $error++; $errorcode='NOT_FOUND'; $errorlabel='Object not found for id='.$id.' nor ref='.$ref.' nor ref_ext='.$ref_ext; - } } else diff --git a/htdocs/webservices/server_user.php b/htdocs/webservices/server_user.php index ab2d18427ff..81702c55456 100644 --- a/htdocs/webservices/server_user.php +++ b/htdocs/webservices/server_user.php @@ -733,7 +733,6 @@ function setUserPassword($authentication,$shortuser) $error++; $errorcode='NOT_FOUND'; $errorlabel='User not found'; } - } else { diff --git a/htdocs/website/index.php b/htdocs/website/index.php index f2bf4ad1888..4f969851ad4 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -1543,7 +1543,6 @@ if ($action == 'importsiteconfirm') } } } - } } @@ -2659,7 +2658,6 @@ if ($action == 'editfile' || $action == 'file_manager') include DOL_DOCUMENT_ROOT.'/core/tpl/filemanager.tpl.php'; print ''; - } if ($action == 'editmenu') diff --git a/scripts/cron/cron_run_jobs.php b/scripts/cron/cron_run_jobs.php index 8ffefa0ca9a..6104cec3b55 100755 --- a/scripts/cron/cron_run_jobs.php +++ b/scripts/cron/cron_run_jobs.php @@ -223,7 +223,6 @@ if (is_array($qualifiedjobs) && (count($qualifiedjobs)>0)) dol_syslog("cron_run_jobs.php::reprogram_jobs Error ".$cronjob->error, LOG_ERR); exit(-1); } - } else { diff --git a/scripts/emailings/mailing-send.php b/scripts/emailings/mailing-send.php index 95b06f187e8..c36e7ea1cc3 100755 --- a/scripts/emailings/mailing-send.php +++ b/scripts/emailings/mailing-send.php @@ -64,7 +64,6 @@ print "***** ".$script_file." (".$version.") pid=".dol_getmypid()." *****\n"; if ($conf->global->MAILING_LIMIT_SENDBYCLI == '-1') { - } $user = new User($db); @@ -329,7 +328,6 @@ if ($resql) if (!empty($conf->global->MAILING_DELAY)) { sleep($conf->global->MAILING_DELAY); } - } } else diff --git a/scripts/members/sync_members_ldap2dolibarr.php b/scripts/members/sync_members_ldap2dolibarr.php index 3e6eaaa4281..d7d4fbdeaaf 100755 --- a/scripts/members/sync_members_ldap2dolibarr.php +++ b/scripts/members/sync_members_ldap2dolibarr.php @@ -299,7 +299,6 @@ if ($result >= 0) //print "yy".dol_print_date($datelast)."\n"; $crowid=$member->subscription($datelast, $pricelast, 0); } - } if (! $error || $forcecommit) diff --git a/scripts/product/migrate_picture_path.php b/scripts/product/migrate_picture_path.php index 69322b2f350..eee15cdb7fa 100755 --- a/scripts/product/migrate_picture_path.php +++ b/scripts/product/migrate_picture_path.php @@ -140,7 +140,6 @@ function migrate_product_photospath($product) { dol_move($origin.'/'.$file, $destin.'/'.$file); } - } } } diff --git a/test/phpunit/CodingSqlTest.php b/test/phpunit/CodingSqlTest.php index c2b620b639b..349e19a1072 100644 --- a/test/phpunit/CodingSqlTest.php +++ b/test/phpunit/CodingSqlTest.php @@ -185,19 +185,16 @@ class CodingSqlTest extends PHPUnit_Framework_TestCase if ($dir == DOL_DOCUMENT_ROOT.'/install/mysql/migration') { // Test for migration files only - } elseif ($dir == DOL_DOCUMENT_ROOT.'/install/mysql/data') { // Test for data files only - } else { if (preg_match('/\.key\.sql$/',$file)) { // Test for key files only - } else { From b5c47f16e6d4a390d32ac1e1ab5124dfe29fe6b0 Mon Sep 17 00:00:00 2001 From: atm-john Date: Wed, 24 Oct 2018 23:25:40 +0200 Subject: [PATCH 02/51] Fix hover stability and modernize style --- htdocs/core/class/dolgraph.class.php | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/htdocs/core/class/dolgraph.class.php b/htdocs/core/class/dolgraph.class.php index ad7b900b033..a331202f424 100644 --- a/htdocs/core/class/dolgraph.class.php +++ b/htdocs/core/class/dolgraph.class.php @@ -1032,11 +1032,13 @@ class DolGraph $(\'
\' + contents + \'
\').css({ position: \'absolute\', display: \'none\', - top: y + 5, - left: x + 5, - border: \'1px solid #ddd\', - padding: \'2px\', - \'background-color\': \'#ffe\', + top: y + 10, + left: x + 15, + border: \'1px solid #000\', + padding: \'5px\', + \'background-color\': \'#000\', + \'color\': \'#fff\', + \'font-weight\': \'bold\', width: 200, opacity: 0.80 }).appendTo("body").fadeIn(20); @@ -1080,7 +1082,7 @@ class DolGraph if ($i > $firstlot) $this->stringtoshow.=', '."\n"; $color=sprintf("%02x%02x%02x",$this->datacolor[$i][0],$this->datacolor[$i][1],$this->datacolor[$i][2]); $this->stringtoshow.='{ '; - if (! isset($this->type[$i]) || $this->type[$i] == 'bars') $this->stringtoshow.='bars: { show: true, align: "'.($i==$firstlot?'center':'left').'", barWidth: 0.5 }, '; + if (! isset($this->type[$i]) || $this->type[$i] == 'bars') $this->stringtoshow.='bars: { lineWidth: 1, show: true, align: "'.($i==$firstlot?'center':'left').'", barWidth: 0.5 }, '; if (isset($this->type[$i]) && $this->type[$i] == 'lines') $this->stringtoshow.='lines: { show: true, fill: false }, '; $this->stringtoshow.='color: "#'.$color.'", label: "'.(isset($this->Legend[$i]) ? dol_escape_js($this->Legend[$i]) : '').'", data: d'.$i.' }'; $i++; @@ -1104,7 +1106,7 @@ class DolGraph // Background color $color1=sprintf("%02x%02x%02x",$this->bgcolorgrid[0],$this->bgcolorgrid[0],$this->bgcolorgrid[2]); $color2=sprintf("%02x%02x%02x",$this->bgcolorgrid[0],$this->bgcolorgrid[1],$this->bgcolorgrid[2]); - $this->stringtoshow.=', grid: { hoverable: true, backgroundColor: { colors: ["#'.$color1.'", "#'.$color2.'"] } }'."\n"; + $this->stringtoshow.=', grid: { hoverable: true, backgroundColor: { colors: ["#'.$color1.'", "#'.$color2.'"] }, borderWidth: 1, borderColor: \'#d0d0d0\', tickColor : \'#f3f3f3\' }'."\n"; //$this->stringtoshow.=', shadowSize: 20'."\n"; TODO Uncommet this $this->stringtoshow.='});'."\n"; $this->stringtoshow.='}'."\n"; From d0dc8b2a9c5eec0cafee6c778acbbe28a64a6261 Mon Sep 17 00:00:00 2001 From: atm-john Date: Thu, 25 Oct 2018 00:24:25 +0200 Subject: [PATCH 03/51] Add points to lines charts and remove shadow to improve performances --- htdocs/core/class/dolgraph.class.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/htdocs/core/class/dolgraph.class.php b/htdocs/core/class/dolgraph.class.php index a331202f424..e95cc08a0a5 100644 --- a/htdocs/core/class/dolgraph.class.php +++ b/htdocs/core/class/dolgraph.class.php @@ -1027,9 +1027,10 @@ class DolGraph else { // Add code to support tooltips + // TODO: remove js css and use graph-tooltip-inner class instead by adding css in each themes $this->stringtoshow.=' function showTooltip_'.$tag.'(x, y, contents) { - $(\'
\' + contents + \'
\').css({ + $(\'
\' + contents + \'
\').css({ position: \'absolute\', display: \'none\', top: y + 10, @@ -1041,7 +1042,7 @@ class DolGraph \'font-weight\': \'bold\', width: 200, opacity: 0.80 - }).appendTo("body").fadeIn(20); + }).appendTo("body").fadeIn(100); } var previousPoint = null; @@ -1083,11 +1084,12 @@ class DolGraph $color=sprintf("%02x%02x%02x",$this->datacolor[$i][0],$this->datacolor[$i][1],$this->datacolor[$i][2]); $this->stringtoshow.='{ '; if (! isset($this->type[$i]) || $this->type[$i] == 'bars') $this->stringtoshow.='bars: { lineWidth: 1, show: true, align: "'.($i==$firstlot?'center':'left').'", barWidth: 0.5 }, '; - if (isset($this->type[$i]) && $this->type[$i] == 'lines') $this->stringtoshow.='lines: { show: true, fill: false }, '; + if (isset($this->type[$i]) && $this->type[$i] == 'lines') $this->stringtoshow.='lines: { show: true, fill: false }, points: { show: true }, '; $this->stringtoshow.='color: "#'.$color.'", label: "'.(isset($this->Legend[$i]) ? dol_escape_js($this->Legend[$i]) : '').'", data: d'.$i.' }'; $i++; } - $this->stringtoshow.="\n".' ], { series: { stack: stack, lines: { fill: false, steps: steps }, bars: { barWidth: 0.6 } }'."\n"; + // shadowSize: 0 -> Drawing is faster without shadows + $this->stringtoshow.="\n".' ], { series: { shadowSize: 0, stack: stack, lines: { fill: false, steps: steps }, bars: { barWidth: 0.6 } }'."\n"; // Xaxis $this->stringtoshow.=', xaxis: { ticks: ['."\n"; @@ -1106,7 +1108,7 @@ class DolGraph // Background color $color1=sprintf("%02x%02x%02x",$this->bgcolorgrid[0],$this->bgcolorgrid[0],$this->bgcolorgrid[2]); $color2=sprintf("%02x%02x%02x",$this->bgcolorgrid[0],$this->bgcolorgrid[1],$this->bgcolorgrid[2]); - $this->stringtoshow.=', grid: { hoverable: true, backgroundColor: { colors: ["#'.$color1.'", "#'.$color2.'"] }, borderWidth: 1, borderColor: \'#d0d0d0\', tickColor : \'#f3f3f3\' }'."\n"; + $this->stringtoshow.=', grid: { hoverable: true, backgroundColor: { colors: ["#'.$color1.'", "#'.$color2.'"] }, borderWidth: 1, borderColor: \'#f3f3f3\', tickColor : \'#f3f3f3\' }'."\n"; //$this->stringtoshow.=', shadowSize: 20'."\n"; TODO Uncommet this $this->stringtoshow.='});'."\n"; $this->stringtoshow.='}'."\n"; From f41e7e05e14cc911bcaf1884f4eee9f7426c3478 Mon Sep 17 00:00:00 2001 From: atm-ph Date: Thu, 25 Oct 2018 12:01:17 +0200 Subject: [PATCH 04/51] Fix PHP warnings printed in javascript --- htdocs/core/lib/functions.lib.php | 72 +++++++++++++++++-------------- 1 file changed, 39 insertions(+), 33 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 7888338cdc2..7dd730214af 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -7094,54 +7094,60 @@ function printCommonFooter($zone='private') $relativepathstring = preg_replace('/^\//', '', $relativepathstring); $relativepathstring = preg_replace('/^custom\//', '', $relativepathstring); $tmpqueryarraywehave=explode('&', dol_string_nohtmltag($_SERVER['QUERY_STRING'])); - foreach($user->default_values[$relativepathstring]['focus'] as $defkey => $defval) + if (!empty($user->default_values[$relativepathstring]['focus'])) { - $qualified = 0; - if ($defkey != '_noquery_') + foreach($user->default_values[$relativepathstring]['focus'] as $defkey => $defval) { - $tmpqueryarraytohave=explode('&', $defkey); - $foundintru=0; - foreach($tmpqueryarraytohave as $tmpquerytohave) + $qualified = 0; + if ($defkey != '_noquery_') { - if (! in_array($tmpquerytohave, $tmpqueryarraywehave)) $foundintru=1; + $tmpqueryarraytohave=explode('&', $defkey); + $foundintru=0; + foreach($tmpqueryarraytohave as $tmpquerytohave) + { + if (! in_array($tmpquerytohave, $tmpqueryarraywehave)) $foundintru=1; + } + if (! $foundintru) $qualified=1; + //var_dump($defkey.'-'.$qualified); } - if (! $foundintru) $qualified=1; - //var_dump($defkey.'-'.$qualified); - } - else $qualified = 1; + else $qualified = 1; - if ($qualified) - { - foreach($defval as $paramkey => $paramval) + if ($qualified) { - // Add property 'required' on input - print 'jQuery("input[name=\''.$paramkey.'\']").focus();'."\n"; + foreach($defval as $paramkey => $paramval) + { + // Add property 'required' on input + print 'jQuery("input[name=\''.$paramkey.'\']").focus();'."\n"; + } } } } - foreach($user->default_values[$relativepathstring]['mandatory'] as $defkey => $defval) + if (!empty($user->default_values[$relativepathstring]['mandatory'])) { - $qualified = 0; - if ($defkey != '_noquery_') + foreach($user->default_values[$relativepathstring]['mandatory'] as $defkey => $defval) { - $tmpqueryarraytohave=explode('&', $defkey); - $foundintru=0; - foreach($tmpqueryarraytohave as $tmpquerytohave) + $qualified = 0; + if ($defkey != '_noquery_') { - if (! in_array($tmpquerytohave, $tmpqueryarraywehave)) $foundintru=1; + $tmpqueryarraytohave=explode('&', $defkey); + $foundintru=0; + foreach($tmpqueryarraytohave as $tmpquerytohave) + { + if (! in_array($tmpquerytohave, $tmpqueryarraywehave)) $foundintru=1; + } + if (! $foundintru) $qualified=1; + //var_dump($defkey.'-'.$qualified); } - if (! $foundintru) $qualified=1; - //var_dump($defkey.'-'.$qualified); - } - else $qualified = 1; + else $qualified = 1; - if ($qualified) - { - foreach($defval as $paramkey => $paramval) + if ($qualified) { - // Add property 'required' on input - print 'jQuery("input[name=\''.$paramkey.'\']").prop(\'required\',true);'."\n"; - print 'jQuery("select[name=\''.$paramkey.'\']").prop(\'required\',true);'."\n"; // required on a select works only if key is "", this does not happen in Dolibarr + foreach($defval as $paramkey => $paramval) + { + // Add property 'required' on input + print 'jQuery("input[name=\''.$paramkey.'\']").prop(\'required\',true);'."\n"; + print 'jQuery("select[name=\''.$paramkey.'\']").prop(\'required\',true);'."\n"; // required on a select works only if key is "", this does not happen in Dolibarr + } } } } From 5daf095fc60f5bbed9fdbb3cdec8db4e109f7869 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 25 Oct 2018 14:05:22 +0200 Subject: [PATCH 05/51] FIX Title and content of automatic email of expense report --- htdocs/expensereport/card.php | 37 +++++++++++++++++++++++------------ 1 file changed, 24 insertions(+), 13 deletions(-) diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index 62315912209..50205fd12d4 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -356,7 +356,10 @@ if (empty($reshook)) $filename=array(); $filedir=array(); $mimetype=array(); // SUBJECT - $subject = $langs->transnoentities("ExpenseReportWaitingForApproval"); + $societeName = $conf->global->MAIN_INFO_SOCIETE_NOM; + if (! empty($conf->global->MAIN_APPLICATION_TITLE)) $societeName = $conf->global->MAIN_APPLICATION_TITLE; + + $subject = $societeName." - ".$langs->transnoentities("ExpenseReportWaitingForApproval"); // CONTENT $link = $urlwithroot.'/expensereport/card.php?id='.$object->id; @@ -472,7 +475,10 @@ if (empty($reshook)) $filename=array(); $filedir=array(); $mimetype=array(); // SUBJECT - $subject = $langs->transnoentities("ExpenseReportWaitingForReApproval"); + $societeName = $conf->global->MAIN_INFO_SOCIETE_NOM; + if (! empty($conf->global->MAIN_APPLICATION_TITLE)) $societeName = $conf->global->MAIN_APPLICATION_TITLE; + + $subject = $societeName." - ".$langs->transnoentities("ExpenseReportWaitingForReApproval"); // CONTENT $link = $urlwithroot.'/expensereport/card.php?id='.$object->id; @@ -594,7 +600,10 @@ if (empty($reshook)) $filename=array(); $filedir=array(); $mimetype=array(); // SUBJECT - $subject = $langs->transnoentities("ExpenseReportApproved"); + $societeName = $conf->global->MAIN_INFO_SOCIETE_NOM; + if (! empty($conf->global->MAIN_APPLICATION_TITLE)) $societeName = $conf->global->MAIN_APPLICATION_TITLE; + + $subject = $societeName." - ".$langs->transnoentities("ExpenseReportApproved"); // CONTENT $link = $urlwithroot.'/expensereport/card.php?id='.$object->id; @@ -713,7 +722,10 @@ if (empty($reshook)) $filename=array(); $filedir=array(); $mimetype=array(); // SUBJECT - $subject = $langs->transnoentities("ExpenseReportRefused"); + $societeName = $conf->global->MAIN_INFO_SOCIETE_NOM; + if (! empty($conf->global->MAIN_APPLICATION_TITLE)) $societeName = $conf->global->MAIN_APPLICATION_TITLE; + + $subject = $societeName." - ".$langs->transnoentities("ExpenseReportRefused"); // CONTENT $link = $urlwithroot.'/expensereport/card.php?id='.$object->id; @@ -842,7 +854,10 @@ if (empty($reshook)) $filename=array(); $filedir=array(); $mimetype=array(); // SUBJECT - $subject = $langs->transnoentities("ExpenseReportCanceled"); + $societeName = $conf->global->MAIN_INFO_SOCIETE_NOM; + if (! empty($conf->global->MAIN_APPLICATION_TITLE)) $societeName = $conf->global->MAIN_APPLICATION_TITLE; + + $subject = $societeName." - ".$langs->transnoentities("ExpenseReportCanceled"); // CONTENT $link = $urlwithroot.'/expensereport/card.php?id='.$object->id; @@ -1008,19 +1023,15 @@ if (empty($reshook)) $filename=array(); $filedir=array(); $mimetype=array(); // SUBJECT - $subject = $langs->transnoentities("ExpenseReportPaid"); + $societeName = $conf->global->MAIN_INFO_SOCIETE_NOM; + if (! empty($conf->global->MAIN_APPLICATION_TITLE)) $societeName = $conf->global->MAIN_APPLICATION_TITLE; + + $subject = $societeName." - ".$langs->transnoentities("ExpenseReportPaid"); // CONTENT $link = $urlwithroot.'/expensereport/card.php?id='.$object->id; $message = $langs->transnoentities("ExpenseReportPaidMessage", $object->ref, $destinataire->getFullName($langs), $expediteur->getFullName($langs), $link); - // CONTENT - $message = "Bonjour {$destinataire->firstname},\n\n"; - $message.= "Votre note de frais \"{$object->ref}\" vient d'être payée.\n"; - $message.= "- Payeur : {$expediteur->firstname} {$expediteur->lastname}\n"; - $message.= "- Lien : {$dolibarr_main_url_root}/expensereport/card.php?id={$object->id}\n\n"; - $message.= "Bien cordialement,\n' SI"; - // Generate pdf before attachment $object->setDocModel($user,""); $resultPDF = expensereport_pdf_create($db,$object,'',"",$langs); From 1ba716b82c760e39efb281e4fb1a41513211eba1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 25 Oct 2018 14:39:54 +0200 Subject: [PATCH 06/51] Fix do not allow use of second or third tax without using 1st one. --- htdocs/admin/company.php | 40 ++++++++++++++++++++++++++++------- htdocs/langs/en_US/admin.lang | 18 ++++++++-------- 2 files changed, 41 insertions(+), 17 deletions(-) diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php index e3ea95d18b5..cc564bfb08e 100644 --- a/htdocs/admin/company.php +++ b/htdocs/admin/company.php @@ -75,6 +75,8 @@ if ( ($action == 'update' && ! GETPOST("cancel",'alpha')) 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); @@ -173,11 +175,24 @@ if ( ($action == 'update' && ! GETPOST("cancel",'alpha')) dolibarr_set_const($db, "SOCIETE_FISCAL_MONTH_START", GETPOST("SOCIETE_FISCAL_MONTH_START",'int'),'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "FACTURE_TVAOPTION", GETPOST("optiontva",'aZ09'),'chaine',0,'',$conf->entity); + // Sale tax options + $usevat = GETPOST("optiontva",'aZ09'); + $uselocaltax1 = GETPOST("optionlocaltax1",'aZ09'); + $uselocaltax2 = GETPOST("optionlocaltax2",'aZ09'); + if ($uselocaltax1 == 'localtax1on' && ! $usevat) + { + setEventMessages($langs->trans("IfYouUseASecondTaxYouMustSetYouUseTheMainTax"), null, 'errors'); + $error++; + } + if ($uselocaltax2 == 'localtax2on' && ! $usevat) + { + setEventMessages($langs->trans("IfYouUseAThirdTaxYouMustSetYouUseTheMainTax"), null, 'errors'); + $error++; + } - // Local taxes - dolibarr_set_const($db, "FACTURE_LOCAL_TAX1_OPTION", GETPOST("optionlocaltax1",'aZ09'),'chaine',0,'',$conf->entity); - dolibarr_set_const($db, "FACTURE_LOCAL_TAX2_OPTION", GETPOST("optionlocaltax2",'aZ09'),'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") { @@ -204,6 +219,15 @@ if ( ($action == 'update' && ! GETPOST("cancel",'alpha')) dolibarr_set_const($db,"MAIN_INFO_LOCALTAX_CALC2", GETPOST("clt2",'aZ09'),'chaine',0,'',$conf->entity); } + if (! $error) + { + $db->commit(); + } + else + { + $db->rollback(); + } + if ($action != 'updateedit' && ! $error) { header("Location: ".$_SERVER["PHP_SELF"]); @@ -586,7 +610,7 @@ if ($action == 'edit' || $action == 'updateedit') print ''; print ""; print ""; - print "\n"; + if ($mysoc->country_code == 'FR') print "\n"; print "
".$langs->trans("Example").': '.$langs->trans("VATIsUsedExampleFR")."
".$langs->trans("Example").': '.$langs->trans("VATIsUsedExampleFR")."
"; print "\n"; @@ -595,7 +619,7 @@ if ($action == 'edit' || $action == 'updateedit') print ''; print ""; print ""; - print "\n"; + if ($mysoc->country_code == 'FR') print "\n"; print "
".$langs->trans("Example").': '.$langs->trans("VATIsNotUsedExampleFR")."
".$langs->trans("Example").': '.$langs->trans("VATIsNotUsedExampleFR")."
"; print "\n"; @@ -1024,7 +1048,7 @@ else print ''; print ""; print ""; - print "\n"; + if ($mysoc->country_code == 'FR') print "\n"; print "
".$langs->trans("Example").': '.$langs->trans("VATIsUsedExampleFR")."
".$langs->trans("Example").': '.$langs->trans("VATIsUsedExampleFR")."
"; print "\n"; @@ -1034,7 +1058,7 @@ else print ''; print ""; print ""; - print "\n"; + if ($mysoc->country_code == 'FR') print "\n"; print "
".$langs->trans("VATIsNotUsedDesc")."
".$langs->trans("Example").': '.$langs->trans("VATIsNotUsedExampleFR")."
".$langs->trans("Example").': '.$langs->trans("VATIsNotUsedExampleFR")."
"; print "\n"; diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 52445134f0f..190b7cded97 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -924,22 +924,22 @@ SetupNotSaved=Setup not saved BackToModuleList=Back to modules list BackToDictionaryList=Back to list of Dictionaries TypeOfRevenueStamp=Type of tax stamp -VATManagement=VAT Management -VATIsUsedDesc=By default when creating prospects, invoices, orders etc. the VAT rate follows the active standard rule:
If the seller is not subject to VAT, then VAT defaults to 0. End of rule.
If the (seller's country = buyer's country), then the VAT by default equals the VAT of the product in the seller's country. End of rule.
If the seller and buyer are both in the European Community and goods are transport-related products (haulage, shipping, airline), the default VAT is 0. This rule is dependant on the seller's country - please consult with your accountant. The VAT should be paid by the buyer to their customs office in their country and not to the seller. End of rule.
If the seller and buyer are both in the European Community and the buyer is not a company (with a registered intra-Community VAT number) then the VAT by defaults to the VAT of the seller's country. End of rule.
If the seller and buyer are both in the European Community and the buyer is a company (with a registered intra-Community VAT number), then the VAT is 0 by default. End of rule.
In any other case the proposed default is VAT=0. End of rule. -VATIsNotUsedDesc=By default the proposed VAT is 0 which can be used for cases like associations, individuals or small companies. -VATIsUsedExampleFR=In France, it means companies or organizations having a real fiscal system (Simplified real or normal real). A system in which VAT is declared. -VATIsNotUsedExampleFR=In France, it means associations that are non VAT declared or companies, organizations or liberal professions that have chosen the micro enterprise fiscal system (VAT in franchise) and paid a franchise VAT without any VAT declaration. This choice will display the reference "Non applicable VAT - art-293B of CGI" on invoices. +VATManagement=Sale Tax Management +VATIsUsedDesc=By default when creating prospects, invoices, orders etc. the Sale Tax rate follows the active standard rule:
If the seller is not subject to Sale tax, then Sale tax defaults to 0. End of rule.
If the (seller's country = buyer's country), then the Sale tax by default equals the Sale tax of the product in the seller's country. End of rule.
If the seller and buyer are both in the European Community and goods are transport-related products (haulage, shipping, airline), the default Sale tax is 0. This rule is dependant on the seller's country - please consult with your accountant. The Sale tax should be paid by the buyer to their customs office in their country and not to the seller. End of rule.
If the seller and buyer are both in the European Community and the buyer is not a company (with a registered intra-Community Sale tax number) then the Sale tax by defaults to the Sale tax of the seller's country. End of rule.
If the seller and buyer are both in the European Community and the buyer is a company (with a registered intra-Community Sale tax number), then the Sale tax is 0 by default. End of rule.
In any other case the proposed default is Sale tax=0. End of rule. +VATIsNotUsedDesc=By default the proposed Sale tax is 0 which can be used for cases like associations, individuals or small companies. +VATIsUsedExampleFR=In France, it means companies or organizations having a real fiscal system (Simplified real or normal real). A system in which Sale tax is declared. +VATIsNotUsedExampleFR=In France, it means associations that are non Sale tax declared or companies, organizations or liberal professions that have chosen the micro enterprise fiscal system (Sale tax in franchise) and paid a franchise Sale tax without any Sale tax declaration. This choice will display the reference "Non applicable Sale tax - art-293B of CGI" on invoices. ##### Local Taxes ##### LTRate=Rate LocalTax1IsNotUsed=Do not use second tax -LocalTax1IsUsedDesc=Use a second type of tax (other than VAT) -LocalTax1IsNotUsedDesc=Do not use other type of tax (other than VAT) +LocalTax1IsUsedDesc=Use a second type of tax (other than first one) +LocalTax1IsNotUsedDesc=Do not use other type of tax (other than first one) LocalTax1Management=Second type of tax LocalTax1IsUsedExample= LocalTax1IsNotUsedExample= LocalTax2IsNotUsed=Do not use third tax -LocalTax2IsUsedDesc=Use a third type of tax (other than VAT) -LocalTax2IsNotUsedDesc=Do not use other type of tax (other than VAT) +LocalTax2IsUsedDesc=Use a third type of tax (other than first one) +LocalTax2IsNotUsedDesc=Do not use other type of tax (other than first one) LocalTax2Management=Third type of tax LocalTax2IsUsedExample= LocalTax2IsNotUsedExample= From 094bcc519f3f137db0fe6cf12eadccd5e7174d04 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 25 Oct 2018 17:25:36 +0200 Subject: [PATCH 07/51] Fix show customer code only if customer in company tooltip --- htdocs/societe/class/societe.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index c91593b079f..a89e242898c 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -2098,11 +2098,11 @@ class Societe extends CommonObject if (strpos($conf->global->SOCIETE_SHOW_FIELD_IN_TOOLTIP, 'profid5') !== false) $label.= '
' . $langs->trans('ProfId5'.$this->country_code) . ': '. $this->idprof5; if (strpos($conf->global->SOCIETE_SHOW_FIELD_IN_TOOLTIP, 'profid6') !== false) $label.= '
' . $langs->trans('ProfId6'.$this->country_code) . ': '. $this->idprof6; } - if (! empty($this->code_client) && $this->client) + if (! empty($this->code_client) && ($this->client == 1 || $this->client == 3)) $label.= '
' . $langs->trans('CustomerCode') . ': '. $this->code_client; if (! empty($this->code_fournisseur) && $this->fournisseur) $label.= '
' . $langs->trans('SupplierCode') . ': '. $this->code_fournisseur; - if (! empty($conf->accounting->enabled) && $this->client) + if (! empty($conf->accounting->enabled) && ($this->client == 1 || $this->client == 3)) $label.= '
' . $langs->trans('CustomerAccountancyCode') . ': '. ($this->code_compta ? $this->code_compta : $this->code_compta_client); if (! empty($conf->accounting->enabled) && $this->fournisseur) $label.= '
' . $langs->trans('SupplierAccountancyCode') . ': '. $this->code_compta_fournisseur; From 70cd68ebefb00a208cf961f1a02cc84a4b8f4294 Mon Sep 17 00:00:00 2001 From: De Coninck Laurent Date: Thu, 25 Oct 2018 18:21:00 +0200 Subject: [PATCH 08/51] improve img_picto by returning ASAP We do not need an else each time some times, return is good enough. I also remove some line of comments since it's only code in it. We have GIT to find the code back we do not need to put it in comment ;-). --- htdocs/core/lib/functions.lib.php | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 7888338cdc2..cf464f69344 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3297,15 +3297,8 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ if ($srconly) { return $fullpathpicto; } - else { // tag title is used for tooltip on
, tag alt can be used with very simple text on image for bind people - //$tmparray=array(0=>$titlealt); - //if (empty($notitle) && preg_match('/:[^\s0-9]/',$titlealt)) $tmparray=explode(':',$titlealt); // We explode if we have TextA:TextB. Not if we have TextA: TextB - //$title=$tmparray[0]; - //$alt=empty($tmparray[1])?'':$tmparray[1]; - $title = $titlealt; - return ''.dol_escape_htmltag($alt).''; // Alt is used for accessibility, title for popup - } + return ''.dol_escape_htmltag($alt).''; // Alt is used for accessibility, title for popup } /** From 8b601bd7fd93340c8786535fe0c08b8fd4812065 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 25 Oct 2018 18:50:53 +0200 Subject: [PATCH 09/51] Fix numbering of holidays --- htdocs/admin/holiday.php | 12 +- .../holiday/mod_holiday_immaculate.php | 2 +- .../modules/holiday/mod_holiday_madonna.php | 8 +- htdocs/holiday/card.php | 17 +- htdocs/holiday/class/holiday.class.php | 150 ++++++++++-------- htdocs/holiday/list.php | 4 +- .../install/mysql/migration/8.0.0-9.0.0.sql | 2 + htdocs/install/mysql/tables/llx_holiday.sql | 6 +- htdocs/langs/en_US/holiday.lang | 5 + 9 files changed, 123 insertions(+), 83 deletions(-) diff --git a/htdocs/admin/holiday.php b/htdocs/admin/holiday.php index f6306f787c3..c02c9bd480d 100644 --- a/htdocs/admin/holiday.php +++ b/htdocs/admin/holiday.php @@ -297,8 +297,13 @@ foreach ($dirmodels as $reldir) print '
'; + + +if ($conf->global->MAIN_FEATURES_LEVEL >= 2) +{ + /* - * Documents models for Contracts + * Documents models for Holidays */ print load_fiche_titre($langs->trans("TemplatePDFHolidays"),'',''); @@ -455,9 +460,9 @@ foreach ($dirmodels as $reldir) print ''; print "
"; + /* * Other options - * */ print '
'; @@ -509,6 +514,9 @@ print ''; print '
'; +} + + dol_fiche_end(); // End of page diff --git a/htdocs/core/modules/holiday/mod_holiday_immaculate.php b/htdocs/core/modules/holiday/mod_holiday_immaculate.php index b63326ca276..338b553166e 100644 --- a/htdocs/core/modules/holiday/mod_holiday_immaculate.php +++ b/htdocs/core/modules/holiday/mod_holiday_immaculate.php @@ -44,7 +44,7 @@ class mod_holiday_immaculate extends ModelNumRefHolidays /** * @var string Nom du modele * @deprecated - * @see name + * @see $name */ public $nom='Immaculate'; diff --git a/htdocs/core/modules/holiday/mod_holiday_madonna.php b/htdocs/core/modules/holiday/mod_holiday_madonna.php index 98380d9fae5..f53e55be6fd 100644 --- a/htdocs/core/modules/holiday/mod_holiday_madonna.php +++ b/htdocs/core/modules/holiday/mod_holiday_madonna.php @@ -45,7 +45,7 @@ class mod_holiday_madonna extends ModelNumRefHolidays /** * @var string Nom du modele * @deprecated - * @see name + * @see $name */ public $nom='Madonna'; @@ -117,10 +117,10 @@ class mod_holiday_madonna extends ModelNumRefHolidays * Return next value * * @param Societe $objsoc third party object - * @param Object $contract contract object + * @param Object $holiday Holiday object * @return string Value if OK, 0 if KO */ - function getNextValue($objsoc,$contract) + function getNextValue($objsoc, $holiday) { global $db,$conf; @@ -143,7 +143,7 @@ class mod_holiday_madonna extends ModelNumRefHolidays return -1; } - $date=$contract->date_contrat; + $date=$holiday->date_debut; $yymm = strftime("%y%m",$date); if ($max >= (pow(10, 4) - 1)) $num=$max+1; // If counter > 9999, we do not format on 4 chars, we take number as it is diff --git a/htdocs/holiday/card.php b/htdocs/holiday/card.php index 9c89124c577..d170a1c9acc 100644 --- a/htdocs/holiday/card.php +++ b/htdocs/holiday/card.php @@ -41,6 +41,7 @@ require_once DOL_DOCUMENT_ROOT.'/holiday/common.inc.php'; // Get parameters $action=GETPOST('action', 'alpha'); $id=GETPOST('id', 'int'); +$ref=GETPOST('ref', 'alpha'); $fuserid = (GETPOST('fuserid','int')?GETPOST('fuserid','int'):$user->id); // Protection if external user @@ -325,7 +326,7 @@ if ($action == 'confirm_delete' && GETPOST('confirm') == 'yes' && $user->rights- } } -// Si envoi de la demande +// Action validate (+ send email for approval) if ($action == 'confirm_send') { $object = new Holiday($db); @@ -761,7 +762,7 @@ $listhalfday=array('morning'=>$langs->trans("Morning"),"afternoon"=>$langs->tran llxHeader('', $langs->trans('CPTitreMenu')); -if (empty($id) || $action == 'add' || $action == 'request' || $action == 'create') +if ((empty($id) && empty($ref)) || $action == 'add' || $action == 'request' || $action == 'create') { // Si l'utilisateur n'a pas le droit de faire une demande if (($fuserid == $user->id && empty($user->rights->holiday->write)) || ($fuserid != $user->id && empty($user->rights->holiday->write_all))) @@ -998,9 +999,9 @@ else else { // Affichage de la fiche d'une demande de congés payés - if ($id > 0) + if (($id > 0) || $ref) { - $object->fetch($id); + $result = $object->fetch($id, $ref); $valideur = new User($db); $valideur->fetch($object->fk_validator); @@ -1064,7 +1065,7 @@ else $linkback='
'.$langs->trans("BackToList").''; - dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref'); + dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref'); print '
'; @@ -1260,7 +1261,7 @@ else } // Si envoi en validation - if ($action == 'sendToValidate' && $object->statut == 1) + if ($action == 'sendToValidate' && $object->statut == Holiday::STATUS_DRAFT) { print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id,$langs->trans("TitleToValidCP"),$langs->trans("ConfirmToValidCP"),"confirm_send", '', 1, 1); } @@ -1291,10 +1292,10 @@ else } - if ($action == 'edit' && $object->statut == 1) + if ($action == 'edit' && $object->statut == Holiday::STATUS_DRAFT) { print '
'; - if ($cancreate && $object->statut == 1) + if ($cancreate && $object->statut == Holiday::STATUS_DRAFT) { print ''; } diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php index bc964ec7fc6..26e11383b9d 100644 --- a/htdocs/holiday/class/holiday.class.php +++ b/htdocs/holiday/class/holiday.class.php @@ -57,7 +57,7 @@ class Holiday extends CommonObject /** * @deprecated - * @see id + * @see $id */ public $rowid; @@ -77,7 +77,7 @@ class Holiday extends CommonObject public $date_fin=''; // Date end in PHP server TZ public $date_debut_gmt=''; // Date start in GMT public $date_fin_gmt=''; // Date end in GMT - public $halfday=''; // 0:Full days, 2:Start afternoon end morning, -1:Start afternoon end afternoon, 1:Start morning end morning + public $halfday=''; // 0:Full days, 2:Start afternoon end morning, -1:Start afternoon end afternoon, 1:Start morning end morning public $statut=''; // 1=draft, 2=validated, 3=approved /** @@ -154,6 +154,67 @@ class Holiday extends CommonObject } + /** + * Returns the reference to the following non used Order depending on the active numbering module + * defined into HOLIDAY_ADDON + * + * @param Societe $objsoc third party object + * @return string Holiday free reference + */ + function getNextNumRef($objsoc) + { + global $langs, $conf; + $langs->load("order"); + + if (empty($conf->global->HOLIDAY_ADDON)) + { + $conf->global->HOLIDAY_ADDON = 'mod_holiday_madonna'; + } + + if (! empty($conf->global->HOLIDAY_ADDON)) + { + $mybool=false; + + $file = $conf->global->HOLIDAY_ADDON.".php"; + $classname = $conf->global->HOLIDAY_ADDON; + + // Include file with class + $dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']); + foreach ($dirmodels as $reldir) + { + $dir = dol_buildpath($reldir."core/modules/holiday/"); + + // Load file with numbering class (if found) + $mybool|=@include_once $dir.$file; + } + + if (! $mybool) + { + dol_print_error('',"Failed to include file ".$file); + return ''; + } + + $obj = new $classname(); + $numref = $obj->getNextValue($objsoc,$this); + + if ($numref != "") + { + return $numref; + } + else + { + $this->error=$obj->error; + //dol_print_error($this->db,get_class($this)."::getNextNumRef ".$obj->error); + return ""; + } + } + else + { + print $langs->trans("Error")." ".$langs->trans("Error_HOLIDAY_ADDON_NotDefined"); + return ""; + } + } + /** * Update balance of vacations and check table of users for holidays is complete. If not complete. * @@ -271,14 +332,16 @@ class Holiday extends CommonObject * Load object in memory from database * * @param int $id Id object + * @param string $ref Ref object * @return int <0 if KO, >0 if OK */ - function fetch($id) + function fetch($id, $ref='') { global $langs; $sql = "SELECT"; $sql.= " cp.rowid,"; + $sql.= " cp.ref,"; $sql.= " cp.fk_user,"; $sql.= " cp.date_create,"; $sql.= " cp.description,"; @@ -300,7 +363,8 @@ class Holiday extends CommonObject $sql.= " cp.fk_type,"; $sql.= " cp.entity"; $sql.= " FROM ".MAIN_DB_PREFIX."holiday as cp"; - $sql.= " WHERE cp.rowid = ".$id; + if ($id > 0) $sql.= " WHERE cp.rowid = ".$id; + else $sql.=" WHERE cp.ref = '".$this->db->escape($ref)."'"; dol_syslog(get_class($this)."::fetch", LOG_DEBUG); $resql=$this->db->query($sql); @@ -312,7 +376,7 @@ class Holiday extends CommonObject $this->id = $obj->rowid; $this->rowid = $obj->rowid; // deprecated - $this->ref = $obj->rowid; + $this->ref = ($obj->ref?$obj->ref:$obj->rowid); $this->fk_user = $obj->fk_user; $this->date_create = $this->db->jdate($obj->date_create); $this->description = $obj->description; @@ -361,6 +425,7 @@ class Holiday extends CommonObject $sql = "SELECT"; $sql.= " cp.rowid,"; + $sql.= " cp.ref,"; $sql.= " cp.fk_user,"; $sql.= " cp.fk_type,"; @@ -427,7 +492,8 @@ class Holiday extends CommonObject $obj = $this->db->fetch_object($resql); $tab_result[$i]['rowid'] = $obj->rowid; - $tab_result[$i]['ref'] = $obj->rowid; + $tab_result[$i]['ref'] = ($obj->ref?$obj->ref:$obj->rowid); + $tab_result[$i]['fk_user'] = $obj->fk_user; $tab_result[$i]['fk_type'] = $obj->fk_type; $tab_result[$i]['date_create'] = $this->db->jdate($obj->date_create); @@ -487,6 +553,7 @@ class Holiday extends CommonObject $sql = "SELECT"; $sql.= " cp.rowid,"; + $sql.= " cp.ref,"; $sql.= " cp.fk_user,"; $sql.= " cp.fk_type,"; @@ -552,7 +619,7 @@ class Holiday extends CommonObject $obj = $this->db->fetch_object($resql); $tab_result[$i]['rowid'] = $obj->rowid; - $tab_result[$i]['ref'] = $obj->rowid; + $tab_result[$i]['ref'] = ($obj->ref?$obj->ref:$obj->rowid); $tab_result[$i]['fk_user'] = $obj->fk_user; $tab_result[$i]['fk_type'] = $obj->fk_type; $tab_result[$i]['date_create'] = $this->db->jdate($obj->date_create); @@ -611,68 +678,25 @@ class Holiday extends CommonObject global $conf, $langs; $error=0; - // Update request + // Define new ref + if (! $error && (preg_match('/^[\(]?PROV/i', $this->ref) || empty($this->ref) || $this->ref == $this->id)) + { + $num = $this->getNextNumRef(null); + } + else + { + $num = $this->ref; + } + $this->newref = $num; + + // Update status $sql = "UPDATE ".MAIN_DB_PREFIX."holiday SET"; - - $sql.= " description= '".$this->db->escape($this->description)."',"; - - if(!empty($this->date_debut)) { - $sql.= " date_debut = '".$this->db->idate($this->date_debut)."',"; - } else { - $error++; - } - if(!empty($this->date_fin)) { - $sql.= " date_fin = '".$this->db->idate($this->date_fin)."',"; - } else { - $error++; - } - $sql.= " halfday = ".$this->halfday.","; if(!empty($this->statut) && is_numeric($this->statut)) { $sql.= " statut = ".$this->statut.","; } else { $error++; } - if(!empty($this->fk_validator)) { - $sql.= " fk_validator = '".$this->db->escape($this->fk_validator)."',"; - } else { - $error++; - } - if(!empty($this->date_valid)) { - $sql.= " date_valid = '".$this->db->idate($this->date_valid)."',"; - } else { - $sql.= " date_valid = NULL,"; - } - if(!empty($this->fk_user_valid)) { - $sql.= " fk_user_valid = '".$this->db->escape($this->fk_user_valid)."',"; - } else { - $sql.= " fk_user_valid = NULL,"; - } - if(!empty($this->date_refuse)) { - $sql.= " date_refuse = '".$this->db->idate($this->date_refuse)."',"; - } else { - $sql.= " date_refuse = NULL,"; - } - if(!empty($this->fk_user_refuse)) { - $sql.= " fk_user_refuse = '".$this->db->escape($this->fk_user_refuse)."',"; - } else { - $sql.= " fk_user_refuse = NULL,"; - } - if(!empty($this->date_cancel)) { - $sql.= " date_cancel = '".$this->db->idate($this->date_cancel)."',"; - } else { - $sql.= " date_cancel = NULL,"; - } - if(!empty($this->fk_user_cancel)) { - $sql.= " fk_user_cancel = '".$this->db->escape($this->fk_user_cancel)."',"; - } else { - $sql.= " fk_user_cancel = NULL,"; - } - if(!empty($this->detail_refuse)) { - $sql.= " detail_refuse = '".$this->db->escape($this->detail_refuse)."'"; - } else { - $sql.= " detail_refuse = NULL"; - } - + $sql.= " ref = '".$num."'"; $sql.= " WHERE rowid= ".$this->id; $this->db->begin(); diff --git a/htdocs/holiday/list.php b/htdocs/holiday/list.php index fcd5cc9d8b0..8d7f8fb666e 100644 --- a/htdocs/holiday/list.php +++ b/htdocs/holiday/list.php @@ -512,7 +512,7 @@ print ''; print "\n"; print ''; -print_liste_field_titre("Ref",$_SERVER["PHP_SELF"],"cp.rowid","",$param,'',$sortfield,$sortorder); +print_liste_field_titre("Ref",$_SERVER["PHP_SELF"],"cp.ref","",$param,'',$sortfield,$sortorder); print_liste_field_titre("DateCreateCP",$_SERVER["PHP_SELF"],"cp.date_create","",$param,'align="center"',$sortfield,$sortorder); print_liste_field_titre("Employee",$_SERVER["PHP_SELF"],"cp.fk_user","",$param,'',$sortfield,$sortorder); print_liste_field_titre("ValidatorCP",$_SERVER["PHP_SELF"],"cp.fk_validator","",$param,'',$sortfield,$sortorder); @@ -546,7 +546,7 @@ elseif (! empty($holiday->holiday) && !empty($mysoc->country_id)) { // Leave request $holidaystatic->id=$infos_CP['rowid']; - $holidaystatic->ref=$infos_CP['rowid']; + $holidaystatic->ref=($infos_CP['ref']?$infos_CP['ref']:$infos_CP['rowid']); // User $userstatic->id=$infos_CP['fk_user']; diff --git a/htdocs/install/mysql/migration/8.0.0-9.0.0.sql b/htdocs/install/mysql/migration/8.0.0-9.0.0.sql index 9048c681aa1..f98c932943c 100644 --- a/htdocs/install/mysql/migration/8.0.0-9.0.0.sql +++ b/htdocs/install/mysql/migration/8.0.0-9.0.0.sql @@ -132,3 +132,5 @@ CREATE TABLE llx_takepos_floor_tables( UPDATE llx_c_payment_term SET decalage = nbjour, nbjour = 0 where decalage IS NULL AND type_cdr = 2; + +UPDATE llx_holiday SET ref = rowid WHERE ref IS NULL; diff --git a/htdocs/install/mysql/tables/llx_holiday.sql b/htdocs/install/mysql/tables/llx_holiday.sql index f6994810021..47c68647ffb 100644 --- a/htdocs/install/mysql/tables/llx_holiday.sql +++ b/htdocs/install/mysql/tables/llx_holiday.sql @@ -32,9 +32,9 @@ date_debut DATE NOT NULL, date_fin DATE NOT NULL, halfday integer DEFAULT 0, -- 0=start morning and end afternoon, -1=start afternoon end afternoon, 1=start morning and end morning, 2=start afternoon and end morning statut integer NOT NULL DEFAULT '1', -fk_validator integer NOT NULL, -date_valid DATETIME DEFAULT NULL, -fk_user_valid integer DEFAULT NULL, +fk_validator integer NOT NULL, -- who should approve +date_valid DATETIME DEFAULT NULL, -- date approval +fk_user_valid integer DEFAULT NULL, -- user approval date_refuse DATETIME DEFAULT NULL, fk_user_refuse integer DEFAULT NULL, date_cancel DATETIME DEFAULT NULL, diff --git a/htdocs/langs/en_US/holiday.lang b/htdocs/langs/en_US/holiday.lang index 1411ae3ad56..8cf5ec2c1e6 100644 --- a/htdocs/langs/en_US/holiday.lang +++ b/htdocs/langs/en_US/holiday.lang @@ -122,3 +122,8 @@ HolidaysCanceledBody=Your leave request for %s to %s has been canceled. FollowedByACounter=1: This type of leave need to be followed by a counter. Counter is incremented manually or automatically and when a leave request is validated, counter is decremented.
0: Not followed by a counter. NoLeaveWithCounterDefined=There is no leave types defined that need to be followed by a counter GoIntoDictionaryHolidayTypes=Go into Home - Setup - Dictionaries - Type of leave to setup the different types of leaves. +HolidaySetup=Setup of module Holiday +HolidaysNumberingModules=Leave requests numbering models +TemplatePDFHolidays=Template for leave requests PDF +FreeLegalTextOnHolidays=Free text on PDF +WatermarkOnDraftHolidayCards=Watermarks on draft leave requests \ No newline at end of file From 61ab507ba43092808a61cc10e6a5edb8e5948251 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 25 Oct 2018 18:53:00 +0200 Subject: [PATCH 10/51] Fix navigation --- htdocs/holiday/document.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/holiday/document.php b/htdocs/holiday/document.php index 655a3ff5d2a..5f33e24e8c6 100644 --- a/htdocs/holiday/document.php +++ b/htdocs/holiday/document.php @@ -111,7 +111,7 @@ if ($object->id) $linkback=''.$langs->trans("BackToList").''; - dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref'); + dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref'); print '
'; From af18e1b0431cc361b750099690a0870f60ab56e9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 25 Oct 2018 19:38:45 +0200 Subject: [PATCH 11/51] FIX XSS --- htdocs/expedition/stats/month.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/expedition/stats/month.php b/htdocs/expedition/stats/month.php index 27b01cc6f55..f716e06a5b2 100644 --- a/htdocs/expedition/stats/month.php +++ b/htdocs/expedition/stats/month.php @@ -27,6 +27,8 @@ require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php'; require_once DOL_DOCUMENT_ROOT.'/expedition/class/expeditionstats.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php'; +$year = GETPOST('year', 'int'); + /* * View @@ -39,10 +41,10 @@ $HEIGHT=DolGraph::getDefaultGraphSizeForStats('height'); $mesg = ''; -print load_fiche_titre($langs->trans("StatisticsOfSendings").' '.$_GET["year"], $mesg); +print load_fiche_titre($langs->trans("StatisticsOfSendings").' '.$year, $mesg); $stats = new ExpeditionStats($db); -$data = $stats->getNbExpeditionByMonth($_GET["year"]); +$data = $stats->getNbExpeditionByMonth($year); dol_mkdir($conf->expedition->dir_temp); From eb0b0baf4081e97f37b25c043c6dd5cb3c1ef434 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 25 Oct 2018 21:36:01 +0200 Subject: [PATCH 12/51] code comment expedition class --- htdocs/expedition/class/expedition.class.php | 177 +++++++++++++++---- 1 file changed, 138 insertions(+), 39 deletions(-) diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index 77df09ee276..d21e21c1624 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -77,14 +77,39 @@ class Expedition extends CommonObject public $picto = 'sending'; public $socid; + + /** + * @var string Customer ref + */ public $ref_customer; + + /** + * @var string internal ref + */ public $ref_int; + public $brouillon; + + /** + * @var int warehouse id + */ public $entrepot_id; public $lines=array(); + + /** + * @var string Tracking number + */ public $tracking_number; + + /** + * @var string Tracking url + */ public $tracking_url; public $billed; + + /** + * @var string name of pdf model + */ public $model_pdf; public $trueWeight; @@ -2343,14 +2368,19 @@ class ExpeditionLigne extends CommonObjectLine */ public $table_element='expeditiondet'; + /** + * @deprecated + * @see fk_origin_line + */ + public $origin_line_id; + /** * @var int ID */ public $fk_origin_line; /** - * Id of shipment - * @var int + * @var int Id of shipment */ public $fk_expedition; @@ -2359,51 +2389,120 @@ class ExpeditionLigne extends CommonObjectLine */ public $db; - // From llx_expeditiondet - var $qty; - var $qty_shipped; - var $fk_product; - var $detail_batch; - /** - * Id of warehouse - * @var int - */ + /** + * @var float qty asked From llx_expeditiondet + */ + public $qty; + + /** + * @var float qty shipped + */ + public $qty_shipped; + + /** + * @var int Id of product + */ + public $fk_product; + public $detail_batch; + + /** + * @var int Id of warehouse + */ public $entrepot_id; - // From llx_commandedet or llx_propaldet - var $qty_asked; + /** + * @var float qty asked From llx_commandedet or llx_propaldet + */ + public $qty_asked; + + /** + * @deprecated + * @see product_ref + */ + public $ref; + + /** + * @var string product ref + */ public $product_ref; - public $product_label; - public $product_desc; - - // Invoicing - var $remise_percent; - var $total_ht; // Total net of tax - var $total_ttc; // Total with tax - var $total_tva; // Total VAT - var $total_localtax1; // Total Local tax 1 - var $total_localtax2; // Total Local tax 2 - - - - // Deprecated - /** - * @deprecated - * @see fk_origin_line - */ - var $origin_line_id; - /** - * @deprecated - * @see product_ref - */ - var $ref; /** * @deprecated * @see product_label */ - var $libelle; + public $libelle; + + /** + * @var string product label + */ + public $product_label; + + /** + * @var string product description + * @deprecated + * @see product_desc + */ + public $desc; + + /** + * @var string product description + */ + public $product_desc; + + /** + * @var float weight + */ + public $weight; + public $weight_units; + + /** + * @var float weight + */ + public $length; + public $length_units; + + /** + * @var float weight + */ + public $surface; + public $surface_units; + + /** + * @var float weight + */ + public $volume; + public $volume_units; + + // Invoicing + public $remise_percent; + public $tva_tx; + + /** + * @var float total without tax + */ + public $total_ht; + + /** + * @var float total with tax + */ + public $total_ttc; + + /** + * @var float total vat + */ + public $total_tva; + + /** + * @var float total localtax 1 + */ + public $total_localtax1; + + /** + * @var float total localtax 2 + */ + public $total_localtax2; + /** * Constructor @@ -2454,7 +2553,7 @@ class ExpeditionLigne extends CommonObjectLine * * @param User $user User that modify * @param int $notrigger 1 = disable triggers - * @return int <0 if KO, line id >0 if OK + * @return int <0 if KO, line id >0 if OK */ function insert($user=null, $notrigger=0) { From 8a9b9f173657f6111bfa6a8ff461a2d2ecb02d41 Mon Sep 17 00:00:00 2001 From: atm-john Date: Thu, 25 Oct 2018 21:53:48 +0200 Subject: [PATCH 13/51] Fix title --- htdocs/core/tpl/ajax/objectlinked_lineimport.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/tpl/ajax/objectlinked_lineimport.tpl.php b/htdocs/core/tpl/ajax/objectlinked_lineimport.tpl.php index ad32f1b9aa8..ae80389bd3a 100644 --- a/htdocs/core/tpl/ajax/objectlinked_lineimport.tpl.php +++ b/htdocs/core/tpl/ajax/objectlinked_lineimport.tpl.php @@ -68,7 +68,7 @@ $(document).ready(function(){ modal: true, height: windowHeight, width: windowWidth, - title: "trans('LinesToImport'); ?>", + title: "transnoentities('LinesToImport'); ?>", buttons: { "trans('Import'); ?>": function() { $( this ).dialog( "close" ); From 21c441540cd7cc29321864c25ce9b033364106a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 25 Oct 2018 21:57:19 +0200 Subject: [PATCH 14/51] add string cast --- htdocs/accountancy/admin/importaccounts.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/htdocs/accountancy/admin/importaccounts.php b/htdocs/accountancy/admin/importaccounts.php index 752e1c18de9..a14509a2aee 100644 --- a/htdocs/accountancy/admin/importaccounts.php +++ b/htdocs/accountancy/admin/importaccounts.php @@ -2,6 +2,7 @@ /* Copyright (C) 2013-2014 Olivier Geffroy * Copyright (C) 2013-2017 Alexandre Spangaro * Copyright (C) 2014 Florian Henry + * Copyright (C) 2018 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -71,10 +72,10 @@ if ($_POST["action"] == 'import') { $accounting = new AccountingAccount($db); - $monLabel = GETPOST('label' . $maLigneCochee); - $monParentAccount = GETPOST('AccountParent' . $maLigneCochee); - $monType = GETPOST('pcgType' . $maLigneCochee); - $monSubType = GETPOST('pcgSubType' . $maLigneCochee); + $monLabel = (string) GETPOST('label' . $maLigneCochee); + $monParentAccount = (string) GETPOST('AccountParent' . $maLigneCochee); + $monType = (string) GETPOST('pcgType' . $maLigneCochee); + $monSubType = (string) GETPOST('pcgSubType' . $maLigneCochee); $accounting->fk_pcg_version = $obj->pcg_version; $accounting->account_number = $maLigneCochee; From 52b7d60a0ffc858d0e3b4d70aa622b55720280e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 26 Oct 2018 08:11:27 +0200 Subject: [PATCH 15/51] use strict compare with boolean --- htdocs/holiday/class/holiday.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php index 26e11383b9d..bc10ce5d53b 100644 --- a/htdocs/holiday/class/holiday.class.php +++ b/htdocs/holiday/class/holiday.class.php @@ -4,6 +4,7 @@ * Copyright (C) 2012-2016 Regis Houssin * Copyright (C) 2013 Florian Henry * Copyright (C) 2016 Juanjo Menent + * Copyright (C) 2018 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -188,7 +189,7 @@ class Holiday extends CommonObject $mybool|=@include_once $dir.$file; } - if (! $mybool) + if ($mybool === false) { dol_print_error('',"Failed to include file ".$file); return ''; From cae83cd8e790c17ccf7beb950559dded6deee507 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 26 Oct 2018 11:10:04 +0200 Subject: [PATCH 16/51] Add solution to translate --- htdocs/modulebuilder/template/class/myobject.class.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/modulebuilder/template/class/myobject.class.php b/htdocs/modulebuilder/template/class/myobject.class.php index 9f180343f5b..e69a4a5dbb2 100644 --- a/htdocs/modulebuilder/template/class/myobject.class.php +++ b/htdocs/modulebuilder/template/class/myobject.class.php @@ -182,7 +182,7 @@ class MyObject extends CommonObject */ public function __construct(DoliDB $db) { - global $conf, $user; + global $conf, $langs, $user; $this->db = $db; @@ -197,6 +197,9 @@ class MyObject extends CommonObject unset($this->fields[$key]); } } + + // Translate some data + $this->fields['status']['arrayofkeyval']=array(0=>$langs->trans('Draft'), 1=>$langs->trans('Active'), -1=>$langs->trans('Cancel')); } /** From 2ce7429735345ee057b1faafc9a3e1afe376e760 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 26 Oct 2018 12:09:52 +0200 Subject: [PATCH 17/51] Remove Google advert --- build/doxygen/doxygen_footer.html | 41 ++++++++++--------------------- 1 file changed, 13 insertions(+), 28 deletions(-) diff --git a/build/doxygen/doxygen_footer.html b/build/doxygen/doxygen_footer.html index a6d5bdfb293..8ffdc5341fe 100644 --- a/build/doxygen/doxygen_footer.html +++ b/build/doxygen/doxygen_footer.html @@ -3,42 +3,27 @@ File added into doxygen generated documentation --> - - - - - + - -
- - -
-
+ + + + + + From 0ba86d4e5b8ca0e3cc849c16ac63b4fcc2734b7e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 26 Oct 2018 12:22:31 +0200 Subject: [PATCH 18/51] Trans --- htdocs/langs/en_US/projects.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/projects.lang b/htdocs/langs/en_US/projects.lang index ce94a6dcc46..ec2061392a1 100644 --- a/htdocs/langs/en_US/projects.lang +++ b/htdocs/langs/en_US/projects.lang @@ -191,7 +191,7 @@ AssignTaskToUser=Assign task to %s SelectTaskToAssign=Select task to assign... AssignTask=Assign ProjectOverview=Overview -ManageTasks=Use projects to follow tasks and time +ManageTasks=Use projects to follow tasks and/or report time spent (timesheets) ManageOpportunitiesStatus=Use projects to follow leads/opportinuties ProjectNbProjectByMonth=No. of created projects by month ProjectNbTaskByMonth=No. of created tasks by month From 5d249d71ca861276c6915347061510bc7c62caf7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 26 Oct 2018 14:38:26 +0200 Subject: [PATCH 19/51] Fix menu at wrong place --- htdocs/core/menus/standard/eldy.lib.php | 17 ++++++++--------- htdocs/theme/eldy/style.css.php | 2 +- htdocs/theme/md/style.css.php | 2 +- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 562ed99a020..468579f6eb4 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -1380,7 +1380,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu $titlenew = $langs->trans("NewLead"); } - // Project affected to user + // Project assigned to user $newmenu->add("/projet/index.php?leftmenu=projects".($search_project_user?'&search_project_user='.$search_project_user:''), $titleboth, 0, $user->rights->projet->lire, '', $mainmenu, 'projects'); $newmenu->add("/projet/card.php?leftmenu=projects&action=create".($search_project_user?'&search_project_user='.$search_project_user:''), $titlenew, 1, $user->rights->projet->creer); @@ -1398,9 +1398,15 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu $newmenu->add('/projet/list.php?mainmenu=project&leftmenu=list&search_opp_status=openedopp&search_status=99', $langs->trans("List"), 2, $showmode); } - // All project i have permission on $newmenu->add("/projet/stats/index.php?leftmenu=projects", $langs->trans("Statistics"), 1, $user->rights->projet->lire); + // Categories + if (! empty($conf->categorie->enabled)) + { + $langs->load("categories"); + $newmenu->add("/categories/index.php?leftmenu=cat&type=6", $langs->trans("Categories"), 1, $user->rights->categorie->lire, '', $mainmenu, 'cat'); + } + if (empty($conf->global->PROJECT_HIDE_TASKS)) { // Project affected to user @@ -1411,13 +1417,6 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu $newmenu->add("/projet/activity/perweek.php?leftmenu=tasks".($search_project_user?'&search_project_user='.$search_project_user:''), $langs->trans("NewTimeSpent"), 0, $user->rights->projet->lire); } - - // Categories - if (! empty($conf->categorie->enabled)) - { - $langs->load("categories"); - $newmenu->add("/categories/index.php?leftmenu=cat&type=6", $langs->trans("Categories"), 1, $user->rights->categorie->lire, '', $mainmenu, 'cat'); - } } } diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index d9ad2a590ac..9eba59317bc 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -1856,7 +1856,7 @@ foreach($mainmenuusedarray as $val) } form#login { padding-bottom: 30px; - font-size: 13px; + font-size: 14px; vertical-align: middle; } .login_table_title { diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 2b760fcd894..80a79b0245a 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -1867,7 +1867,7 @@ a.tmenuimage { } form#login { padding-bottom: 30px; - font-size: 13px; + font-size: 14px; vertical-align: middle; } .login_table_title { From 20d7c8bb8cd714c2b572db70be4b20a0dd59902e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 26 Oct 2018 15:01:50 +0200 Subject: [PATCH 20/51] FIX Total of timespent --- htdocs/core/js/timesheet.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/htdocs/core/js/timesheet.js b/htdocs/core/js/timesheet.js index 44180b42acb..3bd93555d76 100644 --- a/htdocs/core/js/timesheet.js +++ b/htdocs/core/js/timesheet.js @@ -222,20 +222,21 @@ function updateTotal(days,mode) else jQuery('.totalDay'+days).removeClass("bold"); jQuery('.totalDay'+days).text(pad(total.getHours())+':'+pad(total.getMinutes())); - var total = new Date(0); - total.setHours(0); - total.setMinutes(0); + var totalhour = 0; + var totalmin = 0; for (var i=0; i<7; i++) { var taskTime= new Date(0); result=parseTime(jQuery('.totalDay'+i).text(),taskTime); if (result >= 0) { - total.setHours(total.getHours()+taskTime.getHours()); - total.setMinutes(total.getMinutes()+taskTime.getMinutes()); + totalhour = totalhour + taskTime.getHours(); + totalmin = totalmin + taskTime.getMinutes(); } } - jQuery('.totalDayAll').text(pad(total.getHours())+':'+pad(total.getMinutes())); + morehours = Math.floor(totalmin / 60); + totalmin = totalmin % 60; + jQuery('.totalDayAll').text(pad(morehours + totalhour)+':'+pad(totalmin)); } else { From 35421d135a0a638987ec774df0194bca23623783 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 26 Oct 2018 15:01:50 +0200 Subject: [PATCH 21/51] FIX Total of timespent Conflicts: htdocs/core/js/timesheet.js --- htdocs/core/js/timesheet.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/htdocs/core/js/timesheet.js b/htdocs/core/js/timesheet.js index ae7d839919c..aaec6971e2f 100644 --- a/htdocs/core/js/timesheet.js +++ b/htdocs/core/js/timesheet.js @@ -217,20 +217,21 @@ function updateTotal(days,mode) else jQuery('.totalDay'+days).removeClass("bold"); jQuery('.totalDay'+days).text(pad(total.getHours())+':'+pad(total.getMinutes())); - var total = new Date(0); - total.setHours(0); - total.setMinutes(0); + var totalhour = 0; + var totalmin = 0; for (var i=0; i<7; i++) { var taskTime= new Date(0); result=parseTime(jQuery('.totalDay'+i).text(),taskTime); if (result >= 0) { - total.setHours(total.getHours()+taskTime.getHours()); - total.setMinutes(total.getMinutes()+taskTime.getMinutes()); + totalhour = totalhour + taskTime.getHours(); + totalmin = totalmin + taskTime.getMinutes(); } } - jQuery('.totalDayAll').text(pad(total.getHours())+':'+pad(total.getMinutes())); + morehours = Math.floor(totalmin / 60); + totalmin = totalmin % 60; + jQuery('.totalDayAll').text(pad(morehours + totalhour)+':'+pad(totalmin)); } else { From 852b06978516e512589392b1bf226a1a574238f8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 26 Oct 2018 15:46:17 +0200 Subject: [PATCH 22/51] Fix reponsive in stats pages --- htdocs/adherents/stats/index.php | 2 ++ htdocs/comm/propal/stats/index.php | 3 ++- htdocs/commande/stats/index.php | 2 ++ htdocs/compta/deplacement/stats/index.php | 3 ++- htdocs/compta/facture/stats/index.php | 3 ++- htdocs/compta/salaries/stats/index.php | 2 ++ htdocs/don/stats/index.php | 2 ++ htdocs/expedition/stats/index.php | 3 +++ htdocs/expensereport/stats/index.php | 3 ++- htdocs/fichinter/stats/index.php | 2 ++ htdocs/projet/stats/index.php | 2 ++ htdocs/projet/tasks/stats/index.php | 3 +++ 12 files changed, 26 insertions(+), 4 deletions(-) diff --git a/htdocs/adherents/stats/index.php b/htdocs/adherents/stats/index.php index e3bc7287864..69958f60d76 100644 --- a/htdocs/adherents/stats/index.php +++ b/htdocs/adherents/stats/index.php @@ -167,6 +167,7 @@ print '

'; $data = $stats->getAllByYear(); +print '
'; print ''; print ''; print ''; @@ -207,6 +208,7 @@ foreach ($data as $val) } print '
'.$langs->trans("Year").'
'; +print '
'; print '
'; diff --git a/htdocs/comm/propal/stats/index.php b/htdocs/comm/propal/stats/index.php index b7f6bd68493..fc2b9c17ba4 100644 --- a/htdocs/comm/propal/stats/index.php +++ b/htdocs/comm/propal/stats/index.php @@ -276,6 +276,7 @@ print '
'; print '

'; //} +print '
'; print ''; print ''; print ''; @@ -318,7 +319,7 @@ foreach ($data as $val) } print '
'.$langs->trans("Year").'
'; - +print '
'; print '
'; diff --git a/htdocs/commande/stats/index.php b/htdocs/commande/stats/index.php index 49e7d5cfb60..d85b30792be 100644 --- a/htdocs/commande/stats/index.php +++ b/htdocs/commande/stats/index.php @@ -302,6 +302,7 @@ print ''; print '

'; +print '
'; print ''; print ''; print ''; @@ -346,6 +347,7 @@ foreach ($data as $val) } print '
'.$langs->trans("Year").'
'; +print '
'; print '
'; diff --git a/htdocs/compta/deplacement/stats/index.php b/htdocs/compta/deplacement/stats/index.php index 193e2c7e9a9..207e19fc265 100644 --- a/htdocs/compta/deplacement/stats/index.php +++ b/htdocs/compta/deplacement/stats/index.php @@ -256,6 +256,7 @@ print ''; print ''; print '

'; +print '
'; print ''; print ''; print ''; @@ -288,7 +289,7 @@ foreach ($data as $val) } print '
'.$langs->trans("Year").'
'; - +print '
'; print '
'; diff --git a/htdocs/compta/facture/stats/index.php b/htdocs/compta/facture/stats/index.php index 04603076b07..cbf147a8dff 100644 --- a/htdocs/compta/facture/stats/index.php +++ b/htdocs/compta/facture/stats/index.php @@ -280,6 +280,7 @@ print '
'; print '

'; //} +print '
'; print ''; print ''; print ''; @@ -323,7 +324,7 @@ foreach ($data as $val) } print '
'.$langs->trans("Year").'
'; - +print '
'; print '
'; diff --git a/htdocs/compta/salaries/stats/index.php b/htdocs/compta/salaries/stats/index.php index d5e3e226615..edb48edc303 100644 --- a/htdocs/compta/salaries/stats/index.php +++ b/htdocs/compta/salaries/stats/index.php @@ -214,6 +214,7 @@ print ''; print ''; print '

'; +print '
'; print ''; print ''; print ''; @@ -247,6 +248,7 @@ foreach ($data as $val) } print '
'.$langs->trans("Year").'
'; +print '
'; print '
'; diff --git a/htdocs/don/stats/index.php b/htdocs/don/stats/index.php index 224e674e9da..e71212e806a 100644 --- a/htdocs/don/stats/index.php +++ b/htdocs/don/stats/index.php @@ -259,6 +259,7 @@ print '
'; print '

'; //} +print '
'; print ''; print ''; print ''; @@ -293,6 +294,7 @@ foreach ($data as $val) } print '
'.$langs->trans("Year").'
'; +print '
'; print '
'; diff --git a/htdocs/expedition/stats/index.php b/htdocs/expedition/stats/index.php index a167a447d7d..43cf63cd3b3 100644 --- a/htdocs/expedition/stats/index.php +++ b/htdocs/expedition/stats/index.php @@ -259,6 +259,8 @@ print '
'; print '

'; //} + +print '
'; print ''; print ''; print ''; @@ -298,6 +300,7 @@ foreach ($data as $val) } print '
'.$langs->trans("Year").'
'; +print '
'; print '
'; diff --git a/htdocs/expensereport/stats/index.php b/htdocs/expensereport/stats/index.php index b97129a5779..e53757be1db 100644 --- a/htdocs/expensereport/stats/index.php +++ b/htdocs/expensereport/stats/index.php @@ -246,6 +246,7 @@ print ''; print ''; print '

'; +print '
'; print ''; print ''; print ''; @@ -281,7 +282,7 @@ foreach ($data as $val) } print '
'.$langs->trans("Year").'
'; - +print '
'; print '
'; diff --git a/htdocs/fichinter/stats/index.php b/htdocs/fichinter/stats/index.php index b3d5247e67d..f4df5f3c5f8 100644 --- a/htdocs/fichinter/stats/index.php +++ b/htdocs/fichinter/stats/index.php @@ -271,6 +271,7 @@ print '
'; print '

'; //} +print '
'; print ''; print ''; print ''; @@ -316,6 +317,7 @@ foreach ($data as $val) } print '
'.$langs->trans("Year").'
'; +print '
'; print '
'; diff --git a/htdocs/projet/stats/index.php b/htdocs/projet/stats/index.php index 46c6248ebd3..831917a76f6 100644 --- a/htdocs/projet/stats/index.php +++ b/htdocs/projet/stats/index.php @@ -302,6 +302,7 @@ print ''; print ''; print '

'; +print '
'; print ''; print ''; print ''; @@ -348,6 +349,7 @@ foreach ($data_all_year as $val) } print '
'.$langs->trans("Year").'
'; +print '
'; print '
'; diff --git a/htdocs/projet/tasks/stats/index.php b/htdocs/projet/tasks/stats/index.php index 68b52339ebb..020a7969a64 100644 --- a/htdocs/projet/tasks/stats/index.php +++ b/htdocs/projet/tasks/stats/index.php @@ -167,6 +167,8 @@ print ''; print ''; print '

'; + +print '
'; print ''; print ''; print ''; @@ -195,6 +197,7 @@ foreach ($data_all_year as $val) } print '
'.$langs->trans("Year").'
'; +print '
'; print '
'; From d800fe925625790ef14680a068936eadaf0b2eb8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 26 Oct 2018 16:21:01 +0200 Subject: [PATCH 23/51] FIX extrafields of taks not visible in creation --- htdocs/projet/tasks.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php index 145c1742077..94a51ef3d01 100644 --- a/htdocs/projet/tasks.php +++ b/htdocs/projet/tasks.php @@ -490,7 +490,7 @@ if ($action == 'create' && $user->rights->projet->creer && (empty($object->third // Planned workload print ''.$langs->trans("PlannedWorkload").''; - print $form->select_duration('planned_workload', $planned_workload?$planned_workload : $object->planned_workload,0,'text'); + print $form->select_duration('planned_workload', $planned_workload?$planned_workload : 0, 0, 'text'); print ''; // Progress @@ -506,11 +506,12 @@ if ($action == 'create' && $user->rights->projet->creer && (empty($object->third // Other options $parameters=array(); - $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook + $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$taskstatic,$action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; + if (empty($reshook) && ! empty($extrafields_task->attribute_label)) { - print $object->showOptionals($extrafields_task,'edit'); + print $taskstatic->showOptionals($extrafields_task,'edit'); // Do not use $object here that is object of project } print ''; From 087b68948d6afc8e95366dbdd448d9c579a327cd Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 26 Oct 2018 17:32:32 +0200 Subject: [PATCH 24/51] Fix: do not use point for graph with too many points. --- htdocs/compta/bank/graph.php | 8 ++++---- htdocs/core/class/dolgraph.class.php | 14 +++++++------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/htdocs/compta/bank/graph.php b/htdocs/compta/bank/graph.php index 7dad720139a..517c616ec28 100644 --- a/htdocs/compta/bank/graph.php +++ b/htdocs/compta/bank/graph.php @@ -265,7 +265,7 @@ else unset($amounts); } - // Tableau 2 + // Graph Balance for the year if ($mode == 'standard') { @@ -384,7 +384,7 @@ else $px2->SetTitle($title); $px2->SetWidth($WIDTH); $px2->SetHeight($HEIGHT); - $px2->SetType(array('lines','lines','lines')); + $px2->SetType(array('linesnopoint','linesnopoint','linesnopoint')); $px2->setBgColor('onglet'); $px2->setBgColorGrid(array(255,255,255)); $px2->SetHideXGrid(true); @@ -403,7 +403,7 @@ else unset($amounts); } - // Tableau 3 - All time line + // Graph 3 - Balance for all time line if ($mode == 'showalltime') { @@ -500,7 +500,7 @@ else $px3->SetTitle($title); $px3->SetWidth($WIDTH); $px3->SetHeight($HEIGHT); - $px3->SetType(array('lines','lines','lines')); + $px3->SetType(array('linesnopoint','linesnopoint','linesnopoint')); $px3->setBgColor('onglet'); $px3->setBgColorGrid(array(255,255,255)); $px3->SetPrecisionY(0); diff --git a/htdocs/core/class/dolgraph.class.php b/htdocs/core/class/dolgraph.class.php index cdf66aabb64..195bec09daf 100644 --- a/htdocs/core/class/dolgraph.class.php +++ b/htdocs/core/class/dolgraph.class.php @@ -704,7 +704,7 @@ class DolGraph // Create graph $classname=''; if (! isset($this->type[0]) || $this->type[0] == 'bars') $classname='BarPlot'; // Only one type (first one) is supported by artichow - else if ($this->type[0] == 'lines') $classname='LinePlot'; + else if ($this->type[0] == 'lines' || $this->type[0] == 'linesnopoint') $classname='LinePlot'; else $classname='TypeUnknown'; include_once ARTICHOW_PATH.$classname.'.class.php'; @@ -809,7 +809,7 @@ class DolGraph $plot->SetYMin($this->MinValue); } - if ($this->type[0] == 'lines') + if ($this->type[0] == 'lines' || $this->type[0] == 'linesnopoint') { $color=new Color($this->datacolor[$i][0],$this->datacolor[$i][1],$this->datacolor[$i][2],20); $colorbis=new Color(min($this->datacolor[$i][0]+20,255),min($this->datacolor[$i][1]+20,255),min($this->datacolor[$i][2]+20,255),60); @@ -840,8 +840,8 @@ class DolGraph // solve a bug in Artichow with UTF8 if (count($this->Legend)) { - if ($this->type[0] == 'bars') $group->legend->add($plot, $this->Legend[$i], LEGEND_BACKGROUND); - if ($this->type[0] == 'lines') $group->legend->add($plot, $this->Legend[$i], LEGEND_LINE); + if ($this->type[0] == 'bars') $group->legend->add($plot, $this->Legend[$i], LEGEND_BACKGROUND); + if ($this->type[0] == 'lines' || $this->type[0] == 'linesnopoint') $group->legend->add($plot, $this->Legend[$i], LEGEND_LINE); } $group->add($plot); @@ -880,7 +880,7 @@ class DolGraph * @param string $fileurl Url path to show image if saved onto disk. Never used here. * @return void */ - private function draw_jflot($file,$fileurl) + private function draw_jflot($file, $fileurl) { // phpcs:enable global $artichow_defaultfont; @@ -1084,7 +1084,7 @@ class DolGraph $color=sprintf("%02x%02x%02x",$this->datacolor[$i][0],$this->datacolor[$i][1],$this->datacolor[$i][2]); $this->stringtoshow.='{ '; if (! isset($this->type[$i]) || $this->type[$i] == 'bars') $this->stringtoshow.='bars: { lineWidth: 1, show: true, align: "'.($i==$firstlot?'center':'left').'", barWidth: 0.5 }, '; - if (isset($this->type[$i]) && $this->type[$i] == 'lines') $this->stringtoshow.='lines: { show: true, fill: false }, points: { show: true }, '; + if (isset($this->type[$i]) && ($this->type[$i] == 'lines' || $this->type[$i] == 'linesnopoint')) $this->stringtoshow.='lines: { show: true, fill: false }, points: { show: '.($this->type[$i] == 'linesnopoint' ? 'false' : 'true').' }, '; $this->stringtoshow.='color: "#'.$color.'", label: "'.(isset($this->Legend[$i]) ? dol_escape_js($this->Legend[$i]) : '').'", data: d'.$i.' }'; $i++; } @@ -1108,7 +1108,7 @@ class DolGraph // Background color $color1=sprintf("%02x%02x%02x",$this->bgcolorgrid[0],$this->bgcolorgrid[0],$this->bgcolorgrid[2]); $color2=sprintf("%02x%02x%02x",$this->bgcolorgrid[0],$this->bgcolorgrid[1],$this->bgcolorgrid[2]); - $this->stringtoshow.=', grid: { hoverable: true, backgroundColor: { colors: ["#'.$color1.'", "#'.$color2.'"] }, borderWidth: 1, borderColor: \'#f3f3f3\', tickColor : \'#f3f3f3\' }'."\n"; + $this->stringtoshow.=', grid: { hoverable: true, backgroundColor: { colors: ["#'.$color1.'", "#'.$color2.'"] }, borderWidth: 1, borderColor: \'#eee\', tickColor : \'#f3f3f3\' }'."\n"; //$this->stringtoshow.=', shadowSize: 20'."\n"; TODO Uncommet this $this->stringtoshow.='});'."\n"; $this->stringtoshow.='}'."\n"; From 35ab3c9aadbbe567279b9019ffac6489257d16dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 26 Oct 2018 18:24:04 +0200 Subject: [PATCH 25/51] Update holiday.php --- htdocs/admin/holiday.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/holiday.php b/htdocs/admin/holiday.php index c02c9bd480d..c1c5fe58b45 100644 --- a/htdocs/admin/holiday.php +++ b/htdocs/admin/holiday.php @@ -2,6 +2,7 @@ /* Copyright (C) 2011-2013 Juanjo Menent * Copyright (C) 2011-2018 Philippe Grand * Copyright (C) 2018 Charlene Benke + * Copyright (C) 2018 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -513,7 +514,6 @@ print ''; print '
'; print ''; - } From d3893b8b959ca979c8ec44f9d2a73f9893c91678 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 26 Oct 2018 19:00:24 +0200 Subject: [PATCH 26/51] Debug v9 --- htdocs/core/class/html.formprojet.class.php | 5 +++- .../install/mysql/migration/8.0.0-9.0.0.sql | 3 ++ htdocs/install/mysql/tables/llx_paiement.sql | 2 +- .../mysql/tables/llx_payment_salary.sql | 3 +- .../mysql/tables/llx_payment_various.sql | 3 +- htdocs/langs/en_US/projects.lang | 28 +++++++++---------- htdocs/projet/element.php | 6 ++-- htdocs/projet/tasks/time.php | 8 +++++- 8 files changed, 37 insertions(+), 21 deletions(-) diff --git a/htdocs/core/class/html.formprojet.class.php b/htdocs/core/class/html.formprojet.class.php index b2166453bbd..bc62ebc7604 100644 --- a/htdocs/core/class/html.formprojet.class.php +++ b/htdocs/core/class/html.formprojet.class.php @@ -490,7 +490,7 @@ class FormProjets if ($table_element == 'projet_task') return ''; // Special cas of element we never link to a project (already always done) $linkedtothirdparty=false; - if (! in_array($table_element, array('don','expensereport_det','expensereport','loan','stock_mouvement','chargesociales'))) $linkedtothirdparty=true; + if (! in_array($table_element, array('don','expensereport_det','expensereport','loan','stock_mouvement','payment_salary','payment_various','chargesociales'))) $linkedtothirdparty=true; $sqlfilter=''; @@ -533,6 +533,9 @@ class FormProjets $sql = 'SELECT t.rowid, t.label as ref'; $projectkey='fk_origin'; break; + case "payment_salary": + $sql = "SELECT t.rowid, t.num_payment as ref"; // TODO In a future fill and use real ref field + break; case "payment_various": $sql = "SELECT t.rowid, t.num_payment as ref"; break; diff --git a/htdocs/install/mysql/migration/8.0.0-9.0.0.sql b/htdocs/install/mysql/migration/8.0.0-9.0.0.sql index f98c932943c..40660508ad6 100644 --- a/htdocs/install/mysql/migration/8.0.0-9.0.0.sql +++ b/htdocs/install/mysql/migration/8.0.0-9.0.0.sql @@ -72,8 +72,11 @@ insert into llx_c_action_trigger (code,label,description,elementtype,rang) value insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('HOLIDAY_VALIDATE','Expense report validated','Executed when an expense report is validated','expensereport',202); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('HOLIDAY_APPROVE','Expense report approved','Executed when an expense report is approved','expensereport',203); +ALTER TABLE llx_payment_salary ADD COLUMN ref varchar(30) NULL; ALTER TABLE llx_payment_salary ADD COLUMN fk_projet integer DEFAULT NULL after amount; +ALTER TABLE llx_payment_various ADD COLUMN ref varchar(30) NULL; + ALTER TABLE llx_categorie ADD COLUMN ref_ext varchar(255); ALTER TABLE llx_paiement ADD COLUMN ext_payment_id varchar(128); diff --git a/htdocs/install/mysql/tables/llx_paiement.sql b/htdocs/install/mysql/tables/llx_paiement.sql index 6eb6b28f695..25c0097f10e 100644 --- a/htdocs/install/mysql/tables/llx_paiement.sql +++ b/htdocs/install/mysql/tables/llx_paiement.sql @@ -21,7 +21,7 @@ create table llx_paiement ( rowid integer AUTO_INCREMENT PRIMARY KEY, - ref varchar(30) NOT NULL, -- payment reference number + ref varchar(30) NULL, -- payment reference number entity integer DEFAULT 1 NOT NULL, -- Multi company id datec datetime, -- date de creation tms timestamp, diff --git a/htdocs/install/mysql/tables/llx_payment_salary.sql b/htdocs/install/mysql/tables/llx_payment_salary.sql index 4fcbc233f33..c56e6459aa0 100644 --- a/htdocs/install/mysql/tables/llx_payment_salary.sql +++ b/htdocs/install/mysql/tables/llx_payment_salary.sql @@ -19,6 +19,7 @@ create table llx_payment_salary ( rowid integer AUTO_INCREMENT PRIMARY KEY, + ref varchar(30) NOT NULL, -- payment reference number tms timestamp, datec datetime, -- Create date fk_user integer NOT NULL, @@ -28,7 +29,7 @@ create table llx_payment_salary amount double(24,8) NOT NULL DEFAULT 0, fk_projet integer DEFAULT NULL, fk_typepayment integer NOT NULL, - num_payment varchar(50), -- ref + num_payment varchar(50), -- num cheque or other label varchar(255), datesp date, -- date start period dateep date, -- date end period diff --git a/htdocs/install/mysql/tables/llx_payment_various.sql b/htdocs/install/mysql/tables/llx_payment_various.sql index e719dae7d8c..d3351287e58 100644 --- a/htdocs/install/mysql/tables/llx_payment_various.sql +++ b/htdocs/install/mysql/tables/llx_payment_various.sql @@ -19,7 +19,8 @@ create table llx_payment_various ( rowid integer AUTO_INCREMENT PRIMARY KEY, - num_payment varchar(50), -- ref + ref varchar(30) NOT NULL, -- payment reference number + num_payment varchar(50), -- num cheque or other label varchar(255), tms timestamp, datec datetime, -- Create date diff --git a/htdocs/langs/en_US/projects.lang b/htdocs/langs/en_US/projects.lang index ec2061392a1..c83bccd19ad 100644 --- a/htdocs/langs/en_US/projects.lang +++ b/htdocs/langs/en_US/projects.lang @@ -79,20 +79,20 @@ GoToListOfTimeConsumed=Go to list of time consumed GoToListOfTasks=Go to list of tasks GoToGanttView=Go to Gantt view GanttView=Gantt View -ListProposalsAssociatedProject=List of the commercial proposals associated with the project -ListOrdersAssociatedProject=List of customer orders associated with the project -ListInvoicesAssociatedProject=List of customer invoices associated with the project -ListPredefinedInvoicesAssociatedProject=List of customer template invoices associated with project -ListSupplierOrdersAssociatedProject=List of supplier orders associated with the project -ListSupplierInvoicesAssociatedProject=List of supplier invoices associated with the project -ListContractAssociatedProject=List of contracts associated with the project -ListShippingAssociatedProject=List of shippings associated with the project -ListFichinterAssociatedProject=List of interventions associated with the project -ListExpenseReportsAssociatedProject=List of expense reports associated with the project -ListDonationsAssociatedProject=List of donations associated with the project -ListVariousPaymentsAssociatedProject=List of miscellaneous payments associated with the project -ListSalariesAssociatedProject=List of salaries associated with the project -ListActionsAssociatedProject=List of events associated with the project +ListProposalsAssociatedProject=List of the commercial proposals related to the project +ListOrdersAssociatedProject=List of customer orders related to the project +ListInvoicesAssociatedProject=List of customer invoices related to the project +ListPredefinedInvoicesAssociatedProject=List of customer template invoices related to the project +ListSupplierOrdersAssociatedProject=List of supplier orders related to the project +ListSupplierInvoicesAssociatedProject=List of supplier invoices related to the project +ListContractAssociatedProject=List of contracts related to the project +ListShippingAssociatedProject=List of shippings related to the project +ListFichinterAssociatedProject=List of interventions related to the project +ListExpenseReportsAssociatedProject=List of expense reports related to the project +ListDonationsAssociatedProject=List of donations related to the project +ListVariousPaymentsAssociatedProject=List of miscellaneous payments related to the project +ListSalariesAssociatedProject=List of payments of salaries related to the project +ListActionsAssociatedProject=List of events related to the project ListTaskTimeUserProject=List of time consumed on tasks of project ListTaskTimeForTask=List of time consumed on task ActivityOnProjectToday=Activity on project today diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index 2c64826853c..e0ecf9d6051 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -451,7 +451,7 @@ $listofreferent=array( 'disableamount'=>0, 'urlnew'=>DOL_URL_ROOT.'/compta/salaries/card.php?action=create&projectid='.$id, 'lang'=>'salaries', - 'buttonnew'=>'AddSalariesPayment', + 'buttonnew'=>'AddSalaryPayment', 'testnew'=>$user->rights->salaries->write, 'test'=>$conf->salaries->enabled && $user->rights->salaries->read), 'variouspayment'=>array( @@ -872,7 +872,9 @@ foreach ($listofreferent as $key => $value) { if (empty($conf->global->PROJECT_DISABLE_UNLINK_FROM_OVERVIEW) || $user->admin) // PROJECT_DISABLE_UNLINK_FROM_OVERVIEW is empty by defaut, so this test true { - print '' . img_picto($langs->trans('Unlink'), 'editdelete') . ''; + print ''; + print img_picto($langs->trans('Unlink'), 'unlink'); + print ''; } } print "\n"; diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index e432fcdf7fd..bcfc7bde557 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -399,6 +399,11 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0) print nl2br($projectstatic->description); print ''; + // Bill time ? + print ''.$langs->trans("BillTime").''; + print yn($projectstatic->bill_time); + print ''; + // Categories if($conf->categorie->enabled) { print ''.$langs->trans("Categories").''; @@ -1090,7 +1095,7 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0) if (isset($task_time->total_ht)) print price($valuebilled, 1, $langs, 1, -1, -1, $conf->currency); print ''; if (! $i) $totalarray['nbfield']++; - if (! $i) $totalarray['totalvaluefield']=$totalarray['nbfield']; + if (! $i) $totalarray['totalvaluebilledfield']=$totalarray['nbfield']; $totalarray['totalvaluebilled'] += $valuebilled; } @@ -1152,6 +1157,7 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0) } elseif ($totalarray['totaldurationfield'] == $i) print ''.convertSecondToTime($totalarray['totalduration'],'allhourmin').''; elseif ($totalarray['totalvaluefield'] == $i) print ''.price($totalarray['totalvalue']).''; + elseif ($totalarray['totalvaluebilledfield'] == $i) print ''.price($totalarray['totalvaluebilled']).''; else print ''; } print ''; From 622f31fd1e1cf9cc717b5bb8cb70e650adca9b6f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 26 Oct 2018 19:01:42 +0200 Subject: [PATCH 27/51] Fix ref --- htdocs/install/mysql/migration/8.0.0-9.0.0.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/install/mysql/migration/8.0.0-9.0.0.sql b/htdocs/install/mysql/migration/8.0.0-9.0.0.sql index 40660508ad6..a7efecbdc5f 100644 --- a/htdocs/install/mysql/migration/8.0.0-9.0.0.sql +++ b/htdocs/install/mysql/migration/8.0.0-9.0.0.sql @@ -72,10 +72,10 @@ insert into llx_c_action_trigger (code,label,description,elementtype,rang) value insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('HOLIDAY_VALIDATE','Expense report validated','Executed when an expense report is validated','expensereport',202); insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('HOLIDAY_APPROVE','Expense report approved','Executed when an expense report is approved','expensereport',203); -ALTER TABLE llx_payment_salary ADD COLUMN ref varchar(30) NULL; +ALTER TABLE llx_payment_salary ADD COLUMN ref varchar(30) NULL after rowid; ALTER TABLE llx_payment_salary ADD COLUMN fk_projet integer DEFAULT NULL after amount; -ALTER TABLE llx_payment_various ADD COLUMN ref varchar(30) NULL; +ALTER TABLE llx_payment_various ADD COLUMN ref varchar(30) NULL after rowid; ALTER TABLE llx_categorie ADD COLUMN ref_ext varchar(255); From 47ac420133f092f0f12dfe7b0bd8d5d5eeab9d1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 26 Oct 2018 20:12:46 +0200 Subject: [PATCH 28/51] code comment html form class --- htdocs/core/class/html.form.class.php | 31 ++++++++++++++------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index c30dcec6e01..70ffa6ea006 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -3283,17 +3283,17 @@ class Form if ($empty && empty($arraytypes['code'])) continue; if ($format == 0) print ''; } @@ -3806,18 +3806,18 @@ class Form { $more.=''.$input['label'].''."\n"; } - else if ($input['type'] == 'password') + elseif ($input['type'] == 'password') { $more.=''.$input['label'].''."\n"; } - else if ($input['type'] == 'select') + elseif ($input['type'] == 'select') { $more.=''; if (! empty($input['label'])) $more.=$input['label'].''; $more.=$this->selectarray($input['name'],$input['values'],$input['default'],1,0,0,$moreattr,0,0,0,'',$morecss); $more.=''."\n"; } - else if ($input['type'] == 'checkbox') + elseif ($input['type'] == 'checkbox') { $more.=''; $more.=''.$input['label'].' '; @@ -3828,7 +3828,7 @@ class Form $more.=' />'; $more.=''."\n"; } - else if ($input['type'] == 'radio') + elseif ($input['type'] == 'radio') { $i=0; foreach($input['values'] as $selkey => $selval) @@ -3844,7 +3844,7 @@ class Form $i++; } } - else if ($input['type'] == 'date') + elseif ($input['type'] == 'date') { $more.=''.$input['label'].''; $more.=''; @@ -3856,7 +3856,7 @@ class Form $formquestion[] = array('name'=>$input['name'].'hour'); $formquestion[] = array('name'=>$input['name'].'min'); } - else if ($input['type'] == 'other') + elseif ($input['type'] == 'other') { $more.=''; if (! empty($input['label'])) $more.=$input['label'].''; @@ -3864,7 +3864,7 @@ class Form $more.=''."\n"; } - else if ($input['type'] == 'onecolumn') + elseif ($input['type'] == 'onecolumn') { $more.=''; $more.=$input['value']; @@ -4589,6 +4589,7 @@ class Form * * @param string $selected preselected currency code * @param string $htmlname name of HTML select list + * @deprecated * @return void */ function select_currency($selected='',$htmlname='currency_id') @@ -4976,7 +4977,7 @@ class Form * @param int $fullday When a checkbox with this html name is on, hour and day are set with 00:00 or 23:59 * @param string $addplusone Add a link "+1 hour". Value must be name of another select_date field. * @param datetime $adddateof Add a link "Date of invoice" using the following date. - * @return string|null Nothing or string if nooutput is 1 + * @return string|void Nothing or string if nooutput is 1 * @deprecated * @see form_date, select_month, select_year, select_dayofweek */ @@ -5374,7 +5375,7 @@ class Form * if 'textselect' input hour is in text and input min is a combo * @param integer $minunderhours If 1, show minutes selection under the hours * @param int $nooutput Do not output html string but return it - * @return string|null + * @return string|void */ function select_duration($prefix, $iSecond='', $disabled=0, $typehour='select', $minunderhours=0, $nooutput=0) { From b80d2fa12de04de26a573a2529129e77b5d6bdf9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 26 Oct 2018 21:09:46 +0200 Subject: [PATCH 29/51] fill empty catch with log --- .../doc/doc_generic_order_odt.modules.php | 2 +- .../doc/doc_generic_contract_odt.modules.php | 17 +- .../doc/doc_generic_shipment_odt.modules.php | 29 +- .../doc/doc_generic_invoice_odt.modules.php | 27 +- .../doc/doc_generic_product_odt.modules.php | 37 ++- .../doc/doc_generic_project_odt.modules.php | 266 +++++++++--------- .../task/doc/doc_generic_task_odt.modules.php | 45 +-- .../doc/doc_generic_proposal_odt.modules.php | 19 +- .../societe/doc/doc_generic_odt.modules.php | 15 +- .../doc/doc_generic_stock_odt.modules.php | 17 +- ..._generic_supplier_proposal_odt.modules.php | 27 +- .../user/doc/doc_generic_user_odt.modules.php | 22 +- .../doc/doc_generic_usergroup_odt.modules.php | 49 ++-- 13 files changed, 338 insertions(+), 234 deletions(-) diff --git a/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php b/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php index dff597c5593..a849d2a2c7a 100644 --- a/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php +++ b/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php @@ -488,7 +488,7 @@ class doc_generic_order_odt extends ModelePDFCommandes else { try { $odfHandler->saveToDisk($file); - }catch (Exception $e){ + } catch (Exception $e) { $this->error=$e->getMessage(); dol_syslog($e->getMessage(), LOG_INFO); return -1; diff --git a/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php b/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php index f70514b2912..5a19d821653 100644 --- a/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php +++ b/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php @@ -2,7 +2,8 @@ /* Copyright (C) 2010-2012 Laurent Destailleur * Copyright (C) 2012 Juanjo Menent * Copyright (C) 2018 Ferran Marcet -* + * Copyright (C) 2018 Frédéric France + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or @@ -354,6 +355,7 @@ class doc_generic_contract_odt extends ModelePDFContract catch(Exception $e) { $this->error=$e->getMessage(); + dol_syslog($e->getMessage(), LOG_INFO); return -1; } // After construction $odfHandler->contentXml contains content and @@ -367,8 +369,9 @@ class doc_generic_contract_odt extends ModelePDFContract try { $odfHandler->setVars('free_text', $newfreetext, true, 'UTF-8'); } - catch(OdfException $e) + catch (OdfException $e) { + dol_syslog($e->getMessage(), LOG_INFO); } foreach($tmparray as $key=>$value) @@ -384,8 +387,9 @@ class doc_generic_contract_odt extends ModelePDFContract $odfHandler->setVars($key, $value, true, 'UTF-8'); } } - catch(OdfException $e) + catch (OdfException $e) { + dol_syslog($e->getMessage(), LOG_INFO); } } @@ -419,9 +423,11 @@ class doc_generic_contract_odt extends ModelePDFContract } catch(OdfException $e) { + dol_syslog($e->getMessage(), LOG_INFO); } catch(SegmentException $e) { + dol_syslog($e->getMessage(), LOG_INFO); } } $listlines->merge(); @@ -445,6 +451,7 @@ class doc_generic_contract_odt extends ModelePDFContract } catch(OdfException $e) { + dol_syslog($e->getMessage(), LOG_INFO); } } @@ -456,7 +463,7 @@ class doc_generic_contract_odt extends ModelePDFContract if (!empty($conf->global->MAIN_ODT_AS_PDF)) { try { $odfHandler->exportAsAttachedPDF($file); - }catch (Exception $e){ + } catch (Exception $e) { $this->error=$e->getMessage(); return -1; } @@ -464,7 +471,7 @@ class doc_generic_contract_odt extends ModelePDFContract else { try { $odfHandler->saveToDisk($file); - }catch (Exception $e){ + } catch (Exception $e) { $this->error=$e->getMessage(); return -1; } diff --git a/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php b/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php index 38696cb3cc2..6a1543af4cf 100644 --- a/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php +++ b/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php @@ -4,8 +4,8 @@ * Copyright (C) 2014 Marcos García * Copyright (C) 2016 Charlie Benke * Copyright (C) 2018 Philippe Grand - -* + * Copyright (C) 2018 Frédéric France + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or @@ -347,6 +347,7 @@ class doc_generic_shipment_odt extends ModelePdfExpedition catch(Exception $e) { $this->error=$e->getMessage(); + dol_syslog($e->getMessage(), LOG_INFO); return -1; } // After construction $odfHandler->contentXml contains content and @@ -362,6 +363,7 @@ class doc_generic_shipment_odt extends ModelePdfExpedition } catch(OdfException $e) { + dol_syslog($e->getMessage(), LOG_INFO); } // Make substitutions into odt of user info @@ -381,8 +383,9 @@ class doc_generic_shipment_odt extends ModelePdfExpedition $odfHandler->setVars($key, $value, true, 'UTF-8'); } } - catch(OdfException $e) + catch (OdfException $e) { + dol_syslog($e->getMessage(), LOG_INFO); } } // Make substitutions into odt of mysoc @@ -402,8 +405,9 @@ class doc_generic_shipment_odt extends ModelePdfExpedition $odfHandler->setVars($key, $value, true, 'UTF-8'); } } - catch(OdfException $e) + catch (OdfException $e) { + dol_syslog($e->getMessage(), LOG_INFO); } } // Make substitutions into odt of thirdparty @@ -421,8 +425,9 @@ class doc_generic_shipment_odt extends ModelePdfExpedition $odfHandler->setVars($key, $value, true, 'UTF-8'); } } - catch(OdfException $e) + catch (OdfException $e) { + dol_syslog($e->getMessage(), LOG_INFO); } } // Replace tags of object + external modules @@ -446,6 +451,7 @@ class doc_generic_shipment_odt extends ModelePdfExpedition } catch(OdfException $e) { + dol_syslog($e->getMessage(), LOG_INFO); } } // Replace tags of lines @@ -478,9 +484,11 @@ class doc_generic_shipment_odt extends ModelePdfExpedition } catch(OdfException $e) { + dol_syslog($e->getMessage(), LOG_INFO); } catch(SegmentException $e) { + dol_syslog($e->getMessage(), LOG_INFO); } } $listlines->merge(); @@ -488,7 +496,7 @@ class doc_generic_shipment_odt extends ModelePdfExpedition $odfHandler->mergeSegment($listlines); } } - catch(OdfException $e) + catch (OdfException $e) { $this->error=$e->getMessage(); dol_syslog($this->error, LOG_WARNING); @@ -502,8 +510,9 @@ class doc_generic_shipment_odt extends ModelePdfExpedition try { $odfHandler->setVars($key, $value, true, 'UTF-8'); } - catch(OdfException $e) + catch (OdfException $e) { + dol_syslog($e->getMessage(), LOG_INFO); } } @@ -515,16 +524,18 @@ class doc_generic_shipment_odt extends ModelePdfExpedition if (!empty($conf->global->MAIN_ODT_AS_PDF)) { try { $odfHandler->exportAsAttachedPDF($file); - }catch (Exception $e){ + } catch (Exception $e) { $this->error=$e->getMessage(); + dol_syslog($e->getMessage(), LOG_INFO); return -1; } } else { try { $odfHandler->saveToDisk($file); - }catch (Exception $e){ + } catch (Exception $e) { $this->error=$e->getMessage(); + dol_syslog($e->getMessage(), LOG_INFO); return -1; } } diff --git a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php index a823bae2d4b..bfe22b93ae3 100644 --- a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php +++ b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php @@ -1,9 +1,10 @@ -* Copyright (C) 2012 Regis Houssin -* Copyright (C) 2014 Marcos García -* Copyright (C) 2016 Charlie Benke -* + * Copyright (C) 2012 Regis Houssin + * Copyright (C) 2014 Marcos García + * Copyright (C) 2016 Charlie Benke + * Copyright (C) 2018 Frédéric France + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or @@ -355,9 +356,10 @@ class doc_generic_invoice_odt extends ModelePDFFactures ) ); } - catch(Exception $e) + catch (Exception $e) { $this->error=$e->getMessage(); + dol_syslog($e->getMessage(), LOG_INFO); return -1; } // After construction $odfHandler->contentXml contains content and @@ -371,8 +373,9 @@ class doc_generic_invoice_odt extends ModelePDFFactures try { $odfHandler->setVars('free_text', $newfreetext, true, 'UTF-8'); } - catch(OdfException $e) + catch (OdfException $e) { + dol_syslog($e->getMessage(), LOG_INFO); } // Define substitution array @@ -410,8 +413,9 @@ class doc_generic_invoice_odt extends ModelePDFFactures $odfHandler->setVars($key, $value, true, 'UTF-8'); } } - catch(OdfException $e) + catch (OdfException $e) { + dol_syslog($e->getMessage(), LOG_INFO); } } // Replace tags of lines @@ -444,9 +448,11 @@ class doc_generic_invoice_odt extends ModelePDFFactures } catch(OdfException $e) { + dol_syslog($e->getMessage(), LOG_INFO); } catch(SegmentException $e) { + dol_syslog($e->getMessage(), LOG_INFO); } } $listlines->merge(); @@ -470,6 +476,7 @@ class doc_generic_invoice_odt extends ModelePDFFactures } catch(OdfException $e) { + dol_syslog($e->getMessage(), LOG_INFO); } } @@ -483,14 +490,16 @@ class doc_generic_invoice_odt extends ModelePDFFactures $odfHandler->exportAsAttachedPDF($file); }catch (Exception $e){ $this->error=$e->getMessage(); + dol_syslog($e->getMessage(), LOG_INFO); return -1; } } else { try { - $odfHandler->saveToDisk($file); - }catch (Exception $e){ + $odfHandler->saveToDisk($file); + } catch (Exception $e) { $this->error=$e->getMessage(); + dol_syslog($e->getMessage(), LOG_INFO); return -1; } } diff --git a/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php b/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php index 82b33d35240..979b6fbe7fd 100644 --- a/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php +++ b/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php @@ -1,7 +1,8 @@ * Copyright (C) 2012 Juanjo Menent -* + * Copyright (C) 2018 Frédéric France + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or @@ -358,16 +359,17 @@ class doc_generic_product_odt extends ModelePDFProduct $odfHandler = new odf( $srctemplatepath, array( - 'PATH_TO_TMP' => $conf->produit->dir_temp, - 'ZIP_PROXY' => 'PclZipProxy', // PhpZipProxy or PclZipProxy. Got "bad compression method" error when using PhpZipProxy. - 'DELIMITER_LEFT' => '{', - 'DELIMITER_RIGHT' => '}' + 'PATH_TO_TMP' => $conf->produit->dir_temp, + 'ZIP_PROXY' => 'PclZipProxy', // PhpZipProxy or PclZipProxy. Got "bad compression method" error when using PhpZipProxy. + 'DELIMITER_LEFT' => '{', + 'DELIMITER_RIGHT' => '}' ) ); } - catch(Exception $e) + catch (Exception $e) { $this->error=$e->getMessage(); + dol_syslog($e->getMessage(), LOG_INFO); return -1; } // After construction $odfHandler->contentXml contains content and @@ -382,8 +384,9 @@ class doc_generic_product_odt extends ModelePDFProduct try { $odfHandler->setVars('free_text', $newfreetext, true, 'UTF-8'); } - catch(OdfException $e) + catch (OdfException $e) { + dol_syslog($e->getMessage(), LOG_INFO); } // Define substitution array @@ -418,8 +421,9 @@ class doc_generic_product_odt extends ModelePDFProduct $odfHandler->setVars($key, $value, true, 'UTF-8'); } } - catch(OdfException $e) + catch (OdfException $e) { + dol_syslog($e->getMessage(), LOG_INFO); } } // Replace tags of lines @@ -440,11 +444,13 @@ class doc_generic_product_odt extends ModelePDFProduct { $listlines->setVars($key, $val, true, 'UTF-8'); } - catch(OdfException $e) + catch (OdfException $e) { + dol_syslog($e->getMessage(), LOG_INFO); } - catch(SegmentException $e) + catch (SegmentException $e) { + dol_syslog($e->getMessage(), LOG_INFO); } } $listlines->merge(); @@ -452,7 +458,7 @@ class doc_generic_product_odt extends ModelePDFProduct } $odfHandler->mergeSegment($listlines); } - catch(OdfException $e) + catch (OdfException $e) { $this->error=$e->getMessage(); dol_syslog($this->error, LOG_WARNING); @@ -468,6 +474,7 @@ class doc_generic_product_odt extends ModelePDFProduct } catch(OdfException $e) { + dol_syslog($e->getMessage(), LOG_INFO); } } @@ -479,16 +486,18 @@ class doc_generic_product_odt extends ModelePDFProduct if (!empty($conf->global->MAIN_ODT_AS_PDF)) { try { $odfHandler->exportAsAttachedPDF($file); - }catch (Exception $e){ + } catch (Exception $e) { $this->error=$e->getMessage(); + dol_syslog($e->getMessage(), LOG_INFO); return -1; } } else { try { - $odfHandler->saveToDisk($file); - }catch (Exception $e){ + $odfHandler->saveToDisk($file); + } catch (Exception $e) { $this->error=$e->getMessage(); + dol_syslog($e->getMessage(), LOG_INFO); return -1; } } diff --git a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php index bc5da5e306b..d2fa94ceb1e 100644 --- a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php +++ b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php @@ -3,6 +3,7 @@ * Copyright (C) 2012 Juanjo Menent * Copyright (C) 2013 Florian Henry * Copyright (C) 2016 Charlie Benke + * Copyright (C) 2018 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -596,10 +597,9 @@ class doc_generic_project_odt extends ModelePDFProjects 'DELIMITER_RIGHT' => '}' ) ); - } - catch(Exception $e) - { + } catch (Exception $e) { $this->error=$e->getMessage(); + dol_syslog($e->getMessage(), LOG_INFO); return -1; } // After construction $odfHandler->contentXml contains content and @@ -641,8 +641,9 @@ class doc_generic_project_odt extends ModelePDFProjects $odfHandler->setVars($key, $value, true, 'UTF-8'); } } - catch(OdfException $e) + catch (OdfException $e) { + dol_syslog($e->getMessage(), LOG_INFO); } } @@ -672,9 +673,11 @@ class doc_generic_project_odt extends ModelePDFProjects } catch(OdfException $e) { + dol_syslog($e->getMessage(), LOG_INFO); } catch(SegmentException $e) { + dol_syslog($e->getMessage(), LOG_INFO); } } @@ -721,9 +724,11 @@ class doc_generic_project_odt extends ModelePDFProjects } catch(OdfException $e) { + dol_syslog($e->getMessage(), LOG_INFO); } catch(SegmentException $e) { + dol_syslog($e->getMessage(), LOG_INFO); } } $listlinestaskres->merge(); @@ -768,9 +773,11 @@ class doc_generic_project_odt extends ModelePDFProjects } catch(OdfException $e) { + dol_syslog($e->getMessage(), LOG_INFO); } catch(SegmentException $e) { + dol_syslog($e->getMessage(), LOG_INFO); } } $listlinestasktime->merge(); @@ -806,9 +813,11 @@ class doc_generic_project_odt extends ModelePDFProjects } catch(OdfException $e) { + dol_syslog($e->getMessage(), LOG_INFO); } catch(SegmentException $e) { + dol_syslog($e->getMessage(), LOG_INFO); } } $listlinestasktime->merge(); @@ -835,11 +844,13 @@ class doc_generic_project_odt extends ModelePDFProjects { $listtasksfiles->setVars($key, $val, true, 'UTF-8'); } - catch(OdfException $e) + catch (OdfException $e) { + dol_syslog($e->getMessage(), LOG_INFO); } - catch(SegmentException $e) + catch (SegmentException $e) { + dol_syslog($e->getMessage(), LOG_INFO); } } $listtasksfiles->merge(); @@ -881,9 +892,11 @@ class doc_generic_project_odt extends ModelePDFProjects } catch(OdfException $e) { + dol_syslog($e->getMessage(), LOG_INFO); } catch(SegmentException $e) { + dol_syslog($e->getMessage(), LOG_INFO); } } $listlines->merge(); @@ -938,9 +951,11 @@ class doc_generic_project_odt extends ModelePDFProjects } catch(OdfException $e) { + dol_syslog($e->getMessage(), LOG_INFO); } catch(SegmentException $e) { + dol_syslog($e->getMessage(), LOG_INFO); } } $listlines->merge(); @@ -958,113 +973,113 @@ class doc_generic_project_odt extends ModelePDFProjects //List of referent $listofreferent = array( - 'propal' => array( - 'title' => "ListProposalsAssociatedProject", - 'class' => 'Propal', - 'table' => 'propal', - 'test' => $conf->propal->enabled && $user->rights->propale->lire - ), - 'order' => array( - 'title' => "ListOrdersAssociatedProject", - 'class' => 'Commande', - 'table' => 'commande', - 'test' => $conf->commande->enabled && $user->rights->commande->lire - ), - 'invoice' => array( - 'title' => "ListInvoicesAssociatedProject", - 'class' => 'Facture', - 'table' => 'facture', - 'test' => $conf->facture->enabled && $user->rights->facture->lire - ), - 'invoice_predefined' => array( - 'title' => "ListPredefinedInvoicesAssociatedProject", - 'class' => 'FactureRec', - 'table' => 'facture_rec', - 'test' => $conf->facture->enabled && $user->rights->facture->lire - ), - 'proposal_supplier' => array( - 'title' => "ListSupplierProposalsAssociatedProject", - 'class' => 'SupplierProposal', - 'table' => 'supplier_proposal', - 'test' => $conf->supplier_proposal->enabled && $user->rights->supplier_proposal->lire - ), - 'order_supplier' => array( - 'title' => "ListSupplierOrdersAssociatedProject", - 'table' => 'commande_fournisseur', - 'class' => 'CommandeFournisseur', - 'test' => $conf->fournisseur->enabled && $user->rights->fournisseur->commande->lire - ), - 'invoice_supplier' => array( - 'title' => "ListSupplierInvoicesAssociatedProject", - 'table' => 'facture_fourn', - 'class' => 'FactureFournisseur', - 'test' => $conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire - ), - 'contract' => array( - 'title' => "ListContractAssociatedProject", - 'class' => 'Contrat', - 'table' => 'contrat', - 'test' => $conf->contrat->enabled && $user->rights->contrat->lire - ), - 'intervention' => array( - 'title' => "ListFichinterAssociatedProject", - 'class' => 'Fichinter', - 'table' => 'fichinter', - 'disableamount' => 1, - 'test' => $conf->ficheinter->enabled && $user->rights->ficheinter->lire - ), - 'shipping' => array( - 'title' => "ListShippingAssociatedProject", - 'class' => 'Expedition', - 'table' => 'expedition', - 'disableamount' => 1, - 'test' => $conf->expedition->enabled && $user->rights->expedition->lire - ), - 'trip' => array( - 'title' => "ListTripAssociatedProject", - 'class' => 'Deplacement', - 'table' => 'deplacement', - 'disableamount' => 1, - 'test' => $conf->deplacement->enabled && $user->rights->deplacement->lire - ), - 'expensereport' => array( - 'title' => "ListExpenseReportsAssociatedProject", - 'class' => 'ExpenseReportLine', - 'table' => 'expensereport_det', - 'test' => $conf->expensereport->enabled && $user->rights->expensereport->lire - ), - 'donation' => array( - 'title' => "ListDonationsAssociatedProject", - 'class' => 'Don', - 'table' => 'don', - 'test' => $conf->don->enabled && $user->rights->don->lire - ), - 'loan' => array( - 'title' => "ListLoanAssociatedProject", - 'class' => 'Loan', - 'table' => 'loan', - 'test' => $conf->loan->enabled && $user->rights->loan->read - ), - 'chargesociales' => array( - 'title' => "ListSocialContributionAssociatedProject", - 'class' => 'ChargeSociales', - 'table' => 'chargesociales', - 'urlnew' => DOL_URL_ROOT . '/compta/sociales/card.php?action=create&projectid=' . $id, - 'test' => $conf->tax->enabled && $user->rights->tax->charges->lire - ), - 'stock_mouvement' => array( - 'title' => "ListMouvementStockProject", - 'class' => 'MouvementStock', - 'table' => 'stock_mouvement', - 'test' => ($conf->stock->enabled && $user->rights->stock->mouvement->lire && ! empty($conf->global->STOCK_MOVEMENT_INTO_PROJECT_OVERVIEW)) - ), - 'agenda' => array( - 'title' => "ListActionsAssociatedProject", - 'class' => 'ActionComm', - 'table' => 'actioncomm', - 'disableamount' => 1, - 'test' => $conf->agenda->enabled && $user->rights->agenda->allactions->lire - ) + 'propal' => array( + 'title' => "ListProposalsAssociatedProject", + 'class' => 'Propal', + 'table' => 'propal', + 'test' => $conf->propal->enabled && $user->rights->propale->lire + ), + 'order' => array( + 'title' => "ListOrdersAssociatedProject", + 'class' => 'Commande', + 'table' => 'commande', + 'test' => $conf->commande->enabled && $user->rights->commande->lire + ), + 'invoice' => array( + 'title' => "ListInvoicesAssociatedProject", + 'class' => 'Facture', + 'table' => 'facture', + 'test' => $conf->facture->enabled && $user->rights->facture->lire + ), + 'invoice_predefined' => array( + 'title' => "ListPredefinedInvoicesAssociatedProject", + 'class' => 'FactureRec', + 'table' => 'facture_rec', + 'test' => $conf->facture->enabled && $user->rights->facture->lire + ), + 'proposal_supplier' => array( + 'title' => "ListSupplierProposalsAssociatedProject", + 'class' => 'SupplierProposal', + 'table' => 'supplier_proposal', + 'test' => $conf->supplier_proposal->enabled && $user->rights->supplier_proposal->lire + ), + 'order_supplier' => array( + 'title' => "ListSupplierOrdersAssociatedProject", + 'table' => 'commande_fournisseur', + 'class' => 'CommandeFournisseur', + 'test' => $conf->fournisseur->enabled && $user->rights->fournisseur->commande->lire + ), + 'invoice_supplier' => array( + 'title' => "ListSupplierInvoicesAssociatedProject", + 'table' => 'facture_fourn', + 'class' => 'FactureFournisseur', + 'test' => $conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire + ), + 'contract' => array( + 'title' => "ListContractAssociatedProject", + 'class' => 'Contrat', + 'table' => 'contrat', + 'test' => $conf->contrat->enabled && $user->rights->contrat->lire + ), + 'intervention' => array( + 'title' => "ListFichinterAssociatedProject", + 'class' => 'Fichinter', + 'table' => 'fichinter', + 'disableamount' => 1, + 'test' => $conf->ficheinter->enabled && $user->rights->ficheinter->lire + ), + 'shipping' => array( + 'title' => "ListShippingAssociatedProject", + 'class' => 'Expedition', + 'table' => 'expedition', + 'disableamount' => 1, + 'test' => $conf->expedition->enabled && $user->rights->expedition->lire + ), + 'trip' => array( + 'title' => "ListTripAssociatedProject", + 'class' => 'Deplacement', + 'table' => 'deplacement', + 'disableamount' => 1, + 'test' => $conf->deplacement->enabled && $user->rights->deplacement->lire + ), + 'expensereport' => array( + 'title' => "ListExpenseReportsAssociatedProject", + 'class' => 'ExpenseReportLine', + 'table' => 'expensereport_det', + 'test' => $conf->expensereport->enabled && $user->rights->expensereport->lire + ), + 'donation' => array( + 'title' => "ListDonationsAssociatedProject", + 'class' => 'Don', + 'table' => 'don', + 'test' => $conf->don->enabled && $user->rights->don->lire + ), + 'loan' => array( + 'title' => "ListLoanAssociatedProject", + 'class' => 'Loan', + 'table' => 'loan', + 'test' => $conf->loan->enabled && $user->rights->loan->read + ), + 'chargesociales' => array( + 'title' => "ListSocialContributionAssociatedProject", + 'class' => 'ChargeSociales', + 'table' => 'chargesociales', + 'urlnew' => DOL_URL_ROOT . '/compta/sociales/card.php?action=create&projectid=' . $id, + 'test' => $conf->tax->enabled && $user->rights->tax->charges->lire + ), + 'stock_mouvement' => array( + 'title' => "ListMouvementStockProject", + 'class' => 'MouvementStock', + 'table' => 'stock_mouvement', + 'test' => ($conf->stock->enabled && $user->rights->stock->mouvement->lire && ! empty($conf->global->STOCK_MOVEMENT_INTO_PROJECT_OVERVIEW)) + ), + 'agenda' => array( + 'title' => "ListActionsAssociatedProject", + 'class' => 'ActionComm', + 'table' => 'actioncomm', + 'disableamount' => 1, + 'test' => $conf->agenda->enabled && $user->rights->agenda->allactions->lire + ), ); //Insert reference @@ -1116,11 +1131,11 @@ class doc_generic_project_odt extends ModelePDFProjects if (!empty($element->total_ht)) { $ref_array['amountht']=$element->total_ht; $ref_array['amountttc']=$element->total_ttc; - }else { + } else { $ref_array['amountht']=0; $ref_array['amountttc']=0; } - }else { + } else { $ref_array['amountht']=''; $ref_array['amountttc']=''; } @@ -1137,9 +1152,11 @@ class doc_generic_project_odt extends ModelePDFProjects } catch(OdfException $e) { + dol_syslog($e->getMessage(), LOG_INFO); } catch(SegmentException $e) { + dol_syslog($e->getMessage(), LOG_INFO); } } $listlines->merge(); @@ -1148,9 +1165,7 @@ class doc_generic_project_odt extends ModelePDFProjects } $odfHandler->mergeSegment($listlines); } - } - catch(OdfException $e) - { + } catch(OdfException $e) { $this->error=$e->getMessage(); dol_syslog($this->error, LOG_WARNING); return -1; @@ -1162,9 +1177,8 @@ class doc_generic_project_odt extends ModelePDFProjects { try { $odfHandler->setVars($key, $value, true, 'UTF-8'); - } - catch(OdfException $e) - { + } catch (OdfException $e) { + dol_syslog($e->getMessage(), LOG_INFO); } } @@ -1177,16 +1191,16 @@ class doc_generic_project_odt extends ModelePDFProjects if (!empty($conf->global->MAIN_ODT_AS_PDF)) { try { $odfHandler->exportAsAttachedPDF($file); - }catch (Exception $e){ + } catch (Exception $e) { $this->error=$e->getMessage(); return -1; } - } - else { + } else { try { - $odfHandler->saveToDisk($file); - }catch (Exception $e){ + $odfHandler->saveToDisk($file); + } catch (Exception $e){ $this->error=$e->getMessage(); + dol_syslog($e->getMessage(), LOG_INFO); return -1; } } diff --git a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php index 46f0fdacbbb..c8c588d1f4f 100644 --- a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php +++ b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php @@ -3,6 +3,7 @@ * Copyright (C) 2012 Juanjo Menent * Copyright (C) 2013 Florian Henry * Copyright (C) 2016 Charlie Benke + * Copyright (C) 2018 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -560,9 +561,8 @@ class doc_generic_task_odt extends ModelePDFTask { $odfHandler->setVars($key, $value, true, 'UTF-8'); } - } - catch(OdfException $e) - { + } catch (OdfException $e) { + dol_syslog($e->getMessage(), LOG_INFO); } } @@ -577,15 +577,12 @@ class doc_generic_task_odt extends ModelePDFTask complete_substitutions_array($tmparray, $outputlangs, $object); foreach($tmparray as $key => $val) { - try - { + try { $odfHandler->setVars($key, $val, true, 'UTF-8'); - } - catch(OdfException $e) - { - } - catch(SegmentException $e) - { + } catch (OdfException $e) { + dol_syslog($e->getMessage(), LOG_INFO); + } catch(SegmentException $e) { + dol_syslog($e->getMessage(), LOG_INFO); } } @@ -623,15 +620,13 @@ class doc_generic_task_odt extends ModelePDFTask foreach($tmparray as $key => $val) { - try - { + try { $listlinestaskres->setVars($key, $val, true, 'UTF-8'); + } catch (OdfException $e) { + dol_syslog($e->getMessage(), LOG_INFO); } - catch(OdfException $e) - { - } - catch(SegmentException $e) - { + catch (SegmentException $e) { + dol_syslog($e->getMessage(), LOG_INFO); } } $listlinestaskres->merge(); @@ -677,9 +672,11 @@ class doc_generic_task_odt extends ModelePDFTask } catch(OdfException $e) { + dol_syslog($e->getMessage(), LOG_INFO); } catch(SegmentException $e) { + dol_syslog($e->getMessage(), LOG_INFO); } } $listlinestasktime->merge(); @@ -710,9 +707,11 @@ class doc_generic_task_odt extends ModelePDFTask } catch(OdfException $e) { + dol_syslog($e->getMessage(), LOG_INFO); } catch(SegmentException $e) { + dol_syslog($e->getMessage(), LOG_INFO); } } $listtasksfiles->merge(); @@ -752,9 +751,11 @@ class doc_generic_task_odt extends ModelePDFTask } catch(OdfException $e) { + dol_syslog($e->getMessage(), LOG_INFO); } catch(SegmentException $e) { + dol_syslog($e->getMessage(), LOG_INFO); } } $listlines->merge(); @@ -810,9 +811,11 @@ class doc_generic_task_odt extends ModelePDFTask } catch(OdfException $e) { + dol_syslog($e->getMessage(), LOG_INFO); } catch(SegmentException $e) { + dol_syslog($e->getMessage(), LOG_INFO); } } $listlines->merge(); @@ -837,16 +840,18 @@ class doc_generic_task_odt extends ModelePDFTask if (!empty($conf->global->MAIN_ODT_AS_PDF)) { try { $odfHandler->exportAsAttachedPDF($file); - }catch (Exception $e){ + } catch (Exception $e) { $this->error=$e->getMessage(); + dol_syslog($e->getMessage(), LOG_INFO); return -1; } } else { try { $odfHandler->saveToDisk($file); - }catch (Exception $e){ + } catch (Exception $e) { $this->error=$e->getMessage(); + dol_syslog($e->getMessage(), LOG_INFO); return -1; } } diff --git a/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php b/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php index e27fc868155..5b87f744466 100644 --- a/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php +++ b/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php @@ -2,7 +2,8 @@ /* Copyright (C) 2010-2012 Laurent Destailleur * Copyright (C) 2012 Juanjo Menent * Copyright (C) 2016 Charlie Benke -* + * Copyright (C) 2018 Frédéric France + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or @@ -381,6 +382,7 @@ class doc_generic_proposal_odt extends ModelePDFPropales catch(Exception $e) { $this->error=$e->getMessage(); + dol_syslog($e->getMessage(), LOG_INFO); return -1; } // After construction $odfHandler->contentXml contains content and @@ -395,8 +397,9 @@ class doc_generic_proposal_odt extends ModelePDFPropales try { $odfHandler->setVars('free_text', $newfreetext, true, 'UTF-8'); } - catch(OdfException $e) + catch (OdfException $e) { + dol_syslog($e->getMessage(), LOG_INFO); } // Define substitution array @@ -433,6 +436,7 @@ class doc_generic_proposal_odt extends ModelePDFPropales } catch(OdfException $e) { + dol_syslog($e->getMessage(), LOG_INFO); } } // Replace tags of lines @@ -465,9 +469,11 @@ class doc_generic_proposal_odt extends ModelePDFPropales } catch(OdfException $e) { + dol_syslog($e->getMessage(), LOG_INFO); } catch(SegmentException $e) { + dol_syslog($e->getMessage(), LOG_INFO); } } $listlines->merge(); @@ -489,8 +495,9 @@ class doc_generic_proposal_odt extends ModelePDFPropales try { $odfHandler->setVars($key, $value, true, 'UTF-8'); } - catch(OdfException $e) + catch (OdfException $e) { + dol_syslog($e->getMessage(), LOG_INFO); } } @@ -502,16 +509,18 @@ class doc_generic_proposal_odt extends ModelePDFPropales if (!empty($conf->global->MAIN_ODT_AS_PDF)) { try { $odfHandler->exportAsAttachedPDF($file); - }catch (Exception $e){ + } catch (Exception $e) { $this->error=$e->getMessage(); + dol_syslog($e->getMessage(), LOG_INFO); return -1; } } else { try { $odfHandler->saveToDisk($file); - }catch (Exception $e){ + } catch (Exception $e) { $this->error=$e->getMessage(); + dol_syslog($e->getMessage(), LOG_INFO); return -1; } } diff --git a/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php b/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php index fbd4ac84e05..3650af12b24 100644 --- a/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php +++ b/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php @@ -1,6 +1,8 @@ * Copyright (C) 2016 Charlie Benke + * Copyright (C) 2018 Frédéric France + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or @@ -276,6 +278,7 @@ class doc_generic_odt extends ModeleThirdPartyDoc catch(Exception $e) { $this->error=$e->getMessage(); + dol_syslog($e->getMessage(), LOG_INFO); return -1; } //print $odfHandler->__toString()."\n"; @@ -323,9 +326,11 @@ class doc_generic_odt extends ModeleThirdPartyDoc } catch(OdfException $e) { + dol_syslog($e->getMessage(), LOG_INFO); } catch(SegmentException $e) { + dol_syslog($e->getMessage(), LOG_INFO); } } $listlines->merge(); @@ -367,9 +372,10 @@ class doc_generic_odt extends ModeleThirdPartyDoc $odfHandler->setVars($key, $value, true, 'UTF-8'); } } - catch(OdfException $e) + catch (OdfException $e) { // setVars failed, probably because key not found + dol_syslog($e->getMessage(), LOG_INFO); } } @@ -380,8 +386,9 @@ class doc_generic_odt extends ModeleThirdPartyDoc try { $odfHandler->setVars($key, $value, true, 'UTF-8'); } - catch(OdfException $e) + catch (OdfException $e) { + dol_syslog($e->getMessage(), LOG_INFO); } } @@ -393,8 +400,9 @@ class doc_generic_odt extends ModeleThirdPartyDoc if (!empty($conf->global->MAIN_ODT_AS_PDF)) { try { $odfHandler->exportAsAttachedPDF($file); - }catch (Exception $e){ + } catch (Exception $e) { $this->error=$e->getMessage(); + dol_syslog($e->getMessage(), LOG_INFO); return -1; } } @@ -413,6 +421,7 @@ class doc_generic_odt extends ModeleThirdPartyDoc $odfHandler->saveToDisk($file); }catch (Exception $e){ $this->error=$e->getMessage(); + dol_syslog($e->getMessage(), LOG_INFO); return -1; } } diff --git a/htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php b/htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php index fb600eee268..c9c4350e050 100644 --- a/htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php +++ b/htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php @@ -1,6 +1,7 @@ * Copyright (C) 2012 Juanjo Menent + * Copyright (C) 2018 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -368,6 +369,7 @@ class doc_generic_stock_odt extends ModelePDFStock catch(Exception $e) { $this->error=$e->getMessage(); + dol_syslog($e->getMessage(), LOG_INFO); return -1; } // After construction $odfHandler->contentXml contains content and @@ -382,8 +384,9 @@ class doc_generic_stock_odt extends ModelePDFStock try { $odfHandler->setVars('free_text', $newfreetext, true, 'UTF-8'); } - catch(OdfException $e) + catch (OdfException $e) { + dol_syslog($e->getMessage(), LOG_INFO); } // Define substitution array @@ -418,8 +421,9 @@ class doc_generic_stock_odt extends ModelePDFStock $odfHandler->setVars($key, $value, true, 'UTF-8'); } } - catch(OdfException $e) + catch (OdfException $e) { + dol_syslog($e->getMessage(), LOG_INFO); } } // Replace tags of lines @@ -442,9 +446,11 @@ class doc_generic_stock_odt extends ModelePDFStock } catch(OdfException $e) { + dol_syslog($e->getMessage(), LOG_INFO); } catch(SegmentException $e) { + dol_syslog($e->getMessage(), LOG_INFO); } } $listlines->merge(); @@ -468,6 +474,7 @@ class doc_generic_stock_odt extends ModelePDFStock } catch(OdfException $e) { + dol_syslog($e->getMessage(), LOG_INFO); } } @@ -479,16 +486,18 @@ class doc_generic_stock_odt extends ModelePDFStock if (!empty($conf->global->MAIN_ODT_AS_PDF)) { try { $odfHandler->exportAsAttachedPDF($file); - }catch (Exception $e){ + } catch (Exception $e) { $this->error=$e->getMessage(); + dol_syslog($e->getMessage(), LOG_INFO); return -1; } } else { try { $odfHandler->saveToDisk($file); - }catch (Exception $e){ + } catch (Exception $e) { $this->error=$e->getMessage(); + dol_syslog($e->getMessage(), LOG_INFO); return -1; } } diff --git a/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php b/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php index 3bf35edbe13..05bfe535ac7 100644 --- a/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php @@ -2,6 +2,7 @@ /* Copyright (C) 2010-2012 Laurent Destailleur * Copyright (C) 2012 Juanjo Menent * Copyright (C) 2016 Charlie Benke + * Copyright (C) 2018 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -367,16 +368,17 @@ class doc_generic_supplier_proposal_odt extends ModelePDFSupplierProposal $odfHandler = new odf( $srctemplatepath, array( - 'PATH_TO_TMP' => $conf->supplier_proposal->dir_temp, - 'ZIP_PROXY' => 'PclZipProxy', // PhpZipProxy or PclZipProxy. Got "bad compression method" error when using PhpZipProxy. - 'DELIMITER_LEFT' => '{', - 'DELIMITER_RIGHT' => '}' + 'PATH_TO_TMP' => $conf->supplier_proposal->dir_temp, + 'ZIP_PROXY' => 'PclZipProxy', // PhpZipProxy or PclZipProxy. Got "bad compression method" error when using PhpZipProxy. + 'DELIMITER_LEFT' => '{', + 'DELIMITER_RIGHT' => '}' ) ); } - catch(Exception $e) + catch (Exception $e) { $this->error=$e->getMessage(); + dol_syslog($e->getMessage(), LOG_INFO); return -1; } // After construction $odfHandler->contentXml contains content and @@ -390,8 +392,9 @@ class doc_generic_supplier_proposal_odt extends ModelePDFSupplierProposal try { $odfHandler->setVars('free_text', $newfreetext, true, 'UTF-8'); } - catch(OdfException $e) + catch (OdfException $e) { + dol_syslog($e->getMessage(), LOG_INFO); } // Define substitution array @@ -424,6 +427,7 @@ class doc_generic_supplier_proposal_odt extends ModelePDFSupplierProposal } catch(OdfException $e) { + dol_syslog($e->getMessage(), LOG_INFO); } } // Replace tags of lines @@ -456,9 +460,11 @@ class doc_generic_supplier_proposal_odt extends ModelePDFSupplierProposal } catch(OdfException $e) { + dol_syslog($e->getMessage(), LOG_INFO); } catch(SegmentException $e) { + dol_syslog($e->getMessage(), LOG_INFO); } } $listlines->merge(); @@ -482,6 +488,7 @@ class doc_generic_supplier_proposal_odt extends ModelePDFSupplierProposal } catch(OdfException $e) { + dol_syslog($e->getMessage(), LOG_INFO); } } @@ -493,16 +500,18 @@ class doc_generic_supplier_proposal_odt extends ModelePDFSupplierProposal if (!empty($conf->global->MAIN_ODT_AS_PDF)) { try { $odfHandler->exportAsAttachedPDF($file); - }catch (Exception $e){ + } catch (Exception $e) { $this->error=$e->getMessage(); + dol_syslog($e->getMessage(), LOG_INFO); return -1; } } else { try { - $odfHandler->saveToDisk($file); - }catch (Exception $e){ + $odfHandler->saveToDisk($file); + } catch (Exception $e) { $this->error=$e->getMessage(); + dol_syslog($e->getMessage(), LOG_INFO); return -1; } } diff --git a/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php b/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php index cacef2dcb55..f8b6e5cdaba 100644 --- a/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php +++ b/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php @@ -1,6 +1,7 @@ * Copyright (C) 2012 Juanjo Menent + * Copyright (C) 2018 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -333,16 +334,17 @@ class doc_generic_user_odt extends ModelePDFUser $odfHandler = new odf( $srctemplatepath, array( - 'PATH_TO_TMP' => $conf->user->dir_temp, - 'ZIP_PROXY' => 'PclZipProxy', // PhpZipProxy or PclZipProxy. Got "bad compression method" error when using PhpZipProxy. - 'DELIMITER_LEFT' => '{', - 'DELIMITER_RIGHT' => '}' + 'PATH_TO_TMP' => $conf->user->dir_temp, + 'ZIP_PROXY' => 'PclZipProxy', // PhpZipProxy or PclZipProxy. Got "bad compression method" error when using PhpZipProxy. + 'DELIMITER_LEFT' => '{', + 'DELIMITER_RIGHT' => '}' ) ); } catch(Exception $e) { $this->error=$e->getMessage(); + dol_syslog($e->getMessage(), LOG_WARNING); return -1; } @@ -377,6 +379,7 @@ class doc_generic_user_odt extends ModelePDFUser } catch(OdfException $e) { + dol_syslog($e->getMessage(), LOG_WARNING); } } @@ -387,8 +390,9 @@ class doc_generic_user_odt extends ModelePDFUser try { $odfHandler->setVars($key, $value, true, 'UTF-8'); } - catch(OdfException $e) + catch (OdfException $e) { + dol_syslog($e->getMessage(), LOG_WARNING); } } @@ -400,16 +404,18 @@ class doc_generic_user_odt extends ModelePDFUser if (!empty($conf->global->MAIN_ODT_AS_PDF)) { try { $odfHandler->exportAsAttachedPDF($file); - }catch (Exception $e){ + } catch (Exception $e) { $this->error=$e->getMessage(); + dol_syslog($e->getMessage(), LOG_WARNING); return -1; } } else { try { - $odfHandler->saveToDisk($file); - }catch (Exception $e){ + $odfHandler->saveToDisk($file); + } catch (Exception $e) { $this->error=$e->getMessage(); + dol_syslog($e->getMessage(), LOG_WARNING); return -1; } } diff --git a/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php b/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php index 161c9abc3a6..1f7678371e5 100644 --- a/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php +++ b/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php @@ -1,6 +1,7 @@ * Copyright (C) 2012 Juanjo Menent + * Copyright (C) 2018 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -355,16 +356,15 @@ class doc_generic_usergroup_odt extends ModelePDFUserGroup $odfHandler = new odf( $srctemplatepath, array( - 'PATH_TO_TMP' => $conf->user->dir_temp, - 'ZIP_PROXY' => 'PclZipProxy', // PhpZipProxy or PclZipProxy. Got "bad compression method" error when using PhpZipProxy. - 'DELIMITER_LEFT' => '{', - 'DELIMITER_RIGHT' => '}' + 'PATH_TO_TMP' => $conf->user->dir_temp, + 'ZIP_PROXY' => 'PclZipProxy', // PhpZipProxy or PclZipProxy. Got "bad compression method" error when using PhpZipProxy. + 'DELIMITER_LEFT' => '{', + 'DELIMITER_RIGHT' => '}' ) ); - } - catch(Exception $e) - { + } catch (Exception $e) { $this->error=$e->getMessage(); + dol_syslog($e->getMessage(), LOG_WARNING); return -1; } // After construction $odfHandler->contentXml contains content and @@ -378,8 +378,9 @@ class doc_generic_usergroup_odt extends ModelePDFUserGroup try { $odfHandler->setVars('free_text', $newfreetext, true, 'UTF-8'); } - catch(OdfException $e) + catch (OdfException $e) { + dol_syslog($e->getMessage(), LOG_WARNING); } // Make substitutions into odt @@ -414,8 +415,9 @@ class doc_generic_usergroup_odt extends ModelePDFUserGroup $odfHandler->setVars($key, $value, true, 'UTF-8'); } } - catch(OdfException $e) + catch (OdfException $e) { + dol_syslog($e->getMessage(), LOG_WARNING); } } // Replace tags of lines @@ -425,7 +427,7 @@ class doc_generic_usergroup_odt extends ModelePDFUserGroup try { $listlines = $odfHandler->setSegment('lines'); } - catch(OdfException $e) + catch (OdfException $e) { // We may arrive here if tags for lines not present into template $foundtagforlines = 0; @@ -446,15 +448,17 @@ class doc_generic_usergroup_odt extends ModelePDFUserGroup { try { - if(!is_array($val)) { + if (!is_array($val)) { $listlines->setVars($key, $val, true, 'UTF-8'); } } - catch(OdfException $e) + catch (OdfException $e) { + dol_syslog($e->getMessage(), LOG_WARNING); } - catch(SegmentException $e) + catch (SegmentException $e) { + dol_syslog($e->getMessage(), LOG_WARNING); } } $listlines->merge(); @@ -471,39 +475,42 @@ class doc_generic_usergroup_odt extends ModelePDFUserGroup // Replace labels translated $tmparray=$outputlangs->get_translations_for_substitutions(); - foreach($tmparray as $key=>$value) + foreach($tmparray as $key => $value) { try { $odfHandler->setVars($key, $value, true, 'UTF-8'); } - catch(OdfException $e) + catch (OdfException $e) { + dol_syslog($e->getMessage(), LOG_WARNING); } } // Call the beforeODTSave hook - $parameters=array('odfHandler'=>&$odfHandler,'file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs); - $reshook=$hookmanager->executeHooks('beforeODTSave',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks + $parameters=array('odfHandler'=>&$odfHandler, 'file'=>$file, 'object'=>$object, 'outputlangs'=>$outputlangs); + $reshook=$hookmanager->executeHooks('beforeODTSave', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks // Write new file if (!empty($conf->global->MAIN_ODT_AS_PDF)) { try { $odfHandler->exportAsAttachedPDF($file); - }catch (Exception $e){ + } catch (Exception $e) { $this->error=$e->getMessage(); + dol_syslog($e->getMessage(), LOG_WARNING); return -1; } } else { try { - $odfHandler->saveToDisk($file); - }catch (Exception $e){ + $odfHandler->saveToDisk($file); + } catch (Exception $e) { $this->error=$e->getMessage(); + dol_syslog($e->getMessage(), LOG_WARNING); return -1; } } - $reshook=$hookmanager->executeHooks('afterODTCreation',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks + $reshook=$hookmanager->executeHooks('afterODTCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if (! empty($conf->global->MAIN_UMASK)) @chmod($file, octdec($conf->global->MAIN_UMASK)); From dbbcb6f8a10b860bf7203f574ae7acd712667364 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 26 Oct 2018 22:30:48 +0200 Subject: [PATCH 30/51] code comment api contract --- htdocs/contrat/class/api_contracts.class.php | 81 ++++++++++---------- 1 file changed, 41 insertions(+), 40 deletions(-) diff --git a/htdocs/contrat/class/api_contracts.class.php b/htdocs/contrat/class/api_contracts.class.php index 35ec5842e4b..585d5399771 100644 --- a/htdocs/contrat/class/api_contracts.class.php +++ b/htdocs/contrat/class/api_contracts.class.php @@ -1,6 +1,7 @@ * Copyright (C) 2016 Laurent Destailleur + * Copyright (C) 2018 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -215,28 +216,28 @@ class Contracts extends DolibarrApi * * @url GET {id}/lines * - * @return int + * @return array */ function getLines($id) { - if(! DolibarrApiAccess::$user->rights->contrat->lire) { - throw new RestException(401); - } + if(! DolibarrApiAccess::$user->rights->contrat->lire) { + throw new RestException(401); + } - $result = $this->contract->fetch($id); - if( ! $result ) { - throw new RestException(404, 'Contract not found'); - } + $result = $this->contract->fetch($id); + if( ! $result ) { + throw new RestException(404, 'Contract not found'); + } - if( ! DolibarrApi::_checkAccessToResource('contrat',$this->contract->id)) { - throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); - } - $this->contract->getLinesArray(); - $result = array(); - foreach ($this->contract->lines as $line) { - array_push($result,$this->_cleanObjectDatas($line)); - } - return $result; + if( ! DolibarrApi::_checkAccessToResource('contrat',$this->contract->id)) { + throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); + } + $this->contract->getLinesArray(); + $result = array(); + foreach ($this->contract->lines as $line) { + array_push($result, $this->_cleanObjectDatas($line)); + } + return $result; } /** @@ -247,7 +248,7 @@ class Contracts extends DolibarrApi * * @url POST {id}/lines * - * @return int + * @return int|bool */ function postLine($id, $request_data = null) { @@ -300,7 +301,7 @@ class Contracts extends DolibarrApi * * @url PUT {id}/lines/{lineid} * - * @return object + * @return array|bool */ function putLine($id, $lineid, $request_data = null) { @@ -360,7 +361,7 @@ class Contracts extends DolibarrApi * * @url PUT {id}/lines/{lineid}/activate * - * @return object + * @return array|bool */ function activateLine($id, $lineid, $datestart, $dateend = null, $comment = null) { @@ -369,7 +370,7 @@ class Contracts extends DolibarrApi } $result = $this->contract->fetch($id); - if( ! $result ) { + if (! $result) { throw new RestException(404, 'Contrat not found'); } @@ -398,16 +399,16 @@ class Contracts extends DolibarrApi * * @url PUT {id}/lines/{lineid}/unactivate * - * @return object + * @return array|bool */ function unactivateLine($id, $lineid, $datestart, $comment = null) { - if(! DolibarrApiAccess::$user->rights->contrat->creer) { + if (! DolibarrApiAccess::$user->rights->contrat->creer) { throw new RestException(401); } $result = $this->contract->fetch($id); - if( ! $result ) { + if (! $result) { throw new RestException(404, 'Contrat not found'); } @@ -443,16 +444,16 @@ class Contracts extends DolibarrApi */ function deleteLine($id, $lineid) { - if(! DolibarrApiAccess::$user->rights->contrat->creer) { + if (! DolibarrApiAccess::$user->rights->contrat->creer) { throw new RestException(401); } $result = $this->contract->fetch($id); - if( ! $result ) { + if (! $result) { throw new RestException(404, 'Contrat not found'); } - if( ! DolibarrApi::_checkAccessToResource('contrat',$this->contract->id)) { + if (! DolibarrApi::_checkAccessToResource('contrat', $this->contract->id)) { throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); } @@ -478,16 +479,16 @@ class Contracts extends DolibarrApi */ function put($id, $request_data = null) { - if(! DolibarrApiAccess::$user->rights->contrat->creer) { + if (! DolibarrApiAccess::$user->rights->contrat->creer) { throw new RestException(401); } $result = $this->contract->fetch($id); - if( ! $result ) { + if (! $result) { throw new RestException(404, 'Contrat not found'); } - if( ! DolibarrApi::_checkAccessToResource('contrat',$this->contract->id)) { + if (! DolibarrApi::_checkAccessToResource('contrat', $this->contract->id)) { throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); } foreach($request_data as $field => $value) { @@ -514,19 +515,19 @@ class Contracts extends DolibarrApi */ function delete($id) { - if(! DolibarrApiAccess::$user->rights->contrat->supprimer) { + if (! DolibarrApiAccess::$user->rights->contrat->supprimer) { throw new RestException(401); } $result = $this->contract->fetch($id); - if( ! $result ) { + if (! $result) { throw new RestException(404, 'Contract not found'); } - if( ! DolibarrApi::_checkAccessToResource('contrat',$this->contract->id)) { + if (! DolibarrApi::_checkAccessToResource('contrat',$this->contract->id)) { throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); } - if( ! $this->contract->delete(DolibarrApiAccess::$user)) { + if (! $this->contract->delete(DolibarrApiAccess::$user)) { throw new RestException(500, 'Error when delete contract : '.$this->contract->error); } @@ -556,15 +557,15 @@ class Contracts extends DolibarrApi */ function validate($id, $notrigger=0) { - if(! DolibarrApiAccess::$user->rights->contrat->creer) { + if (! DolibarrApiAccess::$user->rights->contrat->creer) { throw new RestException(401); } $result = $this->contract->fetch($id); - if( ! $result ) { + if (! $result) { throw new RestException(404, 'Contract not found'); } - if( ! DolibarrApi::_checkAccessToResource('contrat',$this->contract->id)) { + if (! DolibarrApi::_checkAccessToResource('contrat',$this->contract->id)) { throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); } @@ -602,15 +603,15 @@ class Contracts extends DolibarrApi */ function close($id, $notrigger=0) { - if(! DolibarrApiAccess::$user->rights->contrat->creer) { + if (! DolibarrApiAccess::$user->rights->contrat->creer) { throw new RestException(401); } $result = $this->contract->fetch($id); - if( ! $result ) { + if (! $result) { throw new RestException(404, 'Contract not found'); } - if( ! DolibarrApi::_checkAccessToResource('contrat',$this->contract->id)) { + if (! DolibarrApi::_checkAccessToResource('contrat',$this->contract->id)) { throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); } From 461bd76f7021e3a7995ced8846bcf382a3ca4eb9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 26 Oct 2018 23:27:29 +0200 Subject: [PATCH 31/51] Fix customer and supplier code name Fix bill time flag must be visible only if option on --- htdocs/projet/contact.php | 8 ++++++++ htdocs/projet/element.php | 12 ++++++++++-- htdocs/projet/tasks.php | 15 ++++++++++++--- htdocs/projet/tasks/time.php | 13 ++++++++----- htdocs/societe/card.php | 32 ++++++++++++++++---------------- 5 files changed, 54 insertions(+), 26 deletions(-) diff --git a/htdocs/projet/contact.php b/htdocs/projet/contact.php index 68c9b530c88..4b9aaf58b8b 100644 --- a/htdocs/projet/contact.php +++ b/htdocs/projet/contact.php @@ -240,6 +240,14 @@ if ($id > 0 || ! empty($ref)) print nl2br($object->description); print ''; + // Bill time + if (! empty($conf->global->PROJECT_BILL_TIME_SPENT)) + { + print ''.$langs->trans("BillTime").''; + print yn($object->bill_time); + print ''; + } + // Categories if ($conf->categorie->enabled) { print ''.$langs->trans("Categories").''; diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index e0ecf9d6051..7c44fb9850b 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -217,6 +217,14 @@ print ''.$langs->trans("Description").''; print nl2br($object->description); print ''; +// Bill time +if (! empty($conf->global->PROJECT_BILL_TIME_SPENT)) +{ + print ''.$langs->trans("BillTime").''; + print yn($object->bill_time); + print ''; +} + // Categories if($conf->categorie->enabled) { print ''.$langs->trans("Categories").''; @@ -686,8 +694,8 @@ foreach ($listofreferent as $key => $value) // and the final balance print ''; print ''.$langs->trans("Profit").''; -print ''.price($balance_ht).''; -print ''.price($balance_ttc).''; +print ''.price(price2num($balance_ht, 'MT')).''; +print ''.price(price2num($balance_ttc, 'MT')).''; print ''; print ""; diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php index d9fcc8b642a..47c88885bc4 100644 --- a/htdocs/projet/tasks.php +++ b/htdocs/projet/tasks.php @@ -91,13 +91,14 @@ $planned_workload=$planned_workloadhour*3600+$planned_workloadmin*60; $userAccess=0; -$parameters=array('id'=>$id); -$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'); /* * Actions */ +$parameters=array('id'=>$id); +$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'); + // 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 { @@ -404,6 +405,14 @@ if ($id > 0 || ! empty($ref)) print nl2br($object->description); print ''; + // Bill time + if (! empty($conf->global->PROJECT_BILL_TIME_SPENT)) + { + print ''.$langs->trans("BillTime").''; + print yn($object->bill_time); + print ''; + } + // Categories if($conf->categorie->enabled) { print ''.$langs->trans("Categories").''; diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index bcfc7bde557..7ff93c7b4da 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -399,13 +399,16 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0) print nl2br($projectstatic->description); print ''; - // Bill time ? - print ''.$langs->trans("BillTime").''; - print yn($projectstatic->bill_time); - print ''; + // Bill time + if (! empty($conf->global->PROJECT_BILL_TIME_SPENT)) + { + print ''.$langs->trans("BillTime").''; + print yn($projectstatic->bill_time); + print ''; + } // Categories - if($conf->categorie->enabled) { + if ($conf->categorie->enabled) { print ''.$langs->trans("Categories").''; print $form->showCategories($projectstatic->id,'project',1); print ""; diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index e20e37e5cdc..5935a1d01a1 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -304,13 +304,13 @@ if (empty($reshook)) if (GETPOST('getcustomercode')) { // We defined value code_client - $_POST["code_client"]="Acompleter"; + $_POST["customer_code"]="Acompleter"; } if (GETPOST('getsuppliercode')) { // We defined value code_fournisseur - $_POST["code_fournisseur"]="Acompleter"; + $_POST["supplier_code"]="Acompleter"; } if($action=='set_localtax1') @@ -417,8 +417,8 @@ if (empty($reshook)) $object->idprof5 = trim(GETPOST('idprof5', 'alpha')); $object->idprof6 = trim(GETPOST('idprof6', 'alpha')); $object->prefix_comm = GETPOST('prefix_comm', 'alpha'); - $object->code_client = GETPOST('code_client', 'alpha'); - $object->code_fournisseur = GETPOST('code_fournisseur', 'alpha'); + $object->code_client = GETPOST('customer_code', 'alpha'); + $object->code_fournisseur = GETPOST('supplier_code', 'alpha'); $object->capital = GETPOST('capital', 'alpha'); $object->barcode = GETPOST('barcode', 'alpha'); @@ -947,14 +947,14 @@ else $object->client = GETPOST('client')?GETPOST('client'):$object->client; if(empty($duplicate_code_error)) { - $object->code_client = GETPOST('code_client', 'alpha'); + $object->code_client = GETPOST('customer_code', 'alpha'); $object->fournisseur = GETPOST('fournisseur')?GETPOST('fournisseur'):$object->fournisseur; } else { setEventMessages($langs->trans('NewCustomerSupplierCodeProposed'),'', 'warnings'); } - $object->code_fournisseur = GETPOST('code_fournisseur', 'alpha'); + $object->code_fournisseur = GETPOST('supplier_code', 'alpha'); $object->address = GETPOST('address', 'alpha'); $object->zip = GETPOST('zipcode', 'alpha'); $object->town = GETPOST('town', 'alpha'); @@ -1190,7 +1190,7 @@ else print '
'; $tmpcode=$object->code_client; if (empty($tmpcode) && ! empty($modCodeClient->code_auto)) $tmpcode=$modCodeClient->getNextValue($object,0); - print ''; + print ''; print ''; $s=$modCodeClient->getToolTip($langs,$object,0); print $form->textwithpicto('',$s,1); @@ -1218,7 +1218,7 @@ else print ''; $out.= ''; $out.= '
'; $tmpcode=$object->code_fournisseur; if (empty($tmpcode) && ! empty($modCodeFournisseur->code_auto)) $tmpcode=$modCodeFournisseur->getNextValue($object,1); - print ''; + print ''; print ''; $s=$modCodeFournisseur->getToolTip($langs,$object,1); print $form->textwithpicto('',$s,1); @@ -1570,9 +1570,9 @@ else $object->name = GETPOST('name', 'alpha'); $object->prefix_comm = GETPOST('prefix_comm', 'alpha'); $object->client = GETPOST('client', 'int'); - $object->code_client = GETPOST('code_client', 'alpha'); + $object->code_client = GETPOST('customer_code', 'alpha'); $object->fournisseur = GETPOST('fournisseur', 'int'); - $object->code_fournisseur = GETPOST('code_fournisseur', 'alpha'); + $object->code_fournisseur = GETPOST('supplier_code', 'alpha'); $object->address = GETPOST('address', 'alpha'); $object->zip = GETPOST('zipcode', 'alpha'); $object->town = GETPOST('town', 'alpha'); @@ -1776,16 +1776,16 @@ else $tmpcode=$object->code_client; if (empty($tmpcode) && ! empty($object->oldcopy->code_client)) $tmpcode=$object->oldcopy->code_client; // When there is an error to update a thirdparty, the number for supplier and customer code is kept to old value. if (empty($tmpcode) && ! empty($modCodeClient->code_auto)) $tmpcode=$modCodeClient->getNextValue($object,0); - print ''; + print ''; } else if ($object->codeclient_modifiable()) { - print ''; + print ''; } else { print $object->code_client; - print ''; + print ''; } print ''; $s=$modCodeClient->getToolTip($langs,$object,0); @@ -1816,16 +1816,16 @@ else $tmpcode=$object->code_fournisseur; if (empty($tmpcode) && ! empty($object->oldcopy->code_fournisseur)) $tmpcode=$object->oldcopy->code_fournisseur; // When there is an error to update a thirdparty, the number for supplier and customer code is kept to old value. if (empty($tmpcode) && ! empty($modCodeFournisseur->code_auto)) $tmpcode=$modCodeFournisseur->getNextValue($object,1); - print ''; + print ''; } else if ($object->codefournisseur_modifiable()) { - print ''; + print ''; } else { print $object->code_fournisseur; - print ''; + print ''; } print ''; $s=$modCodeFournisseur->getToolTip($langs,$object,1); From 71c64c09446456da392cbe10e2211f445f6aabc1 Mon Sep 17 00:00:00 2001 From: IJ Date: Sat, 27 Oct 2018 01:57:07 +0100 Subject: [PATCH 32/51] FIX: Expense Report Ref Not Showing in PDF File Properties The generated pdf title field in the pdf file document properties was blank. This fixes that. --- htdocs/core/modules/expensereport/doc/pdf_standard.modules.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php index d98801ab7e2..ec03a2cef8e 100644 --- a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php @@ -278,7 +278,7 @@ class pdf_standard extends ModeleExpenseReport $pagenb=0; $pdf->SetDrawColor(128,128,128); - $pdf->SetTitle($outputlangs->convToOutputCharset($object->ref_number)); + $pdf->SetTitle($outputlangs->convToOutputCharset($object->ref)); $pdf->SetSubject($outputlangs->transnoentities("Trips")); $pdf->SetCreator("Dolibarr ".DOL_VERSION); $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs))); From af9b8f033a804e667b44f8e97680e064acb7dade Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 28 Oct 2018 17:23:42 +0100 Subject: [PATCH 33/51] Click to refresh --- htdocs/langs/en_US/main.lang | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index 03d65917a97..fa74cfa44bc 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -750,6 +750,7 @@ LinkToIntervention=Link to intervention CreateDraft=Create draft SetToDraft=Back to draft ClickToEdit=Click to edit +ClickToRefresh=Click to refresh EditWithEditor=Edit with CKEditor EditWithTextEditor=Edit with Text editor EditHTMLSource=Edit HTML Source From 4611b96da819529cb1600f089d1c4312cecb4dc6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 28 Oct 2018 20:18:09 +0100 Subject: [PATCH 34/51] Fix phpcs --- htdocs/admin/holiday.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/admin/holiday.php b/htdocs/admin/holiday.php index c02c9bd480d..81becbaa37c 100644 --- a/htdocs/admin/holiday.php +++ b/htdocs/admin/holiday.php @@ -513,7 +513,6 @@ print ''; print ''; print ''; - } From 9b3fc6527c82fcbcb6502c3477a33262e1a7fa4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 28 Oct 2018 23:50:13 +0100 Subject: [PATCH 35/51] Update box_graph_product_distribution.php --- htdocs/core/boxes/box_graph_product_distribution.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/htdocs/core/boxes/box_graph_product_distribution.php b/htdocs/core/boxes/box_graph_product_distribution.php index 42afa4fbfe0..9dc4c162e0f 100644 --- a/htdocs/core/boxes/box_graph_product_distribution.php +++ b/htdocs/core/boxes/box_graph_product_distribution.php @@ -1,5 +1,6 @@ + * Copyright (C) 2018 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -139,10 +140,10 @@ class box_graph_product_distribution extends ModeleBoxes if (! empty($conf->facture->enabled) && ! empty($user->rights->facture->lire)) { - // Build graphic number of object. $data = array(array('Lib',val1,val2,val3),...) if ($showinvoicenb) { + $langs->load("bills"); include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facturestats.class.php'; $showpointvalue = 1; $nocolor = 0; @@ -202,6 +203,7 @@ class box_graph_product_distribution extends ModeleBoxes // Build graphic number of object. $data = array(array('Lib',val1,val2,val3),...) if ($showpropalnb) { + $langs->load("propal"); include_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propalestats.class.php'; $showpointvalue = 1; $nocolor = 0; @@ -258,11 +260,10 @@ class box_graph_product_distribution extends ModeleBoxes if (! empty($conf->commande->enabled) && ! empty($user->rights->commande->lire)) { - $langs->load("orders"); - // Build graphic number of object. $data = array(array('Lib',val1,val2,val3),...) if ($showordernb) { + $langs->load("orders"); include_once DOL_DOCUMENT_ROOT.'/commande/class/commandestats.class.php'; $showpointvalue = 1; $nocolor = 0; From f8a49edf782dea3cdf6990d297b518c5e12b5e49 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 29 Oct 2018 00:55:55 +0100 Subject: [PATCH 36/51] Fix use setup of template for attached files in mass actions --- htdocs/core/class/html.formmail.class.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index 68da2dce777..640355c1295 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -880,6 +880,13 @@ class FormMail extends Form $out.= ''.$langs->trans("MailFile").''; + + // If a template was selected, we use setup of template to define if join file checkbox is selected or not. + if (is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) + { + $this->withmaindocfile = ($arraydefaultmessage->joinfiles ? -1 : 1); + } + if (! empty($this->withmaindocfile)) { if ($this->withmaindocfile == 1) From dbb2168b83207ec077cab073a8489d9a5d0780f7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 29 Oct 2018 02:02:43 +0100 Subject: [PATCH 37/51] FIX thirdparty property of object not loaded when only one record --- htdocs/core/actions_massactions.inc.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index 6621ffaeb8a..d3cdc0093b1 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -333,12 +333,16 @@ if (! $error && $massaction == 'confirm_presend') if ($objectclass == 'CommandeFournisseur') $sendtobcc .= (empty($conf->global->MAIN_MAIL_AUTOCOPY_SUPPLIER_ORDER_TO) ? '' : (($sendtobcc?", ":"").$conf->global->MAIN_MAIL_AUTOCOPY_SUPPLIER_ORDER_TO)); if ($objectclass == 'FactureFournisseur') $sendtobcc .= (empty($conf->global->MAIN_MAIL_AUTOCOPY_SUPPLIER_INVOICE_TO) ? '' : (($sendtobcc?", ":"").$conf->global->MAIN_MAIL_AUTOCOPY_SUPPLIER_INVOICE_TO)); - // $listofqualifiedobj is array with key = object id of qualified objects for the current thirdparty + // $listofqualifiedobj is array with key = object id and value is instance of qualified objects, for the current thirdparty (but thirdparty property is not loaded yet) $oneemailperrecipient=(GETPOST('oneemailperrecipient')=='on'?1:0); $looparray=array(); if (! $oneemailperrecipient) { $looparray = $listofqualifiedobj; + foreach ($looparray as $key => $objecttmp) + { + $looparray[$key]->thirdparty = $thirdparty; + } } else { @@ -348,7 +352,7 @@ if (! $error && $massaction == 'confirm_presend') } //var_dump($looparray);exit; - foreach ($looparray as $objecttmp) // $objecttmp is a real object or an empty if we choose to send one email per thirdparty instead of per record + foreach ($looparray as $objecttmp) // $objecttmp is a real object or an empty object if we choose to send one email per thirdparty instead of one per record { // Make substitution in email content $substitutionarray=getCommonSubstitutionArray($langs, 0, null, $objecttmp); From 770f8c3f3b6fc171fcb4cf598871be4274c38d9d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 29 Oct 2018 02:11:33 +0100 Subject: [PATCH 38/51] FIX Selection of addmaindocfile is lost on error --- htdocs/core/class/html.formmail.class.php | 8 ++++++-- htdocs/core/tpl/massactions_pre.tpl.php | 11 ++++++----- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index 640355c1295..de93ee8f66d 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -881,8 +881,12 @@ class FormMail extends Form $out.= ''; + if (GETPOSTISSET('sendmail')) + { + $this->withmaindocfile = (GETPOST('addmaindocfile', 'alpha') ? -1 : 1); + } // If a template was selected, we use setup of template to define if join file checkbox is selected or not. - if (is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) + elseif (is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) { $this->withmaindocfile = ($arraydefaultmessage->joinfiles ? -1 : 1); } @@ -895,7 +899,7 @@ class FormMail extends Form } if ($this->withmaindocfile == -1) { - $out.=''; + $out.=''; } $out.=' '.$langs->trans("JoinMainDoc").'.
'; } diff --git a/htdocs/core/tpl/massactions_pre.tpl.php b/htdocs/core/tpl/massactions_pre.tpl.php index d46e27e28af..a66e9ba270e 100644 --- a/htdocs/core/tpl/massactions_pre.tpl.php +++ b/htdocs/core/tpl/massactions_pre.tpl.php @@ -41,11 +41,12 @@ if ($massaction == 'presend') { $langs->load("mails"); + $listofselectedid = array(); + $listofselectedthirdparties = array(); + $listofselectedref = array(); + if (! GETPOST('cancel', 'alpha')) { - $listofselectedid = array(); - $listofselectedthirdparties = array(); - $listofselectedref = array(); foreach ($arrayofselected as $toselectid) { $result = $objecttmp->fetch($toselectid); @@ -110,8 +111,8 @@ if ($massaction == 'presend') } else { $formmail->withtoreadonly = 1; } - - $formmail->withoptiononeemailperrecipient = empty($liste)?0:((GETPOST('oneemailperrecipient')=='on')?1:-1); + + $formmail->withoptiononeemailperrecipient = (count($listofselectedref) == 1 || empty($liste))? 0 : ((GETPOST('oneemailperrecipient')=='on')?1:-1); $formmail->withto = empty($liste)?(GETPOST('sendto','alpha')?GETPOST('sendto','alpha'):array()):$liste; $formmail->withtofree = empty($liste)?1:0; $formmail->withtocc = 1; From 6e3822345cec2bc1f497a10a23e110fd0be6bb62 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 29 Oct 2018 00:55:55 +0100 Subject: [PATCH 39/51] Fix use setup of template for attached files in mass actions --- htdocs/core/class/html.formmail.class.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index 117bfb13769..6c74c1ca612 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -845,6 +845,13 @@ class FormMail extends Form $out.= '
'.$langs->trans("MailFile").''; + + // If a template was selected, we use setup of template to define if join file checkbox is selected or not. + if (is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) + { + $this->withmaindocfile = ($arraydefaultmessage->joinfiles ? -1 : 1); + } + if (! empty($this->withmaindocfile)) { if ($this->withmaindocfile == 1) From 244c7f8dc3a7f359f1fd356d72ec22c4dfb76dba Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 29 Oct 2018 02:02:43 +0100 Subject: [PATCH 40/51] FIX thirdparty property of object not loaded when only one record --- htdocs/core/actions_massactions.inc.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index b59b03d536f..710091a1661 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -333,12 +333,16 @@ if (! $error && $massaction == 'confirm_presend') if ($objectclass == 'CommandeFournisseur') $sendtobcc .= (empty($conf->global->MAIN_MAIL_AUTOCOPY_SUPPLIER_ORDER_TO) ? '' : (($sendtobcc?", ":"").$conf->global->MAIN_MAIL_AUTOCOPY_SUPPLIER_ORDER_TO)); if ($objectclass == 'FactureFournisseur') $sendtobcc .= (empty($conf->global->MAIN_MAIL_AUTOCOPY_SUPPLIER_INVOICE_TO) ? '' : (($sendtobcc?", ":"").$conf->global->MAIN_MAIL_AUTOCOPY_SUPPLIER_INVOICE_TO)); - // $listofqualifiedobj is array with key = object id of qualified objects for the current thirdparty + // $listofqualifiedobj is array with key = object id and value is instance of qualified objects, for the current thirdparty (but thirdparty property is not loaded yet) $oneemailperrecipient=(GETPOST('oneemailperrecipient')=='on'?1:0); $looparray=array(); if (! $oneemailperrecipient) { $looparray = $listofqualifiedobj; + foreach ($looparray as $key => $objecttmp) + { + $looparray[$key]->thirdparty = $thirdparty; + } } else { @@ -348,7 +352,7 @@ if (! $error && $massaction == 'confirm_presend') } //var_dump($looparray);exit; - foreach ($looparray as $objecttmp) // $objecttmp is a real object or an empty if we choose to send one email per thirdparty instead of per record + foreach ($looparray as $objecttmp) // $objecttmp is a real object or an empty object if we choose to send one email per thirdparty instead of one per record { // Make substitution in email content $substitutionarray=getCommonSubstitutionArray($langs, 0, null, $objecttmp); From 553e984465609c7d1454f4f3e623805c65ca627c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 29 Oct 2018 02:11:33 +0100 Subject: [PATCH 41/51] FIX Selection of addmaindocfile is lost on error --- htdocs/core/class/html.formmail.class.php | 8 ++++++-- htdocs/core/tpl/massactions_pre.tpl.php | 11 ++++++----- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index 6c74c1ca612..434f49bb3d6 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -846,8 +846,12 @@ class FormMail extends Form $out.= ''; + if (GETPOSTISSET('sendmail')) + { + $this->withmaindocfile = (GETPOST('addmaindocfile', 'alpha') ? -1 : 1); + } // If a template was selected, we use setup of template to define if join file checkbox is selected or not. - if (is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) + elseif (is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) { $this->withmaindocfile = ($arraydefaultmessage->joinfiles ? -1 : 1); } @@ -860,7 +864,7 @@ class FormMail extends Form } if ($this->withmaindocfile == -1) { - $out.=''; + $out.=''; } $out.=' '.$langs->trans("JoinMainDoc").'.
'; } diff --git a/htdocs/core/tpl/massactions_pre.tpl.php b/htdocs/core/tpl/massactions_pre.tpl.php index d46e27e28af..a66e9ba270e 100644 --- a/htdocs/core/tpl/massactions_pre.tpl.php +++ b/htdocs/core/tpl/massactions_pre.tpl.php @@ -41,11 +41,12 @@ if ($massaction == 'presend') { $langs->load("mails"); + $listofselectedid = array(); + $listofselectedthirdparties = array(); + $listofselectedref = array(); + if (! GETPOST('cancel', 'alpha')) { - $listofselectedid = array(); - $listofselectedthirdparties = array(); - $listofselectedref = array(); foreach ($arrayofselected as $toselectid) { $result = $objecttmp->fetch($toselectid); @@ -110,8 +111,8 @@ if ($massaction == 'presend') } else { $formmail->withtoreadonly = 1; } - - $formmail->withoptiononeemailperrecipient = empty($liste)?0:((GETPOST('oneemailperrecipient')=='on')?1:-1); + + $formmail->withoptiononeemailperrecipient = (count($listofselectedref) == 1 || empty($liste))? 0 : ((GETPOST('oneemailperrecipient')=='on')?1:-1); $formmail->withto = empty($liste)?(GETPOST('sendto','alpha')?GETPOST('sendto','alpha'):array()):$liste; $formmail->withtofree = empty($liste)?1:0; $formmail->withtocc = 1; From 04f80f0925279bd614d20107aac94e32b52a0043 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 29 Oct 2018 02:27:51 +0100 Subject: [PATCH 42/51] FIX Do not show check box if not applicable --- htdocs/core/actions_massactions.inc.php | 2 +- htdocs/core/class/html.formmail.class.php | 17 ++++++++++------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index 710091a1661..312d6c3d507 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -93,7 +93,7 @@ if (! $error && $massaction == 'confirm_presend') } // Check mandatory parameters - if (empty($user->email)) + if (GETPOST('fromtype','alpha') === 'user' && empty($user->email)) { $error++; setEventMessages($langs->trans("NoSenderEmailDefined"), null, 'warnings'); diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index 434f49bb3d6..99f14e973ca 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -846,14 +846,17 @@ class FormMail extends Form $out.= '
'; - if (GETPOSTISSET('sendmail')) + if ($this->withmaindocfile) // withmaindocfile is set to 1 or -1 to show the checkbox (-1 = checked or 1 = not checked) { - $this->withmaindocfile = (GETPOST('addmaindocfile', 'alpha') ? -1 : 1); - } - // If a template was selected, we use setup of template to define if join file checkbox is selected or not. - elseif (is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) - { - $this->withmaindocfile = ($arraydefaultmessage->joinfiles ? -1 : 1); + if (GETPOSTISSET('sendmail')) + { + $this->withmaindocfile = (GETPOST('addmaindocfile', 'alpha') ? -1 : 1); + } + // If a template was selected, we use setup of template to define if join file checkbox is selected or not. + elseif (is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) + { + $this->withmaindocfile = ($arraydefaultmessage->joinfiles ? -1 : 1); + } } if (! empty($this->withmaindocfile)) From 08862fb482f49fe5d35d4d7eac6a0fbb30274fff Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 29 Oct 2018 03:25:21 +0100 Subject: [PATCH 43/51] Log success of emails --- htdocs/core/actions_massactions.inc.php | 3 ++- htdocs/core/class/CMailFile.class.php | 10 +++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index adf7b9b7c89..088ae69ebed 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -83,9 +83,10 @@ if (! $error && $massaction == 'confirm_presend') if ($result > 0) { $listofobjectid[$toselectid]=$toselectid; - $thirdpartyid=$objecttmp->fk_soc?$objecttmp->fk_soc:$objecttmp->socid; + $thirdpartyid=($objecttmp->fk_soc?$objecttmp->fk_soc:$objecttmp->socid); if ($objecttmp->element == 'societe') $thirdpartyid=$objecttmp->id; if ($objecttmp->element == 'expensereport') $thirdpartyid=$objecttmp->fk_user_author; + if ($objecttmp->element == 'holiday') $thirdpartyid=$objecttmp->fk_user; $listofobjectthirdparties[$thirdpartyid]=$thirdpartyid; $listofobjectref[$thirdpartyid][$toselectid]=$objecttmp; } diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php index a37f6b1562b..f64e18abb32 100644 --- a/htdocs/core/class/CMailFile.class.php +++ b/htdocs/core/class/CMailFile.class.php @@ -735,7 +735,11 @@ class CMailFile if (! empty($conf->global->MAIN_MAIL_DEBUG)) $this->dump_mail(); $result=$this->smtps->getErrors(); - if (empty($this->error) && empty($result)) $res=true; + if (empty($this->error) && empty($result)) + { + dol_syslog("CMailFile::sendfile: mail end success", LOG_DEBUG); + $res=true; + } else { if (empty($this->error)) $this->error=$result; @@ -798,6 +802,10 @@ class CMailFile dol_syslog("CMailFile::sendfile: mail end error=".$this->error, LOG_ERR); $res=false; } + else + { + dol_syslog("CMailFile::sendfile: mail end success", LOG_DEBUG); + } } else { From fcfb9746a858aef3319193b23d0471b6c478b444 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 29 Oct 2018 03:42:02 +0100 Subject: [PATCH 44/51] Fix trackid when email sent from mass actions --- htdocs/core/actions_massactions.inc.php | 29 +++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index 088ae69ebed..cbb3d70fbf4 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -74,6 +74,7 @@ if (! $error && $massaction == 'confirm_presend') { $thirdparty=new Societe($db); if ($objecttmp->element == 'expensereport') $thirdparty=new User($db); + if ($objecttmp->element == 'holiday') $thirdparty=new User($db); $objecttmp=new $objectclass($db); foreach($toselect as $toselectid) @@ -84,9 +85,9 @@ if (! $error && $massaction == 'confirm_presend') { $listofobjectid[$toselectid]=$toselectid; $thirdpartyid=($objecttmp->fk_soc?$objecttmp->fk_soc:$objecttmp->socid); - if ($objecttmp->element == 'societe') $thirdpartyid=$objecttmp->id; + if ($objecttmp->element == 'societe') $thirdpartyid=$objecttmp->id; if ($objecttmp->element == 'expensereport') $thirdpartyid=$objecttmp->fk_user_author; - if ($objecttmp->element == 'holiday') $thirdpartyid=$objecttmp->fk_user; + if ($objecttmp->element == 'holiday') $thirdpartyid=$objecttmp->fk_user; $listofobjectthirdparties[$thirdpartyid]=$thirdpartyid; $listofobjectref[$thirdpartyid][$toselectid]=$objecttmp; } @@ -327,7 +328,7 @@ if (! $error && $massaction == 'confirm_presend') $message = GETPOST('message','none'); $sendtobcc = GETPOST('sendtoccc'); - if ($objectclass == 'Propale') $sendtobcc .= (empty($conf->global->MAIN_MAIL_AUTOCOPY_PROPOSAL_TO) ? '' : (($sendtobcc?", ":"").$conf->global->MAIN_MAIL_AUTOCOPY_PROPOSAL_TO)); + if ($objectclass == 'Propal') $sendtobcc .= (empty($conf->global->MAIN_MAIL_AUTOCOPY_PROPOSAL_TO) ? '' : (($sendtobcc?", ":"").$conf->global->MAIN_MAIL_AUTOCOPY_PROPOSAL_TO)); if ($objectclass == 'Commande') $sendtobcc .= (empty($conf->global->MAIN_MAIL_AUTOCOPY_ORDER_TO) ? '' : (($sendtobcc?", ":"").$conf->global->MAIN_MAIL_AUTOCOPY_ORDER_TO)); if ($objectclass == 'Facture') $sendtobcc .= (empty($conf->global->MAIN_MAIL_AUTOCOPY_INVOICE_TO) ? '' : (($sendtobcc?", ":"").$conf->global->MAIN_MAIL_AUTOCOPY_INVOICE_TO)); if ($objectclass == 'Supplier_Proposal') $sendtobcc .= (empty($conf->global->MAIN_MAIL_AUTOCOPY_SUPPLIER_PROPOSAL_TO) ? '' : (($sendtobcc?", ":"").$conf->global->MAIN_MAIL_AUTOCOPY_SUPPLIER_PROPOSAL_TO)); @@ -380,11 +381,31 @@ if (! $error && $massaction == 'confirm_presend') $filename = $attachedfiles['names']; $mimetype = $attachedfiles['mimes']; + // Define the trackid when emails sent from the mass action + if ($oneemailperrecipient) + { + $trackid='thi'.$thirdparty->id; + if ($objecttmp->element == 'expensereport') $trackid='use'.$thirdparty->id; + if ($objecttmp->element == 'holiday') $trackid='use'.$thirdparty->id; + } + else + { + $trackid=strtolower(get_class($objecttmp)); + if (get_class($objecttmp)=='Contrat') $trackid='con'; + if (get_class($objecttmp)=='Propal') $trackid='pro'; + if (get_class($objecttmp)=='Commande') $trackid='ord'; + if (get_class($objecttmp)=='Facture') $trackid='inv'; + if (get_class($objecttmp)=='Supplier_Proposal') $trackid='spr'; + if (get_class($objecttmp)=='CommandeFournisseur') $trackid='sor'; + if (get_class($objecttmp)=='FactureFournisseur') $trackid='sin'; + + $trackid.=$objecttmp->id; + } //var_dump($filepath); // Send mail (substitutionarray must be done just before this) require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; - $mailfile = new CMailFile($subject,$sendto,$from,$message,$filepath,$mimetype,$filename,$sendtocc,$sendtobcc,$deliveryreceipt,-1); + $mailfile = new CMailFile($subject,$sendto,$from,$message,$filepath,$mimetype,$filename,$sendtocc,$sendtobcc,$deliveryreceipt,-1,'','',$trackid); if ($mailfile->error) { $resaction.='
'.$mailfile->error.'
'; From 7785cae9aa4f87e8ca92826050e4d40128b1349b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 29 Oct 2018 03:46:45 +0100 Subject: [PATCH 45/51] Code comment --- htdocs/core/actions_massactions.inc.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index cbb3d70fbf4..39b89ba21f9 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -402,6 +402,7 @@ if (! $error && $massaction == 'confirm_presend') $trackid.=$objecttmp->id; } //var_dump($filepath); + //var_dump($trackid);exit; // Send mail (substitutionarray must be done just before this) require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; From 31497e867f8ff76227f1af3db72220fc4189ee73 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 29 Oct 2018 11:01:02 +0100 Subject: [PATCH 46/51] FIX missing entity filter --- htdocs/projet/class/project.class.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index a704c7d641e..4a67b948c72 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -529,11 +529,11 @@ class Project extends CommonObject if ($type == 'agenda') { - $sql = "SELECT id as rowid FROM " . MAIN_DB_PREFIX . "actioncomm WHERE fk_project IN (". $ids .")"; + $sql = "SELECT id as rowid FROM " . MAIN_DB_PREFIX . "actioncomm WHERE fk_project IN (". $ids .") AND entity IN (".getEntity('agenda').")"; } elseif ($type == 'expensereport') { - $sql = "SELECT ed.rowid FROM " . MAIN_DB_PREFIX . "expensereport as e, " . MAIN_DB_PREFIX . "expensereport_det as ed WHERE e.rowid = ed.fk_expensereport AND ed.fk_projet IN (". $ids .")"; + $sql = "SELECT ed.rowid FROM " . MAIN_DB_PREFIX . "expensereport as e, " . MAIN_DB_PREFIX . "expensereport_det as ed WHERE e.rowid = ed.fk_expensereport AND ed.fk_projet IN (". $ids .") AND entity IN (".getEntity('expensereport').")"; } elseif ($type == 'project_task') { @@ -545,11 +545,11 @@ class Project extends CommonObject } elseif ($type == 'stock_mouvement') { - $sql = 'SELECT ms.rowid, ms.fk_user_author as fk_user FROM ' . MAIN_DB_PREFIX . "stock_mouvement as ms WHERE ms.origintype = 'project' AND ms.fk_origin IN (". $ids .") AND ms.type_mouvement = 1"; + $sql = 'SELECT ms.rowid, ms.fk_user_author as fk_user FROM ' . MAIN_DB_PREFIX . "stock_mouvement as ms WHERE ms.origintype = 'project' AND ms.fk_origin IN (". $ids .") AND ms.type_mouvement = 1"; } else { - $sql = "SELECT rowid FROM " . MAIN_DB_PREFIX . $tablename." WHERE fk_projet IN (". $ids .")"; + $sql = "SELECT rowid FROM " . MAIN_DB_PREFIX . $tablename." WHERE fk_projet IN (". $ids .") AND entity IN (".getEntity($type).")"; } if ($dates > 0) @@ -723,10 +723,10 @@ class Project extends CommonObject return -1; } } - + /** * Delete tasks with no children first, then task with children recursively - * + * * @param User $user User * @return int <0 if KO, 1 if OK */ @@ -754,7 +754,7 @@ class Project extends CommonObject { if (count($this->lines)) $this->deleteTasks($this->lines); } - + return 1; } From 9e3800d7fda8b5c5a5108e595f503e23d3ba0fe2 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 29 Oct 2018 11:14:05 +0100 Subject: [PATCH 47/51] FIX missing entity filter for stock --- htdocs/projet/class/project.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index 4a67b948c72..8aa867458ee 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -533,7 +533,7 @@ class Project extends CommonObject } elseif ($type == 'expensereport') { - $sql = "SELECT ed.rowid FROM " . MAIN_DB_PREFIX . "expensereport as e, " . MAIN_DB_PREFIX . "expensereport_det as ed WHERE e.rowid = ed.fk_expensereport AND ed.fk_projet IN (". $ids .") AND entity IN (".getEntity('expensereport').")"; + $sql = "SELECT ed.rowid FROM " . MAIN_DB_PREFIX . "expensereport as e, " . MAIN_DB_PREFIX . "expensereport_det as ed WHERE e.rowid = ed.fk_expensereport AND e.entity IN (".getEntity('expensereport').") AND ed.fk_projet IN (". $ids .")"; } elseif ($type == 'project_task') { @@ -545,7 +545,7 @@ class Project extends CommonObject } elseif ($type == 'stock_mouvement') { - $sql = 'SELECT ms.rowid, ms.fk_user_author as fk_user FROM ' . MAIN_DB_PREFIX . "stock_mouvement as ms WHERE ms.origintype = 'project' AND ms.fk_origin IN (". $ids .") AND ms.type_mouvement = 1"; + $sql = 'SELECT ms.rowid, ms.fk_user_author as fk_user FROM ' . MAIN_DB_PREFIX . "stock_mouvement as ms, " . MAIN_DB_PREFIX . "entrepot as e WHERE e.rowid = ms.fk_entrepot AND e.entity IN (".getEntity('stock').") AND ms.origintype = 'project' AND ms.fk_origin IN (". $ids .") AND ms.type_mouvement = 1"; } else { From d8bf635530d0a0f21ee598c5bef9794a0c78556a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 29 Oct 2018 11:21:57 +0100 Subject: [PATCH 48/51] Prepare module --- build/rpm/dolibarr_fedora.spec | 1 + build/rpm/dolibarr_generic.spec | 1 + build/rpm/dolibarr_mandriva.spec | 1 + build/rpm/dolibarr_opensuse.spec | 1 + htdocs/emailcollector/index.html | 1 + 5 files changed, 5 insertions(+) create mode 100644 htdocs/emailcollector/index.html diff --git a/build/rpm/dolibarr_fedora.spec b/build/rpm/dolibarr_fedora.spec index 727875485b4..b6d526bf8e1 100755 --- a/build/rpm/dolibarr_fedora.spec +++ b/build/rpm/dolibarr_fedora.spec @@ -181,6 +181,7 @@ done >>%{name}.lang %_datadir/dolibarr/htdocs/dav %_datadir/dolibarr/htdocs/don %_datadir/dolibarr/htdocs/ecm +%_datadir/dolibarr/htdocs/emailcollector %_datadir/dolibarr/htdocs/expedition %_datadir/dolibarr/htdocs/expensereport %_datadir/dolibarr/htdocs/exports diff --git a/build/rpm/dolibarr_generic.spec b/build/rpm/dolibarr_generic.spec index 3fb68d06a15..32c6e50018e 100755 --- a/build/rpm/dolibarr_generic.spec +++ b/build/rpm/dolibarr_generic.spec @@ -261,6 +261,7 @@ done >>%{name}.lang %_datadir/dolibarr/htdocs/dav %_datadir/dolibarr/htdocs/don %_datadir/dolibarr/htdocs/ecm +%_datadir/dolibarr/htdocs/emailcollector %_datadir/dolibarr/htdocs/expedition %_datadir/dolibarr/htdocs/expensereport %_datadir/dolibarr/htdocs/exports diff --git a/build/rpm/dolibarr_mandriva.spec b/build/rpm/dolibarr_mandriva.spec index a4004273211..dbb8e0d1310 100755 --- a/build/rpm/dolibarr_mandriva.spec +++ b/build/rpm/dolibarr_mandriva.spec @@ -178,6 +178,7 @@ done >>%{name}.lang %_datadir/dolibarr/htdocs/dav %_datadir/dolibarr/htdocs/don %_datadir/dolibarr/htdocs/ecm +%_datadir/dolibarr/htdocs/emailcollector %_datadir/dolibarr/htdocs/expedition %_datadir/dolibarr/htdocs/expensereport %_datadir/dolibarr/htdocs/exports diff --git a/build/rpm/dolibarr_opensuse.spec b/build/rpm/dolibarr_opensuse.spec index 478a889c8d6..aa810a737b9 100755 --- a/build/rpm/dolibarr_opensuse.spec +++ b/build/rpm/dolibarr_opensuse.spec @@ -189,6 +189,7 @@ done >>%{name}.lang %_datadir/dolibarr/htdocs/dav %_datadir/dolibarr/htdocs/don %_datadir/dolibarr/htdocs/ecm +%_datadir/dolibarr/htdocs/emailcollector %_datadir/dolibarr/htdocs/expedition %_datadir/dolibarr/htdocs/expensereport %_datadir/dolibarr/htdocs/exports diff --git a/htdocs/emailcollector/index.html b/htdocs/emailcollector/index.html new file mode 100644 index 00000000000..8b137891791 --- /dev/null +++ b/htdocs/emailcollector/index.html @@ -0,0 +1 @@ + From 0500f54237b33b90b2b3da3c18f7a420a7dca979 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 29 Oct 2018 11:29:08 +0100 Subject: [PATCH 49/51] Email collector --- htdocs/core/modules/modDav.class.php | 4 +- .../core/modules/modEmailCollector.class.php | 323 ++++++++++++++++++ 2 files changed, 325 insertions(+), 2 deletions(-) create mode 100644 htdocs/core/modules/modEmailCollector.class.php diff --git a/htdocs/core/modules/modDav.class.php b/htdocs/core/modules/modDav.class.php index f57e7f12dfe..92153d83688 100644 --- a/htdocs/core/modules/modDav.class.php +++ b/htdocs/core/modules/modDav.class.php @@ -44,7 +44,7 @@ class modDav extends DolibarrModules // Id for module (must be unique). // Use here a free id (See in Home -> System information -> Dolibarr for list of used modules id). - $this->numero = 50310; // TODO Go on page https://wiki.dolibarr.org/index.php/List_of_modules_id to reserve id number for your module + $this->numero = 50310; // Key text used to identify module (for permissions, menus, etc...) $this->rights_class = 'dav'; @@ -104,7 +104,7 @@ class modDav extends DolibarrModules // 1=>array('DAV_MYNEWCONST2','chaine','myvalue','This is another constant to add',0, 'current', 1) // ); $this->const = array( - 1=>array('DAV_MYCONSTANT', 'chaine', 'avalue', 'This is a constant to add', 1, 'allentities', 1) + //1=>array('DAV_MYCONSTANT', 'chaine', 'avalue', 'This is a constant to add', 1, 'allentities', 1) ); diff --git a/htdocs/core/modules/modEmailCollector.class.php b/htdocs/core/modules/modEmailCollector.class.php new file mode 100644 index 00000000000..6d266fbe6f7 --- /dev/null +++ b/htdocs/core/modules/modEmailCollector.class.php @@ -0,0 +1,323 @@ + + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \defgroup dav Module dav + * \brief dav module descriptor. + * + * \file htdocs/dav/core/modules/modDav.class.php + * \ingroup dav + * \brief Description and activation file for module dav + */ +include_once DOL_DOCUMENT_ROOT .'/core/modules/DolibarrModules.class.php'; + + +/** + * Description and activation class for module dav + */ +class modEmailCollector extends DolibarrModules +{ + /** + * Constructor. Define names, constants, directories, boxes, permissions + * + * @param DoliDB $db Database handler + */ + public function __construct($db) + { + global $langs,$conf; + + $this->db = $db; + + // Id for module (must be unique). + // Use here a free id (See in Home -> System information -> Dolibarr for list of used modules id). + $this->numero = 50320; + // Key text used to identify module (for permissions, menus, etc...) + $this->rights_class = 'dav'; + + // Family can be 'base' (core modules),'crm','financial','hr','projects','products','ecm','technic' (transverse modules),'interface' (link with external tools),'other','...' + // It is used to group modules by family in module setup page + $this->family = "interface"; + // Module position in the family on 2 digits ('01', '10', '20', ...) + $this->module_position = '75'; + // Gives the possibility to the module, to provide his own family info and position of this family (Overwrite $this->family and $this->module_position. Avoid this) + //$this->familyinfo = array('myownfamily' => array('position' => '01', 'label' => $langs->trans("MyOwnFamily"))); + + // Module label (no space allowed), used if translation string 'ModuledavName' not found (MyModue is name of module). + $this->name = preg_replace('/^mod/i','',get_class($this)); + // Module description, used if translation string 'ModuledavDesc' not found (MyModue is name of module). + $this->description = "EmailCollectorDescription"; + // Used only if file README.md and README-LL.md not found. + $this->descriptionlong = "EmailCollectorDescription"; + + // Possible values for version are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z' + $this->version = 'development'; + // Key used in llx_const table to save module status enabled/disabled (where DAV is value of property name of module in uppercase) + $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); + // Name of image file used for this module. + // If file is in theme/yourtheme/img directory under name object_pictovalue.png, use this->picto='pictovalue' + // If file is in module/img directory under name object_pictovalue.png, use this->picto='pictovalue@module' + $this->picto='generic'; + + // Defined all module parts (triggers, login, substitutions, menus, css, etc...) + // for default path (eg: /dav/core/xxxxx) (0=disable, 1=enable) + // for specific path of parts (eg: /dav/core/modules/barcode) + // for specific css file (eg: /dav/css/dav.css.php) + $this->module_parts = array(); + + // Data directories to create when module is enabled. + // Example: this->dirs = array("/dav/temp","/dav/subdir"); + $this->dirs = array(); + + // Config pages. Put here list of php page, stored into dav/admin directory, to use to setup module. + $this->config_page_url = array("emailcollector.php"); + + // Dependencies + $this->hidden = false; // A condition to hide module + $this->depends = array(); // List of module class names as string that must be enabled if this module is enabled + $this->requiredby = array(); // List of module ids to disable if this one is disabled + $this->conflictwith = array(); // List of module class names as string this module is in conflict with + $this->langfiles = array("admin"); + $this->phpmin = array(5,4); // Minimum version of PHP required by module + $this->need_dolibarr_version = array(7,0); // Minimum version of Dolibarr required by module + $this->warnings_activation = array(); // Warning to show when we activate module. array('always'='text') or array('FR'='textfr','ES'='textes'...) + $this->warnings_activation_ext = array(); // Warning to show when we activate an external module. array('always'='text') or array('FR'='textfr','ES'='textes'...) + //$this->automatic_activation = array('FR'=>'davWasAutomaticallyActivatedBecauseOfYourCountryChoice'); + //$this->always_enabled = true; // If true, can't be disabled + + // Constants + // List of particular constants to add when module is enabled (key, 'chaine', value, desc, visible, 'current' or 'allentities', deleteonunactive) + // Example: $this->const=array(0=>array('DAV_MYNEWCONST1','chaine','myvalue','This is a constant to add',1), + // 1=>array('DAV_MYNEWCONST2','chaine','myvalue','This is another constant to add',0, 'current', 1) + // ); + $this->const = array( + //1=>array('DAV_MYCONSTANT', 'chaine', 'avalue', 'This is a constant to add', 1, 'allentities', 1) + ); + + + if (! isset($conf->dav) || ! isset($conf->dav->enabled)) + { + $conf->dav=new stdClass(); + $conf->dav->enabled=0; + } + + + // Array to add new pages in new tabs + $this->tabs = array(); + // Example: + // $this->tabs[] = array('data'=>'objecttype:+tabname1:Title1:mylangfile@dav:$user->rights->dav->read:/dav/mynewtab1.php?id=__ID__'); // To add a new tab identified by code tabname1 + // $this->tabs[] = array('data'=>'objecttype:+tabname2:SUBSTITUTION_Title2:mylangfile@dav:$user->rights->othermodule->read:/dav/mynewtab2.php?id=__ID__', // To add another new tab identified by code tabname2. Label will be result of calling all substitution functions on 'Title2' key. + // $this->tabs[] = array('data'=>'objecttype:-tabname:NU:conditiontoremove'); // To remove an existing tab identified by code tabname + // + // Where objecttype can be + // 'categories_x' to add a tab in category view (replace 'x' by type of category (0=product, 1=supplier, 2=customer, 3=member) + // 'contact' to add a tab in contact view + // 'contract' to add a tab in contract view + // 'group' to add a tab in group view + // 'intervention' to add a tab in intervention view + // 'invoice' to add a tab in customer invoice view + // 'invoice_supplier' to add a tab in supplier invoice view + // 'member' to add a tab in fundation member view + // 'opensurveypoll' to add a tab in opensurvey poll view + // 'order' to add a tab in customer order view + // 'order_supplier' to add a tab in supplier order view + // 'payment' to add a tab in payment view + // 'payment_supplier' to add a tab in supplier payment view + // 'product' to add a tab in product view + // 'propal' to add a tab in propal view + // 'project' to add a tab in project view + // 'stock' to add a tab in stock view + // 'thirdparty' to add a tab in third party view + // 'user' to add a tab in user view + + + // Dictionaries + $this->dictionaries=array(); + /* Example: + $this->dictionaries=array( + 'langs'=>'mylangfile@dav', + 'tabname'=>array(MAIN_DB_PREFIX."table1",MAIN_DB_PREFIX."table2",MAIN_DB_PREFIX."table3"), // List of tables we want to see into dictonnary editor + 'tablib'=>array("Table1","Table2","Table3"), // Label of tables + 'tabsql'=>array('SELECT f.rowid as rowid, f.code, f.label, f.active FROM '.MAIN_DB_PREFIX.'table1 as f','SELECT f.rowid as rowid, f.code, f.label, f.active FROM '.MAIN_DB_PREFIX.'table2 as f','SELECT f.rowid as rowid, f.code, f.label, f.active FROM '.MAIN_DB_PREFIX.'table3 as f'), // Request to select fields + 'tabsqlsort'=>array("label ASC","label ASC","label ASC"), // Sort order + 'tabfield'=>array("code,label","code,label","code,label"), // List of fields (result of select to show dictionary) + 'tabfieldvalue'=>array("code,label","code,label","code,label"), // List of fields (list of fields to edit a record) + 'tabfieldinsert'=>array("code,label","code,label","code,label"), // List of fields (list of fields for insert) + 'tabrowid'=>array("rowid","rowid","rowid"), // Name of columns with primary key (try to always name it 'rowid') + 'tabcond'=>array($conf->dav->enabled,$conf->dav->enabled,$conf->dav->enabled) // Condition to show each dictionary + ); + */ + + + // Boxes/Widgets + // Add here list of php file(s) stored in dav/core/boxes that contains class to show a widget. + $this->boxes = array( + //0=>array('file'=>'davwidget1.php@dav','note'=>'Widget provided by dav','enabledbydefaulton'=>'Home'), + //1=>array('file'=>'davwidget2.php@dav','note'=>'Widget provided by dav'), + //2=>array('file'=>'davwidget3.php@dav','note'=>'Widget provided by dav') + ); + + + // Cronjobs (List of cron jobs entries to add when module is enabled) + // unit_frequency must be 60 for minute, 3600 for hour, 86400 for day, 604800 for week + //$this->cronjobs = array( + //0=>array('label'=>'MyJob label', 'jobtype'=>'method', 'class'=>'/dav/class/myobject.class.php', 'objectname'=>'MyObject', 'method'=>'doScheduledJob', 'parameters'=>'', 'comment'=>'Comment', 'frequency'=>2, 'unitfrequency'=>3600, 'status'=>0, 'test'=>true) + //); + // Example: $this->cronjobs=array(0=>array('label'=>'My label', 'jobtype'=>'method', 'class'=>'/dir/class/file.class.php', 'objectname'=>'MyClass', 'method'=>'myMethod', 'parameters'=>'param1, param2', 'comment'=>'Comment', 'frequency'=>2, 'unitfrequency'=>3600, 'status'=>0, 'test'=>true), + // 1=>array('label'=>'My label', 'jobtype'=>'command', 'command'=>'', 'parameters'=>'param1, param2', 'comment'=>'Comment', 'frequency'=>1, 'unitfrequency'=>3600*24, 'status'=>0, 'test'=>true) + // ); + + + // Permissions + $this->rights = array(); // Permission array used by this module + + /* + $r=0; + $this->rights[$r][0] = $this->numero + $r; // Permission id (must not be already used) + $this->rights[$r][1] = 'Read myobject of dav'; // Permission label + $this->rights[$r][3] = 1; // Permission by default for new user (0/1) + $this->rights[$r][4] = 'read'; // In php code, permission will be checked by test if ($user->rights->dav->level1->level2) + $this->rights[$r][5] = ''; // In php code, permission will be checked by test if ($user->rights->dav->level1->level2) + + $r++; + $this->rights[$r][0] = $this->numero + $r; // Permission id (must not be already used) + $this->rights[$r][1] = 'Create/Update myobject of dav'; // Permission label + $this->rights[$r][3] = 1; // Permission by default for new user (0/1) + $this->rights[$r][4] = 'write'; // In php code, permission will be checked by test if ($user->rights->dav->level1->level2) + $this->rights[$r][5] = ''; // In php code, permission will be checked by test if ($user->rights->dav->level1->level2) + + $r++; + $this->rights[$r][0] = $this->numero + $r; // Permission id (must not be already used) + $this->rights[$r][1] = 'Delete myobject of dav'; // Permission label + $this->rights[$r][3] = 1; // Permission by default for new user (0/1) + $this->rights[$r][4] = 'delete'; // In php code, permission will be checked by test if ($user->rights->dav->level1->level2) + $this->rights[$r][5] = ''; // In php code, permission will be checked by test if ($user->rights->dav->level1->level2) + */ + + // Main menu entries + $this->menu = array(); // List of menus to add + $r=0; + + // Add here entries to declare new menus + + /* BEGIN MODULEBUILDER TOPMENU */ + /*$this->menu[$r++]=array('fk_menu'=>'', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode + 'type'=>'top', // This is a Top menu entry + 'titre'=>'dav', + 'mainmenu'=>'dav', + 'leftmenu'=>'', + 'url'=>'/dav/davindex.php', + 'langs'=>'dav@dav', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. + 'position'=>1000+$r, + 'enabled'=>'$conf->dav->enabled', // Define condition to show or hide menu entry. Use '$conf->dav->enabled' if entry must be visible if module is enabled. + 'perms'=>'1', // Use 'perms'=>'$user->rights->dav->level1->level2' if you want your menu with a permission rules + 'target'=>'', + 'user'=>2); // 0=Menu for internal users, 1=external users, 2=both + */ + /* END MODULEBUILDER TOPMENU */ + + /* BEGIN MODULEBUILDER LEFTMENU MYOBJECT + $this->menu[$r++]=array( 'fk_menu'=>'fk_mainmenu=dav', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode + 'type'=>'left', // This is a Left menu entry + 'titre'=>'List MyObject', + 'mainmenu'=>'dav', + 'leftmenu'=>'dav_myobject_list', + 'url'=>'/dav/myobject_list.php', + 'langs'=>'dav@dav', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. + 'position'=>1000+$r, + 'enabled'=>'$conf->dav->enabled', // Define condition to show or hide menu entry. Use '$conf->dav->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected. + 'perms'=>'1', // Use 'perms'=>'$user->rights->dav->level1->level2' if you want your menu with a permission rules + 'target'=>'', + 'user'=>2); // 0=Menu for internal users, 1=external users, 2=both + $this->menu[$r++]=array( 'fk_menu'=>'fk_mainmenu=dav,fk_leftmenu=dav', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode + 'type'=>'left', // This is a Left menu entry + 'titre'=>'New MyObject', + 'mainmenu'=>'dav', + 'leftmenu'=>'dav_myobject_new', + 'url'=>'/dav/myobject_page.php?action=create', + 'langs'=>'dav@dav', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. + 'position'=>1000+$r, + 'enabled'=>'$conf->dav->enabled', // Define condition to show or hide menu entry. Use '$conf->dav->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected. + 'perms'=>'1', // Use 'perms'=>'$user->rights->dav->level1->level2' if you want your menu with a permission rules + 'target'=>'', + 'user'=>2); // 0=Menu for internal users, 1=external users, 2=both + END MODULEBUILDER LEFTMENU MYOBJECT */ + + + // Exports + $r=1; + + /* BEGIN MODULEBUILDER EXPORT MYOBJECT */ + /* + $langs->load("dav@dav"); + $this->export_code[$r]=$this->rights_class.'_'.$r; + $this->export_label[$r]='MyObjectLines'; // Translation key (used only if key ExportDataset_xxx_z not found) + $this->export_icon[$r]='myobject@dav'; + $keyforclass = 'MyObject'; $keyforclassfile='/mymobule/class/myobject.class.php'; $keyforelement='myobject'; + include DOL_DOCUMENT_ROOT.'/core/commonfieldsinexport.inc.php'; + $keyforselect='myobject'; $keyforaliasextra='extra'; $keyforelement='myobject'; + include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php'; + //$this->export_dependencies_array[$r]=array('mysubobject'=>'ts.rowid', 't.myfield'=>array('t.myfield2','t.myfield3')); // To force to activate one or several fields if we select some fields that need same (like to select a unique key if we ask a field of a child to avoid the DISTINCT to discard them, or for computed field than need several other fields) + $this->export_sql_start[$r]='SELECT DISTINCT '; + $this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'myobject as t'; + $this->export_sql_end[$r] .=' WHERE 1 = 1'; + $this->export_sql_end[$r] .=' AND t.entity IN ('.getEntity('myobject').')'; + $r++; */ + /* END MODULEBUILDER EXPORT MYOBJECT */ + } + + /** + * Function called when module is enabled. + * The init function add constants, boxes, permissions and menus (defined in constructor) into Dolibarr database. + * It also creates data directories + * + * @param string $options Options when enabling module ('', 'noboxes') + * @return int 1 if OK, 0 if KO + */ + public function init($options='') + { + //$this->_load_tables('/dav/sql/'); + + // Create extrafields + include_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; + $extrafields = new ExtraFields($this->db); + + //$result1=$extrafields->addExtraField('myattr1', "New Attr 1 label", 'boolean', 1, 3, 'thirdparty', 0, 0, '', '', 1, '', 0, 0, '', '', 'dav@dav', '$conf->dav->enabled'); + //$result2=$extrafields->addExtraField('myattr2', "New Attr 2 label", 'varchar', 1, 10, 'project', 0, 0, '', '', 1, '', 0, 0, '', '', 'dav@dav', '$conf->dav->enabled'); + //$result3=$extrafields->addExtraField('myattr3', "New Attr 3 label", 'varchar', 1, 10, 'bank_account', 0, 0, '', '', 1, '', 0, 0, '', '', 'dav@dav', '$conf->dav->enabled'); + //$result4=$extrafields->addExtraField('myattr4', "New Attr 4 label", 'select', 1, 3, 'thirdparty', 0, 1, '', array('options'=>array('code1'=>'Val1','code2'=>'Val2','code3'=>'Val3')), 1 '', 0, 0, '', '', 'dav@dav', '$conf->dav->enabled'); + //$result5=$extrafields->addExtraField('myattr5', "New Attr 5 label", 'text', 1, 10, 'user', 0, 0, '', '', 1, '', 0, 0, '', '', 'dav@dav', '$conf->dav->enabled'); + + $sql = array(); + + return $this->_init($sql, $options); + } + + /** + * Function called when module is disabled. + * Remove from database constants, boxes and permissions from Dolibarr database. + * Data directories are not deleted + * + * @param string $options Options when enabling module ('', 'noboxes') + * @return int 1 if OK, 0 if KO + */ + public function remove($options = '') + { + $sql = array(); + + return $this->_remove($sql, $options); + } +} From 6e2d62bea6a555d9df33298a214c56ddd48c64e0 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 29 Oct 2018 12:30:36 +0100 Subject: [PATCH 50/51] FIX wrong entity id --- htdocs/core/class/html.formfile.class.php | 10 ++++------ htdocs/projet/element.php | 6 +++--- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 7a0c07bb996..72e14fefdd6 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -879,15 +879,13 @@ class FormFile $out=''; $this->infofiles=array('nboffiles'=>0,'extensions'=>array(),'files'=>array()); + $entity = 1; // Without multicompany + // Get object entity - if (empty($conf->multicompany->enabled)) - { - $entity = $conf->entity; - } - else + if (! empty($conf->multicompany->enabled)) { preg_match('/\/([0-9]+)\/[^\/]+\/'.preg_quote($modulesubdir,'/').'$/', $filedir, $regs); - $entity = ((! empty($regs[1]) && $regs[1] > 1) ? $regs[1] : $conf->entity); + $entity = ((! empty($regs[1]) && $regs[1] > 1) ? $regs[1] : 1); // If entity id not found in $filedir this is entity 1 by default } // Get list of files starting with name of ref (but not followed by "-" to discard uploaded files and get only generated files) diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index 3f611e5525e..d2b1948b5ec 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -882,16 +882,16 @@ foreach ($listofreferent as $key => $value) $element_doc = $element->element; $filename=dol_sanitizeFileName($element->ref); - $filedir=$conf->{$element_doc}->dir_output . '/' . dol_sanitizeFileName($element->ref); + $filedir=$conf->{$element_doc}->multidir_output[$element->entity] . '/' . dol_sanitizeFileName($element->ref); if ($element_doc === 'order_supplier') { $element_doc='commande_fournisseur'; - $filedir = $conf->fournisseur->commande->dir_output.'/'.dol_sanitizeFileName($element->ref); + $filedir = $conf->fournisseur->commande->multidir_output[$element->entity].'/'.dol_sanitizeFileName($element->ref); } else if ($element_doc === 'invoice_supplier') { $element_doc='facture_fournisseur'; $filename = get_exdir($element->id,2,0,0,$element,'product').dol_sanitizeFileName($element->ref); - $filedir = $conf->fournisseur->facture->dir_output.'/'.get_exdir($element->id,2,0,0,$element,'invoice_supplier').dol_sanitizeFileName($element->ref); + $filedir = $conf->fournisseur->facture->multidir_output[$element->entity].'/'.get_exdir($element->id,2,0,0,$element,'invoice_supplier').dol_sanitizeFileName($element->ref); } print '
'.$formfile->getDocumentsLink($element_doc, $filename, $filedir).'
'; From 977a88363e5b898a353a9e961b1185fef37b2207 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 29 Oct 2018 12:50:40 +0100 Subject: [PATCH 51/51] FIX missing multidir_output for supplier modules --- htdocs/core/class/conf.class.php | 42 +++++++++++++++++++++----------- 1 file changed, 28 insertions(+), 14 deletions(-) diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index 4a76abff06f..ae6a73a0973 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -344,32 +344,46 @@ class Conf if (! empty($this->fournisseur)) { $this->fournisseur->commande=new stdClass(); - $this->fournisseur->commande->dir_output=$rootfordata."/fournisseur/commande"; - $this->fournisseur->commande->dir_temp =$rootfordata."/fournisseur/commande/temp"; + $this->fournisseur->commande->multidir_output=array($this->entity => $rootfordata."/fournisseur/commande"); + $this->fournisseur->commande->multidir_temp =array($this->entity => $rootfordata."/fournisseur/commande/temp"); + $this->fournisseur->commande->dir_output=$rootfordata."/fournisseur/commande"; // For backward compatibility + $this->fournisseur->commande->dir_temp =$rootfordata."/fournisseur/commande/temp"; // For backward compatibility $this->fournisseur->facture=new stdClass(); - $this->fournisseur->facture->dir_output =$rootfordata."/fournisseur/facture"; - $this->fournisseur->facture->dir_temp =$rootfordata."/fournisseur/facture/temp"; + $this->fournisseur->facture->multidir_output=array($this->entity => $rootfordata."/fournisseur/facture"); + $this->fournisseur->facture->multidir_temp =array($this->entity => $rootfordata."/fournisseur/facture/temp"); + $this->fournisseur->facture->dir_output =$rootfordata."/fournisseur/facture"; // For backward compatibility + $this->fournisseur->facture->dir_temp =$rootfordata."/fournisseur/facture/temp"; // For backward compatibility $this->supplierproposal=new stdClass(); - $this->supplierproposal->dir_output=$rootfordata."/supplier_proposal"; - $this->supplierproposal->dir_temp=$rootfordata."/supplier_proposal/temp"; + $this->supplierproposal->multidir_output=array($this->entity => $rootfordata."/supplier_proposal"); + $this->supplierproposal->multidir_temp =array($this->entity => $rootfordata."/supplier_proposal/temp"); + $this->supplierproposal->dir_output=$rootfordata."/supplier_proposal"; // For backward compatibility + $this->supplierproposal->dir_temp=$rootfordata."/supplier_proposal/temp"; // For backward compatibility $this->fournisseur->payment=new stdClass(); - $this->fournisseur->payment->dir_output =$rootfordata."/fournisseur/payment"; - $this->fournisseur->payment->dir_temp =$rootfordata."/fournisseur/payment/temp"; + $this->fournisseur->payment->multidir_output=array($this->entity => $rootfordata."/fournisseur/payment"); + $this->fournisseur->payment->multidir_temp =array($this->entity => $rootfordata."/fournisseur/payment/temp"); + $this->fournisseur->payment->dir_output =$rootfordata."/fournisseur/payment"; // For backward compatibility + $this->fournisseur->payment->dir_temp =$rootfordata."/fournisseur/payment/temp"; // For backward compatibility // To prepare split of module fournisseur into fournisseur + supplier_order + supplier_invoice if (! empty($this->fournisseur->enabled) && empty($this->global->MAIN_USE_NEW_SUPPLIERMOD)) // By default, if module supplier is on, we set new properties { $this->supplier_order=new stdClass(); $this->supplier_order->enabled=1; - $this->supplier_order->dir_output=$rootfordata."/fournisseur/commande"; - $this->supplier_order->dir_temp=$rootfordata."/fournisseur/commande/temp"; + $this->supplier_order->multidir_output=array($this->entity => $rootfordata."/fournisseur/commande"); + $this->supplier_order->multidir_temp =array($this->entity => $rootfordata."/fournisseur/commande/temp"); + $this->supplier_order->dir_output=$rootfordata."/fournisseur/commande"; // For backward compatibility + $this->supplier_order->dir_temp=$rootfordata."/fournisseur/commande/temp"; // For backward compatibility $this->supplier_invoice=new stdClass(); $this->supplier_invoice->enabled=1; - $this->supplier_invoice->dir_output=$rootfordata."/fournisseur/facture"; - $this->supplier_invoice->dir_temp=$rootfordata."/fournisseur/facture/temp"; + $this->supplier_invoice->multidir_output=array($this->entity => $rootfordata."/fournisseur/facture"); + $this->supplier_invoice->multidir_temp =array($this->entity => $rootfordata."/fournisseur/facture/temp"); + $this->supplier_invoice->dir_output=$rootfordata."/fournisseur/facture"; // For backward compatibility + $this->supplier_invoice->dir_temp=$rootfordata."/fournisseur/facture/temp"; // For backward compatibility $this->supplierproposal=new stdClass(); - $this->supplierproposal->dir_output=$rootfordata."/supplier_proposal"; - $this->supplierproposal->dir_temp=$rootfordata."/supplier_proposal/temp"; + $this->supplierproposal->multidir_output=array($this->entity => $rootfordata."/supplier_proposal"); + $this->supplierproposal->multidir_temp =array($this->entity => $rootfordata."/supplier_proposal/temp"); + $this->supplierproposal->dir_output=$rootfordata."/supplier_proposal"; // For backward compatibility + $this->supplierproposal->dir_temp=$rootfordata."/supplier_proposal/temp"; // For backward compatibility } }