From ebfba19778e595fe083e04a78b4f86e320b64103 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 26 Feb 2021 21:17:52 +0100 Subject: [PATCH] code syntax s... t.. dir --- htdocs/salaries/admin/salaries.php | 23 +- .../salaries/admin/salaries_extrafields.php | 17 +- htdocs/salaries/card.php | 128 +- htdocs/salaries/class/salariesstats.class.php | 7 +- htdocs/salaries/document.php | 22 +- htdocs/salaries/info.php | 4 +- htdocs/salaries/stats/index.php | 48 +- htdocs/societe/admin/contact_extrafields.php | 17 +- htdocs/societe/admin/societe.php | 277 ++-- htdocs/societe/admin/societe_extrafields.php | 17 +- htdocs/societe/agenda.php | 71 +- htdocs/societe/ajax/company.php | 46 +- htdocs/societe/ajaxcompanies.php | 55 +- htdocs/societe/ajaxcountries.php | 33 +- .../canvas/actions_card_common.class.php | 155 ++- .../company/actions_card_company.class.php | 45 +- .../canvas/company/tpl/card_create.tpl.php | 53 +- .../canvas/company/tpl/card_edit.tpl.php | 27 +- .../canvas/company/tpl/card_view.tpl.php | 49 +- .../actions_card_individual.class.php | 18 +- .../canvas/individual/tpl/card_create.tpl.php | 39 +- .../canvas/individual/tpl/card_edit.tpl.php | 7 +- .../canvas/individual/tpl/card_view.tpl.php | 15 +- htdocs/societe/card.php | 1063 +++++++------- htdocs/societe/checkvat/checkVatPopup.php | 51 +- htdocs/societe/class/api_contacts.class.php | 121 +- .../societe/class/api_thirdparties.class.php | 192 +-- htdocs/societe/class/client.class.php | 23 +- .../class/companybankaccount.class.php | 115 +- .../class/companypaymentmode.class.php | 92 +- htdocs/societe/class/societe.class.php | 20 +- htdocs/societe/class/societeaccount.class.php | 126 +- htdocs/societe/consumption.php | 264 ++-- htdocs/societe/contact.php | 68 +- htdocs/societe/document.php | 49 +- htdocs/societe/index.php | 128 +- htdocs/societe/list.php | 1234 +++++++++++------ htdocs/societe/note.php | 66 +- htdocs/societe/notify/card.php | 212 +-- htdocs/societe/paymentmodes.php | 679 +++++---- htdocs/societe/price.php | 63 +- htdocs/societe/project.php | 28 +- htdocs/societe/societecontact.php | 136 +- .../tpl/linesalesrepresentative.tpl.php | 4 +- htdocs/societe/website.php | 277 ++-- htdocs/stripe/admin/stripe.php | 106 +- htdocs/stripe/charge.php | 69 +- htdocs/stripe/class/actions_stripe.class.php | 24 +- htdocs/stripe/class/stripe.class.php | 298 ++-- htdocs/stripe/config.php | 3 +- htdocs/stripe/lib/stripe.lib.php | 37 +- htdocs/stripe/payout.php | 22 +- htdocs/stripe/transaction.php | 29 +- .../admin/supplier_proposal_extrafields.php | 17 +- .../supplier_proposaldet_extrafields.php | 20 +- htdocs/supplier_proposal/card.php | 550 ++++---- .../class/api_supplier_proposals.class.php | 47 +- .../class/supplier_proposal.class.php | 856 ++++++------ htdocs/supplier_proposal/contact.php | 50 +- htdocs/supplier_proposal/document.php | 30 +- htdocs/supplier_proposal/index.php | 139 +- htdocs/supplier_proposal/info.php | 10 +- htdocs/supplier_proposal/list.php | 668 +++++---- htdocs/supplier_proposal/note.php | 23 +- .../tpl/linkedobjectblock.tpl.php | 53 +- htdocs/support/inc.php | 103 +- htdocs/support/index.php | 59 +- htdocs/takepos/admin/appearance.php | 17 +- htdocs/takepos/admin/bar.php | 23 +- htdocs/takepos/admin/orderprinters.php | 68 +- htdocs/takepos/admin/other.php | 12 +- htdocs/takepos/admin/printqr.php | 7 +- htdocs/takepos/admin/receipt.php | 37 +- htdocs/takepos/admin/setup.php | 71 +- htdocs/takepos/admin/terminal.php | 101 +- htdocs/takepos/ajax/ajax.php | 43 +- htdocs/takepos/css/pos.css.php | 195 +-- htdocs/takepos/floors.php | 95 +- htdocs/takepos/freezone.php | 35 +- htdocs/takepos/genimg/index.php | 40 +- htdocs/takepos/genimg/qr.php | 35 +- htdocs/takepos/index.php | 438 +++--- htdocs/takepos/invoice.php | 645 +++++---- htdocs/takepos/pay.php | 224 +-- htdocs/takepos/phone.php | 99 +- htdocs/takepos/public/auto_order.php | 26 +- htdocs/takepos/public/menu.php | 51 +- htdocs/takepos/receipt.php | 193 ++- htdocs/takepos/reduction.php | 191 +-- htdocs/takepos/send.php | 29 +- htdocs/takepos/smpcb.php | 20 +- 91 files changed, 6658 insertions(+), 5434 deletions(-) diff --git a/htdocs/salaries/admin/salaries.php b/htdocs/salaries/admin/salaries.php index 2b429dc79ec..01f25d56d05 100644 --- a/htdocs/salaries/admin/salaries.php +++ b/htdocs/salaries/admin/salaries.php @@ -27,14 +27,17 @@ require '../../main.inc.php'; // Class require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/salaries.lib.php'; -if (!empty($conf->accounting->enabled)) require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php'; +if (!empty($conf->accounting->enabled)) { + require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php'; +} // Load translation files required by the page $langs->loadLangs(array('admin', 'salaries')); // Security check -if (!$user->admin) +if (!$user->admin) { accessforbidden(); +} $action = GETPOST('action', 'aZ09'); @@ -47,8 +50,7 @@ $list = array( * Actions */ -if ($action == 'update') -{ +if ($action == 'update') { $error = 0; foreach ($list as $constname) { @@ -59,8 +61,7 @@ if ($action == 'update') } } - if (!$error) - { + if (!$error) { setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { setEventMessages($langs->trans("Error"), null, 'errors'); @@ -74,7 +75,9 @@ if ($action == 'update') llxHeader('', $langs->trans('SalariesSetup')); $form = new Form($db); -if (!empty($conf->accounting->enabled)) $formaccounting = new FormAccounting($db); +if (!empty($conf->accounting->enabled)) { + $formaccounting = new FormAccounting($db); +} $linkback = ''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans('SalariesSetup'), $linkback, 'title_setup'); @@ -99,8 +102,7 @@ print ''.$langs->trans("Parameters").''; print ''.$langs->trans("Value")."\n"; print "\n"; -foreach ($list as $key) -{ +foreach ($list as $key) { print ''; // Param @@ -109,8 +111,7 @@ foreach ($list as $key) // Value print ''; - if (!empty($conf->accounting->enabled)) - { + if (!empty($conf->accounting->enabled)) { print $formaccounting->select_account($conf->global->$key, $key, 1, '', 1, 1); } else { print ''; diff --git a/htdocs/salaries/admin/salaries_extrafields.php b/htdocs/salaries/admin/salaries_extrafields.php index 62073f8177b..59074e582d2 100644 --- a/htdocs/salaries/admin/salaries_extrafields.php +++ b/htdocs/salaries/admin/salaries_extrafields.php @@ -36,13 +36,17 @@ $form = new Form($db); // List of supported format $tmptype2label = ExtraFields::$type2label; $type2label = array(''); -foreach ($tmptype2label as $key => $val) $type2label[$key] = $langs->transnoentitiesnoconv($val); +foreach ($tmptype2label as $key => $val) { + $type2label[$key] = $langs->transnoentitiesnoconv($val); +} $action = GETPOST('action', 'aZ09'); $attrname = GETPOST('attrname', 'alpha'); $elementtype = 'payment_salary'; //Must be the $table_element of the class that manage extrafield -if (!$user->admin) accessforbidden(); +if (!$user->admin) { + accessforbidden(); +} /* @@ -77,8 +81,7 @@ print dol_get_fiche_end(); // Buttons -if ($action != 'create' && $action != 'edit') -{ +if ($action != 'create' && $action != 'edit') { print '
'; print ''; print "
"; @@ -91,8 +94,7 @@ if ($action != 'create' && $action != 'edit') /* */ /* ************************************************************************** */ -if ($action == 'create') -{ +if ($action == 'create') { print '

