From e8083e2a659e7c7b529758f4bf70f2c5071784c5 Mon Sep 17 00:00:00 2001 From: Scrutinizer Auto-Fixer Date: Mon, 23 Mar 2020 14:54:02 +0000 Subject: [PATCH] Scrutinizer Auto-Fixes This commit consists of patches automatically generated for this project on https://scrutinizer-ci.com --- htdocs/accountancy/class/lettering.class.php | 2 +- .../admin/adherent_type_extrafields.php | 4 +- htdocs/admin/chequereceipts.php | 24 +- ...mande_fournisseur_dispatch_extrafields.php | 18 +- htdocs/admin/confexped.php | 12 +- htdocs/admin/dolistore/ajax/image.php | 28 +- htdocs/admin/ecm.php | 40 +- htdocs/admin/expedition_extrafields.php | 16 +- htdocs/admin/expensereport_extrafields.php | 16 +- htdocs/admin/ldap_contacts.php | 30 +- htdocs/admin/livraison_extrafields.php | 16 +- htdocs/admin/mailing.php | 22 +- htdocs/admin/menus.php | 8 +- htdocs/admin/prelevement.php | 80 +-- htdocs/admin/proxy.php | 58 +- htdocs/admin/reception_extrafields.php | 18 +- htdocs/admin/resource.php | 2 +- .../admin/supplierinvoicedet_extrafields.php | 16 +- htdocs/admin/supplierorder_extrafields.php | 16 +- htdocs/admin/system/constall.php | 88 +-- htdocs/admin/system/modules.php | 60 +- htdocs/admin/system/xdebug.php | 104 ++-- htdocs/admin/ticket_extrafields.php | 22 +- htdocs/admin/tools/update.php | 68 +-- htdocs/asset/admin/assets_extrafields.php | 18 +- htdocs/barcode/codeinit.php | 40 +- htdocs/blockedlog/ajax/block-add.php | 4 +- htdocs/blockedlog/lib/blockedlog.lib.php | 10 +- htdocs/cashdesk/index.php | 4 +- htdocs/comm/action/document.php | 30 +- htdocs/comm/admin/propaldet_extrafields.php | 16 +- htdocs/commande/customer.php | 14 +- htdocs/compta/prelevement/stats.php | 32 +- htdocs/compta/sociales/info.php | 34 +- htdocs/contrat/admin/contract_extrafields.php | 14 +- .../contrat/admin/contractdet_extrafields.php | 14 +- htdocs/core/actions_dellink.inc.php | 6 +- htdocs/core/actions_printing.inc.php | 114 ++-- htdocs/core/actions_setnotes.inc.php | 4 +- htdocs/core/ajax/bankconciliate.php | 32 +- htdocs/core/ajax/fileupload.php | 34 +- htdocs/core/ajax/objectonoff.php | 2 +- htdocs/core/ajax/security.php | 4 +- htdocs/core/ajax/ziptown.php | 58 +- htdocs/core/antispamimage.php | 6 +- htdocs/core/class/commonobjectline.class.php | 14 +- htdocs/core/datepicker.php | 28 +- .../filemanagerdol/connectors/php/upload.php | 2 +- .../filemanagerdol/connectors/php/util.php | 36 +- htdocs/core/js/lib_notification.js.php | 8 +- htdocs/core/lib/categories.lib.php | 22 +- htdocs/core/lib/doc.lib.php | 12 +- htdocs/core/lib/ecm.lib.php | 32 +- htdocs/core/lib/import.lib.php | 10 +- htdocs/core/lib/invoice2.lib.php | 134 ++-- htdocs/core/lib/mailmanspip.lib.php | 26 +- htdocs/core/lib/prelevement.lib.php | 16 +- htdocs/core/lib/receiptprinter.lib.php | 52 +- htdocs/core/lib/trip.lib.php | 4 +- htdocs/core/modules/modDav.class.php | 32 +- htdocs/core/modules/modExport.class.php | 2 +- htdocs/core/modules/modHRM.class.php | 2 +- htdocs/core/modules/modImport.class.php | 4 +- htdocs/core/modules/modMargin.class.php | 22 +- .../oauth/stripetest_oauthcallback.php | 96 +-- htdocs/core/modules/syslog/logHandler.php | 2 +- htdocs/core/search.php | 12 +- htdocs/core/search_page.php | 38 +- htdocs/datapolicy/admin/setupmail.php | 56 +- htdocs/don/admin/donation_extrafields.php | 18 +- htdocs/ecm/ajax/ecmdatabase.php | 10 +- htdocs/ecm/dir_card.php | 90 +-- htdocs/expensereport/info.php | 10 +- htdocs/expensereport/note.php | 6 +- htdocs/externalsite/admin/externalsite.php | 32 +- htdocs/externalsite/frames.php | 2 +- .../fichinter/admin/fichinter_extrafields.php | 14 +- htdocs/fichinter/info.php | 4 +- htdocs/ftp/admin/ftpclient.php | 54 +- htdocs/hrm/establishment/info.php | 8 +- htdocs/install/index.php | 4 +- htdocs/install/step5.php | 578 +++++++++--------- htdocs/margin/admin/margin.php | 88 +-- .../template/test/phpunit/MyObjectTest.php | 16 +- htdocs/opensurvey/fonctions.php | 10 +- htdocs/paybox/admin/paybox.php | 16 +- htdocs/paypal/lib/paypalfunctions.lib.php | 24 +- htdocs/printing/index.php | 24 +- htdocs/printing/lib/printing.lib.php | 58 +- htdocs/product/admin/product_tools.php | 2 +- htdocs/product/dynamic_price/editor.php | 16 +- htdocs/product/popuprop.php | 30 +- .../product/stock/lib/replenishment.lib.php | 134 ++-- htdocs/projet/document.php | 18 +- htdocs/projet/ganttchart.inc.php | 152 ++--- htdocs/public/agenda/agendaexport.php | 18 +- htdocs/public/emailing/mailing-read.php | 2 +- htdocs/public/members/public_card.php | 2 +- htdocs/public/members/public_list.php | 12 +- htdocs/public/notice.php | 12 +- htdocs/public/opensurvey/studs.php | 10 +- htdocs/public/test/test_arrays.php | 30 +- htdocs/public/website/index.php | 36 +- htdocs/resource/contact.php | 10 +- htdocs/societe/admin/contact_extrafields.php | 14 +- htdocs/societe/admin/societe_extrafields.php | 18 +- htdocs/ticket/class/utils_diff.class.php | 564 ++++++++--------- htdocs/ticket/css/styles.css.php | 2 +- htdocs/user/admin/group_extrafields.php | 4 +- htdocs/user/logout.php | 2 +- htdocs/variants/create_val.php | 6 +- htdocs/webservices/server_other.php | 76 +-- .../accountancy/export-thirdpartyaccount.php | 2 +- 113 files changed, 2079 insertions(+), 2079 deletions(-) diff --git a/htdocs/accountancy/class/lettering.class.php b/htdocs/accountancy/class/lettering.class.php index 2012efe0eb9..97d62ebb5dc 100644 --- a/htdocs/accountancy/class/lettering.class.php +++ b/htdocs/accountancy/class/lettering.class.php @@ -230,7 +230,7 @@ class Lettering extends BookKeeping * * @param array $ids ids array * @param boolean $notrigger no trigger - * @return number + * @return number */ public function updateLettering($ids = array(), $notrigger = false) { diff --git a/htdocs/adherents/admin/adherent_type_extrafields.php b/htdocs/adherents/admin/adherent_type_extrafields.php index 3e091acdfda..cd73320d02d 100644 --- a/htdocs/adherents/admin/adherent_type_extrafields.php +++ b/htdocs/adherents/admin/adherent_type_extrafields.php @@ -100,7 +100,7 @@ if ($action == 'create') print "
"; print load_fiche_titre($langs->trans('NewAttribute')); - require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; + require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } /* ************************************************************************** */ @@ -113,7 +113,7 @@ if ($action == 'edit' && ! empty($attrname)) print "
"; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); - require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; + require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; } // End of page diff --git a/htdocs/admin/chequereceipts.php b/htdocs/admin/chequereceipts.php index b63cecf340b..f5f0f6eb752 100644 --- a/htdocs/admin/chequereceipts.php +++ b/htdocs/admin/chequereceipts.php @@ -76,18 +76,18 @@ if ($action == 'set_BANK_CHEQUERECEIPT_FREE_TEXT') { $freetext = GETPOST('BANK_CHEQUERECEIPT_FREE_TEXT', 'none'); // No alpha here, we want exact string - $res = dolibarr_set_const($db, "BANK_CHEQUERECEIPT_FREE_TEXT", $freetext, 'chaine', 0, '', $conf->entity); + $res = dolibarr_set_const($db, "BANK_CHEQUERECEIPT_FREE_TEXT", $freetext, 'chaine', 0, '', $conf->entity); if (! $res > 0) $error++; if (! $error) - { - setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } - else - { - setEventMessages($langs->trans("Error"), null, 'errors'); - } + { + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); + } + else + { + setEventMessages($langs->trans("Error"), null, 'errors'); + } } /* @@ -258,13 +258,13 @@ print $form->textwithpicto($langs->trans("FreeLegalTextOnChequeReceipts"), $lang $variablename='BANK_CHEQUERECEIPT_FREE_TEXT'; if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) { - print ''; + print ''; } else { - include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor=new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes'); - print $doleditor->Create(); + include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; + $doleditor=new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes'); + print $doleditor->Create(); } print ''; print ''; diff --git a/htdocs/admin/commande_fournisseur_dispatch_extrafields.php b/htdocs/admin/commande_fournisseur_dispatch_extrafields.php index 900d66c73b5..b7e874beec2 100644 --- a/htdocs/admin/commande_fournisseur_dispatch_extrafields.php +++ b/htdocs/admin/commande_fournisseur_dispatch_extrafields.php @@ -89,9 +89,9 @@ dol_fiche_end(); // Buttons if ($action != 'create' && $action != 'edit') { - print '
'; - print "".$langs->trans("NewAttribute").""; - print "
"; + print '
'; + print "".$langs->trans("NewAttribute").""; + print "
"; } @@ -103,10 +103,10 @@ if ($action != 'create' && $action != 'edit') if ($action == 'create') { - print "
"; - print load_fiche_titre($langs->trans('NewAttribute')); + print "
"; + print load_fiche_titre($langs->trans('NewAttribute')); - require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; + require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } /* ************************************************************************** */ @@ -116,10 +116,10 @@ if ($action == 'create') /* ************************************************************************** */ if ($action == 'edit' && ! empty($attrname)) { - print "
"; - print load_fiche_titre($langs->trans("FieldEdition", $attrname)); + print "
"; + print load_fiche_titre($langs->trans("FieldEdition", $attrname)); - require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; + require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; } llxFooter(); diff --git a/htdocs/admin/confexped.php b/htdocs/admin/confexped.php index 29940f95d56..b3265479d38 100644 --- a/htdocs/admin/confexped.php +++ b/htdocs/admin/confexped.php @@ -45,8 +45,8 @@ $action=GETPOST('action', 'alpha'); // Shipment note if (! empty($conf->expedition->enabled) && empty($conf->global->MAIN_SUBMODULE_EXPEDITION)) { - // This option should always be set to on when module is on. - dolibarr_set_const($db, "MAIN_SUBMODULE_EXPEDITION", "1", 'chaine', 0, '', $conf->entity); + // This option should always be set to on when module is on. + dolibarr_set_const($db, "MAIN_SUBMODULE_EXPEDITION", "1", 'chaine', 0, '', $conf->entity); } /* if ($action == 'activate_sending') @@ -66,16 +66,16 @@ if ($action == 'disable_sending') // Delivery note if ($action == 'activate_delivery') { - dolibarr_set_const($db, "MAIN_SUBMODULE_EXPEDITION", "1", 'chaine', 0, '', $conf->entity); // We must also enable this - dolibarr_set_const($db, "MAIN_SUBMODULE_LIVRAISON", "1", 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_SUBMODULE_EXPEDITION", "1", 'chaine', 0, '', $conf->entity); // We must also enable this + dolibarr_set_const($db, "MAIN_SUBMODULE_LIVRAISON", "1", 'chaine', 0, '', $conf->entity); header("Location: confexped.php"); exit; } elseif ($action == 'disable_delivery') { dolibarr_del_const($db, "MAIN_SUBMODULE_LIVRAISON", $conf->entity); - header("Location: confexped.php"); - exit; + header("Location: confexped.php"); + exit; } diff --git a/htdocs/admin/dolistore/ajax/image.php b/htdocs/admin/dolistore/ajax/image.php index ecba02c712c..8d1122417b5 100644 --- a/htdocs/admin/dolistore/ajax/image.php +++ b/htdocs/admin/dolistore/ajax/image.php @@ -40,19 +40,19 @@ $id_image = GETPOST('id_image', 'int'); $quality = GETPOST('quality', 'alpha'); try { - $url = $conf->global->MAIN_MODULE_DOLISTORE_API_SRV.'/api/images/products/'.$id_product.'/'.$id_image.'/'.$quality; - $api = new PrestaShopWebservice( - $conf->global->MAIN_MODULE_DOLISTORE_API_SRV, - $conf->global->MAIN_MODULE_DOLISTORE_API_KEY, $dolistore->debug_api - ); - //echo $url; - $request = $api->executeRequest($url, array(CURLOPT_CUSTOMREQUEST => 'GET')); - header('Content-type:image'); - print $request['response']; + $url = $conf->global->MAIN_MODULE_DOLISTORE_API_SRV.'/api/images/products/'.$id_product.'/'.$id_image.'/'.$quality; + $api = new PrestaShopWebservice( + $conf->global->MAIN_MODULE_DOLISTORE_API_SRV, + $conf->global->MAIN_MODULE_DOLISTORE_API_KEY, $dolistore->debug_api + ); + //echo $url; + $request = $api->executeRequest($url, array(CURLOPT_CUSTOMREQUEST => 'GET')); + header('Content-type:image'); + print $request['response']; } catch (PrestaShopWebserviceException $e) { - // Here we are dealing with errors - $trace = $e->getTrace(); - if ($trace[0]['args'][0] == 404) die('Bad ID'); - elseif ($trace[0]['args'][0] == 401) die('Bad auth key'); - else die('Can not access to '.$conf->global->MAIN_MODULE_DOLISTORE_API_SRV); + // Here we are dealing with errors + $trace = $e->getTrace(); + if ($trace[0]['args'][0] == 404) die('Bad ID'); + elseif ($trace[0]['args'][0] == 401) die('Bad auth key'); + else die('Can not access to '.$conf->global->MAIN_MODULE_DOLISTORE_API_SRV); } diff --git a/htdocs/admin/ecm.php b/htdocs/admin/ecm.php index 2fcf3fe6422..66fa695c5b9 100644 --- a/htdocs/admin/ecm.php +++ b/htdocs/admin/ecm.php @@ -36,30 +36,30 @@ if (! $user->admin) accessforbidden(); */ if (preg_match('/set_([a-z0-9_\-]+)/i', $action, $reg)) { - $code=$reg[1]; - if (dolibarr_set_const($db, $code, 1, 'chaine', 0, '', $conf->entity) > 0) - { - header("Location: ".$_SERVER["PHP_SELF"]); - exit; - } - else - { - dol_print_error($db); - } + $code=$reg[1]; + if (dolibarr_set_const($db, $code, 1, 'chaine', 0, '', $conf->entity) > 0) + { + header("Location: ".$_SERVER["PHP_SELF"]); + exit; + } + else + { + dol_print_error($db); + } } if (preg_match('/del_([a-z0-9_\-]+)/i', $action, $reg)) { - $code=$reg[1]; - if (dolibarr_del_const($db, $code, $conf->entity) > 0) - { - header("Location: ".$_SERVER["PHP_SELF"]); - exit; - } - else - { - dol_print_error($db); - } + $code=$reg[1]; + if (dolibarr_del_const($db, $code, $conf->entity) > 0) + { + header("Location: ".$_SERVER["PHP_SELF"]); + exit; + } + else + { + dol_print_error($db); + } } diff --git a/htdocs/admin/expedition_extrafields.php b/htdocs/admin/expedition_extrafields.php index a34bd841c81..69ad145e7df 100644 --- a/htdocs/admin/expedition_extrafields.php +++ b/htdocs/admin/expedition_extrafields.php @@ -86,9 +86,9 @@ dol_fiche_end(); // Buttons if ($action != 'create' && $action != 'edit') { - print '
'; - print "".$langs->trans("NewAttribute").""; - print "
"; + print '
'; + print "".$langs->trans("NewAttribute").""; + print "
"; } @@ -101,9 +101,9 @@ if ($action != 'create' && $action != 'edit') if ($action == 'create') { print '
'; - print load_fiche_titre($langs->trans('NewAttribute')); + print load_fiche_titre($langs->trans('NewAttribute')); - require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; + require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } /* ************************************************************************** */ @@ -113,10 +113,10 @@ if ($action == 'create') /* ************************************************************************** */ if ($action == 'edit' && ! empty($attrname)) { - print "
"; - print load_fiche_titre($langs->trans("FieldEdition", $attrname)); + print "
"; + print load_fiche_titre($langs->trans("FieldEdition", $attrname)); - require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; + require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; } // End of page diff --git a/htdocs/admin/expensereport_extrafields.php b/htdocs/admin/expensereport_extrafields.php index 276a50bc440..61dcf3dcf66 100644 --- a/htdocs/admin/expensereport_extrafields.php +++ b/htdocs/admin/expensereport_extrafields.php @@ -80,9 +80,9 @@ dol_fiche_end(); // Buttons if ($action != 'create' && $action != 'edit') { - print '
'; - print "".$langs->trans("NewAttribute").""; - print "
"; + print '
'; + print "".$langs->trans("NewAttribute").""; + print "
"; } @@ -95,9 +95,9 @@ if ($action != 'create' && $action != 'edit') if ($action == 'create') { print '
'; - print load_fiche_titre($langs->trans('NewAttribute')); + print load_fiche_titre($langs->trans('NewAttribute')); - require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; + require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } /* ************************************************************************** */ @@ -107,10 +107,10 @@ if ($action == 'create') /* ************************************************************************** */ if ($action == 'edit' && ! empty($attrname)) { - print "
"; - print load_fiche_titre($langs->trans("FieldEdition", $attrname)); + print "
"; + print load_fiche_titre($langs->trans("FieldEdition", $attrname)); - require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; + require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; } // End of page diff --git a/htdocs/admin/ldap_contacts.php b/htdocs/admin/ldap_contacts.php index 4a6a21197a8..d2984cab6bf 100644 --- a/htdocs/admin/ldap_contacts.php +++ b/htdocs/admin/ldap_contacts.php @@ -68,22 +68,22 @@ if ($action == 'setvalue' && $user->admin) if (! dolibarr_set_const($db, 'LDAP_CONTACT_FIELD_TOWN', GETPOST("fieldtown"), 'chaine', 0, '', $conf->entity)) $error++; if (! dolibarr_set_const($db, 'LDAP_CONTACT_FIELD_COUNTRY', GETPOST("fieldcountry"), 'chaine', 0, '', $conf->entity)) $error++; - // This one must be after the others - $valkey=''; - $key=GETPOST("key"); - if ($key) $valkey=$conf->global->$key; - if (! dolibarr_set_const($db, 'LDAP_KEY_CONTACTS', $valkey, 'chaine', 0, '', $conf->entity)) $error++; + // This one must be after the others + $valkey=''; + $key=GETPOST("key"); + if ($key) $valkey=$conf->global->$key; + if (! dolibarr_set_const($db, 'LDAP_KEY_CONTACTS', $valkey, 'chaine', 0, '', $conf->entity)) $error++; - if (! $error) - { - $db->commit(); - setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } - else - { - $db->rollback(); - dol_print_error($db); - } + if (! $error) + { + $db->commit(); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); + } + else + { + $db->rollback(); + dol_print_error($db); + } } diff --git a/htdocs/admin/livraison_extrafields.php b/htdocs/admin/livraison_extrafields.php index b78e6f1730e..814a865216d 100644 --- a/htdocs/admin/livraison_extrafields.php +++ b/htdocs/admin/livraison_extrafields.php @@ -86,9 +86,9 @@ dol_fiche_end(); // Buttons if ($action != 'create' && $action != 'edit') { - print '
'; - print "".$langs->trans("NewAttribute").""; - print "
"; + print '
'; + print "".$langs->trans("NewAttribute").""; + print "
"; } @@ -101,9 +101,9 @@ if ($action != 'create' && $action != 'edit') if ($action == 'create') { print '
'; - print load_fiche_titre($langs->trans('NewAttribute')); + print load_fiche_titre($langs->trans('NewAttribute')); - require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; + require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } /* ************************************************************************** */ @@ -113,10 +113,10 @@ if ($action == 'create') /* ************************************************************************** */ if ($action == 'edit' && ! empty($attrname)) { - print "
"; - print load_fiche_titre($langs->trans("FieldEdition", $attrname)); + print "
"; + print load_fiche_titre($langs->trans("FieldEdition", $attrname)); - require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; + require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; } // End of page diff --git a/htdocs/admin/mailing.php b/htdocs/admin/mailing.php index 4a37c761628..7598d2d8588 100644 --- a/htdocs/admin/mailing.php +++ b/htdocs/admin/mailing.php @@ -48,7 +48,7 @@ if ($action == 'setvalue') $mailerror = GETPOST('MAILING_EMAIL_ERRORSTO', 'alpha'); $checkread = GETPOST('value', 'alpha'); $checkread_key = GETPOST('MAILING_EMAIL_UNSUBSCRIBE_KEY', 'alpha'); - $mailingdelay = GETPOST('MAILING_DELAY', 'int'); + $mailingdelay = GETPOST('MAILING_DELAY', 'int'); $res=dolibarr_set_const($db, "MAILING_EMAIL_FROM", $mailfrom, 'chaine', 0, '', $conf->entity); if (! $res > 0) $error++; @@ -61,16 +61,16 @@ if ($action == 'setvalue') $res=dolibarr_set_const($db, "MAILING_EMAIL_UNSUBSCRIBE_KEY", $checkread_key, 'chaine', 0, '', $conf->entity); if (! $res > 0) $error++; - if (! $error) - { - $db->commit(); - setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } - else - { - $db->rollback(); - setEventMessages($langs->trans("Error"), null, 'errors'); - } + if (! $error) + { + $db->commit(); + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); + } + else + { + $db->rollback(); + setEventMessages($langs->trans("Error"), null, 'errors'); + } } diff --git a/htdocs/admin/menus.php b/htdocs/admin/menus.php index 32cd7c35829..ce0136642e2 100644 --- a/htdocs/admin/menus.php +++ b/htdocs/admin/menus.php @@ -41,8 +41,8 @@ $dirsmartphone = array(); $dirmenus=array_merge(array("/core/menus/"), (array) $conf->modules_parts['menus']); foreach($dirmenus as $dirmenu) { - $dirstandard[]=$dirmenu.'standard'; - $dirsmartphone[]=$dirmenu.'smartphone'; + $dirstandard[]=$dirmenu.'standard'; + $dirsmartphone[]=$dirmenu.'smartphone'; } $error=0; @@ -85,8 +85,8 @@ if ($action == 'update' && ! $cancel) foreach($dirmenus as $dirmenu) { $file='init_menu_'.$key.'.sql'; - $fullpath=dol_buildpath($dirmenu.$file); - //print 'action='.$action.' Search menu into fullpath='.$fullpath.'
';exit; + $fullpath=dol_buildpath($dirmenu.$file); + //print 'action='.$action.' Search menu into fullpath='.$fullpath.'
';exit; if (file_exists($fullpath)) { diff --git a/htdocs/admin/prelevement.php b/htdocs/admin/prelevement.php index b3e6ec312ae..12231079ae0 100644 --- a/htdocs/admin/prelevement.php +++ b/htdocs/admin/prelevement.php @@ -46,15 +46,15 @@ $type = 'paymentorder'; if ($action == "set") { - $db->begin(); + $db->begin(); - $id=GETPOST('PRELEVEMENT_ID_BANKACCOUNT', 'int'); - $account = new Account($db); - if($account->fetch($id)>0) - { - $res = dolibarr_set_const($db, "PRELEVEMENT_ID_BANKACCOUNT", $id, 'chaine', 0, '', $conf->entity); - if (! $res > 0) $error++; - /* + $id=GETPOST('PRELEVEMENT_ID_BANKACCOUNT', 'int'); + $account = new Account($db); + if($account->fetch($id)>0) + { + $res = dolibarr_set_const($db, "PRELEVEMENT_ID_BANKACCOUNT", $id, 'chaine', 0, '', $conf->entity); + if (! $res > 0) $error++; + /* $res = dolibarr_set_const($db, "PRELEVEMENT_CODE_BANQUE", $account->code_banque,'chaine',0,'',$conf->entity); if (! $res > 0) $error++; $res = dolibarr_set_const($db, "PRELEVEMENT_CODE_GUICHET", $account->code_guichet,'chaine',0,'',$conf->entity); @@ -70,33 +70,33 @@ if ($action == "set") $res = dolibarr_set_const($db, "PRELEVEMENT_RAISON_SOCIALE", $account->proprio,'chaine',0,'',$conf->entity); if (! $res > 0) $error++; */ - } - else $error++; + } + else $error++; - $res = dolibarr_set_const($db, "PRELEVEMENT_ICS", GETPOST("PRELEVEMENT_ICS"), 'chaine', 0, '', $conf->entity); - if (! $res > 0) $error++; + $res = dolibarr_set_const($db, "PRELEVEMENT_ICS", GETPOST("PRELEVEMENT_ICS"), 'chaine', 0, '', $conf->entity); + if (! $res > 0) $error++; - if (GETPOST("PRELEVEMENT_USER") > 0) - { - $res = dolibarr_set_const($db, "PRELEVEMENT_USER", GETPOST("PRELEVEMENT_USER"), 'chaine', 0, '', $conf->entity); - if (! $res > 0) $error++; - } - if (GETPOST("PRELEVEMENT_END_TO_END") || GETPOST("PRELEVEMENT_END_TO_END")=="") - { - $res = dolibarr_set_const($db, "PRELEVEMENT_END_TO_END", GETPOST("PRELEVEMENT_END_TO_END"), 'chaine', 0, '', $conf->entity); - if (! $res > 0) $error++; - } - if (GETPOST("PRELEVEMENT_USTRD") || GETPOST("PRELEVEMENT_USTRD")=="") - { - $res = dolibarr_set_const($db, "PRELEVEMENT_USTRD", GETPOST("PRELEVEMENT_USTRD"), 'chaine', 0, '', $conf->entity); - if (! $res > 0) $error++; - } + if (GETPOST("PRELEVEMENT_USER") > 0) + { + $res = dolibarr_set_const($db, "PRELEVEMENT_USER", GETPOST("PRELEVEMENT_USER"), 'chaine', 0, '', $conf->entity); + if (! $res > 0) $error++; + } + if (GETPOST("PRELEVEMENT_END_TO_END") || GETPOST("PRELEVEMENT_END_TO_END")=="") + { + $res = dolibarr_set_const($db, "PRELEVEMENT_END_TO_END", GETPOST("PRELEVEMENT_END_TO_END"), 'chaine', 0, '', $conf->entity); + if (! $res > 0) $error++; + } + if (GETPOST("PRELEVEMENT_USTRD") || GETPOST("PRELEVEMENT_USTRD")=="") + { + $res = dolibarr_set_const($db, "PRELEVEMENT_USTRD", GETPOST("PRELEVEMENT_USTRD"), 'chaine', 0, '', $conf->entity); + if (! $res > 0) $error++; + } - if (GETPOST("PRELEVEMENT_ADDDAYS") || GETPOST("PRELEVEMENT_ADDDAYS")=="") - { - $res = dolibarr_set_const($db, "PRELEVEMENT_ADDDAYS", GETPOST("PRELEVEMENT_ADDDAYS"), 'chaine', 0, '', $conf->entity); - if (! $res > 0) $error++; - } elseif (! $error) + if (GETPOST("PRELEVEMENT_ADDDAYS") || GETPOST("PRELEVEMENT_ADDDAYS")=="") + { + $res = dolibarr_set_const($db, "PRELEVEMENT_ADDDAYS", GETPOST("PRELEVEMENT_ADDDAYS"), 'chaine', 0, '', $conf->entity); + if (! $res > 0) $error++; + } elseif (! $error) { $db->commit(); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); @@ -110,20 +110,20 @@ if ($action == "set") if ($action == "addnotif") { - $bon = new BonPrelevement($db); - $bon->AddNotification($db, GETPOST('user', 'int'), $action); + $bon = new BonPrelevement($db); + $bon->AddNotification($db, GETPOST('user', 'int'), $action); - header("Location: prelevement.php"); - exit; + header("Location: prelevement.php"); + exit; } if ($action == "deletenotif") { - $bon = new BonPrelevement($db); - $bon->DeleteNotificationById(GETPOST('notif', 'int')); + $bon = new BonPrelevement($db); + $bon->DeleteNotificationById(GETPOST('notif', 'int')); - header("Location: prelevement.php"); - exit; + header("Location: prelevement.php"); + exit; } /* diff --git a/htdocs/admin/proxy.php b/htdocs/admin/proxy.php index c00bef75697..9011c6b4e67 100644 --- a/htdocs/admin/proxy.php +++ b/htdocs/admin/proxy.php @@ -40,34 +40,34 @@ $upload_dir=$conf->admin->dir_temp; if (GETPOST('action', 'aZ09') == 'set_proxy') { - if (GETPOST("MAIN_USE_CONNECT_TIMEOUT") && ! is_numeric(GETPOST("MAIN_USE_CONNECT_TIMEOUT"))) - { - setEventMessages($langs->trans("ErrorValueMustBeInteger"), null, 'errors'); - $error++; - } - if (GETPOST("MAIN_USE_RESPONSE_TIMEOUT") && ! is_numeric(GETPOST("MAIN_USE_RESPONSE_TIMEOUT"))) - { - setEventMessages($langs->trans("ErrorValueMustBeInteger"), null, 'errors'); - $error++; - } + if (GETPOST("MAIN_USE_CONNECT_TIMEOUT") && ! is_numeric(GETPOST("MAIN_USE_CONNECT_TIMEOUT"))) + { + setEventMessages($langs->trans("ErrorValueMustBeInteger"), null, 'errors'); + $error++; + } + if (GETPOST("MAIN_USE_RESPONSE_TIMEOUT") && ! is_numeric(GETPOST("MAIN_USE_RESPONSE_TIMEOUT"))) + { + setEventMessages($langs->trans("ErrorValueMustBeInteger"), null, 'errors'); + $error++; + } - if (! $error) - { - $result=0; - $result+=dolibarr_set_const($db, 'MAIN_USE_CONNECT_TIMEOUT', GETPOST("MAIN_USE_CONNECT_TIMEOUT"), 'chaine', 0, '', $conf->entity); - $result+=dolibarr_set_const($db, 'MAIN_USE_RESPONSE_TIMEOUT', GETPOST("MAIN_USE_RESPONSE_TIMEOUT"), 'chaine', 0, '', $conf->entity); - $result+=dolibarr_set_const($db, 'MAIN_PROXY_USE', GETPOST("MAIN_PROXY_USE"), 'chaine', 0, '', $conf->entity); - $result+=dolibarr_set_const($db, 'MAIN_PROXY_HOST', GETPOST("MAIN_PROXY_HOST"), 'chaine', 0, '', $conf->entity); - $result+=dolibarr_set_const($db, 'MAIN_PROXY_PORT', GETPOST("MAIN_PROXY_PORT"), 'chaine', 0, '', $conf->entity); - $result+=dolibarr_set_const($db, 'MAIN_PROXY_USER', GETPOST("MAIN_PROXY_USER"), 'chaine', 0, '', $conf->entity); - $result+=dolibarr_set_const($db, 'MAIN_PROXY_PASS', GETPOST("MAIN_PROXY_PASS"), 'chaine', 0, '', $conf->entity); - if ($result < 5) dol_print_error($db); - } + if (! $error) + { + $result=0; + $result+=dolibarr_set_const($db, 'MAIN_USE_CONNECT_TIMEOUT', GETPOST("MAIN_USE_CONNECT_TIMEOUT"), 'chaine', 0, '', $conf->entity); + $result+=dolibarr_set_const($db, 'MAIN_USE_RESPONSE_TIMEOUT', GETPOST("MAIN_USE_RESPONSE_TIMEOUT"), 'chaine', 0, '', $conf->entity); + $result+=dolibarr_set_const($db, 'MAIN_PROXY_USE', GETPOST("MAIN_PROXY_USE"), 'chaine', 0, '', $conf->entity); + $result+=dolibarr_set_const($db, 'MAIN_PROXY_HOST', GETPOST("MAIN_PROXY_HOST"), 'chaine', 0, '', $conf->entity); + $result+=dolibarr_set_const($db, 'MAIN_PROXY_PORT', GETPOST("MAIN_PROXY_PORT"), 'chaine', 0, '', $conf->entity); + $result+=dolibarr_set_const($db, 'MAIN_PROXY_USER', GETPOST("MAIN_PROXY_USER"), 'chaine', 0, '', $conf->entity); + $result+=dolibarr_set_const($db, 'MAIN_PROXY_PASS', GETPOST("MAIN_PROXY_PASS"), 'chaine', 0, '', $conf->entity); + if ($result < 5) dol_print_error($db); + } - if (! $error) - { - setEventMessages($langs->trans("RecordModifiedSuccessfully"), null, 'mesgs'); - } + if (! $error) + { + setEventMessages($langs->trans("RecordModifiedSuccessfully"), null, 'mesgs'); + } } @@ -99,8 +99,8 @@ dol_fiche_head($head, 'proxy', $langs->trans("Security"), -1); if ($conf->use_javascript_ajax) { - print "\n".''."\n"; + print ''."\n"; } diff --git a/htdocs/admin/reception_extrafields.php b/htdocs/admin/reception_extrafields.php index 454fe1c4a8f..95338903ade 100644 --- a/htdocs/admin/reception_extrafields.php +++ b/htdocs/admin/reception_extrafields.php @@ -89,9 +89,9 @@ dol_fiche_end(); // Buttons if ($action != 'create' && $action != 'edit') { - print '
'; - print "".$langs->trans("NewAttribute").""; - print "
"; + print '
'; + print "".$langs->trans("NewAttribute").""; + print "
"; } @@ -103,10 +103,10 @@ if ($action != 'create' && $action != 'edit') if ($action == 'create') { - print "
"; - print load_fiche_titre($langs->trans('NewAttribute')); + print "
"; + print load_fiche_titre($langs->trans('NewAttribute')); - require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; + require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } /* ************************************************************************** */ @@ -116,10 +116,10 @@ if ($action == 'create') /* ************************************************************************** */ if ($action == 'edit' && ! empty($attrname)) { - print "
"; - print load_fiche_titre($langs->trans("FieldEdition", $attrname)); + print "
"; + print load_fiche_titre($langs->trans("FieldEdition", $attrname)); - require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; + require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; } llxFooter(); diff --git a/htdocs/admin/resource.php b/htdocs/admin/resource.php index 462326316b2..b64c01c5f00 100644 --- a/htdocs/admin/resource.php +++ b/htdocs/admin/resource.php @@ -35,7 +35,7 @@ $langs->loadLangs(array("admin","resource")); // Security check if (!$user->admin) - accessforbidden(); + accessforbidden(); $action = GETPOST('action', 'alpha'); diff --git a/htdocs/admin/supplierinvoicedet_extrafields.php b/htdocs/admin/supplierinvoicedet_extrafields.php index bcb3b5769ee..39a757bbf9c 100644 --- a/htdocs/admin/supplierinvoicedet_extrafields.php +++ b/htdocs/admin/supplierinvoicedet_extrafields.php @@ -86,9 +86,9 @@ dol_fiche_end(); // Buttons if ($action != 'create' && $action != 'edit') { - print '
'; - print "".$langs->trans("NewAttribute").""; - print "
"; + print '
'; + print "".$langs->trans("NewAttribute").""; + print "
"; } @@ -101,9 +101,9 @@ if ($action != 'create' && $action != 'edit') if ($action == 'create') { print '
'; - print load_fiche_titre($langs->trans('NewAttribute')); + print load_fiche_titre($langs->trans('NewAttribute')); - require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; + require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } /* ************************************************************************** */ @@ -113,10 +113,10 @@ if ($action == 'create') /* ************************************************************************** */ if ($action == 'edit' && ! empty($attrname)) { - print "
"; - print load_fiche_titre($langs->trans("FieldEdition", $attrname)); + print "
"; + print load_fiche_titre($langs->trans("FieldEdition", $attrname)); - require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; + require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; } // End of page diff --git a/htdocs/admin/supplierorder_extrafields.php b/htdocs/admin/supplierorder_extrafields.php index 78c31291414..8924741df52 100644 --- a/htdocs/admin/supplierorder_extrafields.php +++ b/htdocs/admin/supplierorder_extrafields.php @@ -84,9 +84,9 @@ dol_fiche_end(); // Buttons if ($action != 'create' && $action != 'edit') { - print '
'; - print "".$langs->trans("NewAttribute").""; - print "
"; + print '
'; + print "".$langs->trans("NewAttribute").""; + print "
"; } @@ -99,9 +99,9 @@ if ($action != 'create' && $action != 'edit') if ($action == 'create') { print '
'; - print load_fiche_titre($langs->trans('NewAttribute')); + print load_fiche_titre($langs->trans('NewAttribute')); - require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; + require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } /* ************************************************************************** */ @@ -111,10 +111,10 @@ if ($action == 'create') /* ************************************************************************** */ if ($action == 'edit' && ! empty($attrname)) { - print "
"; - print load_fiche_titre($langs->trans("FieldEdition", $attrname)); + print "
"; + print load_fiche_titre($langs->trans("FieldEdition", $attrname)); - require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; + require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; } // End of page diff --git a/htdocs/admin/system/constall.php b/htdocs/admin/system/constall.php index 194c871958d..0835138227b 100644 --- a/htdocs/admin/system/constall.php +++ b/htdocs/admin/system/constall.php @@ -70,27 +70,27 @@ $configfileparameters=array( '?dolibarr_main_auth_ldap_admin_login', '?dolibarr_main_auth_ldap_admin_pass', '?dolibarr_main_auth_ldap_debug', - 'separator', - '?dolibarr_lib_ADODB_PATH', + 'separator', + '?dolibarr_lib_ADODB_PATH', '?dolibarr_lib_FPDF_PATH', - '?dolibarr_lib_TCPDF_PATH', + '?dolibarr_lib_TCPDF_PATH', '?dolibarr_lib_FPDI_PATH', - '?dolibarr_lib_TCPDI_PATH', + '?dolibarr_lib_TCPDI_PATH', '?dolibarr_lib_NUSOAP_PATH', - '?dolibarr_lib_PHPEXCEL_PATH', - '?dolibarr_lib_GEOIP_PATH', + '?dolibarr_lib_PHPEXCEL_PATH', + '?dolibarr_lib_GEOIP_PATH', '?dolibarr_lib_ODTPHP_PATH', - '?dolibarr_lib_ODTPHP_PATHTOPCLZIP', - '?dolibarr_js_CKEDITOR', - '?dolibarr_js_JQUERY', - '?dolibarr_js_JQUERY_UI', - '?dolibarr_js_JQUERY_FLOT', + '?dolibarr_lib_ODTPHP_PATHTOPCLZIP', + '?dolibarr_js_CKEDITOR', + '?dolibarr_js_JQUERY', + '?dolibarr_js_JQUERY_UI', + '?dolibarr_js_JQUERY_FLOT', '?dolibarr_font_DOL_DEFAULT_TTF', - '?dolibarr_font_DOL_DEFAULT_TTF_BOLD', + '?dolibarr_font_DOL_DEFAULT_TTF_BOLD', 'separator', '?dolibarr_mailing_limit_sendbyweb', '?dolibarr_mailing_limit_sendbycli', - '?dolibarr_strict_mode' + '?dolibarr_strict_mode' ); $configfilelib=array( // 'separator', @@ -121,20 +121,20 @@ $configfilelib=array( 'dolibarr_main_auth_ldap_admin_pass', 'dolibarr_main_auth_ldap_debug', 'separator', - 'dolibarr_lib_ADODB_PATH', - 'dolibarr_lib_TCPDF_PATH', - 'dolibarr_lib_FPDI_PATH', + 'dolibarr_lib_ADODB_PATH', + 'dolibarr_lib_TCPDF_PATH', + 'dolibarr_lib_FPDI_PATH', 'dolibarr_lib_NUSOAP_PATH', - 'dolibarr_lib_PHPEXCEL_PATH', - 'dolibarr_lib_GEOIP_PATH', + 'dolibarr_lib_PHPEXCEL_PATH', + 'dolibarr_lib_GEOIP_PATH', 'dolibarr_lib_ODTPHP_PATH', - 'dolibarr_lib_ODTPHP_PATHTOPCLZIP', - 'dolibarr_js_CKEDITOR', - 'dolibarr_js_JQUERY', - 'dolibarr_js_JQUERY_UI', - 'dolibarr_js_JQUERY_FLOT', + 'dolibarr_lib_ODTPHP_PATHTOPCLZIP', + 'dolibarr_js_CKEDITOR', + 'dolibarr_js_JQUERY', + 'dolibarr_js_JQUERY_UI', + 'dolibarr_js_JQUERY_FLOT', 'dolibarr_font_DOL_DEFAULT_TTF', - 'dolibarr_font_DOL_DEFAULT_TTF_BOLD', + 'dolibarr_font_DOL_DEFAULT_TTF_BOLD', 'separator', 'Limit nb of email sent by page', 'Strict mode is on/off' @@ -155,19 +155,19 @@ foreach($configfileparameters as $key) if (empty($ignore)) { - $newkey = preg_replace('/^\?/', '', $key); + $newkey = preg_replace('/^\?/', '', $key); - if (preg_match('/^\?/', $key) && empty(${$newkey})) - { - $i++; - continue; // We discard parametes starting with ? - } + if (preg_match('/^\?/', $key) && empty(${$newkey})) + { + $i++; + continue; // We discard parametes starting with ? + } - if ($newkey == 'separator' && $lastkeyshown == 'separator') - { - $i++; - continue; - } + if ($newkey == 'separator' && $lastkeyshown == 'separator') + { + $i++; + continue; + } print ''; if ($newkey == 'separator') @@ -233,17 +233,17 @@ if ($resql) $i = 0; while ($i < $num) - { - $obj = $db->fetch_object($resql); + { + $obj = $db->fetch_object($resql); - print ''; - print ''.$obj->name.''."\n"; - print ''.$obj->value.''."\n"; - if (empty($conf->multicompany->enabled) || !$user->entity) print ''.$obj->entity.''."\n"; // If superadmin or multicompany disabled - print "\n"; + print ''; + print ''.$obj->name.''."\n"; + print ''.$obj->value.''."\n"; + if (empty($conf->multicompany->enabled) || !$user->entity) print ''.$obj->entity.''."\n"; // If superadmin or multicompany disabled + print "\n"; - $i++; - } + $i++; + } } print ''; diff --git a/htdocs/admin/system/modules.php b/htdocs/admin/system/modules.php index 7a53b95fcf2..dce23de6270 100644 --- a/htdocs/admin/system/modules.php +++ b/htdocs/admin/system/modules.php @@ -54,17 +54,17 @@ $i=0; foreach($modulesdir as $dir) { $handle=@opendir(dol_osencode($dir)); - if (is_resource($handle)) - { - while (($file = readdir($handle))!==false) - { - if (is_readable($dir.$file) && substr($file, 0, 3) == 'mod' && substr($file, dol_strlen($file) - 10) == '.class.php') - { - $modName = substr($file, 0, dol_strlen($file) - 10); + if (is_resource($handle)) + { + while (($file = readdir($handle))!==false) + { + if (is_readable($dir.$file) && substr($file, 0, 3) == 'mod' && substr($file, dol_strlen($file) - 10) == '.class.php') + { + $modName = substr($file, 0, dol_strlen($file) - 10); - if ($modName) - { - //print 'xx'.$dir.$file.'
'; + if ($modName) + { + //print 'xx'.$dir.$file.'
'; if (in_array($file, $modules_files)) { // File duplicate @@ -77,13 +77,13 @@ foreach($modulesdir as $dir) if (class_exists($modName)) { try { - $objMod = new $modName($db); + $objMod = new $modName($db); - $modules[$objMod->numero]=$objMod; - $modules_names[$objMod->numero]=$objMod->name; - $modules_files[$objMod->numero]=$file; - $modules_fullpath[$file]=$dir.$file; - $picto[$objMod->numero]=(isset($objMod->picto) && $objMod->picto)?$objMod->picto:'generic'; + $modules[$objMod->numero]=$objMod; + $modules_names[$objMod->numero]=$objMod->name; + $modules_files[$objMod->numero]=$file; + $modules_fullpath[$file]=$dir.$file; + $picto[$objMod->numero]=(isset($objMod->picto) && $objMod->picto)?$objMod->picto:'generic'; } catch(Exception $e) { @@ -95,11 +95,11 @@ foreach($modulesdir as $dir) print "Warning bad descriptor file : ".$dir.$file." (Class ".$modName." not found into file)
"; } } - } - } - } - closedir($handle); - } + } + } + } + closedir($handle); + } } print '
'; @@ -120,15 +120,15 @@ foreach($sortorder as $numero=>$name) // Module print ''; $alt=$name.' - '.$modules_files[$numero]; - if (! empty($picto[$numero])) - { - if (preg_match('/^\//', $picto[$numero])) print img_picto($alt, $picto[$numero], 'width="14px"', 1); - else print img_object($alt, $picto[$numero], 'width="14px"'); - } - else - { - print img_object($alt, $picto[$numero], 'width="14px"'); - } + if (! empty($picto[$numero])) + { + if (preg_match('/^\//', $picto[$numero])) print img_picto($alt, $picto[$numero], 'width="14px"', 1); + else print img_object($alt, $picto[$numero], 'width="14px"'); + } + else + { + print img_object($alt, $picto[$numero], 'width="14px"'); + } print ' '.$modules[$numero]->getName(); print ""; // Version diff --git a/htdocs/admin/system/xdebug.php b/htdocs/admin/system/xdebug.php index 56b452706f5..9ea68431b1a 100644 --- a/htdocs/admin/system/xdebug.php +++ b/htdocs/admin/system/xdebug.php @@ -41,54 +41,54 @@ print "
\n"; if (!function_exists('xdebug_is_enabled')) { - print 'XDebug seems to be not installed. Function xdebug_is_enabled not found.'; - llxFooter(); - exit; + print 'XDebug seems to be not installed. Function xdebug_is_enabled not found.'; + llxFooter(); + exit; } if (function_exists('socket_create')) { - $address = ini_get('xdebug.remote_host')?ini_get('xdebug.remote_host'):'127.0.0.1'; - $port = ini_get('xdebug.remote_port')?ini_get('xdebug.remote_port'):9000; + $address = ini_get('xdebug.remote_host')?ini_get('xdebug.remote_host'):'127.0.0.1'; + $port = ini_get('xdebug.remote_port')?ini_get('xdebug.remote_port'):9000; - print "Current xdebug setup:
\n"; - print "* Remote debug setup:
\n"; - print 'xdebug.remote_enable = '.ini_get('xdebug.remote_enable')."
\n"; - print 'xdebug.remote_host = '.$address."
\n"; - print 'xdebug.remote_port = '.$port."
\n"; - print "* Profiler setup "; - if (function_exists('xdebug_get_profiler_filename')) print xdebug_get_profiler_filename()?"(currently on into file ".xdebug_get_profiler_filename().")":"(currently off)"; - else print "(currenlty not available)"; - print ":
\n"; - print 'xdebug.profiler_enable = '.ini_get('xdebug.profiler_enable')."
\n"; - print 'xdebug.profiler_enable_trigger = '.ini_get('xdebug.profiler_enable_trigger')."
\n"; - print 'xdebug.profiler_output_dir = '.ini_get('xdebug.profiler_output_dir')."
\n"; - print 'xdebug.profiler_output_name = '.ini_get('xdebug.profiler_output_name')."
\n"; - print 'xdebug.profiler_append = '.ini_get('xdebug.profiler_append')."
\n"; - print "
\n"; + print "Current xdebug setup:
\n"; + print "* Remote debug setup:
\n"; + print 'xdebug.remote_enable = '.ini_get('xdebug.remote_enable')."
\n"; + print 'xdebug.remote_host = '.$address."
\n"; + print 'xdebug.remote_port = '.$port."
\n"; + print "* Profiler setup "; + if (function_exists('xdebug_get_profiler_filename')) print xdebug_get_profiler_filename()?"(currently on into file ".xdebug_get_profiler_filename().")":"(currently off)"; + else print "(currenlty not available)"; + print ":
\n"; + print 'xdebug.profiler_enable = '.ini_get('xdebug.profiler_enable')."
\n"; + print 'xdebug.profiler_enable_trigger = '.ini_get('xdebug.profiler_enable_trigger')."
\n"; + print 'xdebug.profiler_output_dir = '.ini_get('xdebug.profiler_output_dir')."
\n"; + print 'xdebug.profiler_output_name = '.ini_get('xdebug.profiler_output_name')."
\n"; + print 'xdebug.profiler_append = '.ini_get('xdebug.profiler_append')."
\n"; + print "
\n"; - echo "To run a debug session, add parameter
"; - echo "* XDEBUG_SESSION_START=aname on your URL. To stop, remove cookie XDEBUG_SESSION_START.
\n"; - echo "To run a profiler session (when xdebug.profiler_enable_trigger=1), add parameter
\n"; - echo "* XDEBUG_PROFILE=aname on each URL.
"; - print "
"; + echo "To run a debug session, add parameter
"; + echo "* XDEBUG_SESSION_START=aname on your URL. To stop, remove cookie XDEBUG_SESSION_START.
\n"; + echo "To run a profiler session (when xdebug.profiler_enable_trigger=1), add parameter
\n"; + echo "* XDEBUG_PROFILE=aname on each URL.
"; + print "
"; - print "Test debugger server (Eclipse for example):
\n"; - $socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP); - if (empty($socket)) die('Unable to prepare a socket'); - //socket_bind($sock, $address, $port) or die('Unable to bind on address='.$address.' port='.$port); - //socket_listen($sock); - //$client = socket_accept($sock); - $client=socket_connect($socket, $address, $port); - if ($client) - { - echo "Connection established: ".$client." - address=".$address." port=".$port."
\n"; - echo "There is a Remote debug server at this address.
\n"; - echo "
\n"; - echo "To be sure this debugger accepts input from your PHP server and xdebug, be sure to have\n"; - echo "your php.ini file with this :
\n"; - echo '\n"; - print "

