From 360bf55f5be3d85b17f83f963059dc8567cdc599 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 20 Oct 2019 01:09:11 +0200 Subject: [PATCH] clean indent --- dev/setup/codesniffer/ruleset.xml | 5 +- htdocs/accountancy/admin/index.php | 50 +- htdocs/accountancy/customer/list.php | 2 - htdocs/accountancy/expensereport/list.php | 2 - htdocs/accountancy/journal/bankjournal.php | 2 +- .../journal/expensereportsjournal.php | 194 +++--- .../accountancy/journal/purchasesjournal.php | 232 ++++--- htdocs/accountancy/journal/sellsjournal.php | 232 ++++--- htdocs/accountancy/supplier/list.php | 2 - .../default/tpl/adherentcard_view.tpl.php | 44 +- htdocs/adherents/card.php | 30 +- htdocs/adherents/class/adherent.class.php | 2 +- .../adherents/class/adherent_type.class.php | 46 +- .../adherents/tpl/linkedobjectblock.tpl.php | 32 +- htdocs/adherents/type.php | 16 +- htdocs/adherents/type_translation.php | 2 +- htdocs/admin/agenda_other.php | 22 +- htdocs/admin/barcode.php | 36 +- htdocs/admin/bom.php | 2 +- htdocs/admin/commande.php | 2 +- htdocs/admin/const.php | 4 +- htdocs/admin/contract.php | 2 +- htdocs/admin/dict.php | 79 ++- .../class/PSWebServiceLibrary.class.php | 17 +- .../admin/dolistore/class/dolistore.class.php | 2 +- htdocs/admin/emailcollector_card.php | 2 +- htdocs/admin/expedition.php | 2 +- htdocs/admin/external_rss.php | 4 +- htdocs/admin/fichinter.php | 45 +- htdocs/admin/holiday.php | 18 +- htdocs/admin/ldap_users.php | 2 +- htdocs/admin/livraison.php | 2 +- htdocs/admin/mails_templates.php | 10 +- htdocs/admin/modules.php | 18 +- htdocs/admin/propal.php | 2 +- htdocs/admin/reception_setup.php | 2 +- htdocs/admin/sms.php | 4 +- htdocs/admin/stock.php | 194 +++--- htdocs/admin/supplier_order.php | 4 +- htdocs/admin/supplier_proposal.php | 2 +- htdocs/admin/system/database-tables.php | 4 +- htdocs/admin/system/index.php | 8 +- htdocs/admin/tools/dolibarr_export.php | 619 +++++++++--------- htdocs/admin/tools/dolibarr_import.php | 50 +- htdocs/admin/tools/listsessions.php | 4 +- htdocs/admin/tools/purge.php | 6 +- htdocs/admin/user.php | 6 +- htdocs/admin/usergroup.php | 2 +- htdocs/core/class/html.formcron.class.php | 28 +- htdocs/modulebuilder/index.php | 170 ++--- .../test/phpunit/MyModuleFunctionalTest.php | 22 +- 51 files changed, 1126 insertions(+), 1163 deletions(-) diff --git a/dev/setup/codesniffer/ruleset.xml b/dev/setup/codesniffer/ruleset.xml index 32c44ce91e4..0b4be95e692 100644 --- a/dev/setup/codesniffer/ruleset.xml +++ b/dev/setup/codesniffer/ruleset.xml @@ -185,16 +185,15 @@ + - - --> diff --git a/htdocs/accountancy/admin/index.php b/htdocs/accountancy/admin/index.php index 4cf2401d51b..0460f31af30 100644 --- a/htdocs/accountancy/admin/index.php +++ b/htdocs/accountancy/admin/index.php @@ -88,11 +88,11 @@ if ($action == 'setlistsorttodo') { if (! $res > 0) $error ++; - if (! $error) { - setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } else { - setEventMessages($langs->trans("Error"), null, 'mesgs'); - } + if (! $error) { + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); + } else { + setEventMessages($langs->trans("Error"), null, 'mesgs'); + } } if ($action == 'setlistsortdone') { @@ -100,11 +100,11 @@ if ($action == 'setlistsortdone') { $res = dolibarr_set_const($db, "ACCOUNTING_LIST_SORT_VENTILATION_DONE", $setlistsortdone, 'yesno', 0, '', $conf->entity); if (! $res > 0) $error ++; - if (! $error) { - setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } else { - setEventMessages($langs->trans("Error"), null, 'mesgs'); - } + if (! $error) { + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); + } else { + setEventMessages($langs->trans("Error"), null, 'mesgs'); + } } if ($action == 'setmanagezero') { @@ -112,11 +112,11 @@ if ($action == 'setmanagezero') { $res = dolibarr_set_const($db, "ACCOUNTING_MANAGE_ZERO", $setmanagezero, 'yesno', 0, '', $conf->entity); if (! $res > 0) $error ++; - if (! $error) { - setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } else { - setEventMessages($langs->trans("Error"), null, 'mesgs'); - } + if (! $error) { + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); + } else { + setEventMessages($langs->trans("Error"), null, 'mesgs'); + } } if ($action == 'setdisabledirectinput') { @@ -124,11 +124,11 @@ if ($action == 'setdisabledirectinput') { $res = dolibarr_set_const($db, "BANK_DISABLE_DIRECT_INPUT", $setdisabledirectinput, 'yesno', 0, '', $conf->entity); if (! $res > 0) $error ++; - if (! $error) { - setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } else { - setEventMessages($langs->trans("Error"), null, 'mesgs'); - } + if (! $error) { + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); + } else { + setEventMessages($langs->trans("Error"), null, 'mesgs'); + } } if ($action == 'setenabledraftexport') { @@ -136,11 +136,11 @@ if ($action == 'setenabledraftexport') { $res = dolibarr_set_const($db, "ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL", $setenabledraftexport, 'yesno', 0, '', $conf->entity); if (! $res > 0) $error ++; - if (! $error) { - setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } else { - setEventMessages($langs->trans("Error"), null, 'mesgs'); - } + if (! $error) { + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); + } else { + setEventMessages($langs->trans("Error"), null, 'mesgs'); + } } if ($action == 'setenablesubsidiarylist') { diff --git a/htdocs/accountancy/customer/list.php b/htdocs/accountancy/customer/list.php index 96520c4756c..c15ace96ffc 100644 --- a/htdocs/accountancy/customer/list.php +++ b/htdocs/accountancy/customer/list.php @@ -180,8 +180,6 @@ if ($massaction == 'ventil') { } $msg.=''; $msg.= '
' . $langs->trans("EndProcessing") . '
'; - //} else { - // setEventMessages($langs->trans("NoRecordSelected"), null, 'warnings'); } } diff --git a/htdocs/accountancy/expensereport/list.php b/htdocs/accountancy/expensereport/list.php index 77a97b86322..1ec89dfc9cc 100644 --- a/htdocs/accountancy/expensereport/list.php +++ b/htdocs/accountancy/expensereport/list.php @@ -161,8 +161,6 @@ if ($massaction == 'ventil') { } $msg.=''; $msg.= '
' . $langs->trans("EndProcessing") . '
'; - //} else { - // setEventMessages($langs->trans("NoRecordSelected"), null, 'warnings'); } } diff --git a/htdocs/accountancy/journal/bankjournal.php b/htdocs/accountancy/journal/bankjournal.php index 6e709835f42..7063f7fd53e 100644 --- a/htdocs/accountancy/journal/bankjournal.php +++ b/htdocs/accountancy/journal/bankjournal.php @@ -996,7 +996,7 @@ if (empty($action) || $action == 'view') { if (($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER == "") || $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER == '-1' || ($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER == "") || $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER == '-1') { - print ''; + print ''; } else { if ($in_bookkeeping == 'notyet') print ''; diff --git a/htdocs/accountancy/journal/expensereportsjournal.php b/htdocs/accountancy/journal/expensereportsjournal.php index 6cefc893b39..c61cdda4d48 100644 --- a/htdocs/accountancy/journal/expensereportsjournal.php +++ b/htdocs/accountancy/journal/expensereportsjournal.php @@ -306,49 +306,49 @@ if ($action == 'writebookkeeping') { foreach ($arrayofvat[$key] as $k => $mt) { if ($mt) { - // get compte id and label - $bookkeeping = new BookKeeping($db); - $bookkeeping->doc_date = $val["date"]; - $bookkeeping->doc_ref = $val["ref"]; - $bookkeeping->date_creation = $now; - $bookkeeping->doc_type = 'expense_report'; - $bookkeeping->fk_doc = $key; - $bookkeeping->fk_docdet = $val["fk_expensereportdet"]; - $bookkeeping->subledger_account = ''; - $bookkeeping->subledger_label = ''; - $bookkeeping->numero_compte = $k; + // get compte id and label + $bookkeeping = new BookKeeping($db); + $bookkeeping->doc_date = $val["date"]; + $bookkeeping->doc_ref = $val["ref"]; + $bookkeeping->date_creation = $now; + $bookkeeping->doc_type = 'expense_report'; + $bookkeeping->fk_doc = $key; + $bookkeeping->fk_docdet = $val["fk_expensereportdet"]; + $bookkeeping->subledger_account = ''; + $bookkeeping->subledger_label = ''; + $bookkeeping->numero_compte = $k; - $accountingaccount->fetch($k, null, true); - $bookkeeping->label_compte = $accountingaccount->label; + $accountingaccount->fetch($k, null, true); + $bookkeeping->label_compte = $accountingaccount->label; - $bookkeeping->label_operation = $langs->trans("VAT"). ' '.join(', ', $def_tva[$key][$k]).' %'; - $bookkeeping->montant = $mt; - $bookkeeping->sens = ($mt < 0) ? 'C' : 'D'; - $bookkeeping->debit = ($mt > 0) ? $mt : 0; - $bookkeeping->credit = ($mt <= 0) ? $mt : 0; - $bookkeeping->code_journal = $journal; - $bookkeeping->journal_label = $journal_label; - $bookkeeping->fk_user_author = $user->id; - $bookkeeping->entity = $conf->entity; + $bookkeeping->label_operation = $langs->trans("VAT"). ' '.join(', ', $def_tva[$key][$k]).' %'; + $bookkeeping->montant = $mt; + $bookkeeping->sens = ($mt < 0) ? 'C' : 'D'; + $bookkeeping->debit = ($mt > 0) ? $mt : 0; + $bookkeeping->credit = ($mt <= 0) ? $mt : 0; + $bookkeeping->code_journal = $journal; + $bookkeeping->journal_label = $journal_label; + $bookkeeping->fk_user_author = $user->id; + $bookkeeping->entity = $conf->entity; - $totaldebit += $bookkeeping->debit; - $totalcredit += $bookkeeping->credit; + $totaldebit += $bookkeeping->debit; + $totalcredit += $bookkeeping->credit; - $result = $bookkeeping->create($user); - if ($result < 0) { - if ($bookkeeping->error == 'BookkeepingRecordAlreadyExists') // Already exists - { - $error++; - $errorforline++; - //setEventMessages('Transaction for ('.$bookkeeping->doc_type.', '.$bookkeeping->fk_doc.', '.$bookkeeping->fk_docdet.') were already recorded', null, 'warnings'); + $result = $bookkeeping->create($user); + if ($result < 0) { + if ($bookkeeping->error == 'BookkeepingRecordAlreadyExists') // Already exists + { + $error++; + $errorforline++; + //setEventMessages('Transaction for ('.$bookkeeping->doc_type.', '.$bookkeeping->fk_doc.', '.$bookkeeping->fk_docdet.') were already recorded', null, 'warnings'); + } + else + { + $error++; + $errorforline++; + setEventMessages($bookkeeping->error, $bookkeeping->errors, 'errors'); + } } - else - { - $error++; - $errorforline++; - setEventMessages($bookkeeping->error, $bookkeeping->errors, 'errors'); - } - } } } } @@ -438,48 +438,48 @@ if ($action == 'exportcsv') { // ISO and not UTF8 ! print "\n"; foreach ($taber as $key => $val) { - $date = dol_print_date($val["date"], 'day'); + $date = dol_print_date($val["date"], 'day'); - $userstatic->id = $tabuser[$key]['id']; - $userstatic->name = $tabuser[$key]['name']; + $userstatic->id = $tabuser[$key]['id']; + $userstatic->name = $tabuser[$key]['name']; - // Fees - foreach ($tabht[$key] as $k => $mt) { - $accountingaccount = new AccountingAccount($db); - $accountingaccount->fetch(null, $k, true); - if ($mt) { - print '"' . $date . '"' . $sep; - print '"' . $val["ref"] . '"' . $sep; - print '"' . length_accountg(html_entity_decode($k)) . '"' . $sep; - print '"' . dol_trunc($accountingaccount->label, 32) . '"' . $sep; - print '"' . ($mt >= 0 ? price($mt) : '') . '"' . $sep; - print '"' . ($mt < 0 ? price(- $mt) : '') . '"'; - print "\n"; + // Fees + foreach ($tabht[$key] as $k => $mt) { + $accountingaccount = new AccountingAccount($db); + $accountingaccount->fetch(null, $k, true); + if ($mt) { + print '"' . $date . '"' . $sep; + print '"' . $val["ref"] . '"' . $sep; + print '"' . length_accountg(html_entity_decode($k)) . '"' . $sep; + print '"' . dol_trunc($accountingaccount->label, 32) . '"' . $sep; + print '"' . ($mt >= 0 ? price($mt) : '') . '"' . $sep; + print '"' . ($mt < 0 ? price(- $mt) : '') . '"'; + print "\n"; + } } - } - // VAT - foreach ($tabtva[$key] as $k => $mt) { - if ($mt) { - print '"' . $date . '"' . $sep; - print '"' . $val["ref"] . '"' . $sep; - print '"' . length_accountg(html_entity_decode($k)) . '"' . $sep; - print '"' . dol_trunc($langs->trans("VAT")) . '"' . $sep; - print '"' . ($mt >= 0 ? price($mt) : '') . '"' . $sep; - print '"' . ($mt < 0 ? price(- $mt) : '') . '"'; - print "\n"; + // VAT + foreach ($tabtva[$key] as $k => $mt) { + if ($mt) { + print '"' . $date . '"' . $sep; + print '"' . $val["ref"] . '"' . $sep; + print '"' . length_accountg(html_entity_decode($k)) . '"' . $sep; + print '"' . dol_trunc($langs->trans("VAT")) . '"' . $sep; + print '"' . ($mt >= 0 ? price($mt) : '') . '"' . $sep; + print '"' . ($mt < 0 ? price(- $mt) : '') . '"'; + print "\n"; + } } - } - // Third party - foreach ($tabttc[$key] as $k => $mt) { - print '"' . $date . '"' . $sep; - print '"' . $val["ref"] . '"' . $sep; - print '"' . length_accounta(html_entity_decode($k)) . '"' . $sep; - print '"' . dol_trunc($userstatic->name) . '"' . $sep; - print '"' . ($mt < 0 ? price(- $mt) : '') . '"' . $sep; - print '"' . ($mt >= 0 ? price($mt) : '') . '"'; - } - print "\n"; + // Third party + foreach ($tabttc[$key] as $k => $mt) { + print '"' . $date . '"' . $sep; + print '"' . $val["ref"] . '"' . $sep; + print '"' . length_accounta(html_entity_decode($k)) . '"' . $sep; + print '"' . dol_trunc($userstatic->name) . '"' . $sep; + print '"' . ($mt < 0 ? price(- $mt) : '') . '"' . $sep; + print '"' . ($mt >= 0 ? price($mt) : '') . '"'; + } + print "\n"; } } @@ -638,29 +638,29 @@ if (empty($action) || $action == 'view') { if ($numtax == 2) $arrayofvat = $tablocaltax2; foreach ($arrayofvat[$key] as $k => $mt) { - if ($mt) { - print ''; - print ""; - print "" . $date . ""; - print "" . $expensereportstatic->getNomUrl(1) . ""; - // Account - print ""; - $accountoshow = length_accountg($k); - if (($accountoshow == "") || $accountoshow == 'NotDefined') - { - print ''.$langs->trans("VATAccountNotDefined").''; + if ($mt) { + print ''; + print ""; + print "" . $date . ""; + print "" . $expensereportstatic->getNomUrl(1) . ""; + // Account + print ""; + $accountoshow = length_accountg($k); + if (($accountoshow == "") || $accountoshow == 'NotDefined') + { + print ''.$langs->trans("VATAccountNotDefined").''; + } + else print $accountoshow; + print ""; + // Subledger account + print ""; + print ''; + print "" . $userstatic->getNomUrl(0, 'user', 16) . ' - ' . $langs->trans("VAT"). ' '.join(', ', $def_tva[$key][$k]).' %'.($numtax?' - Localtax '.$numtax:''); + print ""; + print '' . ($mt >= 0 ? price($mt) : '') . ""; + print '' . ($mt < 0 ? price(- $mt) : '') . ""; + print ""; } - else print $accountoshow; - print ""; - // Subledger account - print ""; - print ''; - print "" . $userstatic->getNomUrl(0, 'user', 16) . ' - ' . $langs->trans("VAT"). ' '.join(', ', $def_tva[$key][$k]).' %'.($numtax?' - Localtax '.$numtax:''); - print ""; - print '' . ($mt >= 0 ? price($mt) : '') . ""; - print '' . ($mt < 0 ? price(- $mt) : '') . ""; - print ""; - } } } } diff --git a/htdocs/accountancy/journal/purchasesjournal.php b/htdocs/accountancy/journal/purchasesjournal.php index ddf456c85f0..a3728c7f6f9 100644 --- a/htdocs/accountancy/journal/purchasesjournal.php +++ b/htdocs/accountancy/journal/purchasesjournal.php @@ -294,7 +294,61 @@ if ($action == 'writebookkeeping') { if (! $errorforline) { foreach ($tabttc[$key] as $k => $mt) { - //if ($mt) { + $bookkeeping = new BookKeeping($db); + $bookkeeping->doc_date = $val["date"]; + $bookkeeping->date_lim_reglement = $val["datereg"]; + $bookkeeping->doc_ref = $val["refsologest"]; + $bookkeeping->date_creation = $now; + $bookkeeping->doc_type = 'supplier_invoice'; + $bookkeeping->fk_doc = $key; + $bookkeeping->fk_docdet = 0; // Useless, can be several lines that are source of this record to add + $bookkeeping->thirdparty_code = $companystatic->code_fournisseur; + $bookkeeping->subledger_account = $tabcompany[$key]['code_compta_fournisseur']; + $bookkeeping->subledger_label = $tabcompany[$key]['name']; + $bookkeeping->numero_compte = $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER; + + $accountingaccount->fetch(null, $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER, true); + $bookkeeping->label_compte = $accountingaccount->label; + + $bookkeeping->label_operation = dol_trunc($companystatic->name, 16) . ' - ' . $invoicestatic->ref_supplier . ' - ' . $langs->trans("SubledgerAccount"); + $bookkeeping->montant = $mt; + $bookkeeping->sens = ($mt >= 0) ? 'C' : 'D'; + $bookkeeping->debit = ($mt <= 0) ? -$mt : 0; + $bookkeeping->credit = ($mt > 0) ? $mt : 0; + $bookkeeping->code_journal = $journal; + $bookkeeping->journal_label = $journal_label; + $bookkeeping->fk_user_author = $user->id; + $bookkeeping->entity = $conf->entity; + + $totaldebit += $bookkeeping->debit; + $totalcredit += $bookkeeping->credit; + + $result = $bookkeeping->create($user); + if ($result < 0) { + if ($bookkeeping->error == 'BookkeepingRecordAlreadyExists') // Already exists + { + $error++; + $errorforline++; + $errorforinvoice[$key]='alreadyjournalized'; + //setEventMessages('Transaction for ('.$bookkeeping->doc_type.', '.$bookkeeping->fk_doc.', '.$bookkeeping->fk_docdet.') were already recorded', null, 'warnings'); + } + else + { + $error++; + $errorforline++; + $errorforinvoice[$key]='other'; + setEventMessages($bookkeeping->error, $bookkeeping->errors, 'errors'); + } + } + } + } + + // Product / Service + if (! $errorforline) + { + foreach ($tabht[$key] as $k => $mt) { + // get compte id and label + if ($accountingaccount->fetch(null, $k, true)) { $bookkeeping = new BookKeeping($db); $bookkeeping->doc_date = $val["date"]; $bookkeeping->date_lim_reglement = $val["datereg"]; @@ -302,20 +356,17 @@ if ($action == 'writebookkeeping') { $bookkeeping->date_creation = $now; $bookkeeping->doc_type = 'supplier_invoice'; $bookkeeping->fk_doc = $key; - $bookkeeping->fk_docdet = 0; // Useless, can be several lines that are source of this record to add + $bookkeeping->fk_docdet = 0; // Useless, can be several lines that are source of this record to add $bookkeeping->thirdparty_code = $companystatic->code_fournisseur; - $bookkeeping->subledger_account = $tabcompany[$key]['code_compta_fournisseur']; - $bookkeeping->subledger_label = $tabcompany[$key]['name']; - $bookkeeping->numero_compte = $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER; - - $accountingaccount->fetch(null, $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER, true); + $bookkeeping->subledger_account = ''; + $bookkeeping->subledger_label = ''; + $bookkeeping->numero_compte = $k; $bookkeeping->label_compte = $accountingaccount->label; - - $bookkeeping->label_operation = dol_trunc($companystatic->name, 16) . ' - ' . $invoicestatic->ref_supplier . ' - ' . $langs->trans("SubledgerAccount"); + $bookkeeping->label_operation = dol_trunc($companystatic->name, 16) . ' - ' . $invoicestatic->ref_supplier . ' - ' . $accountingaccount->label; $bookkeeping->montant = $mt; - $bookkeeping->sens = ($mt >= 0) ? 'C' : 'D'; - $bookkeeping->debit = ($mt <= 0) ? -$mt : 0; - $bookkeeping->credit = ($mt > 0) ? $mt : 0; + $bookkeeping->sens = ($mt < 0) ? 'C' : 'D'; + $bookkeeping->debit = ($mt > 0) ? $mt : 0; + $bookkeeping->credit = ($mt <= 0) ? -$mt : 0; $bookkeeping->code_journal = $journal; $bookkeeping->journal_label = $journal_label; $bookkeeping->fk_user_author = $user->id; @@ -341,62 +392,7 @@ if ($action == 'writebookkeeping') { setEventMessages($bookkeeping->error, $bookkeeping->errors, 'errors'); } } - //} - } - } - - // Product / Service - if (! $errorforline) - { - foreach ($tabht[$key] as $k => $mt) { - //if ($mt) { - // get compte id and label - if ($accountingaccount->fetch(null, $k, true)) { - $bookkeeping = new BookKeeping($db); - $bookkeeping->doc_date = $val["date"]; - $bookkeeping->date_lim_reglement = $val["datereg"]; - $bookkeeping->doc_ref = $val["refsologest"]; - $bookkeeping->date_creation = $now; - $bookkeeping->doc_type = 'supplier_invoice'; - $bookkeeping->fk_doc = $key; - $bookkeeping->fk_docdet = 0; // Useless, can be several lines that are source of this record to add - $bookkeeping->thirdparty_code = $companystatic->code_fournisseur; - $bookkeeping->subledger_account = ''; - $bookkeeping->subledger_label = ''; - $bookkeeping->numero_compte = $k; - $bookkeeping->label_compte = $accountingaccount->label; - $bookkeeping->label_operation = dol_trunc($companystatic->name, 16) . ' - ' . $invoicestatic->ref_supplier . ' - ' . $accountingaccount->label; - $bookkeeping->montant = $mt; - $bookkeeping->sens = ($mt < 0) ? 'C' : 'D'; - $bookkeeping->debit = ($mt > 0) ? $mt : 0; - $bookkeeping->credit = ($mt <= 0) ? -$mt : 0; - $bookkeeping->code_journal = $journal; - $bookkeeping->journal_label = $journal_label; - $bookkeeping->fk_user_author = $user->id; - $bookkeeping->entity = $conf->entity; - - $totaldebit += $bookkeeping->debit; - $totalcredit += $bookkeeping->credit; - - $result = $bookkeeping->create($user); - if ($result < 0) { - if ($bookkeeping->error == 'BookkeepingRecordAlreadyExists') // Already exists - { - $error++; - $errorforline++; - $errorforinvoice[$key]='alreadyjournalized'; - //setEventMessages('Transaction for ('.$bookkeeping->doc_type.', '.$bookkeeping->fk_doc.', '.$bookkeeping->fk_docdet.') were already recorded', null, 'warnings'); - } - else - { - $error++; - $errorforline++; - $errorforinvoice[$key]='other'; - setEventMessages($bookkeeping->error, $bookkeeping->errors, 'errors'); - } - } - } - //} + } } } @@ -865,34 +861,32 @@ if (empty($action) || $action == 'view') { // Third party foreach ($tabttc[$key] as $k => $mt) { - //if ($mt) { - print ''; - print ""; - print "" . $date . ""; - print "" . $invoicestatic->getNomUrl(1) . ""; - // Account - print ""; - $accountoshow = length_accounta($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER); - if (($accountoshow == "") || $accountoshow == 'NotDefined') - { - print ''.$langs->trans("MainAccountForSuppliersNotDefined").''; - } - else print $accountoshow; - print ''; - // Subledger account - print ""; - $accountoshow = length_accounta($k); - if (($accountoshow == "") || $accountoshow == 'NotDefined') - { - print ''.$langs->trans("ThirdpartyAccountNotDefined").''; - } - else print $accountoshow; - print ''; - print "" . $companystatic->getNomUrl(0, 'supplier', 16) . ' - ' . $invoicestatic->ref_supplier . ' - ' . $langs->trans("SubledgerAccount") . ""; - print ''. ($mt < 0 ? price(- $mt) : '') . ""; - print '' . ($mt >= 0 ? price($mt) : '') . ""; - print ""; - //} + print ''; + print ""; + print "" . $date . ""; + print "" . $invoicestatic->getNomUrl(1) . ""; + // Account + print ""; + $accountoshow = length_accounta($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER); + if (($accountoshow == "") || $accountoshow == 'NotDefined') + { + print ''.$langs->trans("MainAccountForSuppliersNotDefined").''; + } + else print $accountoshow; + print ''; + // Subledger account + print ""; + $accountoshow = length_accounta($k); + if (($accountoshow == "") || $accountoshow == 'NotDefined') + { + print ''.$langs->trans("ThirdpartyAccountNotDefined").''; + } + else print $accountoshow; + print ''; + print "" . $companystatic->getNomUrl(0, 'supplier', 16) . ' - ' . $invoicestatic->ref_supplier . ' - ' . $langs->trans("SubledgerAccount") . ""; + print ''. ($mt < 0 ? price(- $mt) : '') . ""; + print '' . ($mt >= 0 ? price($mt) : '') . ""; + print ""; } // Product / Service @@ -900,30 +894,28 @@ if (empty($action) || $action == 'view') { $accountingaccount = new AccountingAccount($db); $accountingaccount->fetch(null, $k, true); - //if ($mt) { - print ''; - print ""; - print "" . $date . ""; - print "" . $invoicestatic->getNomUrl(1) . ""; - // Account - print ""; - $accountoshow = length_accountg($k); - if (($accountoshow == "") || $accountoshow == 'NotDefined') - { - print ''.$langs->trans("ProductAccountNotDefined").''; - } - else print $accountoshow; - print ""; - // Subledger account - print ""; - print ''; - $companystatic->id = $tabcompany[$key]['id']; - $companystatic->name = $tabcompany[$key]['name']; - print "" . $companystatic->getNomUrl(0, 'supplier', 16) . ' - ' . $invoicestatic->ref_supplier . ' - ' . $accountingaccount->label . ""; - print '' . ($mt >= 0 ? price($mt) : '') . ""; - print '' . ($mt < 0 ? price(- $mt) : '') . ""; - print ""; - //} + print ''; + print ""; + print "" . $date . ""; + print "" . $invoicestatic->getNomUrl(1) . ""; + // Account + print ""; + $accountoshow = length_accountg($k); + if (($accountoshow == "") || $accountoshow == 'NotDefined') + { + print ''.$langs->trans("ProductAccountNotDefined").''; + } + else print $accountoshow; + print ""; + // Subledger account + print ""; + print ''; + $companystatic->id = $tabcompany[$key]['id']; + $companystatic->name = $tabcompany[$key]['name']; + print "" . $companystatic->getNomUrl(0, 'supplier', 16) . ' - ' . $invoicestatic->ref_supplier . ' - ' . $accountingaccount->label . ""; + print '' . ($mt >= 0 ? price($mt) : '') . ""; + print '' . ($mt < 0 ? price(- $mt) : '') . ""; + print ""; } // VAT diff --git a/htdocs/accountancy/journal/sellsjournal.php b/htdocs/accountancy/journal/sellsjournal.php index ed56065df0a..367fa2eb817 100644 --- a/htdocs/accountancy/journal/sellsjournal.php +++ b/htdocs/accountancy/journal/sellsjournal.php @@ -124,7 +124,7 @@ if ($in_bookkeeping == 'already') if ($in_bookkeeping == 'notyet') { $sql .= " AND f.rowid NOT IN (SELECT fk_doc FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping as ab WHERE ab.doc_type='customer_invoice')"; -// $sql .= " AND fd.rowid NOT IN (SELECT fk_docdet FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping as ab WHERE ab.doc_type='customer_invoice')"; // Useless, we save one line for all products with same account + // $sql .= " AND fd.rowid NOT IN (SELECT fk_docdet FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping as ab WHERE ab.doc_type='customer_invoice')"; // Useless, we save one line for all products with same account } $sql .= " ORDER BY f.datef"; //print $sql; @@ -305,7 +305,61 @@ if ($action == 'writebookkeeping') { if (! $errorforline) { foreach ($tabttc[$key] as $k => $mt) { - //if ($mt) { + $bookkeeping = new BookKeeping($db); + $bookkeeping->doc_date = $val["date"]; + $bookkeeping->date_lim_reglement = $val["datereg"]; + $bookkeeping->doc_ref = $val["ref"]; + $bookkeeping->date_creation = $now; + $bookkeeping->doc_type = 'customer_invoice'; + $bookkeeping->fk_doc = $key; + $bookkeeping->fk_docdet = 0; // Useless, can be several lines that are source of this record to add + $bookkeeping->thirdparty_code = $companystatic->code_client; + $bookkeeping->subledger_account = $tabcompany[$key]['code_compta']; + $bookkeeping->subledger_label = $tabcompany[$key]['name']; + $bookkeeping->numero_compte = $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER; + + $accountingaccount->fetch(null, $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER, true); + $bookkeeping->label_compte = $accountingaccount->label; + + $bookkeeping->label_operation = dol_trunc($companystatic->name, 16) . ' - ' . $invoicestatic->ref . ' - ' . $langs->trans("SubledgerAccount"); + $bookkeeping->montant = $mt; + $bookkeeping->sens = ($mt >= 0) ? 'D' : 'C'; + $bookkeeping->debit = ($mt >= 0) ? $mt : 0; + $bookkeeping->credit = ($mt < 0) ? -$mt : 0; + $bookkeeping->code_journal = $journal; + $bookkeeping->journal_label = $journal_label; + $bookkeeping->fk_user_author = $user->id; + $bookkeeping->entity = $conf->entity; + + $totaldebit += $bookkeeping->debit; + $totalcredit += $bookkeeping->credit; + + $result = $bookkeeping->create($user); + if ($result < 0) { + if ($bookkeeping->error == 'BookkeepingRecordAlreadyExists') // Already exists + { + $error++; + $errorforline++; + $errorforinvoice[$key]='alreadyjournalized'; + //setEventMessages('Transaction for ('.$bookkeeping->doc_type.', '.$bookkeeping->fk_doc.', '.$bookkeeping->fk_docdet.') were already recorded', null, 'warnings'); + } + else + { + $error++; + $errorforline++; + $errorforinvoice[$key]='other'; + setEventMessages($bookkeeping->error, $bookkeeping->errors, 'errors'); + } + } + } + } + + // Product / Service + if (! $errorforline) + { + foreach ($tabht[$key] as $k => $mt) { + // get compte id and label + if ($accountingaccount->fetch(null, $k, true)) { $bookkeeping = new BookKeeping($db); $bookkeeping->doc_date = $val["date"]; $bookkeeping->date_lim_reglement = $val["datereg"]; @@ -315,18 +369,15 @@ if ($action == 'writebookkeeping') { $bookkeeping->fk_doc = $key; $bookkeeping->fk_docdet = 0; // Useless, can be several lines that are source of this record to add $bookkeeping->thirdparty_code = $companystatic->code_client; - $bookkeeping->subledger_account = $tabcompany[$key]['code_compta']; - $bookkeeping->subledger_label = $tabcompany[$key]['name']; - $bookkeeping->numero_compte = $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER; - - $accountingaccount->fetch(null, $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER, true); + $bookkeeping->subledger_account = ''; + $bookkeeping->subledger_label = ''; + $bookkeeping->numero_compte = $k; $bookkeeping->label_compte = $accountingaccount->label; - - $bookkeeping->label_operation = dol_trunc($companystatic->name, 16) . ' - ' . $invoicestatic->ref . ' - ' . $langs->trans("SubledgerAccount"); + $bookkeeping->label_operation = dol_trunc($companystatic->name, 16) . ' - ' . $invoicestatic->ref . ' - ' . $accountingaccount->label; $bookkeeping->montant = $mt; - $bookkeeping->sens = ($mt >= 0) ? 'D' : 'C'; - $bookkeeping->debit = ($mt >= 0) ? $mt : 0; - $bookkeeping->credit = ($mt < 0) ? -$mt : 0; + $bookkeeping->sens = ($mt < 0) ? 'D' : 'C'; + $bookkeeping->debit = ($mt < 0) ? -$mt : 0; + $bookkeeping->credit = ($mt >= 0) ? $mt : 0; $bookkeeping->code_journal = $journal; $bookkeeping->journal_label = $journal_label; $bookkeeping->fk_user_author = $user->id; @@ -352,62 +403,7 @@ if ($action == 'writebookkeeping') { setEventMessages($bookkeeping->error, $bookkeeping->errors, 'errors'); } } - //} - } - } - - // Product / Service - if (! $errorforline) - { - foreach ($tabht[$key] as $k => $mt) { - //if ($mt) { - // get compte id and label - if ($accountingaccount->fetch(null, $k, true)) { - $bookkeeping = new BookKeeping($db); - $bookkeeping->doc_date = $val["date"]; - $bookkeeping->date_lim_reglement = $val["datereg"]; - $bookkeeping->doc_ref = $val["ref"]; - $bookkeeping->date_creation = $now; - $bookkeeping->doc_type = 'customer_invoice'; - $bookkeeping->fk_doc = $key; - $bookkeeping->fk_docdet = 0; // Useless, can be several lines that are source of this record to add - $bookkeeping->thirdparty_code = $companystatic->code_client; - $bookkeeping->subledger_account = ''; - $bookkeeping->subledger_label = ''; - $bookkeeping->numero_compte = $k; - $bookkeeping->label_compte = $accountingaccount->label; - $bookkeeping->label_operation = dol_trunc($companystatic->name, 16) . ' - ' . $invoicestatic->ref . ' - ' . $accountingaccount->label; - $bookkeeping->montant = $mt; - $bookkeeping->sens = ($mt < 0) ? 'D' : 'C'; - $bookkeeping->debit = ($mt < 0) ? -$mt : 0; - $bookkeeping->credit = ($mt >= 0) ? $mt : 0; - $bookkeeping->code_journal = $journal; - $bookkeeping->journal_label = $journal_label; - $bookkeeping->fk_user_author = $user->id; - $bookkeeping->entity = $conf->entity; - - $totaldebit += $bookkeeping->debit; - $totalcredit += $bookkeeping->credit; - - $result = $bookkeeping->create($user); - if ($result < 0) { - if ($bookkeeping->error == 'BookkeepingRecordAlreadyExists') // Already exists - { - $error++; - $errorforline++; - $errorforinvoice[$key]='alreadyjournalized'; - //setEventMessages('Transaction for ('.$bookkeeping->doc_type.', '.$bookkeeping->fk_doc.', '.$bookkeeping->fk_docdet.') were already recorded', null, 'warnings'); - } - else - { - $error++; - $errorforline++; - $errorforinvoice[$key]='other'; - setEventMessages($bookkeeping->error, $bookkeeping->errors, 'errors'); - } - } - } - //} + } } } @@ -801,34 +797,32 @@ if (empty($action) || $action == 'view') { // Third party foreach ($tabttc[$key] as $k => $mt) { - //if ($mt) { - print ''; - print ""; - print "" . $date . ""; - print "" . $invoicestatic->getNomUrl(1) . ""; - // Account - print ""; - $accountoshow = length_accounta($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER); - if (($accountoshow == "") || $accountoshow == 'NotDefined') - { - print ''.$langs->trans("MainAccountForCustomersNotDefined").''; - } - else print $accountoshow; - print ''; - // Subledger account - print ""; - $accountoshow = length_accounta($k); - if (($accountoshow == "") || $accountoshow == 'NotDefined') - { - print ''.$langs->trans("ThirdpartyAccountNotDefined").''; - } - else print $accountoshow; - print ''; - print "" . $companystatic->getNomUrl(0, 'customer', 16) . ' - ' . $invoicestatic->ref . ' - ' . $langs->trans("SubledgerAccount") . ""; - print '' . ($mt >= 0 ? price($mt) : '') . ""; - print '' . ($mt < 0 ? price(- $mt) : '') . ""; - print ""; - //} + print ''; + print ""; + print "" . $date . ""; + print "" . $invoicestatic->getNomUrl(1) . ""; + // Account + print ""; + $accountoshow = length_accounta($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER); + if (($accountoshow == "") || $accountoshow == 'NotDefined') + { + print ''.$langs->trans("MainAccountForCustomersNotDefined").''; + } + else print $accountoshow; + print ''; + // Subledger account + print ""; + $accountoshow = length_accounta($k); + if (($accountoshow == "") || $accountoshow == 'NotDefined') + { + print ''.$langs->trans("ThirdpartyAccountNotDefined").''; + } + else print $accountoshow; + print ''; + print "" . $companystatic->getNomUrl(0, 'customer', 16) . ' - ' . $invoicestatic->ref . ' - ' . $langs->trans("SubledgerAccount") . ""; + print '' . ($mt >= 0 ? price($mt) : '') . ""; + print '' . ($mt < 0 ? price(- $mt) : '') . ""; + print ""; } // Product / Service @@ -837,30 +831,28 @@ if (empty($action) || $action == 'view') { $accountingaccount = new AccountingAccount($db); $accountingaccount->fetch(null, $k, true); - //if ($mt) { - print ''; - print ""; - print "" . $date . ""; - print "" . $invoicestatic->getNomUrl(1) . ""; - // Account - print ""; - $accountoshow = length_accountg($k); - if (($accountoshow == "") || $accountoshow == 'NotDefined') - { - print ''.$langs->trans("ProductNotDefined").''; - } - else print $accountoshow; - print ""; - // Subledger account - print ""; - print ''; - $companystatic->id = $tabcompany[$key]['id']; - $companystatic->name = $tabcompany[$key]['name']; - print "" . $companystatic->getNomUrl(0, 'customer', 16) . ' - ' . $invoicestatic->ref . ' - ' . $accountingaccount->label . ""; - print '' . ($mt < 0 ? price(- $mt) : '') . ""; - print '' . ($mt >= 0 ? price($mt) : '') . ""; - print ""; - //} + print ''; + print ""; + print "" . $date . ""; + print "" . $invoicestatic->getNomUrl(1) . ""; + // Account + print ""; + $accountoshow = length_accountg($k); + if (($accountoshow == "") || $accountoshow == 'NotDefined') + { + print ''.$langs->trans("ProductNotDefined").''; + } + else print $accountoshow; + print ""; + // Subledger account + print ""; + print ''; + $companystatic->id = $tabcompany[$key]['id']; + $companystatic->name = $tabcompany[$key]['name']; + print "" . $companystatic->getNomUrl(0, 'customer', 16) . ' - ' . $invoicestatic->ref . ' - ' . $accountingaccount->label . ""; + print '' . ($mt < 0 ? price(- $mt) : '') . ""; + print '' . ($mt >= 0 ? price($mt) : '') . ""; + print ""; } // VAT diff --git a/htdocs/accountancy/supplier/list.php b/htdocs/accountancy/supplier/list.php index fc453a94250..f43749f6958 100644 --- a/htdocs/accountancy/supplier/list.php +++ b/htdocs/accountancy/supplier/list.php @@ -184,8 +184,6 @@ if ($massaction == 'ventil') { } $msg.=''; $msg.= '
' . $langs->trans("EndProcessing") . '
'; - //} else { - // setEventMessages($langs->trans("NoRecordSelected"), null, 'warnings'); } } diff --git a/htdocs/adherents/canvas/default/tpl/adherentcard_view.tpl.php b/htdocs/adherents/canvas/default/tpl/adherentcard_view.tpl.php index 87190bef2fe..9c6f657d5e0 100644 --- a/htdocs/adherents/canvas/default/tpl/adherentcard_view.tpl.php +++ b/htdocs/adherents/canvas/default/tpl/adherentcard_view.tpl.php @@ -26,17 +26,12 @@ if (empty($conf) || ! is_object($conf)) $contact = $GLOBALS['objcanvas']->control->object; -?> +echo "\n"; +echo $this->control->tpl['showhead']; - -control->tpl['showhead']; ?> - -control->tpl['error'], $this->control->tpl['errors']); -?> - -control->tpl['action_create_user'])) echo $this->control->tpl['action_create_user']; ?> -control->tpl['action_delete'])) echo $this->control->tpl['action_delete']; ?> +if (! empty($this->control->tpl['action_create_user'])) echo $this->control->tpl['action_create_user']; +if (! empty($this->control->tpl['action_delete'])) echo $this->control->tpl['action_delete']; ?> @@ -121,29 +116,28 @@ dol_htmloutput_errors($this->control->tpl['error'], $this->control->tpl['errors'
-control->tpl['showend']; ?> +control->tpl['showend']; -societe_id)) { ?> -
+if (empty($user->societe_id)) { + echo '
'; -rights->adherent->creer) { ?> -">trans('Modify'); ?> - + if ($user->rights->adherent->creer) { + echo ''.$langs->trans('Modify').''; + } -control->tpl['user_id'] && $user->rights->user->user->creer) { ?> -">trans("CreateDolibarrLogin"); ?> - + if (! $this->control->tpl['user_id'] && $user->rights->user->user->creer) { + echo ''.$langs->trans("CreateDolibarrLogin").''; + } -rights->adherent->supprimer) { ?> -">trans('Delete'); ?> - + if ($user->rights->adherent->supprimer) { + echo ''.$langs->trans('Delete').''; + } -

-
'; +} echo $this->control->tpl['actionstodo']; echo $this->control->tpl['actionsdone']; -?> - +echo "\n"; diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index 06053127c9a..0f2cfc52840 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -866,18 +866,18 @@ else $object->country_code=$tmparray['code']; $object->country=$tmparray['label']; } - - if (!empty($socid)) { -$object = new Societe($db); -if ($socid > 0) $object->fetch($socid); -if (! ($object->id > 0)) -{ - $langs->load("errors"); - print($langs->trans('ErrorRecordNotFound')); - exit; -} - } + if (!empty($socid)) { + $object = new Societe($db); + if ($socid > 0) $object->fetch($socid); + + if (! ($object->id > 0)) + { + $langs->load("errors"); + print($langs->trans('ErrorRecordNotFound')); + exit; + } + } $adht = new AdherentType($db); @@ -1679,14 +1679,14 @@ if (! ($object->id > 0)) else { if ($object->need_subscription == 0) - { - print $langs->trans("SubscriptionNotNeeded"); + { + print $langs->trans("SubscriptionNotNeeded"); } - elseif (! $adht->subscription) + elseif (! $adht->subscription) { print $langs->trans("SubscriptionNotRecorded"); if ($object->statut > 0) print " ".img_warning($langs->trans("Late")); // displays delay Pictogram only if not a draft and not terminated - } + } else { print $langs->trans("SubscriptionNotReceived"); diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index e9bd50de0ff..fbc62083b97 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -2471,7 +2471,7 @@ class Adherent extends CommonObject // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore - /** + /** * Initialise tableau info (tableau des attributs LDAP) * * @return array Tableau info des attributs diff --git a/htdocs/adherents/class/adherent_type.class.php b/htdocs/adherents/class/adherent_type.class.php index 94df4b10ba0..b4bdb119b29 100644 --- a/htdocs/adherents/class/adherent_type.class.php +++ b/htdocs/adherents/class/adherent_type.class.php @@ -88,8 +88,8 @@ class AdherentType extends CommonObject /** @var array Array of members */ public $members=array(); - - public $multilangs=array(); + + public $multilangs=array(); /** @@ -129,9 +129,9 @@ class AdherentType extends CommonObject $this->description = $obj->description; $this->email = $obj->email; } - $this->multilangs["$obj->lang"]["label"] = $obj->label; - $this->multilangs["$obj->lang"]["description"] = $obj->description; - $this->multilangs["$obj->lang"]["email"] = $obj->email; + $this->multilangs["$obj->lang"]["label"] = $obj->label; + $this->multilangs["$obj->lang"]["description"] = $obj->description; + $this->multilangs["$obj->lang"]["email"] = $obj->email; } return 1; } @@ -141,7 +141,7 @@ class AdherentType extends CommonObject return -1; } } - + /** * Update or add a translation for a product * @@ -248,7 +248,7 @@ class AdherentType extends CommonObject return 1; } - + /** * Delete a language for this product * @@ -361,7 +361,7 @@ class AdherentType extends CommonObject */ public function update($user, $notrigger = 0) { - global $langs, $conf, $hookmanager; + global $langs, $conf, $hookmanager; $error=0; @@ -383,16 +383,16 @@ class AdherentType extends CommonObject $result = $this->db->query($sql); if ($result) { - $this->description = $this->db->escape($this->note); + $this->description = $this->db->escape($this->note); - // Multilangs - if (! empty($conf->global->MAIN_MULTILANGS)) { - if ($this->setMultiLangs($user) < 0) { - $this->error=$langs->trans("Error")." : ".$this->db->error()." - ".$sql; - return -2; - } + // Multilangs + if (! empty($conf->global->MAIN_MULTILANGS)) { + if ($this->setMultiLangs($user) < 0) { + $this->error=$langs->trans("Error")." : ".$this->db->error()." - ".$sql; + return -2; } - + } + $action='update'; // Actions on extra fields @@ -474,8 +474,8 @@ class AdherentType extends CommonObject */ public function fetch($rowid) { - global $langs, $conf; - + global $langs, $conf; + $sql = "SELECT d.rowid, d.libelle as label, d.morphy, d.statut, d.subscription, d.mail_valid, d.note, d.vote"; $sql .= " FROM ".MAIN_DB_PREFIX."adherent_type as d"; $sql .= " WHERE d.rowid = ".(int) $rowid; @@ -498,11 +498,11 @@ class AdherentType extends CommonObject $this->mail_valid = $obj->mail_valid; $this->note = $obj->note; $this->vote = $obj->vote; - - // multilangs - if (! empty($conf->global->MAIN_MULTILANGS)) { - $this->getMultiLangs(); - } + + // multilangs + if (! empty($conf->global->MAIN_MULTILANGS)) { + $this->getMultiLangs(); + } } return 1; diff --git a/htdocs/adherents/tpl/linkedobjectblock.tpl.php b/htdocs/adherents/tpl/linkedobjectblock.tpl.php index 8e2ec3ba730..accf7de07b6 100644 --- a/htdocs/adherents/tpl/linkedobjectblock.tpl.php +++ b/htdocs/adherents/tpl/linkedobjectblock.tpl.php @@ -24,11 +24,7 @@ if (empty($conf) || ! is_object($conf)) exit; } -?> - - - -\n"; global $user; @@ -39,22 +35,20 @@ $langs->load("members"); $total=0; foreach($linkedObjectBlock as $key => $objectlink) { -?> - - trans("Subscription"); ?> - getNomUrl(1); ?> - - dateh, 'day'); ?> - '; + echo ''.$langs->trans("Subscription").''; + echo ''.$objectlink->getNomUrl(1).''; + echo ''; + echo ''.dol_print_date($objectlink->dateh, 'day').''; + echo ''; if ($user->rights->adherent->lire) { $total = $total + $objectlink->amount; echo price($objectlink->amount); - } ?> - - ">transnoentitiesnoconv("RemoveLink"), 'unlink'); ?> - -'; + echo ''; + echo ''.img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink').''; + echo ''; } -?> - +echo "\n"; diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php index 2848ed4119e..94978e7f8a9 100644 --- a/htdocs/adherents/type.php +++ b/htdocs/adherents/type.php @@ -523,14 +523,14 @@ if ($rowid > 0) { $sql.= natural_search("d.email", $search_email); } - if ($filter == 'uptodate') - { - $sql.=" AND (datefin >= '".$db->idate($now)."') OR t.subscription = 0)"; - } - if ($filter == 'outofdate') - { - $sql.=" AND (datefin < '".$db->idate($now)."' AND t.subscription = 1)"; - } + if ($filter == 'uptodate') + { + $sql.=" AND (datefin >= '".$db->idate($now)."') OR t.subscription = 0)"; + } + if ($filter == 'outofdate') + { + $sql.=" AND (datefin < '".$db->idate($now)."' AND t.subscription = 1)"; + } $sql.= " ".$db->order($sortfield, $sortorder); diff --git a/htdocs/adherents/type_translation.php b/htdocs/adherents/type_translation.php index 5122bebcecf..ac9a269bf29 100644 --- a/htdocs/adherents/type_translation.php +++ b/htdocs/adherents/type_translation.php @@ -295,7 +295,7 @@ if ($action == 'add' && $user->rights->adherent->configurer) print ''; print ''; print ''; print '"; } else diff --git a/htdocs/admin/barcode.php b/htdocs/admin/barcode.php index b6c9a5dec9a..57031a9822f 100644 --- a/htdocs/admin/barcode.php +++ b/htdocs/admin/barcode.php @@ -96,29 +96,29 @@ elseif ($action == 'updateengine') $resql=$db->query($sql); if ($resql) { - $num = $db->num_rows($resql); - $i = 0; + $num = $db->num_rows($resql); + $i = 0; - while ($i < $num) - { - $obj = $db->fetch_object($resql); + while ($i < $num) + { + $obj = $db->fetch_object($resql); - if (GETPOST('coder'.$obj->rowid, 'alpha')) - { - $coder = GETPOST('coder'.$obj->rowid, 'alpha'); - $code_id = $obj->rowid; + if (GETPOST('coder'.$obj->rowid, 'alpha')) + { + $coder = GETPOST('coder'.$obj->rowid, 'alpha'); + $code_id = $obj->rowid; - $sqlp = "UPDATE ".MAIN_DB_PREFIX."c_barcode_type"; - $sqlp.= " SET coder = '" . $coder."'"; - $sqlp.= " WHERE rowid = ". $code_id; - $sqlp.= " AND entity = ".$conf->entity; + $sqlp = "UPDATE ".MAIN_DB_PREFIX."c_barcode_type"; + $sqlp.= " SET coder = '" . $coder."'"; + $sqlp.= " WHERE rowid = ". $code_id; + $sqlp.= " AND entity = ".$conf->entity; - $upsql=$db->query($sqlp); - if (! $upsql) dol_print_error($db); - } + $upsql=$db->query($sqlp); + if (! $upsql) dol_print_error($db); + } - $i++; - } + $i++; + } } } diff --git a/htdocs/admin/bom.php b/htdocs/admin/bom.php index 5bf01de1053..26ea1b12a29 100644 --- a/htdocs/admin/bom.php +++ b/htdocs/admin/bom.php @@ -430,7 +430,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) } print ''; - // Info + // Info $htmltooltip = ''.$langs->trans("Name").': '.$module->name; $htmltooltip.='
'.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown")); if ($module->type == 'pdf') diff --git a/htdocs/admin/commande.php b/htdocs/admin/commande.php index 5bb2dbe79ed..10955b5e8bd 100644 --- a/htdocs/admin/commande.php +++ b/htdocs/admin/commande.php @@ -470,7 +470,7 @@ foreach ($dirmodels as $reldir) } print ''; - // Info + // Info $htmltooltip = ''.$langs->trans("Name").': '.$module->name; $htmltooltip.='
'.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown")); if ($module->type == 'pdf') diff --git a/htdocs/admin/const.php b/htdocs/admin/const.php index 37559c3d4ab..795a38c867d 100644 --- a/htdocs/admin/const.php +++ b/htdocs/admin/const.php @@ -163,7 +163,7 @@ llxHeader('', $langs->trans("Setup"), $wikihelp); // Add logic to show/hide buttons if ($conf->use_javascript_ajax) { -?> + ?> -trans("OtherSetup"), '', 'title_setup'); diff --git a/htdocs/admin/contract.php b/htdocs/admin/contract.php index 0aa97dd36e6..7f123c0f367 100644 --- a/htdocs/admin/contract.php +++ b/htdocs/admin/contract.php @@ -406,7 +406,7 @@ foreach ($dirmodels as $reldir) } print ''; - // Info + // Info $htmltooltip = ''.$langs->trans("Name").': '.$module->name; $htmltooltip.='
'.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown")); if ($module->type == 'pdf') diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 501a6d18113..af61dd1c09f 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -551,27 +551,27 @@ $elementList = array(); $sourceList=array(); if ($id == 11) { - $elementList = array( - '' => '', - 'societe' => $langs->trans('ThirdParty'), -// 'proposal' => $langs->trans('Proposal'), -// 'order' => $langs->trans('Order'), -// 'invoice' => $langs->trans('Bill'), - 'supplier_proposal' => $langs->trans('SupplierProposal'), - 'order_supplier' => $langs->trans('SupplierOrder'), - 'invoice_supplier' => $langs->trans('SupplierBill'), -// 'intervention' => $langs->trans('InterventionCard'), -// 'contract' => $langs->trans('Contract'), - 'project' => $langs->trans('Project'), - 'project_task' => $langs->trans('Task'), - 'agenda' => $langs->trans('Agenda'), - 'dolresource' => $langs->trans('Resource'), - // old deprecated - 'propal' => $langs->trans('Proposal'), - 'commande' => $langs->trans('Order'), - 'facture' => $langs->trans('Bill'), - 'fichinter' => $langs->trans('InterventionCard'), - 'contrat' => $langs->trans('Contract') + $elementList = array( + '' => '', + 'societe' => $langs->trans('ThirdParty'), + // 'proposal' => $langs->trans('Proposal'), + // 'order' => $langs->trans('Order'), + // 'invoice' => $langs->trans('Bill'), + 'supplier_proposal' => $langs->trans('SupplierProposal'), + 'order_supplier' => $langs->trans('SupplierOrder'), + 'invoice_supplier' => $langs->trans('SupplierBill'), + // 'intervention' => $langs->trans('InterventionCard'), + // 'contract' => $langs->trans('Contract'), + 'project' => $langs->trans('Project'), + 'project_task' => $langs->trans('Task'), + 'agenda' => $langs->trans('Agenda'), + 'dolresource' => $langs->trans('Resource'), + // old deprecated + 'propal' => $langs->trans('Proposal'), + 'commande' => $langs->trans('Order'), + 'facture' => $langs->trans('Bill'), + 'fichinter' => $langs->trans('InterventionCard'), + 'contrat' => $langs->trans('Contract'), ); if (! empty($conf->global->MAIN_SUPPORT_SHARED_CONTACT_BETWEEN_THIRDPARTIES)) $elementList["societe"] = $langs->trans('ThirdParty'); @@ -589,13 +589,13 @@ $localtax_typeList = array(); if ($id == 10) { $localtax_typeList = array( - "0" => $langs->trans("No"), - "1" => $langs->trans("Yes").' ('.$langs->trans("Type")." 1)", //$langs->trans("%ageOnAllWithoutVAT"), - "2" => $langs->trans("Yes").' ('.$langs->trans("Type")." 2)", //$langs->trans("%ageOnAllBeforeVAT"), - "3" => $langs->trans("Yes").' ('.$langs->trans("Type")." 3)", //$langs->trans("%ageOnProductsWithoutVAT"), - "4" => $langs->trans("Yes").' ('.$langs->trans("Type")." 4)", //$langs->trans("%ageOnProductsBeforeVAT"), - "5" => $langs->trans("Yes").' ('.$langs->trans("Type")." 5)", //$langs->trans("%ageOnServiceWithoutVAT"), - "6" => $langs->trans("Yes").' ('.$langs->trans("Type")." 6)" //$langs->trans("%ageOnServiceBeforeVAT"), + "0" => $langs->trans("No"), + "1" => $langs->trans("Yes").' ('.$langs->trans("Type")." 1)", //$langs->trans("%ageOnAllWithoutVAT"), + "2" => $langs->trans("Yes").' ('.$langs->trans("Type")." 2)", //$langs->trans("%ageOnAllBeforeVAT"), + "3" => $langs->trans("Yes").' ('.$langs->trans("Type")." 3)", //$langs->trans("%ageOnProductsWithoutVAT"), + "4" => $langs->trans("Yes").' ('.$langs->trans("Type")." 4)", //$langs->trans("%ageOnProductsBeforeVAT"), + "5" => $langs->trans("Yes").' ('.$langs->trans("Type")." 5)", //$langs->trans("%ageOnServiceWithoutVAT"), + "6" => $langs->trans("Yes").' ('.$langs->trans("Type")." 6)" //$langs->trans("%ageOnServiceBeforeVAT"), ); } @@ -636,8 +636,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) && (! in_array($listfield[$f], array('decalage','module','accountancy_code','accountancy_code_sell','accountancy_code_buy','tracking')) // Fields that are not mandatory && (! ($id == 10 && $listfield[$f] == 'code')) // Code is mandatory fir table 10 ) - ) - { + ) { $ok=0; $fieldnamekey=$listfield[$f]; // We take translate key of field @@ -1562,18 +1561,18 @@ if ($id) $class="center"; } elseif ($fieldlist[$field]=='localtax1_type') { - if ($obj->localtax1 != 0) - $valuetoshow=$localtax_typeList[$valuetoshow]; - else - $valuetoshow = ''; - $align="center"; + if ($obj->localtax1 != 0) + $valuetoshow=$localtax_typeList[$valuetoshow]; + else + $valuetoshow = ''; + $align="center"; } elseif ($fieldlist[$field]=='localtax2_type') { - if ($obj->localtax2 != 0) - $valuetoshow=$localtax_typeList[$valuetoshow]; - else - $valuetoshow = ''; - $align="center"; + if ($obj->localtax2 != 0) + $valuetoshow=$localtax_typeList[$valuetoshow]; + else + $valuetoshow = ''; + $align="center"; } elseif ($fieldlist[$field]=='taux') { $valuetoshow = price($valuetoshow, 0, $langs, 0, 0); diff --git a/htdocs/admin/dolistore/class/PSWebServiceLibrary.class.php b/htdocs/admin/dolistore/class/PSWebServiceLibrary.class.php index c6262e84a79..4f1fad15343 100644 --- a/htdocs/admin/dolistore/class/PSWebServiceLibrary.class.php +++ b/htdocs/admin/dolistore/class/PSWebServiceLibrary.class.php @@ -423,17 +423,20 @@ class PrestaShopWebservice */ public function delete($options) { - if (isset($options['url'])) + if (isset($options['url'])) { $url = $options['url']; - elseif (isset($options['resource']) && isset($options['id'])) + } elseif (isset($options['resource']) && isset($options['id'])) { if (is_array($options['id'])) $url = $this->url.'/api/'.$options['resource'].'/?id=['.implode(',', $options['id']).']'; else - $url = $this->url.'/api/'.$options['resource'].'/'.$options['id']; - if (isset($options['id_shop'])) - $url .= '&id_shop='.$options['id_shop']; - if (isset($options['id_group_shop'])) - $url .= '&id_group_shop='.$options['id_group_shop']; + $url = $this->url.'/api/'.$options['resource'].'/'.$options['id']; + } + if (isset($options['id_shop'])) { + $url .= '&id_shop='.$options['id_shop']; + } + if (isset($options['id_group_shop'])) { + $url .= '&id_group_shop='.$options['id_group_shop']; + } $request = self::executeRequest($url, array(CURLOPT_CUSTOMREQUEST => 'DELETE')); self::checkStatusCode($request['status_code']);// check the response validity return true; diff --git a/htdocs/admin/dolistore/class/dolistore.class.php b/htdocs/admin/dolistore/class/dolistore.class.php index e65eb2bbb0a..22029b2c691 100644 --- a/htdocs/admin/dolistore/class/dolistore.class.php +++ b/htdocs/admin/dolistore/class/dolistore.class.php @@ -32,8 +32,8 @@ class Dolistore * beginning of pagination * @var int */ + public $start; - public $start; /** * end of pagination * @var int diff --git a/htdocs/admin/emailcollector_card.php b/htdocs/admin/emailcollector_card.php index 255fdb68a0d..daa0c896809 100644 --- a/htdocs/admin/emailcollector_card.php +++ b/htdocs/admin/emailcollector_card.php @@ -513,7 +513,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $noparam=array(); foreach($arrayoftypes as $key => $value) { - if ($value['noparam']) $noparam[]=$key; + if ($value['noparam']) $noparam[]=$key; } print '})'; print ''."\n"; diff --git a/htdocs/admin/expedition.php b/htdocs/admin/expedition.php index 29ef6d40a1e..7cc2e7dff44 100644 --- a/htdocs/admin/expedition.php +++ b/htdocs/admin/expedition.php @@ -415,7 +415,7 @@ foreach ($dirmodels as $reldir) } print ''; - // Info + // Info $htmltooltip = ''.$langs->trans("Name").': '.$module->name; $htmltooltip.='
'.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown")); if ($module->type == 'pdf') diff --git a/htdocs/admin/external_rss.php b/htdocs/admin/external_rss.php index e3adeaca890..4bb2bf1c964 100644 --- a/htdocs/admin/external_rss.php +++ b/htdocs/admin/external_rss.php @@ -79,7 +79,7 @@ if ($action == 'add' || GETPOST("modify")) if ($_POST["modify"]) { // Supprime boite box_external_rss de definition des boites -/* $sql = "UPDATE ".MAIN_DB_PREFIX."boxes_def"; + /* $sql = "UPDATE ".MAIN_DB_PREFIX."boxes_def"; $sql.= " SET name = '".$boxlabel."'"; $sql.= " WHERE file ='box_external_rss.php' AND note like '".$_POST["norss"]." %'"; @@ -89,7 +89,7 @@ if ($action == 'add' || GETPOST("modify")) dol_print_error($db,"sql=$sql"); exit; } -*/ + */ } else { diff --git a/htdocs/admin/fichinter.php b/htdocs/admin/fichinter.php index f9f051dc272..876f4b90abb 100644 --- a/htdocs/admin/fichinter.php +++ b/htdocs/admin/fichinter.php @@ -207,8 +207,7 @@ elseif ($action == 'set_FICHINTER_PRINT_PRODUCTS') } } elseif ($action == 'set_FICHINTER_USE_SERVICE_DURATION') { $val = GETPOST('FICHINTER_USE_SERVICE_DURATION', 'alpha'); -$res = dolibarr_set_const($db, "FICHINTER_USE_SERVICE_DURATION", ($val == 'on' ? 1 : 0), 'bool', 0, '', - $conf->entity); + $res = dolibarr_set_const($db, "FICHINTER_USE_SERVICE_DURATION", ($val == 'on' ? 1 : 0), 'bool', 0, '', $conf->entity); if (!$res > 0) { $error++; @@ -220,33 +219,31 @@ $res = dolibarr_set_const($db, "FICHINTER_USE_SERVICE_DURATION", ($val == 'on' ? setEventMessages($langs->trans("Error"), null, 'errors'); } } elseif ($action == 'set_FICHINTER_WITHOUT_DURATION') { - $val = GETPOST('FICHINTER_WITHOUT_DURATION', 'alpha'); - $res = dolibarr_set_const($db, "FICHINTER_WITHOUT_DURATION", ($val == 'on' ? 1 : 0), 'bool', 0, '', - $conf->entity); + $val = GETPOST('FICHINTER_WITHOUT_DURATION', 'alpha'); + $res = dolibarr_set_const($db, "FICHINTER_WITHOUT_DURATION", ($val == 'on' ? 1 : 0), 'bool', 0, '', $conf->entity); - if (!$res > 0) { - $error++; - } + if (!$res > 0) { + $error++; + } - if (!$error) { - setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } else { - setEventMessages($langs->trans("Error"), null, 'errors'); - } + if (!$error) { + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); + } else { + setEventMessages($langs->trans("Error"), null, 'errors'); + } } elseif ($action == 'set_FICHINTER_DATE_WITHOUT_HOUR') { - $val = GETPOST('FICHINTER_DATE_WITHOUT_HOUR', 'alpha'); - $res = dolibarr_set_const($db, "FICHINTER_DATE_WITHOUT_HOUR", ($val == 'on' ? 1 : 0), 'bool', 0, '', - $conf->entity); + $val = GETPOST('FICHINTER_DATE_WITHOUT_HOUR', 'alpha'); + $res = dolibarr_set_const($db, "FICHINTER_DATE_WITHOUT_HOUR", ($val == 'on' ? 1 : 0), 'bool', 0, '', $conf->entity); - if (!$res > 0) { - $error++; - } + if (!$res > 0) { + $error++; + } - if (!$error) { - setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } else { - setEventMessages($langs->trans("Error"), null, 'errors'); - } + if (!$error) { + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); + } else { + setEventMessages($langs->trans("Error"), null, 'errors'); + } } diff --git a/htdocs/admin/holiday.php b/htdocs/admin/holiday.php index 58ea3dcdbaa..2d3f986e6a1 100644 --- a/htdocs/admin/holiday.php +++ b/htdocs/admin/holiday.php @@ -300,8 +300,14 @@ print ''; print '
'; -if ($conf->global->MAIN_FEATURES_LEVEL >= 2) -{ +if ($conf->global->MAIN_FEATURES_LEVEL < 2) { + dol_fiche_end(); + // End of page + llxFooter(); + $db->close(); + exit; +} + /* * Documents models for Holidays */ @@ -317,8 +323,8 @@ $sql.= " AND entity = ".$conf->entity; $resql=$db->query($sql); if ($resql) { - $i = 0; - $num_rows=$db->num_rows($resql); + $i = 0; + $num_rows=$db->num_rows($resql); while ($i < $num_rows) { $array = $db->fetch_array($resql); @@ -416,7 +422,7 @@ foreach ($dirmodels as $reldir) } print ''; - // Info + // Info $htmltooltip = ''.$langs->trans("Name").': '.$module->name; $htmltooltip.='
'.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown")); if ($module->type == 'pdf') @@ -518,7 +524,7 @@ print ''; print ''; print ''; -} + dol_fiche_end(); diff --git a/htdocs/admin/ldap_users.php b/htdocs/admin/ldap_users.php index cba9481849d..8d1f7d3279e 100644 --- a/htdocs/admin/ldap_users.php +++ b/htdocs/admin/ldap_users.php @@ -478,7 +478,7 @@ if (function_exists("ldap_connect")) } } else - { + { setEventMessages($ldap->error, $ldap->errors, 'errors'); } diff --git a/htdocs/admin/livraison.php b/htdocs/admin/livraison.php index 99cd481095b..794020cfc95 100644 --- a/htdocs/admin/livraison.php +++ b/htdocs/admin/livraison.php @@ -139,7 +139,7 @@ if ($action == 'set') if ($action == 'del') { - $ret = delDocumentModel($value, $type); + $ret = delDocumentModel($value, $type); if ($ret > 0) { if ($conf->global->LIVRAISON_ADDON_PDF == "$value") dolibarr_del_const($db, 'LIVRAISON_ADDON_PDF', $conf->entity); diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php index 0dbdf90b53b..7ac91d51c8d 100644 --- a/htdocs/admin/mails_templates.php +++ b/htdocs/admin/mails_templates.php @@ -45,11 +45,11 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php'; // Load translation files required by the page $langs->loadLangs(array("errors","admin","mails","languages")); -$action = GETPOST('action', 'alpha')?GETPOST('action', 'alpha'):'view'; -$confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation +$action = GETPOST('action', 'alpha')?GETPOST('action', 'alpha'):'view'; +$confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation -$id = GETPOST('id', 'int'); -$rowid = GETPOST('rowid', 'alpha'); +$id = GETPOST('id', 'int'); +$rowid = GETPOST('rowid', 'alpha'); $search_label=GETPOST('search_label', 'alphanohtml'); // Must allow value like 'Abc Def' or '(MyTemplateName)' $search_type_template=GETPOST('search_type_template', 'alpha'); $search_lang=GETPOST('search_lang', 'alpha'); @@ -327,7 +327,7 @@ if (empty($reshook)) $i++; } $sql.= " WHERE ".$rowidcol." = '".$rowid."'"; -//print $sql;exit; + //print $sql;exit; dol_syslog("actionmodify", LOG_DEBUG); //print $sql; $resql = $db->query($sql); diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index 88ad0acf097..8bdfb978219 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -923,19 +923,17 @@ if ($mode == 'marketplace')  
- -
- + '; + print ''; - '; - print '
'; + print ''; + print '
'; - ?> + ?>
    diff --git a/htdocs/admin/propal.php b/htdocs/admin/propal.php index db9efb0e5c7..a0f817a40c1 100644 --- a/htdocs/admin/propal.php +++ b/htdocs/admin/propal.php @@ -467,7 +467,7 @@ foreach ($dirmodels as $reldir) } print ''; - // Info + // Info $htmltooltip = $langs->trans("Name").': '.$module->name; $htmltooltip.='
    '.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown")); if ($module->type == 'pdf') diff --git a/htdocs/admin/reception_setup.php b/htdocs/admin/reception_setup.php index 07d448c5d11..27564d6b4e0 100644 --- a/htdocs/admin/reception_setup.php +++ b/htdocs/admin/reception_setup.php @@ -420,7 +420,7 @@ foreach ($dirmodels as $reldir) } print ''; - // Info + // Info $htmltooltip = ''.$langs->trans("Name").': '.$module->name; $htmltooltip.='
    '.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown")); if ($module->type == 'pdf') diff --git a/htdocs/admin/sms.php b/htdocs/admin/sms.php index 833d6c25d22..1f37a36ec4f 100644 --- a/htdocs/admin/sms.php +++ b/htdocs/admin/sms.php @@ -262,11 +262,11 @@ else if (count($listofmethods) && ! empty($conf->global->MAIN_SMS_SENDMODE)) { - print ''.$langs->trans("DoTestSend").''; + print ''.$langs->trans("DoTestSend").''; } else { - print ''.$langs->trans("DoTestSend").''; + print ''.$langs->trans("DoTestSend").''; } print '
'; diff --git a/htdocs/admin/stock.php b/htdocs/admin/stock.php index 42daea12861..51bf959bb72 100644 --- a/htdocs/admin/stock.php +++ b/htdocs/admin/stock.php @@ -113,12 +113,12 @@ print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; - print '\n\n"; $found++; -print ''; + print ''; print ''; - print '\n\n"; $found++; } @@ -284,15 +284,15 @@ else { print ''; print ''; - print ''; print ''; - print '\n"; - print "\n"; + print '\n"; + print "\n"; } if($conf->order->enabled) { print ''; print ''; - print '\n"; print "\n"; } @@ -368,13 +368,13 @@ if($conf->expedition->enabled) { print ''; print ''; - print '\n"; print "\n"; } @@ -383,27 +383,30 @@ print '
'.$langs->trans('Language').''; - print $formadmin->select_language('', 'forcelangprod', 0, $object->multilangs, 1); + print $formadmin->select_language('', 'forcelangprod', 0, $object->multilangs, 1); print '
'.$langs->trans('Label').'
'.$langs->trans('Description').''; diff --git a/htdocs/admin/agenda_other.php b/htdocs/admin/agenda_other.php index 3caa3418af5..beccc9e9d5a 100644 --- a/htdocs/admin/agenda_other.php +++ b/htdocs/admin/agenda_other.php @@ -268,17 +268,17 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) // Active if (in_array($name, $def)) { - print ''."\n"; - if ($conf->global->ACTION_EVENT_ADDON_PDF != "$name") - { - print 'scandir.'&label='.urlencode($module->name).'&type=action">'; - print img_picto($langs->trans("Enabled"), 'switch_on'); - print ''; - } - else - { - print img_picto($langs->trans("Enabled"), 'switch_on'); - } + print ''."\n"; + if ($conf->global->ACTION_EVENT_ADDON_PDF != "$name") + { + print 'scandir.'&label='.urlencode($module->name).'&type=action">'; + print img_picto($langs->trans("Enabled"), 'switch_on'); + print ''; + } + else + { + print img_picto($langs->trans("Enabled"), 'switch_on'); + } print " '.$langs->trans("DeStockOnBill").''; if (! empty($conf->facture->enabled)) { -if ($conf->use_javascript_ajax) { - print ajax_constantonoff('STOCK_CALCULATE_ON_BILL'); -} else { - $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); - print $form->selectarray("STOCK_CALCULATE_ON_BILL", $arrval, $conf->global->STOCK_CALCULATE_ON_BILL); -} + if ($conf->use_javascript_ajax) { + print ajax_constantonoff('STOCK_CALCULATE_ON_BILL'); + } else { + $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); + print $form->selectarray("STOCK_CALCULATE_ON_BILL", $arrval, $conf->global->STOCK_CALCULATE_ON_BILL); + } } else { @@ -133,12 +133,12 @@ print ''.$langs->trans("DeStockOnValidateOrder").''; if (! empty($conf->commande->enabled)) { -if ($conf->use_javascript_ajax) { - print ajax_constantonoff('STOCK_CALCULATE_ON_VALIDATE_ORDER'); -} else { - $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); - print $form->selectarray("STOCK_CALCULATE_ON_VALIDATE_ORDER", $arrval, $conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER); -} + if ($conf->use_javascript_ajax) { + print ajax_constantonoff('STOCK_CALCULATE_ON_VALIDATE_ORDER'); + } else { + $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); + print $form->selectarray("STOCK_CALCULATE_ON_VALIDATE_ORDER", $arrval, $conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER); + } } else { @@ -155,12 +155,12 @@ print ''.$langs->trans("DeStockOnShipment").''; if (! empty($conf->expedition->enabled)) { -if ($conf->use_javascript_ajax) { - print ajax_constantonoff('STOCK_CALCULATE_ON_SHIPMENT'); -} else { - $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); - print $form->selectarray("STOCK_CALCULATE_ON_SHIPMENT", $arrval, $conf->global->STOCK_CALCULATE_ON_SHIPMENT); -} + if ($conf->use_javascript_ajax) { + print ajax_constantonoff('STOCK_CALCULATE_ON_SHIPMENT'); + } else { + $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); + print $form->selectarray("STOCK_CALCULATE_ON_SHIPMENT", $arrval, $conf->global->STOCK_CALCULATE_ON_SHIPMENT); + } } else { @@ -175,12 +175,12 @@ print ''.$langs->trans("DeStockOnShipmentOnClosing").''; if (! empty($conf->expedition->enabled)) { -if ($conf->use_javascript_ajax) { - print ajax_constantonoff('STOCK_CALCULATE_ON_SHIPMENT_CLOSE'); -} else { - $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); - print $form->selectarray("STOCK_CALCULATE_ON_SHIPMENT_CLOSE", $arrval, $conf->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE); -} + if ($conf->use_javascript_ajax) { + print ajax_constantonoff('STOCK_CALCULATE_ON_SHIPMENT_CLOSE'); + } else { + $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); + print $form->selectarray("STOCK_CALCULATE_ON_SHIPMENT_CLOSE", $arrval, $conf->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE); + } } else { @@ -215,12 +215,12 @@ print ''.$langs->trans("ReStockOnBill").''; if (! empty($conf->fournisseur->enabled)) { -if ($conf->use_javascript_ajax) { - print ajax_constantonoff('STOCK_CALCULATE_ON_SUPPLIER_BILL'); -} else { - $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); - print $form->selectarray("STOCK_CALCULATE_ON_SUPPLIER_BILL", $arrval, $conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL); -} + if ($conf->use_javascript_ajax) { + print ajax_constantonoff('STOCK_CALCULATE_ON_SUPPLIER_BILL'); + } else { + $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); + print $form->selectarray("STOCK_CALCULATE_ON_SUPPLIER_BILL", $arrval, $conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL); + } } else { @@ -236,12 +236,12 @@ print ''.$langs->trans("ReStockOnValidateOrder").''; if (! empty($conf->fournisseur->enabled)) { -if ($conf->use_javascript_ajax) { - print ajax_constantonoff('STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER'); -} else { - $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); - print $form->selectarray("STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER", $arrval, $conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER); -} + if ($conf->use_javascript_ajax) { + print ajax_constantonoff('STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER'); + } else { + $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); + print $form->selectarray("STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER", $arrval, $conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER); + } } else { @@ -254,29 +254,29 @@ if (!empty($conf->reception->enabled)) { print '
'.$langs->trans("StockOnReception").''; + print ''; -if ($conf->use_javascript_ajax) { - print ajax_constantonoff('STOCK_CALCULATE_ON_RECEPTION'); -} else { - $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); - print $form->selectarray("STOCK_CALCULATE_ON_RECEPTION", $arrval, $conf->global->STOCK_CALCULATE_ON_RECEPTION); -} + if ($conf->use_javascript_ajax) { + print ajax_constantonoff('STOCK_CALCULATE_ON_RECEPTION'); + } else { + $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); + print $form->selectarray("STOCK_CALCULATE_ON_RECEPTION", $arrval, $conf->global->STOCK_CALCULATE_ON_RECEPTION); + } print "
'.$langs->trans("StockOnReceptionOnClosing").''; + print ''; -if ($conf->use_javascript_ajax) { - print ajax_constantonoff('STOCK_CALCULATE_ON_RECEPTION_CLOSE'); -} else { - $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); - print $form->selectarray("STOCK_CALCULATE_ON_RECEPTION_CLOSE", $arrval, $conf->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE); -} + if ($conf->use_javascript_ajax) { + print ajax_constantonoff('STOCK_CALCULATE_ON_RECEPTION_CLOSE'); + } else { + $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); + print $form->selectarray("STOCK_CALCULATE_ON_RECEPTION_CLOSE", $arrval, $conf->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE); + } print "
'.$langs->trans("ReStockOnDispatchOrder").''; + print ''; if (! empty($conf->fournisseur->enabled)) { -if ($conf->use_javascript_ajax) { - print ajax_constantonoff('STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER'); -} else { - $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); - print $form->selectarray("STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER", $arrval, $conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER); -} + if ($conf->use_javascript_ajax) { + print ajax_constantonoff('STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER'); + } else { + $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); + print $form->selectarray("STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER", $arrval, $conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER); + } } else { @@ -338,28 +338,28 @@ if($conf->invoice->enabled) { print '
'.$langs->trans("StockMustBeEnoughForInvoice").''; -if ($conf->use_javascript_ajax) { - print ajax_constantonoff('STOCK_MUST_BE_ENOUGH_FOR_INVOICE'); -} else { - $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); - print $form->selectarray("STOCK_MUST_BE_ENOUGH_FOR_INVOICE", $arrval, $conf->global->STOCK_MUST_BE_ENOUGH_FOR_INVOICE); -} - print "
'; + if ($conf->use_javascript_ajax) { + print ajax_constantonoff('STOCK_MUST_BE_ENOUGH_FOR_INVOICE'); + } else { + $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); + print $form->selectarray("STOCK_MUST_BE_ENOUGH_FOR_INVOICE", $arrval, $conf->global->STOCK_MUST_BE_ENOUGH_FOR_INVOICE); + } + print "
'.$langs->trans("StockMustBeEnoughForOrder").''; -if ($conf->use_javascript_ajax) { - print ajax_constantonoff('STOCK_MUST_BE_ENOUGH_FOR_ORDER'); -} else { - $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); - print $form->selectarray("STOCK_MUST_BE_ENOUGH_FOR_ORDER", $arrval, $conf->global->STOCK_MUST_BE_ENOUGH_FOR_ORDER); -} + print ''; + if ($conf->use_javascript_ajax) { + print ajax_constantonoff('STOCK_MUST_BE_ENOUGH_FOR_ORDER'); + } else { + $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); + print $form->selectarray("STOCK_MUST_BE_ENOUGH_FOR_ORDER", $arrval, $conf->global->STOCK_MUST_BE_ENOUGH_FOR_ORDER); + } print "
'.$langs->trans("StockMustBeEnoughForShipment").''; -if ($conf->use_javascript_ajax) { - print ajax_constantonoff('STOCK_MUST_BE_ENOUGH_FOR_SHIPMENT'); -} else { - $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); - print $form->selectarray("STOCK_MUST_BE_ENOUGH_FOR_SHIPMENT", $arrval, $conf->global->STOCK_MUST_BE_ENOUGH_FOR_SHIPMENT); -} + print ''; + if ($conf->use_javascript_ajax) { + print ajax_constantonoff('STOCK_MUST_BE_ENOUGH_FOR_SHIPMENT'); + } else { + $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); + print $form->selectarray("STOCK_MUST_BE_ENOUGH_FOR_SHIPMENT", $arrval, $conf->global->STOCK_MUST_BE_ENOUGH_FOR_SHIPMENT); + } print "
'; print '
'; $virtualdiffersfromphysical=0; -if (! empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT) - || ! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER) - ) $virtualdiffersfromphysical=1; // According to increase/decrease stock options, virtual and physical stock may differs. +if ( + ! empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT) + || ! empty($conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER) +) { + $virtualdiffersfromphysical=1; // According to increase/decrease stock options, virtual and physical stock may differs. +} if ($virtualdiffersfromphysical) { -print ''; -print ''; + print '
'; + print ''; print "\n"; - print ''."\n"; + print ''."\n"; print ''."\n"; print ''; print ''; - print '\n"; print "\n"; print '
".$langs->trans("RuleForStockReplenishment")." ".img_help('help', $langs->trans("VirtualDiffersFromPhysical"))."'.$langs->trans("Status").''.$langs->trans("Status").'
'.$langs->trans("UseVirtualStockByDefault").''; -if ($conf->use_javascript_ajax) { - print ajax_constantonoff('STOCK_USE_VIRTUAL_STOCK'); -} else { - $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); - print $form->selectarray("STOCK_USE_VIRTUAL_STOCK", $arrval, $conf->global->STOCK_USE_VIRTUAL_STOCK); -} + print ''; + if ($conf->use_javascript_ajax) { + print ajax_constantonoff('STOCK_USE_VIRTUAL_STOCK'); + } else { + $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); + print $form->selectarray("STOCK_USE_VIRTUAL_STOCK", $arrval, $conf->global->STOCK_USE_VIRTUAL_STOCK); + } print "
'; @@ -504,7 +507,6 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) print $form->selectarray("INVENTORY_USE_INVENTORY_DATE_FOR_DATE_OF_MVT", $arrval, $conf->global->INVENTORY_USE_INVENTORY_DATE_FOR_DATE_OF_MVT); } print ''; - print ''; } @@ -512,8 +514,6 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) If not used by a module, I still need to understand in which case user may need this now we can set rule on product page. if ($conf->global->PRODUIT_SOUSPRODUITS) { - - print ''; print ''.$langs->trans("IndependantSubProductStock").''; print ''; diff --git a/htdocs/admin/supplier_order.php b/htdocs/admin/supplier_order.php index 6369efb1361..c2a7a5d4077 100644 --- a/htdocs/admin/supplier_order.php +++ b/htdocs/admin/supplier_order.php @@ -413,8 +413,8 @@ foreach ($dirmodels as $reldir) print "\n"; require_once $dir.$file; $module = new $classname($db, $specimenthirdparty); - if (method_exists($module, 'info')) print $module->info($langs); - else print $module->description; + if (method_exists($module, 'info')) print $module->info($langs); + else print $module->description; print "\n"; // Active diff --git a/htdocs/admin/supplier_proposal.php b/htdocs/admin/supplier_proposal.php index bd2cb10a3ad..30a85f2af3b 100644 --- a/htdocs/admin/supplier_proposal.php +++ b/htdocs/admin/supplier_proposal.php @@ -433,7 +433,7 @@ foreach ($dirmodels as $reldir) } print ''; - // Info + // Info $htmltooltip = ''.$langs->trans("Name").': '.$module->name; $htmltooltip.='
'.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown")); if ($module->type == 'pdf') diff --git a/htdocs/admin/system/database-tables.php b/htdocs/admin/system/database-tables.php index 01836dd4a72..01fc5ff5fc1 100644 --- a/htdocs/admin/system/database-tables.php +++ b/htdocs/admin/system/database-tables.php @@ -189,8 +189,8 @@ else if ($base == 4) { // Sqlite by PDO or by Sqlite3 - print '
'; - print ''; + print '
'; + print '
'; print ''; print ''; print ''; diff --git a/htdocs/admin/system/index.php b/htdocs/admin/system/index.php index d08eb564f17..928b193b1ee 100644 --- a/htdocs/admin/system/index.php +++ b/htdocs/admin/system/index.php @@ -94,10 +94,10 @@ if ($db->type == 'pgsql') { // Check option standard_conforming_strings is on $paramarray=$db->getServerParametersValues('standard_conforming_strings'); -// if ($paramarray['standard_conforming_strings'] != 'on' && $paramarray['standard_conforming_strings'] != 1) -// { -// $langs->load("errors"); -// } + // if ($paramarray['standard_conforming_strings'] != 'on' && $paramarray['standard_conforming_strings'] != 1) + // { + // $langs->load("errors"); + // } } print '
'; diff --git a/htdocs/admin/tools/dolibarr_export.php b/htdocs/admin/tools/dolibarr_export.php index 109b2a748fb..f1759ec6c06 100644 --- a/htdocs/admin/tools/dolibarr_export.php +++ b/htdocs/admin/tools/dolibarr_export.php @@ -111,13 +111,15 @@ jQuery(document).ready(function() { } }); - -}); -\n"; print load_fiche_titre($langs->trans("Backup"), '', 'title_setup'); //print_barre_liste($langs->trans("Backup"), '', '', '', '', '', $langs->trans("BackupDesc",DOL_DATA_ROOT), 0, 0, 'title_setup'); @@ -127,24 +129,17 @@ print $langs->trans("BackupDesc", DOL_DATA_ROOT); print ''; print '
'; -?> +print "\n"; +print ''; +print ''; +print ''; +print '
1'; - - - -
1 - -trans("BackupDesc3", $dolibarr_main_db_name).'
'; //print $langs->trans("BackupDescY").'
'; print '
'; -?> -
- -'; print load_fiche_titre($title?$title:$langs->trans("BackupDumpWizard")); @@ -155,275 +150,296 @@ print $langs->trans("DatabaseName").' : '.$dolibarr_main_db_name.'
'; print ''; print '
'; print ''; print '
'.$langs->trans("TableName").''.$langs->trans("NbOfRecord").'
'; -?> - - - - -
+print ''; +print ''; +print ' - '; +print ''; +print ''; +print '
'; -
-
trans("ExportMethod"); ?> - -
- -
-
-
- -
- -
- -
- -
-
+print '
'; +print '
'.$langs->trans("ExportMethod").''; +if (in_array($type, array('mysql', 'mysqli'))) { + print '
'; + print ''; + print '
'; + print '
'; + print '
'; + print ''; + print '
'; +} elseif (in_array($type, array('pgsql'))) { + print '
'; + print ''; + print '
'; +} else { + print 'No method available with database '.$label; +} +print '
'; +print '
'; -
+print ''; -
- -
trans("MySqlExportParameters"); ?> +print '
'; +if (in_array($type, array('mysql', 'mysqli'))) { + print "\n"; + print '
'.$langs->trans("MySqlExportParameters").''; -
trans("FullPathToMysqldumpCommand"); - if (empty($conf->global->SYSTEMTOOLS_MYSQLDUMP)) - { - $fullpathofmysqldump=$db->getPathOfDump(); - } - else - { - $fullpathofmysqldump=$conf->global->SYSTEMTOOLS_MYSQLDUMP; - } - ?>
-
+ print '
'.$langs->trans("FullPathToMysqldumpCommand"); + if (empty($conf->global->SYSTEMTOOLS_MYSQLDUMP)) + { + $fullpathofmysqldump=$db->getPathOfDump(); + } + else + { + $fullpathofmysqldump=$conf->global->SYSTEMTOOLS_MYSQLDUMP; + } + print '
'; + print '
'; -
-
trans("ExportOptions"); ?> -
+ print '
'; + print '
'.$langs->trans("ExportOptions").''; + print '
'; + print ''; + print ''; -
+ print '
'; - global->MYSQL_OLD_OPTION_DISABLE_FK)) { ?> -
-
- + if (! empty($conf->global->MYSQL_OLD_OPTION_DISABLE_FK)) { + print '
'; + print ''; + print ''; + print '
'; + } - + print ''; -
- -
+ print ''; + print '
'; + print ''; + print '
'; -
-
id="checkbox_dump_drop" />
-
+ print '
'; + print '
'; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print '
'; + print '
'; -
-

+ print '
'; + print '
'; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print '
'; -
+ print ''; + print ''; + print '
'; -
+ print ''; + print ''; + print '
'; -
+ print ''; + print ''; + print '
'; -
+ print ''; + print ''; + print '
'; -
+ print ''; + print ''; + print '
'; -
+ print ''; + print ''; + print '
'; -
-
+ print '
'; + print ''; + print "\n"; + print '
'; + print ''.$langs->trans("MySqlExportParameters").''; + print '
'; + print ''.$langs->trans("ExportOptions").''; + print '
'; + print ''; + print ''; - -
trans("MySqlExportParameters"); ?> -
- trans("ExportOptions"); ?> -
+ print '
'; + if (! empty($conf->global->MYSQL_OLD_OPTION_DISABLE_FK)) { + print '
'; + print ''; + print ''; + print '
'; + } + print '
'; -
- global->MYSQL_OLD_OPTION_DISABLE_FK)) { ?> -
-
- -
+ print '
'; + print '
'.$langs->trans('ExportStructure').''; + print ''; + print ''; + print '
'; + print '
'; -
-
trans('ExportStructure') ?> id="checkbox_dump_drop" />
-
+ print '
'; + print '
'; + print ''.$langs->trans("Datas").''; -
-
- trans("Datas"); ?> + print ''; + print ''; + print '
'; -
+ print ''; + print ''; + print '
'; -
+ print ''; + print ''; + print '
'; -
+ print ''; + print ''; + print '
'; -
+ print '
'; + print '
'; +} -
- +if (in_array($type, array('pgsql'))) { + print "\n"; + print '
'.$langs->trans("PostgreSqlExportParameters").''; - '.$langs->trans("FullPathToPostgreSQLdumpCommand"); + if (empty($conf->global->SYSTEMTOOLS_POSTGRESQLDUMP)) { + $fullpathofpgdump=$db->getPathOfDump(); + } + else + { + $fullpathofpgdump=$conf->global->SYSTEMTOOLS_POSTGRESQLDUMP; + } + print '
'; + print '
'; - if (in_array($type, array('pgsql'))) - { - ?> -
trans("PostgreSqlExportParameters"); ?> + print '
'; + print '
'; + print ''.$langs->trans("ExportOptions").''; + print ''; + print ''; + print '
'; + print ''; + print '
'; + print '
'; + print '
'; + print ''; + print ''; + print ''; + print ''; + print '
'; + print '
'; + print '
'; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print '
'; + print '
'; + print '
'; +} +print ''; -
trans("FullPathToPostgreSQLdumpCommand"); - if (empty($conf->global->SYSTEMTOOLS_POSTGRESQLDUMP)) - { - $fullpathofpgdump=$db->getPathOfDump(); - } - else - { - $fullpathofpgdump=$conf->global->SYSTEMTOOLS_POSTGRESQLDUMP; - } - ?>
-
+print '
'; -
-
trans("ExportOptions"); ?> - -
- -
- -
-
- -
-

- -
- - - - -
- - - -
-
- -->'; +print '
'; +print ''; +print '
'; $prefix='dump'; $ext='.sql'; -if (in_array($type, array('mysql', 'mysqli'))) { $prefix='mysqldump'; $ext='sql'; } -//if ($label == 'PostgreSQL') { $prefix='pg_dump'; $ext='dump'; } -if (in_array($type, array('pgsql'))) { $prefix='pg_dump'; $ext='sql'; } +if (in_array($type, array('mysql', 'mysqli'))) { + $prefix='mysqldump'; + $ext='sql'; +} +//if ($label == 'PostgreSQL') { +// $prefix='pg_dump'; +// $ext='dump'; +//} +if (in_array($type, array('pgsql'))) { + $prefix='pg_dump'; + $ext='sql'; +} $file=$prefix.'_'.$dolibarr_main_db_name.'_'.dol_sanitizeFileName(DOL_VERSION).'_'.strftime("%Y%m%d%H%M").'.'.$ext; -echo $file; -?>" />
-
- -'; +print '
'; +print '
'; // Define compressions array $compression=array(); -if (in_array($type, array('mysql', 'mysqli'))) -{ - $compression['none'] = array('function' => '', 'id' => 'radio_compression_none', 'label' => $langs->trans("None")); - $compression['gz'] = array('function' => 'gzopen', 'id' => 'radio_compression_gzip', 'label' => $langs->trans("Gzip")); - // $compression['zip']= array('function' => 'dol_compress', 'id' => 'radio_compression_zip', 'label' => $langs->trans("FormatZip")); // Not open source format. Must implement dol_compress function - $compression['bz'] = array('function' => 'bzopen', 'id' => 'radio_compression_bzip', 'label' => $langs->trans("Bzip2")); +if (in_array($type, array('mysql', 'mysqli'))) { + $compression['none'] = array( + 'function' => '', + 'id' => 'radio_compression_none', + 'label' => $langs->trans("None") + ); + $compression['gz'] = array( + 'function' => 'gzopen', + 'id' => 'radio_compression_gzip', + 'label' => $langs->trans("Gzip") + ); + // Not open source format. Must implement dol_compress function + // $compression['zip']= array( + // 'function' => 'dol_compress', + // 'id' => 'radio_compression_zip', + // 'label' => $langs->trans("FormatZip") + // ); + $compression['bz'] = array( + 'function' => 'bzopen', + 'id' => 'radio_compression_bzip', + 'label' => $langs->trans("Bzip2") + ); } else { - $compression['none'] = array('function' => '', 'id' => 'radio_compression_none', 'label' => $langs->trans("Default")); - $compression['gz'] = array('function' => 'gzopen', 'id' => 'radio_compression_gzip', 'label' => $langs->trans("Gzip")); + $compression['none'] = array( + 'function' => '', + 'id' => 'radio_compression_none', + 'label' => $langs->trans("Default") + ); + $compression['gz'] = array( + 'function' => 'gzopen', + 'id' => 'radio_compression_gzip', + 'label' => $langs->trans("Gzip") + ); } // Show compression choices @@ -434,13 +450,14 @@ print $langs->trans("Compression").':   '; foreach($compression as $key => $val) { - if (! $val['function'] || function_exists($val['function'])) // Enabled export format - { + if (! $val['function'] || function_exists($val['function'])) { + // Enabled export format print ''; print ' '; } - else // Disabled export format + else { + // Disabled export format print ''; print ' '; print ' ('.$langs->trans("NotAvailable").')'; @@ -451,20 +468,18 @@ foreach($compression as $key => $val) print ''; print "\n"; -?> +print " \n"; +print '
'; +print '
'; +print ''; +print ''; +print '
'; +print '
'; -
-
- " id="buttonGo"> - -
-
- -'.$langs->trans("RunCommandSummary").':
'."\n"; + print '
'.$langs->trans("RunCommandSummary").':
'."\n"; print '
'."\n"; print '
'; @@ -491,71 +506,51 @@ if (! empty($_SESSION["commandbackuptorun"])) $_SESSION["commandbackuptorun"]=''; $_SESSION["commandbackupresult"]=''; } -?> -
+print "
\n"; -
'; - -?> - -
+print "
\n"; -
-
+print '
'; +print '
'; -admin->dir_output.'/backup', 'files', 0, '', '', $sortfield, (strtolower($sortorder)=='asc'?SORT_ASC:SORT_DESC), 1); $result=$formfile->list_of_documents($filearray, null, 'systemtools', '', 1, 'backup/', 1, 0, $langs->trans("NoBackupFileAvailable"), 0, $langs->trans("PreviousDumpFiles")); print '
'; -?> +print '
'; +print '
'; +print ''; +print ''; -
-
- - +print "
\n"; +print "\n"; -
- +print '
'; +print ''; +print ''; - - - +print '
2'; -
2 - -trans("BackupDesc2", DOL_DATA_ROOT).'
'; print $langs->trans("BackupDescX").'

'; -?> - -
- -'; print load_fiche_titre($title?$title:$langs->trans("BackupDumpWizard")); -?> -
-'.$langs->trans("FileNameToGenerate").'
'; $prefix='documents'; $ext='zip'; - $file=$prefix.'_'.$dolibarr_main_db_name.'_'.dol_sanitizeFileName(DOL_VERSION).'_'.strftime("%Y%m%d%H%M").'.'.$ext; -echo $file; -?>" />
-
+print '
'; +print '
'; -'; print "\n"; @@ -584,32 +579,26 @@ foreach($filecompression as $key => $val) print '
'; print "\n"; -?> -
-
" id="buttonGo" />
-
-
+print '
'; +print '
'; +print '
'; +print '
'; +print '
'; - +print ''; -
-
+print '
'; +print '
'; -admin->dir_output.'/documents', 'files', 0, '', '', $sortfield, (strtolower($sortorder)=='asc'?SORT_ASC:SORT_DESC), 1); $result=$formfile->list_of_documents($filearray, null, 'systemtools', '', 1, 'documents/', 1, 0, $langs->trans("NoBackupFileAvailable"), 0, $langs->trans("PreviousDumpFiles")); print '
'; -?> +print '
'; +print '
'; -
-
- -
- - -'; +print ''; // End of page llxFooter(); diff --git a/htdocs/admin/tools/dolibarr_import.php b/htdocs/admin/tools/dolibarr_import.php index a5d52eb2929..c6c31fe7f45 100644 --- a/htdocs/admin/tools/dolibarr_import.php +++ b/htdocs/admin/tools/dolibarr_import.php @@ -99,21 +99,21 @@ print $langs->trans("RestoreDesc3", $dolibarr_main_db_name).'

'; + ?>
/>
- + ?>
/>
- trans("RestoreDesc3", $dolibarr_main_db_name).'

'; -
- trans('RestoreMySQL') ?> -
- '; + print ''.$langs->trans('RestoreMySQL').''; + print '
'; // Parameteres execution $command=$db->getPathOfRestore(); if (preg_match("/\s/", $command)) $command=$command=escapeshellarg($command); // Use quotes on command @@ -157,20 +155,18 @@ if (in_array($type, array('mysql', 'mysqli'))) print '
'; print ajax_autoselect('restorecommand'); - if (empty($_GET["showpass"]) && $dolibarr_main_db_pass) print '
'.$langs->trans("UnHidePassword").''; - //else print '
'.$langs->trans("HidePassword").''; - ?> -
-
-'.$langs->trans("UnHidePassword").''; + } + //else print '
'.$langs->trans("HidePassword").''; + print ''; + print '
'; } elseif (in_array($type, array('pgsql'))) { -?> -
- Restore PostgreSQL -
- '; + print 'Restore PostgreSQL'; + print '
'; // Parameteres execution $command=$db->getPathOfRestore(); if (preg_match("/\s/", $command)) $command=$command=escapeshellarg($command); // Use quotes on command @@ -198,20 +194,16 @@ elseif (in_array($type, array('pgsql'))) print ajax_autoselect('restorecommand'); //if (empty($_GET["showpass"]) && $dolibarr_main_db_pass) print '
'.$langs->trans("UnHidePassword").''; //else print '
'.$langs->trans("HidePassword").''; - ?> -
-
-'; + print ''; } -?> - +print ''; - - +print ''; +print ''; -close(); diff --git a/htdocs/admin/tools/listsessions.php b/htdocs/admin/tools/listsessions.php index 7db64a8a3ed..1fedf9e40de 100644 --- a/htdocs/admin/tools/listsessions.php +++ b/htdocs/admin/tools/listsessions.php @@ -37,8 +37,8 @@ $confirm=GETPOST('confirm', 'alpha'); // Security check if ($user->societe_id > 0) { - $action = ''; - $socid = $user->societe_id; + $action = ''; + $socid = $user->societe_id; } $sortfield = GETPOST("sortfield", 'alpha'); diff --git a/htdocs/admin/tools/purge.php b/htdocs/admin/tools/purge.php index 3c99e3e10b8..f991bb5752e 100644 --- a/htdocs/admin/tools/purge.php +++ b/htdocs/admin/tools/purge.php @@ -97,9 +97,9 @@ if (! empty($conf->syslog->enabled)) $filelogparam=$filelog; if ($user->admin && preg_match('/^dolibarr.*\.log$/', basename($filelog))) { - $filelogparam =''.$filelog.''; + $filelogparam =''.$filelog.''; } print '> '.$langs->trans("PurgeDeleteLogFile", $filelogparam); print '

'; diff --git a/htdocs/admin/user.php b/htdocs/admin/user.php index ba6c3660bcd..1b4c59505db 100644 --- a/htdocs/admin/user.php +++ b/htdocs/admin/user.php @@ -288,9 +288,9 @@ foreach ($dirmodels as $reldir) } print ''; - // Info - $htmltooltip = ''.$langs->trans("Name").': '.$module->name; - $htmltooltip.='
'.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown")); + // Info + $htmltooltip = ''.$langs->trans("Name").': '.$module->name; + $htmltooltip.= '
'.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown")); if ($module->type == 'pdf') { $htmltooltip.='
'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur; diff --git a/htdocs/admin/usergroup.php b/htdocs/admin/usergroup.php index 190391b462b..bd8ae3d5e92 100644 --- a/htdocs/admin/usergroup.php +++ b/htdocs/admin/usergroup.php @@ -235,7 +235,7 @@ foreach ($dirmodels as $reldir) } print ''; - // Info + // Info $htmltooltip = ''.$langs->trans("Name").': '.$module->name; $htmltooltip.='
'.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown")); if ($module->type == 'pdf') diff --git a/htdocs/core/class/html.formcron.class.php b/htdocs/core/class/html.formcron.class.php index 42fec36ef6a..0277630ae78 100644 --- a/htdocs/core/class/html.formcron.class.php +++ b/htdocs/core/class/html.formcron.class.php @@ -77,23 +77,23 @@ class FormCron extends Form $out.=''; } } else { - $out=''; - if ($selected=='command') { - $selected_attr=' selected '; - } else { - $selected_attr=''; - } - $out.= ''; + if ($selected=='command') { + $selected_attr=' selected '; + } else { + $selected_attr=''; + } + $out.= ''; - if ($selected=='method') { - $selected_attr=' selected '; - } else { - $selected_attr=''; - } - $out.= ''; + if ($selected=='method') { + $selected_attr=' selected '; + } else { + $selected_attr=''; + } + $out.= ''; - $out.=''; + $out.=''; } return $out; diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index 4ac7fb6e716..970d4841fbf 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -660,20 +660,20 @@ if ($dirins && $action == 'initobject' && $module && $objectname) { // Copy some files $filetogenerate = array( - 'myobject_card.php'=>strtolower($objectname).'_card.php', - 'myobject_note.php'=>strtolower($objectname).'_note.php', - 'myobject_document.php'=>strtolower($objectname).'_document.php', - 'myobject_agenda.php'=>strtolower($objectname).'_agenda.php', - 'myobject_list.php'=>strtolower($objectname).'_list.php', - 'lib/mymodule_myobject.lib.php'=>'lib/'.strtolower($module).'_'.strtolower($objectname).'.lib.php', - //'test/phpunit/MyObjectTest.php'=>'test/phpunit/'.strtolower($objectname).'Test.php', - 'sql/llx_mymodule_myobject.sql'=>'sql/llx_'.strtolower($module).'_'.strtolower($objectname).'.sql', - 'sql/llx_mymodule_myobject_extrafields.sql'=>'sql/llx_'.strtolower($module).'_'.strtolower($objectname).'_extrafields.sql', - 'sql/llx_mymodule_myobject.key.sql'=>'sql/llx_'.strtolower($module).'_'.strtolower($objectname).'.key.sql', - //'scripts/mymodule.php'=>'scripts/'.strtolower($objectname).'.php', - 'img/object_myobject.png'=>'img/object_'.strtolower($objectname).'.png', - 'class/myobject.class.php'=>'class/'.strtolower($objectname).'.class.php', - //'class/api_mymodule.class.php'=>'class/api_'.strtolower($module).'.class.php' + 'myobject_card.php'=>strtolower($objectname).'_card.php', + 'myobject_note.php'=>strtolower($objectname).'_note.php', + 'myobject_document.php'=>strtolower($objectname).'_document.php', + 'myobject_agenda.php'=>strtolower($objectname).'_agenda.php', + 'myobject_list.php'=>strtolower($objectname).'_list.php', + 'lib/mymodule_myobject.lib.php'=>'lib/'.strtolower($module).'_'.strtolower($objectname).'.lib.php', + //'test/phpunit/MyObjectTest.php'=>'test/phpunit/'.strtolower($objectname).'Test.php', + 'sql/llx_mymodule_myobject.sql'=>'sql/llx_'.strtolower($module).'_'.strtolower($objectname).'.sql', + 'sql/llx_mymodule_myobject_extrafields.sql'=>'sql/llx_'.strtolower($module).'_'.strtolower($objectname).'_extrafields.sql', + 'sql/llx_mymodule_myobject.key.sql'=>'sql/llx_'.strtolower($module).'_'.strtolower($objectname).'.key.sql', + //'scripts/mymodule.php'=>'scripts/'.strtolower($objectname).'.php', + 'img/object_myobject.png'=>'img/object_'.strtolower($objectname).'.png', + 'class/myobject.class.php'=>'class/'.strtolower($objectname).'.class.php', + //'class/api_mymodule.class.php'=>'class/api_'.strtolower($module).'.class.php', ); foreach($filetogenerate as $srcfile => $destfile) @@ -696,68 +696,81 @@ if ($dirins && $action == 'initobject' && $module && $objectname) //if (! $error) // If there is error copying 1 file, we still have to make the replacement //{ - // Scan for object class files - $listofobject = dol_dir_list($destdir.'/class', 'files', 0, '\.class\.php$'); + // Scan for object class files + $listofobject = dol_dir_list($destdir.'/class', 'files', 0, '\.class\.php$'); - $firstobjectname=''; - foreach($listofobject as $fileobj) + $firstobjectname=''; + foreach($listofobject as $fileobj) + { + if (preg_match('/^api_/', $fileobj['name'])) continue; + if (preg_match('/^actions_/', $fileobj['name'])) continue; + + $tmpcontent=file_get_contents($fileobj['fullname']); + $reg=array(); + if (preg_match('/class\s+([^\s]*)\s+extends\s+CommonObject/ims', $tmpcontent, $reg)) { - if (preg_match('/^api_/', $fileobj['name'])) continue; - if (preg_match('/^actions_/', $fileobj['name'])) continue; - - $tmpcontent=file_get_contents($fileobj['fullname']); - $reg=array(); - if (preg_match('/class\s+([^\s]*)\s+extends\s+CommonObject/ims', $tmpcontent, $reg)) - { - $objectnameloop = $reg[1]; - if (empty($firstobjectname)) $firstobjectname = $objectnameloop; - } - - // Regenerate left menu entry in descriptor for $objectname - $stringtoadd=" -\t\t\$this->menu[\$r++]=array( - 'fk_menu'=>'fk_mainmenu=mymodule', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode - 'type'=>'left', // This is a Left menu entry - 'titre'=>'List MyObject', - 'mainmenu'=>'mymodule', - 'leftmenu'=>'mymodule_myobject', - 'url'=>'/mymodule/myobject_list.php', - 'langs'=>'mymodule@mymodule', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. - 'position'=>1100+\$r, - 'enabled'=>'\$conf->mymodule->enabled', // Define condition to show or hide menu entry. Use '\$conf->mymodule->enabled' if entry must be visible if module is enabled. Use '\$leftmenu==\'system\'' to show if leftmenu system is selected. - 'perms'=>'1', // Use 'perms'=>'\$user->rights->mymodule->level1->level2' if you want your menu with a permission rules - 'target'=>'', - 'user'=>2); // 0=Menu for internal users, 1=external users, 2=both -\t\t\$this->menu[\$r++]=array( - 'fk_menu'=>'fk_mainmenu=mymodule,fk_leftmenu=mymodule_myobject', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode - 'type'=>'left', // This is a Left menu entry - 'titre'=>'New MyObject', - 'mainmenu'=>'mymodule', - 'leftmenu'=>'mymodule_myobject', - 'url'=>'/mymodule/myobject_card.php?action=create', - 'langs'=>'mymodule@mymodule', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. - 'position'=>1100+\$r, - 'enabled'=>'\$conf->mymodule->enabled', // Define condition to show or hide menu entry. Use '\$conf->mymodule->enabled' if entry must be visible if module is enabled. Use '\$leftmenu==\'system\'' to show if leftmenu system is selected. - 'perms'=>'1', // Use 'perms'=>'\$user->rights->mymodule->level1->level2' if you want your menu with a permission rules - 'target'=>'', - 'user'=>2); // 0=Menu for internal users, 1=external users, 2=both - "; - $stringtoadd = preg_replace('/MyObject/', $objectnameloop, $stringtoadd); - $stringtoadd = preg_replace('/mymodule/', strtolower($module), $stringtoadd); - $stringtoadd = preg_replace('/myobject/', strtolower($objectnameloop), $stringtoadd); - - $moduledescriptorfile=$destdir.'/core/modules/mod'.$module.'.class.php'; - - // TODO Allow a replace with regex using dolReplaceInFile with param arryreplacementisregex to 1 - // TODO Avoid duplicate addition - - dolReplaceInFile($moduledescriptorfile, array('END MODULEBUILDER LEFTMENU MYOBJECT */' => '*/'."\n".$stringtoadd."\n\t\t/* END MODULEBUILDER LEFTMENU MYOBJECT */")); - - // Add module descriptor to list of files to replace "MyObject' string with real name of object. - $filetogenerate[]='core/modules/mod'.$module.'.class.php'; - - // TODO + $objectnameloop = $reg[1]; + if (empty($firstobjectname)) $firstobjectname = $objectnameloop; } + + // Regenerate left menu entry in descriptor for $objectname + $stringtoadd = " + \$this->menu[\$r++]=array( + // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode + 'fk_menu'=>'fk_mainmenu=mymodule', + // This is a Left menu entry + 'type'=>'left', + 'titre'=>'List MyObject', + 'mainmenu'=>'mymodule', + 'leftmenu'=>'mymodule_myobject', + 'url'=>'/mymodule/myobject_list.php', + // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. + 'langs'=>'mymodule@mymodule', + 'position'=>1100+\$r, + // Define condition to show or hide menu entry. Use '\$conf->mymodule->enabled' if entry must be visible if module is enabled. Use '\$leftmenu==\'system\'' to show if leftmenu system is selected. + 'enabled'=>'\$conf->mymodule->enabled', + // Use 'perms'=>'\$user->rights->mymodule->level1->level2' if you want your menu with a permission rules + 'perms'=>'1', + 'target'=>'', + // 0=Menu for internal users, 1=external users, 2=both + 'user'=>2, + ); + \$this->menu[\$r++]=array( + // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode + 'fk_menu'=>'fk_mainmenu=mymodule,fk_leftmenu=mymodule_myobject', + // This is a Left menu entry + 'type'=>'left', + 'titre'=>'New MyObject', + 'mainmenu'=>'mymodule', + 'leftmenu'=>'mymodule_myobject', + 'url'=>'/mymodule/myobject_card.php?action=create', + // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory. + 'langs'=>'mymodule@mymodule', + 'position'=>1100+\$r, + // Define condition to show or hide menu entry. Use '\$conf->mymodule->enabled' if entry must be visible if module is enabled. Use '\$leftmenu==\'system\'' to show if leftmenu system is selected. + 'enabled'=>'\$conf->mymodule->enabled', + // Use 'perms'=>'\$user->rights->mymodule->level1->level2' if you want your menu with a permission rules + 'perms'=>'1', + 'target'=>'', + // 0=Menu for internal users, 1=external users, 2=both + 'user'=>2 + );\n"; + $stringtoadd = preg_replace('/MyObject/', $objectnameloop, $stringtoadd); + $stringtoadd = preg_replace('/mymodule/', strtolower($module), $stringtoadd); + $stringtoadd = preg_replace('/myobject/', strtolower($objectnameloop), $stringtoadd); + + $moduledescriptorfile=$destdir.'/core/modules/mod'.$module.'.class.php'; + + // TODO Allow a replace with regex using dolReplaceInFile with param arryreplacementisregex to 1 + // TODO Avoid duplicate addition + + dolReplaceInFile($moduledescriptorfile, array('END MODULEBUILDER LEFTMENU MYOBJECT */' => '*/'."\n".$stringtoadd."\n\t\t/* END MODULEBUILDER LEFTMENU MYOBJECT */")); + + // Add module descriptor to list of files to replace "MyObject' string with real name of object. + $filetogenerate[]='core/modules/mod'.$module.'.class.php'; + + // TODO + } //} } @@ -888,11 +901,12 @@ if ($dirins && $action == 'addproperty' && !empty($module) && ! empty($tabobj)) if (! $error) { $addfieldentry = array( - 'name'=>GETPOST('propname', 'aZ09'),'label'=>GETPOST('proplabel', 'alpha'),'type'=>GETPOST('proptype', 'alpha'), - 'arrayofkeyval'=>GETPOST('proparrayofkeyval', 'none'), // Example json string '{"0":"Draft","1":"Active","-1":"Cancel"}' - 'visible'=>GETPOST('propvisible', 'int'),'enabled'=>GETPOST('propenabled', 'int'), - 'position'=>GETPOST('propposition', 'int'),'notnull'=>GETPOST('propnotnull', 'int'),'index'=>GETPOST('propindex', 'int'),'searchall'=>GETPOST('propsearchall', 'int'), - 'isameasure'=>GETPOST('propisameasure', 'int'), 'comment'=>GETPOST('propcomment', 'alpha'),'help'=>GETPOST('prophelp', 'alpha')); + 'name'=>GETPOST('propname', 'aZ09'),'label'=>GETPOST('proplabel', 'alpha'),'type'=>GETPOST('proptype', 'alpha'), + 'arrayofkeyval'=>GETPOST('proparrayofkeyval', 'none'), // Example json string '{"0":"Draft","1":"Active","-1":"Cancel"}' + 'visible'=>GETPOST('propvisible', 'int'),'enabled'=>GETPOST('propenabled', 'int'), + 'position'=>GETPOST('propposition', 'int'),'notnull'=>GETPOST('propnotnull', 'int'),'index'=>GETPOST('propindex', 'int'),'searchall'=>GETPOST('propsearchall', 'int'), + 'isameasure'=>GETPOST('propisameasure', 'int'), 'comment'=>GETPOST('propcomment', 'alpha'),'help'=>GETPOST('prophelp', 'alpha') + ); if (! empty($addfieldentry['arrayofkeyval']) && ! is_array($addfieldentry['arrayofkeyval'])) { diff --git a/htdocs/modulebuilder/template/test/phpunit/MyModuleFunctionalTest.php b/htdocs/modulebuilder/template/test/phpunit/MyModuleFunctionalTest.php index b4057cf178e..d7077d750b5 100644 --- a/htdocs/modulebuilder/template/test/phpunit/MyModuleFunctionalTest.php +++ b/htdocs/modulebuilder/template/test/phpunit/MyModuleFunctionalTest.php @@ -69,14 +69,14 @@ class MyModuleFunctionalTest extends \PHPUnit_Extensions_Selenium2TestCase ), // Geckodriver does not keep the session at the moment?! // XPath selectors also don't seem to work -// array( -// 'browser' => 'Mozilla Firefox on Linux', -// 'browserName' => 'firefox', -// 'sessionStrategy' => 'shared', -// 'desiredCapabilities' => array( -// 'marionette' => true -// ) -// ) + //array( + // 'browser' => 'Mozilla Firefox on Linux', + // 'browserName' => 'firefox', + // 'sessionStrategy' => 'shared', + // 'desiredCapabilities' => array( + // 'marionette' => true, + // ), + //) ); /** @@ -224,7 +224,7 @@ class MyModuleFunctionalTest extends \PHPUnit_Extensions_Selenium2TestCase { $this->url('/custom/mymodule/admin/about.php'); $this->authenticate(); -return $this->assertEquals( + return $this->assertEquals( 'Dolibarr Module Template (aka My Module)', $this->byTag('h1')->text(), "Readme title" @@ -254,7 +254,7 @@ return $this->assertEquals( { $this->url('/admin/triggers.php'); $this->authenticate(); -return $this->assertContains( + return $this->assertContains( 'interface_99_modMyModule_MyModuleTriggers.class.php', $this->byTag('body')->text(), "Trigger declared" @@ -271,7 +271,7 @@ return $this->assertContains( { $this->url('/admin/triggers.php'); $this->authenticate(); -return $this->assertContains( + return $this->assertContains( 'tick.png', $this->byXPath('//td[text()="interface_99_modMyModule_MyTrigger.class.php"]/following::img')->attribute('src'), "Trigger enabled"