'; print load_fiche_titre($langs->trans('NewAttribute')); @@ -104,8 +106,7 @@ if ($action == 'create') /* Edition of an optional field */ /* */ /* ************************************************************************** */ -if ($action == 'edit' && !empty($attrname)) -{ +if ($action == 'edit' && !empty($attrname)) { print '

'; print load_fiche_titre($langs->trans("FieldEdition", $attrname)); diff --git a/htdocs/salaries/card.php b/htdocs/salaries/card.php index 2fc71bec099..af2aecdfe14 100644 --- a/htdocs/salaries/card.php +++ b/htdocs/salaries/card.php @@ -31,15 +31,16 @@ require_once DOL_DOCUMENT_ROOT.'/salaries/class/paymentsalary.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/salaries.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; -if (!empty($conf->projet->enabled)) -{ +if (!empty($conf->projet->enabled)) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; } // Load translation files required by the page $langs->loadLangs(array("compta", "banks", "bills", "users", "salaries", "hrm")); -if (!empty($conf->projet->enabled)) $langs->load("projects"); +if (!empty($conf->projet->enabled)) { + $langs->load("projects"); +} $id = GETPOST("id", 'int'); $action = GETPOST('action', 'aZ09'); @@ -54,7 +55,9 @@ $dateep = dol_mktime(12, 0, 0, GETPOST("dateepmonth", 'int'), GETPOST("dateepday // Security check $socid = GETPOST("socid", "int"); -if ($user->socid) $socid = $user->socid; +if ($user->socid) { + $socid = $user->socid; +} $result = restrictedArea($user, 'salaries', '', '', ''); $object = new PaymentSalary($db); @@ -71,24 +74,23 @@ $hookmanager->initHooks(array('salarycard', 'globalcard')); * Actions */ -if ($cancel) -{ +if ($cancel) { header("Location: list.php"); exit; } // Link to a project -if ($action == 'classin' && $user->rights->banque->modifier) -{ +if ($action == 'classin' && $user->rights->banque->modifier) { $object->fetch($id); $object->setProject($projectid); } -if ($action == 'add' && empty($cancel)) -{ +if ($action == 'add' && empty($cancel)) { $error = 0; - if (empty($datev)) $datev = $datep; + if (empty($datev)) { + $datev = $datep; + } $type_payment = dol_getIdFromCode($db, GETPOST("paymenttype", 'alpha'), 'c_paiement', 'code', 'id', 1); @@ -113,41 +115,36 @@ if ($action == 'add' && empty($cancel)) // Fill array 'array_options' with data from add form $ret = $extrafields->setOptionalsFromPost(null, $object); - if ($ret < 0) $error++; + if ($ret < 0) { + $error++; + } - if (empty($datep) || empty($datev) || empty($datesp) || empty($dateep)) - { + if (empty($datep) || empty($datev) || empty($datesp) || empty($dateep)) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Date")), null, 'errors'); $error++; } - if (empty($object->fk_user) || $object->fk_user < 0) - { + if (empty($object->fk_user) || $object->fk_user < 0) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Employee")), null, 'errors'); $error++; } - if (empty($type_payment) || $type_payment < 0) - { + if (empty($type_payment) || $type_payment < 0) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("PaymentMode")), null, 'errors'); $error++; } - if (empty($object->amount)) - { + if (empty($object->amount)) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Amount")), null, 'errors'); $error++; } - if (!empty($conf->banque->enabled) && !$object->accountid > 0) - { + if (!empty($conf->banque->enabled) && !$object->accountid > 0) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("BankAccount")), null, 'errors'); $error++; } - if (!$error) - { + if (!$error) { $db->begin(); $ret = $object->create($user); - if ($ret > 0) - { + if ($ret > 0) { $db->commit(); if (GETPOST('saveandnew', 'alpha')) { @@ -168,26 +165,23 @@ if ($action == 'add' && empty($cancel)) $action = 'create'; } -if ($action == 'delete') -{ +if ($action == 'delete') { $result = $object->fetch($id); - if ($object->rappro == 0) - { + if ($object->rappro == 0) { $db->begin(); $ret = $object->delete($user); - if ($ret > 0) - { - if ($object->fk_bank) - { + if ($ret > 0) { + if ($object->fk_bank) { $accountline = new AccountLine($db); $result = $accountline->fetch($object->fk_bank); - if ($result > 0) $result = $accountline->delete($user); // $result may be 0 if not found (when bank entry was deleted manually and fk_bank point to nothing) + if ($result > 0) { + $result = $accountline->delete($user); // $result may be 0 if not found (when bank entry was deleted manually and fk_bank point to nothing) + } } - if ($result >= 0) - { + if ($result >= 0) { $db->commit(); header("Location: ".DOL_URL_ROOT.'/salaries/list.php'); exit; @@ -213,27 +207,25 @@ if ($action == 'delete') llxHeader("", $langs->trans("SalaryPayment")); $form = new Form($db); -if (!empty($conf->projet->enabled)) $formproject = new FormProjets($db); +if (!empty($conf->projet->enabled)) { + $formproject = new FormProjets($db); +} -if ($id) -{ +if ($id) { $object = new PaymentSalary($db); $result = $object->fetch($id); - if ($result <= 0) - { + if ($result <= 0) { dol_print_error($db); exit; } } // Create -if ($action == 'create') -{ +if ($action == 'create') { $year_current = strftime("%Y", dol_now()); $pastmonth = strftime("%m", dol_now()) - 1; $pastmonthyear = $year_current; - if ($pastmonth == 0) - { + if ($pastmonth == 0) { $pastmonth = 12; $pastmonthyear--; } @@ -247,8 +239,7 @@ if ($action == 'create') $datesp = dol_mktime(0, 0, 0, $datespmonth, $datespday, $datespyear); $dateep = dol_mktime(23, 59, 59, $dateepmonth, $dateepday, $dateepyear); - if (empty($datesp) || empty($dateep)) // We define date_start and date_end - { + if (empty($datesp) || empty($dateep)) { // We define date_start and date_end $datesp = dol_get_first_day($pastmonthyear, $pastmonth, false); $dateep = dol_get_last_day($pastmonthyear, $pastmonth, false); } @@ -306,8 +297,7 @@ if ($action == 'create') print ''; // Bank - if (!empty($conf->banque->enabled)) - { + if (!empty($conf->banque->enabled)) { print ''; print $form->editfieldkey('BankAccount', 'selectaccountid', '', $object, 0, 'string', '', 1).''; $form->select_comptes($accountid, "accountid", 0, '', 1); // Affiche liste des comptes courant @@ -321,8 +311,7 @@ if ($action == 'create') print ''; // Number - if (!empty($conf->banque->enabled)) - { + if (!empty($conf->banque->enabled)) { // Number print '