\n"; - echo 'Then check in your debug server (Eclipse), you have setup:
+ print "

\n"; + echo 'Then check in your debug server (Eclipse), you have setup:
XDebug with same port than in php.ini
Allow Remote debug=yes or prompt
'."\n"; - print "
\n"; - } - else - { - print socket_strerror(socket_last_error()); - echo "Failed to connect to address=".$address." port=".$port."
\n"; - echo "There is no Remote debug server at this address.\n"; - } - socket_close($socket); + print "
\n"; + } + else + { + print socket_strerror(socket_last_error()); + echo "Failed to connect to address=".$address." port=".$port."
\n"; + echo "There is no Remote debug server at this address.\n"; + } + socket_close($socket); } else { - print "Can't test if PHPDebug is OK as PHP socket functions are not enabled."; + print "Can't test if PHPDebug is OK as PHP socket functions are not enabled."; } diff --git a/htdocs/admin/ticket_extrafields.php b/htdocs/admin/ticket_extrafields.php index 18d5eee40a6..d7be1d058e6 100644 --- a/htdocs/admin/ticket_extrafields.php +++ b/htdocs/admin/ticket_extrafields.php @@ -36,7 +36,7 @@ $form = new Form($db); $tmptype2label = ExtraFields::$type2label; $type2label = array(''); foreach ($tmptype2label as $key => $val) { - $type2label[$key] = $langs->trans($val); + $type2label[$key] = $langs->trans($val); } $action = GETPOST('action', 'alpha'); @@ -44,7 +44,7 @@ $attrname = GETPOST('attrname', 'alpha'); $elementtype = 'ticket'; //Must be the $table_element of the class that manage extrafield if (!$user->admin) { - accessforbidden(); + accessforbidden(); } @@ -79,9 +79,9 @@ dol_fiche_end(); // Buttons if ($action != 'create' && $action != 'edit') { - print '"; + print '"; } /* ************************************************************************** */ @@ -91,10 +91,10 @@ if ($action != 'create' && $action != 'edit') { /* ************************************************************************** */ if ($action == 'create') { - print "
"; - print load_fiche_titre($langs->trans('NewAttribute')); + print "
"; + print load_fiche_titre($langs->trans('NewAttribute')); - include DOL_DOCUMENT_ROOT . '/core/tpl/admin_extrafields_add.tpl.php'; + include DOL_DOCUMENT_ROOT . '/core/tpl/admin_extrafields_add.tpl.php'; } /* ************************************************************************** */ @@ -103,10 +103,10 @@ if ($action == 'create') { /* */ /* ************************************************************************** */ if ($action == 'edit' && !empty($attrname)) { - print "
"; - print load_fiche_titre($langs->trans("FieldEdition", $attrname)); + print "
"; + print load_fiche_titre($langs->trans("FieldEdition", $attrname)); - include DOL_DOCUMENT_ROOT . '/core/tpl/admin_extrafields_edit.tpl.php'; + include DOL_DOCUMENT_ROOT . '/core/tpl/admin_extrafields_edit.tpl.php'; } // End of page diff --git a/htdocs/admin/tools/update.php b/htdocs/admin/tools/update.php index 664cda18916..6d1f40ec4a0 100644 --- a/htdocs/admin/tools/update.php +++ b/htdocs/admin/tools/update.php @@ -54,9 +54,9 @@ $version='0.0'; if ($action == 'getlastversion') { - $result = getURLContent('http://sourceforge.net/projects/dolibarr/rss'); - //var_dump($result['content']); - $sfurl = simplexml_load_string($result['content']); + $result = getURLContent('http://sourceforge.net/projects/dolibarr/rss'); + //var_dump($result['content']); + $sfurl = simplexml_load_string($result['content']); } @@ -75,39 +75,39 @@ print $langs->trans("CurrentVersion").' : '.DOL_VERSION.'
'; if (function_exists('curl_init')) { - $conf->global->MAIN_USE_RESPONSE_TIMEOUT = 10; + $conf->global->MAIN_USE_RESPONSE_TIMEOUT = 10; - if ($action == 'getlastversion') - { - if ($sfurl) - { - $i=0; - while (! empty($sfurl->channel[0]->item[$i]->title) && $i < 10000) - { - $title=$sfurl->channel[0]->item[$i]->title; - if (preg_match('/([0-9]+\.([0-9\.]+))/', $title, $reg)) - { - $newversion=$reg[1]; - $newversionarray=explode('.', $newversion); - $versionarray=explode('.', $version); - //var_dump($newversionarray);var_dump($versionarray); - if (versioncompare($newversionarray, $versionarray) > 0) $version=$newversion; - } - $i++; - } + if ($action == 'getlastversion') + { + if ($sfurl) + { + $i=0; + while (! empty($sfurl->channel[0]->item[$i]->title) && $i < 10000) + { + $title=$sfurl->channel[0]->item[$i]->title; + if (preg_match('/([0-9]+\.([0-9\.]+))/', $title, $reg)) + { + $newversion=$reg[1]; + $newversionarray=explode('.', $newversion); + $versionarray=explode('.', $version); + //var_dump($newversionarray);var_dump($versionarray); + if (versioncompare($newversionarray, $versionarray) > 0) $version=$newversion; + } + $i++; + } - // Show version - print $langs->trans("LastStableVersion").' : '. (($version != '0.0')?$version:$langs->trans("Unknown")) .'
'; - } - else - { - print $langs->trans("LastStableVersion").' : ' .$langs->trans("UpdateServerOffline").'
'; - } - } - else - { - print $langs->trans("LastStableVersion").' : ' .$langs->trans("Check").'
'; - } + // Show version + print $langs->trans("LastStableVersion").' : '. (($version != '0.0')?$version:$langs->trans("Unknown")) .'
'; + } + else + { + print $langs->trans("LastStableVersion").' : ' .$langs->trans("UpdateServerOffline").'
'; + } + } + else + { + print $langs->trans("LastStableVersion").' : ' .$langs->trans("Check").'
'; + } } print '
'; diff --git a/htdocs/asset/admin/assets_extrafields.php b/htdocs/asset/admin/assets_extrafields.php index d4ae2bd2930..9d224fe079e 100644 --- a/htdocs/asset/admin/assets_extrafields.php +++ b/htdocs/asset/admin/assets_extrafields.php @@ -76,9 +76,9 @@ dol_fiche_end(); // Buttons if ($action != 'create' && $action != 'edit') { - print '
'; - print ''; - print "
"; + print '
'; + print ''; + print "
"; } @@ -90,10 +90,10 @@ if ($action != 'create' && $action != 'edit') if ($action == 'create') { - print "
"; - print load_fiche_titre($langs->trans('NewAttribute')); + print "
"; + print load_fiche_titre($langs->trans('NewAttribute')); - require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; + require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } /* ************************************************************************** */ @@ -103,10 +103,10 @@ if ($action == 'create') /* ************************************************************************** */ if ($action == 'edit' && ! empty($attrname)) { - print "
"; - print load_fiche_titre($langs->trans("FieldEdition", $attrname)); + print "
"; + print load_fiche_titre($langs->trans("FieldEdition", $attrname)); - require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; + require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; } // End of page diff --git a/htdocs/barcode/codeinit.php b/htdocs/barcode/codeinit.php index 20f189dd99f..e298e0e6540 100644 --- a/htdocs/barcode/codeinit.php +++ b/htdocs/barcode/codeinit.php @@ -61,28 +61,28 @@ if (! empty($conf->global->BARCODE_PRODUCT_ADDON_NUM)) $dir = dol_buildpath($dirroot, 0); $handle = @opendir($dir); - if (is_resource($handle)) - { - while (($file = readdir($handle))!==false) - { - if (preg_match('/^mod_barcode_product_.*php$/', $file)) - { - $file = substr($file, 0, dol_strlen($file)-4); + if (is_resource($handle)) + { + while (($file = readdir($handle))!==false) + { + if (preg_match('/^mod_barcode_product_.*php$/', $file)) + { + $file = substr($file, 0, dol_strlen($file)-4); - try { - dol_include_once($dirroot.$file.'.php'); - } - catch(Exception $e) - { - dol_syslog($e->getMessage(), LOG_ERR); - } + try { + dol_include_once($dirroot.$file.'.php'); + } + catch(Exception $e) + { + dol_syslog($e->getMessage(), LOG_ERR); + } - $modBarCodeProduct = new $file(); - break; - } - } - closedir($handle); - } + $modBarCodeProduct = new $file(); + break; + } + } + closedir($handle); + } } } diff --git a/htdocs/blockedlog/ajax/block-add.php b/htdocs/blockedlog/ajax/block-add.php index f38efde42b2..92ccd8af369 100644 --- a/htdocs/blockedlog/ajax/block-add.php +++ b/htdocs/blockedlog/ajax/block-add.php @@ -37,8 +37,8 @@ $element = GETPOST('element', 'alpha'); $action = GETPOST('action', 'alpha'); if ($element === 'facture') { - require_once DOL_DOCUMENT_ROOT.'/blockedlog/class/blockedlog.class.php'; - require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; + require_once DOL_DOCUMENT_ROOT.'/blockedlog/class/blockedlog.class.php'; + require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; $facture = new Facture($db); if($facture->fetch($id)>0) { diff --git a/htdocs/blockedlog/lib/blockedlog.lib.php b/htdocs/blockedlog/lib/blockedlog.lib.php index 13c7ac61d1a..998a97e9bab 100644 --- a/htdocs/blockedlog/lib/blockedlog.lib.php +++ b/htdocs/blockedlog/lib/blockedlog.lib.php @@ -53,13 +53,13 @@ function blockedlogadmin_prepare_head() $object=new stdClass(); - // Show more tabs from modules - // Entries must be declared in modules descriptor with line - // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab - // $this->tabs = array('entity:-tabname); to remove a tab + // Show more tabs from modules + // Entries must be declared in modules descriptor with line + // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab + // $this->tabs = array('entity:-tabname); to remove a tab complete_head_from_modules($conf, $langs, $object, $head, $h, 'blockedlog'); complete_head_from_modules($conf, $langs, $object, $head, $h, 'blockedlog', 'remove'); - return $head; + return $head; } diff --git a/htdocs/cashdesk/index.php b/htdocs/cashdesk/index.php index 7122e1b6f59..fcfe9905bae 100644 --- a/htdocs/cashdesk/index.php +++ b/htdocs/cashdesk/index.php @@ -74,11 +74,11 @@ if (is_array($hookmanager->resArray) && ! empty($hookmanager->resArray)) { logo_small)) { - print 'Logo company'; + print 'Logo company'; } else { - print '
'.$mysoc->name.'
'; + print '
'.$mysoc->name.'
'; } ?>
diff --git a/htdocs/comm/action/document.php b/htdocs/comm/action/document.php index 31f608a9ee0..b9ad3015adf 100644 --- a/htdocs/comm/action/document.php +++ b/htdocs/comm/action/document.php @@ -143,19 +143,19 @@ if ($object->id > 0) // Project if (! empty($conf->projet->enabled)) { - $langs->load("projects"); - //$morehtmlref.='
'.$langs->trans('Project') . ' '; - $morehtmlref.=$langs->trans('Project') . ': '; - if (! empty($object->fk_project)) { - $proj = new Project($db); - $proj->fetch($object->fk_project); - $morehtmlref.=''; - $morehtmlref.=$proj->ref; - $morehtmlref.=''; - if ($proj->title) $morehtmlref.=' - '.$proj->title; - } else { - $morehtmlref.=''; - } + $langs->load("projects"); + //$morehtmlref.='
'.$langs->trans('Project') . ' '; + $morehtmlref.=$langs->trans('Project') . ': '; + if (! empty($object->fk_project)) { + $proj = new Project($db); + $proj->fetch($object->fk_project); + $morehtmlref.=''; + $morehtmlref.=$proj->ref; + $morehtmlref.=''; + if ($proj->title) $morehtmlref.=' - '.$proj->title; + } else { + $morehtmlref.=''; + } } $morehtmlref.=''; @@ -253,9 +253,9 @@ if ($object->id > 0) print ''; - print ''; + print ''; - dol_fiche_end(); + dol_fiche_end(); $modulepart = 'actions'; diff --git a/htdocs/comm/admin/propaldet_extrafields.php b/htdocs/comm/admin/propaldet_extrafields.php index fc53f90ed55..a0530e8c262 100644 --- a/htdocs/comm/admin/propaldet_extrafields.php +++ b/htdocs/comm/admin/propaldet_extrafields.php @@ -85,9 +85,9 @@ dol_fiche_end(); // Buttons if ($action != 'create' && $action != 'edit') { - print '
'; - print "".$langs->trans("NewAttribute").""; - print "
"; + print '
'; + print "".$langs->trans("NewAttribute").""; + print "
"; } @@ -100,9 +100,9 @@ if ($action != 'create' && $action != 'edit') if ($action == 'create') { print '
'; - print load_fiche_titre($langs->trans('NewAttribute')); + print load_fiche_titre($langs->trans('NewAttribute')); - require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; + require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } /* ************************************************************************** */ @@ -112,10 +112,10 @@ if ($action == 'create') /* ************************************************************************** */ if ($action == 'edit' && ! empty($attrname)) { - print "
"; - print load_fiche_titre($langs->trans("FieldEdition", $attrname)); + print "
"; + print load_fiche_titre($langs->trans("FieldEdition", $attrname)); - require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; + require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; } // End of page diff --git a/htdocs/commande/customer.php b/htdocs/commande/customer.php index a3b754e0979..4da1ea48fd6 100644 --- a/htdocs/commande/customer.php +++ b/htdocs/commande/customer.php @@ -162,13 +162,13 @@ if ($resql) print ''; print ''; - $result=''; - $link=$linkend=''; - $link = ''; - $linkend=''; - $name=$obj->name; - $result.=($link.img_object($langs->trans("ShowCompany").': '.$name, 'company').$linkend); - $result.=$link.(dol_trunc($name, $maxlen)).$linkend; + $result=''; + $link=$linkend=''; + $link = ''; + $linkend=''; + $name=$obj->name; + $result.=($link.img_object($langs->trans("ShowCompany").': '.$name, 'company').$linkend); + $result.=$link.(dol_trunc($name, $maxlen)).$linkend; print $result; print ''; diff --git a/htdocs/compta/prelevement/stats.php b/htdocs/compta/prelevement/stats.php index 55bf5e1f022..fdc1d622e90 100644 --- a/htdocs/compta/prelevement/stats.php +++ b/htdocs/compta/prelevement/stats.php @@ -54,15 +54,15 @@ $sql.= " AND pb.entity = ".$conf->entity; $resql=$db->query($sql); if ($resql) { - $num = $db->num_rows($resql); - $i = 0; + $num = $db->num_rows($resql); + $i = 0; - if ( $num > 0 ) - { - $row = $db->fetch_row($resql); - $total = $row[0]; - $nbtotal = $row[1]; - } + if ( $num > 0 ) + { + $row = $db->fetch_row($resql); + $total = $row[0]; + $nbtotal = $row[1]; + } } @@ -150,15 +150,15 @@ $sql.= " AND pl.statut = 3"; $resql=$db->query($sql); if ($resql) { - $num = $db->num_rows($resql); - $i = 0; + $num = $db->num_rows($resql); + $i = 0; - if ( $num > 0 ) - { - $row = $db->fetch_row($resql); - $total = $row[0]; - $nbtotal = $row[1]; - } + if ( $num > 0 ) + { + $row = $db->fetch_row($resql); + $total = $row[0]; + $nbtotal = $row[1]; + } } /* diff --git a/htdocs/compta/sociales/info.php b/htdocs/compta/sociales/info.php index e449f907bc8..7806e3e4cc1 100644 --- a/htdocs/compta/sociales/info.php +++ b/htdocs/compta/sociales/info.php @@ -27,8 +27,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/tax.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; if (! empty($conf->projet->enabled)) { - include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; - include_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; + include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; + include_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; } // Load translation files required by the page @@ -51,10 +51,10 @@ $object = new ChargeSociales($db); if ($action == 'setlib' && $user->rights->tax->charges->creer) { - $object->fetch($id); - $result = $object->setValueFrom('libelle', GETPOST('lib'), '', '', 'text', '', $user, 'TAX_MODIFY'); - if ($result < 0) - setEventMessages($object->error, $object->errors, 'errors'); + $object->fetch($id); + $result = $object->setValueFrom('libelle', GETPOST('lib'), '', '', 'text', '', $user, 'TAX_MODIFY'); + if ($result < 0) + setEventMessages($object->error, $object->errors, 'errors'); } @@ -84,17 +84,17 @@ $morehtmlref.=$form->editfieldval("Label", 'lib', $object->label, $object, $user // Project if (! empty($conf->projet->enabled)) { - $langs->load("projects"); - $morehtmlref.='
'.$langs->trans('Project') . ' : '; - if (! empty($object->fk_project)) { - $proj = new Project($db); - $proj->fetch($object->fk_project); - $morehtmlref.=''; - $morehtmlref.=$proj->ref; - $morehtmlref.=''; - } else { - $morehtmlref.=''; - } + $langs->load("projects"); + $morehtmlref.='
'.$langs->trans('Project') . ' : '; + if (! empty($object->fk_project)) { + $proj = new Project($db); + $proj->fetch($object->fk_project); + $morehtmlref.=''; + $morehtmlref.=$proj->ref; + $morehtmlref.=''; + } else { + $morehtmlref.=''; + } } $morehtmlref.=''; diff --git a/htdocs/contrat/admin/contract_extrafields.php b/htdocs/contrat/admin/contract_extrafields.php index 5f6bea09a3d..7696e3365d2 100644 --- a/htdocs/contrat/admin/contract_extrafields.php +++ b/htdocs/contrat/admin/contract_extrafields.php @@ -80,9 +80,9 @@ dol_fiche_end(); // Buttons if ($action != 'create' && $action != 'edit') { - print '
'; - print "".$langs->trans("NewAttribute").""; - print "
"; + print '
'; + print "".$langs->trans("NewAttribute").""; + print "
"; } @@ -95,9 +95,9 @@ if ($action != 'create' && $action != 'edit') if ($action == 'create') { print '
'; - print load_fiche_titre($langs->trans('NewAttribute')); + print load_fiche_titre($langs->trans('NewAttribute')); - require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; + require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } /* ************************************************************************** */ @@ -108,9 +108,9 @@ if ($action == 'create') if ($action == 'edit' && ! empty($attrname)) { print '

'; - print load_fiche_titre($langs->trans("FieldEdition", $attrname)); + print load_fiche_titre($langs->trans("FieldEdition", $attrname)); - require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; + require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; } llxFooter(); diff --git a/htdocs/contrat/admin/contractdet_extrafields.php b/htdocs/contrat/admin/contractdet_extrafields.php index 3a8340dfecc..a78669bec22 100644 --- a/htdocs/contrat/admin/contractdet_extrafields.php +++ b/htdocs/contrat/admin/contractdet_extrafields.php @@ -80,9 +80,9 @@ dol_fiche_end(); // Buttons if ($action != 'create' && $action != 'edit') { - print '
'; - print "".$langs->trans("NewAttribute").""; - print "
"; + print '
'; + print "".$langs->trans("NewAttribute").""; + print "
"; } @@ -97,7 +97,7 @@ if ($action == 'create') print '
'; print load_fiche_titre($langs->trans('NewAttribute')); - require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; + require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; } /* ************************************************************************** */ @@ -107,10 +107,10 @@ if ($action == 'create') /* ************************************************************************** */ if ($action == 'edit' && ! empty($attrname)) { - print "
"; - print load_fiche_titre($langs->trans("FieldEdition", $attrname)); + print "
"; + print load_fiche_titre($langs->trans("FieldEdition", $attrname)); - require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; + require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; } llxFooter(); diff --git a/htdocs/core/actions_dellink.inc.php b/htdocs/core/actions_dellink.inc.php index 9fca4502dcf..ca5f05f5f4d 100644 --- a/htdocs/core/actions_dellink.inc.php +++ b/htdocs/core/actions_dellink.inc.php @@ -32,9 +32,9 @@ $addlinkid = GETPOST('idtolinkto', 'int'); // Link invoice to order if ($action == 'addlink' && ! empty($permissiondellink) && ! GETPOST('cancel', 'alpha') && $id > 0 && $addlinkid > 0) { - $object->fetch($id); - $object->fetch_thirdparty(); - $result = $object->add_object_linked(GETPOST('addlink', 'alpha'), $addlinkid); + $object->fetch($id); + $object->fetch_thirdparty(); + $result = $object->add_object_linked(GETPOST('addlink', 'alpha'), $addlinkid); } // Delete link diff --git a/htdocs/core/actions_printing.inc.php b/htdocs/core/actions_printing.inc.php index fc0f25a1297..0671e998684 100644 --- a/htdocs/core/actions_printing.inc.php +++ b/htdocs/core/actions_printing.inc.php @@ -29,63 +29,63 @@ // Print file if ($action == 'print_file' && $user->rights->printing->read) { - $langs->load("printing"); - require_once DOL_DOCUMENT_ROOT . '/core/modules/printing/modules_printing.php'; - $objectprint = new PrintingDriver($db); - $list = $objectprint->listDrivers($db, 10); - if (! empty($list)) { - $errorprint=0; - $printerfound=0; - foreach ($list as $driver) { - require_once DOL_DOCUMENT_ROOT.'/core/modules/printing/'.$driver.'.modules.php'; - $langs->load($driver); - $classname = 'printing_'.$driver; - $printer = new $classname($db); - //print '
'.print_r($printer, true).'
'; + $langs->load("printing"); + require_once DOL_DOCUMENT_ROOT . '/core/modules/printing/modules_printing.php'; + $objectprint = new PrintingDriver($db); + $list = $objectprint->listDrivers($db, 10); + if (! empty($list)) { + $errorprint=0; + $printerfound=0; + foreach ($list as $driver) { + require_once DOL_DOCUMENT_ROOT.'/core/modules/printing/'.$driver.'.modules.php'; + $langs->load($driver); + $classname = 'printing_'.$driver; + $printer = new $classname($db); + //print '
'.print_r($printer, true).'
'; - if (! empty($conf->global->{$printer->active})) - { - $printerfound++; + if (! empty($conf->global->{$printer->active})) + { + $printerfound++; - $subdir=''; - $module = GETPOST('printer', 'alpha'); - switch ($module ) - { - case 'livraison' : - $subdir = 'receipt'; - $module = 'expedition'; - break; - case 'expedition' : - $subdir = 'sending'; - break; - case 'commande_fournisseur' : - $module = 'fournisseur'; - $subdir = 'commande'; - break; - } - try { - $ret = $printer->printFile(GETPOST('file', 'alpha'), $module, $subdir); - if ($ret > 0) { - //print '
'.print_r($printer->errors, true).'
'; - setEventMessages($printer->error, $printer->errors, 'errors'); - } - if ($ret==0) - { - //print '
'.print_r($printer->errors, true).'
'; - setEventMessages($printer->error, $printer->errors); - setEventMessages($langs->transnoentitiesnoconv("FileWasSentToPrinter", basename(GETPOST('file', 'alpha'))).' '.$langs->transnoentitiesnoconv("ViaModule").' '.$printer->name, null); - } - } - catch(Exception $e) - { - $ret = 1; - setEventMessages($e->getMessage(), null, 'errors'); - } - } - } - if ($printerfound==0) setEventMessages($langs->trans("NoActivePrintingModuleFound", $langs->transnoentities("Module64000Name")), null, 'warnings'); - } else { - setEventMessages($langs->trans("NoModuleFound"), null, 'warnings'); - } - $action = ''; + $subdir=''; + $module = GETPOST('printer', 'alpha'); + switch ($module ) + { + case 'livraison' : + $subdir = 'receipt'; + $module = 'expedition'; + break; + case 'expedition' : + $subdir = 'sending'; + break; + case 'commande_fournisseur' : + $module = 'fournisseur'; + $subdir = 'commande'; + break; + } + try { + $ret = $printer->printFile(GETPOST('file', 'alpha'), $module, $subdir); + if ($ret > 0) { + //print '
'.print_r($printer->errors, true).'
'; + setEventMessages($printer->error, $printer->errors, 'errors'); + } + if ($ret==0) + { + //print '
'.print_r($printer->errors, true).'
'; + setEventMessages($printer->error, $printer->errors); + setEventMessages($langs->transnoentitiesnoconv("FileWasSentToPrinter", basename(GETPOST('file', 'alpha'))).' '.$langs->transnoentitiesnoconv("ViaModule").' '.$printer->name, null); + } + } + catch(Exception $e) + { + $ret = 1; + setEventMessages($e->getMessage(), null, 'errors'); + } + } + } + if ($printerfound==0) setEventMessages($langs->trans("NoActivePrintingModuleFound", $langs->transnoentities("Module64000Name")), null, 'warnings'); + } else { + setEventMessages($langs->trans("NoModuleFound"), null, 'warnings'); + } + $action = ''; } diff --git a/htdocs/core/actions_setnotes.inc.php b/htdocs/core/actions_setnotes.inc.php index 425204e00a4..8c8f23f9b0e 100644 --- a/htdocs/core/actions_setnotes.inc.php +++ b/htdocs/core/actions_setnotes.inc.php @@ -60,8 +60,8 @@ if ($action == 'setnote_public' && ! empty($permissionnote) && ! GETPOST('cancel } } } elseif ($action == 'setnote_private' && ! empty($permissionnote) && ! GETPOST('cancel', 'alpha')) { - // Set public note - if (empty($action) || ! is_object($object) || empty($id)) dol_print_error('', 'Include of actions_setnotes.inc.php was done but required variable was not set before'); + // Set public note + if (empty($action) || ! is_object($object) || empty($id)) dol_print_error('', 'Include of actions_setnotes.inc.php was done but required variable was not set before'); if (empty($object->id)) $object->fetch($id); // Fetch may not be already done $result=$object->update_note(dol_html_entity_decode(GETPOST('note_private', 'none'), ENT_QUOTES), '_private'); if ($result < 0) setEventMessages($object->error, $object->errors, 'errors'); diff --git a/htdocs/core/ajax/bankconciliate.php b/htdocs/core/ajax/bankconciliate.php index 690ebc80f85..f3e6c379392 100644 --- a/htdocs/core/ajax/bankconciliate.php +++ b/htdocs/core/ajax/bankconciliate.php @@ -51,46 +51,46 @@ if (($user->rights->banque->modifier || $user->rights->banque->consolidate) && $ { // Increase date $al = new AccountLine($db); - $al->datev_next(GETPOST('rowid', 'int')); - $al->fetch(GETPOST('rowid', 'int')); + $al->datev_next(GETPOST('rowid', 'int')); + $al->fetch(GETPOST('rowid', 'int')); - print ''.dol_print_date($db->jdate($al->datev), "day").''; + print ''.dol_print_date($db->jdate($al->datev), "day").''; - exit; + exit; } if (($user->rights->banque->modifier || $user->rights->banque->consolidate) && $action == 'dvprev') { // Decrease date $al =new AccountLine($db); - $al->datev_previous(GETPOST('rowid', 'int')); - $al->fetch(GETPOST('rowid', 'int')); + $al->datev_previous(GETPOST('rowid', 'int')); + $al->fetch(GETPOST('rowid', 'int')); - print ''.dol_print_date($db->jdate($al->datev), "day").''; + print ''.dol_print_date($db->jdate($al->datev), "day").''; - exit; + exit; } if (($user->rights->banque->modifier || $user->rights->banque->consolidate) && $action == 'donext') { // Increase date $al = new AccountLine($db); - $al->dateo_next(GETPOST('rowid', 'int')); - $al->fetch(GETPOST('rowid', 'int')); + $al->dateo_next(GETPOST('rowid', 'int')); + $al->fetch(GETPOST('rowid', 'int')); - print ''.dol_print_date($db->jdate($al->dateo), "day").''; + print ''.dol_print_date($db->jdate($al->dateo), "day").''; - exit; + exit; } if (($user->rights->banque->modifier || $user->rights->banque->consolidate) && $action == 'doprev') { // Decrease date $al =new AccountLine($db); - $al->dateo_previous(GETPOST('rowid', 'int')); - $al->fetch(GETPOST('rowid', 'int')); + $al->dateo_previous(GETPOST('rowid', 'int')); + $al->fetch(GETPOST('rowid', 'int')); - print ''.dol_print_date($db->jdate($al->dateo), "day").''; + print ''.dol_print_date($db->jdate($al->dateo), "day").''; - exit; + exit; } diff --git a/htdocs/core/ajax/fileupload.php b/htdocs/core/ajax/fileupload.php index 5a3b18da55e..4e2252cee56 100644 --- a/htdocs/core/ajax/fileupload.php +++ b/htdocs/core/ajax/fileupload.php @@ -53,23 +53,23 @@ header('Access-Control-Allow-Headers: X-File-Name, X-File-Type, X-File-Size'); switch ($_SERVER['REQUEST_METHOD']) { case 'OPTIONS': break; - case 'HEAD': - case 'GET': - $upload_handler->get(); - break; - case 'POST': - if (isset($_REQUEST['_method']) && $_REQUEST['_method'] === 'DELETE') { - $upload_handler->delete(); - } else { - $upload_handler->post(); - } - break; - case 'DELETE': - $upload_handler->delete(); - break; - default: - header('HTTP/1.0 405 Method Not Allowed'); - exit; + case 'HEAD': + case 'GET': + $upload_handler->get(); + break; + case 'POST': + if (isset($_REQUEST['_method']) && $_REQUEST['_method'] === 'DELETE') { + $upload_handler->delete(); + } else { + $upload_handler->post(); + } + break; + case 'DELETE': + $upload_handler->delete(); + break; + default: + header('HTTP/1.0 405 Method Not Allowed'); + exit; } $db->close(); diff --git a/htdocs/core/ajax/objectonoff.php b/htdocs/core/ajax/objectonoff.php index 0d662b6a0bd..e1a5c451ba5 100644 --- a/htdocs/core/ajax/objectonoff.php +++ b/htdocs/core/ajax/objectonoff.php @@ -68,4 +68,4 @@ else // Registering new values if (($action == 'set') && ! empty($id)) - $object->setValueFrom($field, $value, $element, $id); + $object->setValueFrom($field, $value, $element, $id); diff --git a/htdocs/core/ajax/security.php b/htdocs/core/ajax/security.php index 1cbede80339..39c2bf7b07f 100644 --- a/htdocs/core/ajax/security.php +++ b/htdocs/core/ajax/security.php @@ -44,8 +44,8 @@ if (isset($_GET['action']) && ! empty($_GET['action'])) { if ($_GET['action'] == 'getrandompassword' && $user->admin) { - require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php'; - $generic = $_GET['generic'] ? true : false; + require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php'; + $generic = $_GET['generic'] ? true : false; echo getRandomPassword($generic); } } diff --git a/htdocs/core/ajax/ziptown.php b/htdocs/core/ajax/ziptown.php index df9f70da1df..72eb73f84e0 100644 --- a/htdocs/core/ajax/ziptown.php +++ b/htdocs/core/ajax/ziptown.php @@ -62,36 +62,36 @@ if (! empty($_GET['zipcode']) || ! empty($_GET['town'])) if (! empty($conf->global->MAIN_USE_ZIPTOWN_DICTIONNARY)) // Use zip-town table { - $sql = "SELECT z.rowid, z.zip, z.town, z.fk_county, z.fk_pays as fk_country"; - $sql.= ", c.rowid as fk_country, c.code as country_code, c.label as country"; - $sql.= ", d.rowid as fk_county, d.code_departement as county_code, d.nom as county"; - $sql.= " FROM ".MAIN_DB_PREFIX."c_ziptown as z"; - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX ."c_departements as d ON z.fk_county = d.rowid"; - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_regions as r ON d.fk_region = r.code_region,"; - $sql.= " ".MAIN_DB_PREFIX."c_country as c"; - $sql.= " WHERE z.fk_pays = c.rowid"; - $sql.= " AND z.active = 1 AND c.active = 1"; - if ($zipcode) $sql.=" AND z.zip LIKE '" . $db->escape($zipcode) . "%'"; - if ($town) $sql.=" AND z.town LIKE '%" . $db->escape($town) . "%'"; - $sql.= " ORDER BY z.zip, z.town"; - $sql.= $db->plimit(100); // Avoid pb with bad criteria + $sql = "SELECT z.rowid, z.zip, z.town, z.fk_county, z.fk_pays as fk_country"; + $sql.= ", c.rowid as fk_country, c.code as country_code, c.label as country"; + $sql.= ", d.rowid as fk_county, d.code_departement as county_code, d.nom as county"; + $sql.= " FROM ".MAIN_DB_PREFIX."c_ziptown as z"; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX ."c_departements as d ON z.fk_county = d.rowid"; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_regions as r ON d.fk_region = r.code_region,"; + $sql.= " ".MAIN_DB_PREFIX."c_country as c"; + $sql.= " WHERE z.fk_pays = c.rowid"; + $sql.= " AND z.active = 1 AND c.active = 1"; + if ($zipcode) $sql.=" AND z.zip LIKE '" . $db->escape($zipcode) . "%'"; + if ($town) $sql.=" AND z.town LIKE '%" . $db->escape($town) . "%'"; + $sql.= " ORDER BY z.zip, z.town"; + $sql.= $db->plimit(100); // Avoid pb with bad criteria } else // Use table of third parties { - $sql = "SELECT DISTINCT s.zip, s.town, s.fk_departement as fk_county, s.fk_pays as fk_country"; - $sql.= ", c.code as country_code, c.label as country"; - $sql.= ", d.code_departement as county_code , d.nom as county"; - $sql.= " FROM ".MAIN_DB_PREFIX.'societe as s'; - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX ."c_departements as d ON s.fk_departement = d.rowid"; - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX.'c_country as c ON s.fk_pays = c.rowid'; - $sql.= " WHERE"; - if ($zipcode) $sql.= " s.zip LIKE '".$db->escape($zipcode)."%'"; - if ($town) $sql.= " s.town LIKE '%" . $db->escape($town) . "%'"; - $sql.= " ORDER BY s.fk_pays, s.zip, s.town"; - $sql.= $db->plimit(100); // Avoid pb with bad criteria + $sql = "SELECT DISTINCT s.zip, s.town, s.fk_departement as fk_county, s.fk_pays as fk_country"; + $sql.= ", c.code as country_code, c.label as country"; + $sql.= ", d.code_departement as county_code , d.nom as county"; + $sql.= " FROM ".MAIN_DB_PREFIX.'societe as s'; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX ."c_departements as d ON s.fk_departement = d.rowid"; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX.'c_country as c ON s.fk_pays = c.rowid'; + $sql.= " WHERE"; + if ($zipcode) $sql.= " s.zip LIKE '".$db->escape($zipcode)."%'"; + if ($town) $sql.= " s.town LIKE '%" . $db->escape($town) . "%'"; + $sql.= " ORDER BY s.fk_pays, s.zip, s.town"; + $sql.= $db->plimit(100); // Avoid pb with bad criteria } - //print $sql; + //print $sql; $resql=$db->query($sql); //var_dump($db); if ($resql) @@ -103,11 +103,11 @@ if (! empty($_GET['zipcode']) || ! empty($_GET['town'])) $row_array['label'] = $row['zip'].' '.$row['town']; $row_array['label'] .= ($county || $country)?' (':''; - $row_array['label'] .= $county; + $row_array['label'] .= $county; $row_array['label'] .= ($county && $country?' - ':''); - $row_array['label'] .= $country; - $row_array['label'] .= ($county || $country)?')':''; - if ($zipcode) + $row_array['label'] .= $country; + $row_array['label'] .= ($county || $country)?')':''; + if ($zipcode) { $row_array['value'] = $row['zip']; $row_array['town'] = $row['town']; diff --git a/htdocs/core/antispamimage.php b/htdocs/core/antispamimage.php index 015f4597d12..38bb261e068 100644 --- a/htdocs/core/antispamimage.php +++ b/htdocs/core/antispamimage.php @@ -43,7 +43,7 @@ $number = strlen($letters); $string = ''; for($i = 0; $i < $length; $i++) { - $string .= $letters{mt_rand(0, $number - 1)}; + $string .= $letters{mt_rand(0, $number - 1)}; } //print $string; @@ -54,8 +54,8 @@ $_SESSION[$sessionkey]=$string; $img = imagecreate(80, 32); if (empty($img)) { - dol_print_error('', "Problem with GD creation"); - exit; + dol_print_error('', "Problem with GD creation"); + exit; } // Define mime type diff --git a/htdocs/core/class/commonobjectline.class.php b/htdocs/core/class/commonobjectline.class.php index 023a2e6dc6d..448d1ffdf8d 100644 --- a/htdocs/core/class/commonobjectline.class.php +++ b/htdocs/core/class/commonobjectline.class.php @@ -50,13 +50,13 @@ abstract class CommonObjectLine extends CommonObject public $fk_unit; - /** - * Returns the translation key from units dictionary. - * A langs->trans() must be called on result to get translated value. - * - * @param string $type Label type (long or short) - * @return string|int <0 if ko, label if ok - */ + /** + * Returns the translation key from units dictionary. + * A langs->trans() must be called on result to get translated value. + * + * @param string $type Label type (long or short) + * @return string|int <0 if ko, label if ok + */ public function getLabelOfUnit($type = 'long') { global $langs; diff --git a/htdocs/core/datepicker.php b/htdocs/core/datepicker.php index 4406d421745..c37041967c2 100644 --- a/htdocs/core/datepicker.php +++ b/htdocs/core/datepicker.php @@ -67,18 +67,18 @@ else // Define tradMonths javascript array (we define this in datapicker AND in parent page to avoid errors with IE8) $tradTemp=array( - $langs->trans("January"), - $langs->trans("February"), - $langs->trans("March"), - $langs->trans("April"), - $langs->trans("May"), - $langs->trans("June"), - $langs->trans("July"), - $langs->trans("August"), - $langs->trans("September"), - $langs->trans("October"), - $langs->trans("November"), - $langs->trans("December") + $langs->trans("January"), + $langs->trans("February"), + $langs->trans("March"), + $langs->trans("April"), + $langs->trans("May"), + $langs->trans("June"), + $langs->trans("July"), + $langs->trans("August"), + $langs->trans("September"), + $langs->trans("October"), + $langs->trans("November"), + $langs->trans("December") ); print '