diff --git a/htdocs/accountancy/admin/account.php b/htdocs/accountancy/admin/account.php index 58bbd09fdf2..ac45b3993a4 100644 --- a/htdocs/accountancy/admin/account.php +++ b/htdocs/accountancy/admin/account.php @@ -28,12 +28,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php'; require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingaccount.class.php'; -// Langs -$langs->load("compta"); -$langs->load("bills"); -$langs->load("admin"); -$langs->load("accountancy"); -$langs->load("salaries"); +$langs->loadLangs(array("compta","bills","admin","accountancy","salaries")); $mesg = ''; $action = GETPOST('action','aZ09'); diff --git a/htdocs/accountancy/admin/accountmodel.php b/htdocs/accountancy/admin/accountmodel.php index 9728a9524ea..a06d8a3f8d1 100644 --- a/htdocs/accountancy/admin/accountmodel.php +++ b/htdocs/accountancy/admin/accountmodel.php @@ -880,7 +880,7 @@ if ($id) $valuetoshow=price($valuetoshow); } else if ($fieldlist[$field]=='libelle_facture') { - $langs->load("bills"); + $langs->loadLangs(array("bills")); $key=$langs->trans("PaymentCondition".strtoupper($obj->code)); $valuetoshow=($obj->code && $key != "PaymentCondition".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]}); $valuetoshow=nl2br($valuetoshow); @@ -890,7 +890,7 @@ if ($id) $valuetoshow=($obj->code && $key != "Country".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]}); } else if ($fieldlist[$field]=='label' && $tabname[$id]==MAIN_DB_PREFIX.'c_availability') { - $langs->load("propal"); + $langs->loadLangs(array("propal")); $key=$langs->trans("AvailabilityType".strtoupper($obj->code)); $valuetoshow=($obj->code && $key != "AvailabilityType".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]}); } @@ -915,17 +915,17 @@ if ($id) $valuetoshow=($obj->code && $key != "Civility".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]}); } else if ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_type_contact') { - $langs->load('agenda'); + $langs->loadLangs(array("agenda")); $key=$langs->trans("TypeContact_".$obj->element."_".$obj->source."_".strtoupper($obj->code)); $valuetoshow=($obj->code && $key != "TypeContact_".$obj->element."_".$obj->source."_".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]}); } else if ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_payment_term') { - $langs->load("bills"); + $langs->loadLangs(array("bills")); $key=$langs->trans("PaymentConditionShort".strtoupper($obj->code)); $valuetoshow=($obj->code && $key != "PaymentConditionShort".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]}); } else if ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_paiement') { - $langs->load("bills"); + $langs->loadLangs(array("bills")); $key=$langs->trans("PaymentType".strtoupper($obj->code)); $valuetoshow=($obj->code && $key != "PaymentType".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]}); } @@ -934,12 +934,12 @@ if ($id) $valuetoshow=($obj->code && $key != "DemandReasonType".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]}); } else if ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_input_method') { - $langs->load("orders"); + $langs->loadLangs(array("orders")); $key=$langs->trans($obj->code); $valuetoshow=($obj->code && $key != $obj->code)?$key:$obj->{$fieldlist[$field]}; } else if ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_shipment_mode') { - $langs->load("sendings"); + $langs->loadLangs(array("sendings")); $key=$langs->trans("SendingMethod".strtoupper($obj->code)); $valuetoshow=($obj->code && $key != "SendingMethod".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]}); } @@ -950,7 +950,7 @@ if ($id) } else if ($fieldlist[$field] == 'label' && $tabname[$id] == MAIN_DB_PREFIX.'c_type_fees') { - $langs->load('trips'); + $langs->loadLangs(array("trips")); $key = $langs->trans(strtoupper($obj->code)); $valuetoshow = ($obj->code && $key != strtoupper($obj->code) ? $key : $obj->{$fieldlist[$field]}); } @@ -961,11 +961,11 @@ if ($id) $valuetoshow = $langs->getCurrencySymbol($obj->code,1); } else if ($fieldlist[$field]=='label' && $tabname[$_GET["id"]]==MAIN_DB_PREFIX.'c_units') { - $langs->load("products"); + $langs->loadLangs(array("products")); $valuetoshow=$langs->trans($obj->{$fieldlist[$field]}); } else if ($fieldlist[$field]=='short_label' && $tabname[$_GET["id"]]==MAIN_DB_PREFIX.'c_units') { - $langs->load("products"); + $langs->loadLangs(array("products")); $valuetoshow = $langs->trans($obj->{$fieldlist[$field]}); } else if (($fieldlist[$field] == 'unit') && ($tabname[$id] == MAIN_DB_PREFIX.'c_paper_format')) diff --git a/htdocs/accountancy/admin/card.php b/htdocs/accountancy/admin/card.php index 61166f88d07..669283077d9 100644 --- a/htdocs/accountancy/admin/card.php +++ b/htdocs/accountancy/admin/card.php @@ -31,9 +31,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php'; $error = 0; -// Langs -$langs->load("bills"); -$langs->load("accountancy"); +$langs->loadLangs(array("bills","accountancy")); $mesg = ''; $action = GETPOST('action','aZ09'); diff --git a/htdocs/accountancy/admin/categories.php b/htdocs/accountancy/admin/categories.php index 69d09ae301b..1a287b3d039 100644 --- a/htdocs/accountancy/admin/categories.php +++ b/htdocs/accountancy/admin/categories.php @@ -29,8 +29,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php'; $error = 0; -$langs->load("bills"); -$langs->load("accountancy"); +$langs->loadLangs(array("bills","accountancy")); $mesg = ''; $id = GETPOST('id', 'int'); diff --git a/htdocs/accountancy/admin/categories_list.php b/htdocs/accountancy/admin/categories_list.php index fb7561dda94..dedc55b3fd5 100644 --- a/htdocs/accountancy/admin/categories_list.php +++ b/htdocs/accountancy/admin/categories_list.php @@ -178,7 +178,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) } if (! is_numeric(GETPOST('position','alpha'))) { - $langs->load("errors"); + $langs->loadLangs(array("errors")); $ok=0; setEventMessages($langs->transnoentities('ErrorFieldMustBeANumeric', $langs->transnoentities("Position")), null, 'errors'); } @@ -735,7 +735,7 @@ if ($id) $valuetoshow=($obj->code && $key != "Country".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]}); } else if ($fieldlist[$field]=='label' && $tabname[$id]==MAIN_DB_PREFIX.'c_availability') { - $langs->load("propal"); + $langs->loadLangs(array("propal")); $key=$langs->trans("AvailabilityType".strtoupper($obj->code)); $valuetoshow=($obj->code && $key != "AvailabilityType".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]}); } diff --git a/htdocs/accountancy/admin/defaultaccounts.php b/htdocs/accountancy/admin/defaultaccounts.php index c4b31c0f169..9d254338526 100644 --- a/htdocs/accountancy/admin/defaultaccounts.php +++ b/htdocs/accountancy/admin/defaultaccounts.php @@ -34,12 +34,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php'; -$langs->load("compta"); -$langs->load("bills"); -$langs->load("admin"); -$langs->load("accountancy"); -$langs->load("salaries"); -$langs->load("loan"); +$langs->loadLangs(array("compta","bills","admin","accountancy","salaries","loan")); // Security check if (empty($user->rights->accounting->chartofaccount)) diff --git a/htdocs/accountancy/admin/export.php b/htdocs/accountancy/admin/export.php index dbe2a3b0c1c..6845491d003 100644 --- a/htdocs/accountancy/admin/export.php +++ b/htdocs/accountancy/admin/export.php @@ -28,15 +28,11 @@ */ require '../../main.inc.php'; -// Class require_once DOL_DOCUMENT_ROOT . '/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php'; require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountancyexport.class.php'; -$langs->load("compta"); -$langs->load("bills"); -$langs->load("admin"); -$langs->load("accountancy"); +$langs->loadLangs(array("compta","bills","admin","accountancy")); // Security access if (empty($user->rights->accounting->chartofaccount)) diff --git a/htdocs/accountancy/admin/fiscalyear.php b/htdocs/accountancy/admin/fiscalyear.php index 147c140bdd1..f3a6c9feb75 100644 --- a/htdocs/accountancy/admin/fiscalyear.php +++ b/htdocs/accountancy/admin/fiscalyear.php @@ -39,8 +39,7 @@ $pagenext = $page + 1; if (! $sortfield) $sortfield="f.rowid"; // Set here default search field if (! $sortorder) $sortorder="ASC"; -$langs->load("admin"); -$langs->load("compta"); +$langs->loadLangs(array("admin","compta")); // Security check if ($user->societe_id > 0) diff --git a/htdocs/accountancy/admin/fiscalyear_card.php b/htdocs/accountancy/admin/fiscalyear_card.php index 78c6510469b..db323881bdc 100644 --- a/htdocs/accountancy/admin/fiscalyear_card.php +++ b/htdocs/accountancy/admin/fiscalyear_card.php @@ -26,8 +26,7 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/fiscalyear.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/fiscalyear.class.php'; -$langs->load("admin"); -$langs->load("compta"); +$langs->loadLangs(array("admin","compta")); // Security check if ($user->societe_id > 0) diff --git a/htdocs/accountancy/admin/fiscalyear_info.php b/htdocs/accountancy/admin/fiscalyear_info.php index baadbdc0828..f8f0bd5668e 100644 --- a/htdocs/accountancy/admin/fiscalyear_info.php +++ b/htdocs/accountancy/admin/fiscalyear_info.php @@ -26,8 +26,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/fiscalyear.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/fiscalyear.class.php'; -$langs->load("admin"); -$langs->load("compta"); +$langs->loadLangs(array("admin","compta")); // Security check if ($user->societe_id > 0) diff --git a/htdocs/accountancy/admin/importaccounts.php b/htdocs/accountancy/admin/importaccounts.php index 93d41b3cbc6..6e235bc183e 100644 --- a/htdocs/accountancy/admin/importaccounts.php +++ b/htdocs/accountancy/admin/importaccounts.php @@ -24,16 +24,12 @@ */ require '../../main.inc.php'; -// Class require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php'; require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingaccount.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php'; -// langs -$langs->load("compta"); -$langs->load("bills"); -$langs->load("main"); -$langs->load("accountancy"); +// Load traductions files requiredby by page +$langs->loadLangs(array("compta","bills","accountancy")); // Security check if (! $user->admin) @@ -141,7 +137,6 @@ if ($result) { $form = new Form($db); $formaccounting = new FormAccounting($db); - $var = true; while ( $i < min($num_lines, $limit) ) { $objp = $db->fetch_object($result); print ''; diff --git a/htdocs/accountancy/admin/index.php b/htdocs/accountancy/admin/index.php index 44c816530dd..64857fbfbb4 100644 --- a/htdocs/accountancy/admin/index.php +++ b/htdocs/accountancy/admin/index.php @@ -32,10 +32,7 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php'; -$langs->load("compta"); -$langs->load("bills"); -$langs->load("admin"); -$langs->load("accountancy"); +$langs->loadLangs(array("compta","bills","admin","accountancy")); // Security access if (empty($user->rights->accounting->chartofaccount)) diff --git a/htdocs/accountancy/admin/journals_list.php b/htdocs/accountancy/admin/journals_list.php index a7811a2d606..8aea0463fc3 100644 --- a/htdocs/accountancy/admin/journals_list.php +++ b/htdocs/accountancy/admin/journals_list.php @@ -30,9 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php'; require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingjournal.class.php'; -$langs->load("admin"); -$langs->load("compta"); -$langs->load("accountancy"); +$langs->loadLangs(array("admin","compta","accountancy")); $action=GETPOST('action','alpha')?GETPOST('action','alpha'):'view'; $confirm=GETPOST('confirm','alpha'); @@ -629,7 +627,7 @@ if ($id) $valuetoshow=$langs->trans('All'); } else if ($fieldlist[$field]=='nature' && $tabname[$id]==MAIN_DB_PREFIX.'accounting_journal') { - $langs->load("accountancy"); + $langs->loadLangs(array("accountancy")); $key=$langs->trans("AccountingJournalType".strtoupper($obj->nature)); $valuetoshow=($obj->nature && $key != "AccountingJournalType".strtoupper($obj->nature)?$key:$obj->{$fieldlist[$field]}); } diff --git a/htdocs/accountancy/admin/productaccount.php b/htdocs/accountancy/admin/productaccount.php index f6552d3d1e1..7f48ad81ef8 100644 --- a/htdocs/accountancy/admin/productaccount.php +++ b/htdocs/accountancy/admin/productaccount.php @@ -26,7 +26,6 @@ */ require '../../main.inc.php'; -// Class require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/report.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/admin.lib.php'; @@ -35,12 +34,8 @@ require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php'; require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingaccount.class.php'; require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; -// Langs -$langs->load("companies"); -$langs->load("compta"); -$langs->load("main"); -$langs->load("accountancy"); -$langs->load("products"); +// Load traductions files requiredby by page +$langs->loadLangs(array("companies","compta","accountancy","products")); // Security check if (empty($conf->accounting->enabled)) { @@ -360,7 +355,6 @@ if ($result) $product_static = new Product($db); - $var = true; $i=0; while ($i < min($num,$limit)) { diff --git a/htdocs/accountancy/bookkeeping/balance.php b/htdocs/accountancy/bookkeeping/balance.php index d27da1afbe9..d8a59a5ba43 100644 --- a/htdocs/accountancy/bookkeeping/balance.php +++ b/htdocs/accountancy/bookkeeping/balance.php @@ -35,7 +35,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php'; // Langs -$langs->load("accountancy"); +$langs->loadLangs(array("accountancy")); $page = GETPOST("page"); $sortorder = GETPOST("sortorder"); diff --git a/htdocs/accountancy/bookkeeping/balancebymonth.php b/htdocs/accountancy/bookkeeping/balancebymonth.php index 1d746b4d4df..a433e19a09d 100644 --- a/htdocs/accountancy/bookkeeping/balancebymonth.php +++ b/htdocs/accountancy/bookkeeping/balancebymonth.php @@ -26,16 +26,11 @@ */ require '../../main.inc.php'; -// Class require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php'; -// Langs -$langs->load("main"); -$langs->load("compta"); -$langs->load("bills"); -$langs->load("other"); -$langs->load("accountancy"); +// Load traductions files requiredby by page +$langs->loadLangs(array("bills","compta","accountancy","other")); // Filter $year = GETPOST("year",'int'); @@ -75,8 +70,6 @@ if ($result) { $y = $year_current; -$var = true; - print ''; print ''; @@ -108,7 +101,7 @@ if ($resql) { $row = $db->fetch_row($resql); - print ''; + print ''; print ''; print ''; print ''; diff --git a/htdocs/accountancy/bookkeeping/list.php b/htdocs/accountancy/bookkeeping/list.php index d3bf948aaf7..368cf406185 100644 --- a/htdocs/accountancy/bookkeeping/list.php +++ b/htdocs/accountancy/bookkeeping/list.php @@ -32,8 +32,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; -// Langs -$langs->load("accountancy"); +$langs->loadLangs(array("accountancy")); $action = GETPOST('action', 'alpha'); $search_mvt_num = GETPOST('search_mvt_num', 'int'); diff --git a/htdocs/accountancy/bookkeeping/listbyaccount.php b/htdocs/accountancy/bookkeeping/listbyaccount.php index 15be2255830..499865233db 100644 --- a/htdocs/accountancy/bookkeeping/listbyaccount.php +++ b/htdocs/accountancy/bookkeeping/listbyaccount.php @@ -33,8 +33,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; -// Langs -$langs->load("accountancy"); +$langs->loadLangs(array("accountancy")); $page = GETPOST("page"); $sortorder = GETPOST("sortorder"); diff --git a/htdocs/accountancy/bookkeeping/thirdparty_lettrage.php b/htdocs/accountancy/bookkeeping/thirdparty_lettrage.php index 550ea1d933a..67d89bcda90 100644 --- a/htdocs/accountancy/bookkeeping/thirdparty_lettrage.php +++ b/htdocs/accountancy/bookkeeping/thirdparty_lettrage.php @@ -33,6 +33,8 @@ require_once DOL_DOCUMENT_ROOT . '/accountancy/class/lettering.class.php'; require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php'; +$langs->loadLangs(array("compta")); + $action = GETPOST('action', 'aZ09'); $massaction = GETPOST('massaction', 'alpha'); $show_files = GETPOST('show_files', 'int'); @@ -141,7 +143,6 @@ if ($object->check_codeclient() != 0) print ''; print ''; -$langs->load('compta'); print ''; print ''; print ''; -$langs->load('compta'); print ''; print ''; + print ''; // Label if ($objp->fk_product > 0) { @@ -1684,7 +1684,7 @@ else $colspan = 7; } - print ''; + print ''; print '"; + print ''; print '"; + print ''; print ''; + print ''; print ''; print "\n"; } @@ -1886,7 +1886,7 @@ else { print '
' . $langs->trans("Label") . '' . $langs->trans("JanuaryMin") . '' . $langs->trans("FebruaryMin") . '' . $langs->trans("MarchMin") . '' . $langs->trans("AprilMin") . '' . $langs->trans("MayMin") . '' . $langs->trans("JuneMin") . '' . $langs->trans("JulyMin") . '' . $langs->trans("AugustMin") . '' . $langs->trans("SeptemberMin") . '' . $langs->trans("OctoberMin") . '' . $langs->trans("NovemberMin") . '' . $langs->trans("DecemberMin") . 'Total
' . length_accountg($row[0]) . '
' . length_accountg($row[0]) . '' . price($row[1]) . '' . price($row[2]) . '' . price($row[3]) . '
'; print $form->editfieldkey("CustomerAccountancyCode", 'customeraccountancycode', $object->code_compta, $object, $user->rights->societe->creer); diff --git a/htdocs/accountancy/bookkeeping/thirdparty_lettrage_supplier.php b/htdocs/accountancy/bookkeeping/thirdparty_lettrage_supplier.php index 35bdcfa23fe..96317a3a740 100644 --- a/htdocs/accountancy/bookkeeping/thirdparty_lettrage_supplier.php +++ b/htdocs/accountancy/bookkeeping/thirdparty_lettrage_supplier.php @@ -35,6 +35,8 @@ require_once DOL_DOCUMENT_ROOT . '/accountancy/class/lettering.class.php'; require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php'; +$langs->loadLangs(array("compta")); + $action = GETPOST('action', 'aZ09'); $massaction = GETPOST('massaction', 'alpha'); $show_files = GETPOST('show_files', 'int'); @@ -157,7 +159,6 @@ if ($object->check_codefournisseur() != 0) print '
'; print $form->editfieldkey("SupplierAccountancyCode", 'supplieraccountancycode', $object->code_compta_fournisseur, $object, $user->rights->societe->creer); diff --git a/htdocs/accountancy/class/accountingaccount.class.php b/htdocs/accountancy/class/accountingaccount.class.php index 0b0d42b0075..d1870fabc38 100644 --- a/htdocs/accountancy/class/accountingaccount.class.php +++ b/htdocs/accountancy/class/accountingaccount.class.php @@ -566,7 +566,7 @@ class AccountingAccount extends CommonObject function LibStatut($statut,$mode=0) { global $langs; - $langs->load('users'); + $langs->loadLangs(array("users")); if ($mode == 0) { diff --git a/htdocs/accountancy/class/accountingjournal.class.php b/htdocs/accountancy/class/accountingjournal.class.php index 2e48fc8a54a..454de6d7b84 100644 --- a/htdocs/accountancy/class/accountingjournal.class.php +++ b/htdocs/accountancy/class/accountingjournal.class.php @@ -256,7 +256,7 @@ class AccountingJournal extends CommonObject { global $langs; - $langs->load("accountancy"); + $langs->loadLangs(array("accountancy")); if ($mode == 0) { diff --git a/htdocs/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php index 6c82672f311..f7fed2e2b5b 100644 --- a/htdocs/accountancy/class/bookkeeping.class.php +++ b/htdocs/accountancy/class/bookkeeping.class.php @@ -170,7 +170,7 @@ class BookKeeping extends CommonObject // Check parameters if (empty($this->numero_compte) || $this->numero_compte == '-1' || $this->numero_compte == 'NotDefined') { - $langs->load("errors"); + $langs->loadLangs(array("errors")); if (in_array($this->doc_type, array('bank', 'expense_report'))) { $this->errors[]=$langs->trans('ErrorFieldAccountNotDefinedForBankLine', $this->fk_docdet, $this->doc_type); diff --git a/htdocs/accountancy/customer/card.php b/htdocs/accountancy/customer/card.php index 92d8f7b1c37..d0e5adc97fd 100644 --- a/htdocs/accountancy/customer/card.php +++ b/htdocs/accountancy/customer/card.php @@ -24,13 +24,10 @@ */ require '../../main.inc.php'; -// Class require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php'; -// Langs -$langs->load("bills"); -$langs->load("accountancy"); +$langs->loadLangs(array("bills","accountancy")); $action = GETPOST('action', 'alpha'); $cancel = GETPOST('cancel', 'alpha'); diff --git a/htdocs/accountancy/customer/lines.php b/htdocs/accountancy/customer/lines.php index d148bf8579b..b62b4e8f5ca 100644 --- a/htdocs/accountancy/customer/lines.php +++ b/htdocs/accountancy/customer/lines.php @@ -27,7 +27,6 @@ */ require '../../main.inc.php'; -// Class require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php'; require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; @@ -35,12 +34,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; -// Langs -$langs->load("bills"); -$langs->load("compta"); -$langs->load("main"); -$langs->load("accountancy"); -$langs->load("productbatch"); +$langs->loadLangs(array("bills","compta","accountancy","productbatch")); $account_parent = GETPOST('account_parent'); $changeaccount = GETPOST('changeaccount'); diff --git a/htdocs/accountancy/customer/list.php b/htdocs/accountancy/customer/list.php index 436be21abb7..c5b166b9fb7 100644 --- a/htdocs/accountancy/customer/list.php +++ b/htdocs/accountancy/customer/list.php @@ -27,7 +27,6 @@ */ require '../../main.inc.php'; -// Class require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php'; @@ -36,13 +35,8 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; -// Langs -$langs->load("compta"); -$langs->load("bills"); -$langs->load("other"); -$langs->load("main"); -$langs->load("accountancy"); -$langs->load("productbatch"); +// Load traductions files requiredby by page +$langs->loadLangs(array("bills","compta","accountancy","other","productbatch")); $action=GETPOST('action','alpha'); $massaction=GETPOST('massaction','alpha'); diff --git a/htdocs/accountancy/expensereport/card.php b/htdocs/accountancy/expensereport/card.php index 3b59847d84d..59237fd13b2 100644 --- a/htdocs/accountancy/expensereport/card.php +++ b/htdocs/accountancy/expensereport/card.php @@ -28,14 +28,10 @@ */ require '../../main.inc.php'; -// Class require_once DOL_DOCUMENT_ROOT . '/expensereport/class/expensereport.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php'; -// Langs -$langs->load("bills"); -$langs->load("accountancy"); -$langs->load("trips"); +$langs->loadLangs(array("bills","accountancy","trips")); $action = GETPOST('action', 'alpha'); $cancel = GETPOST('cancel', 'alpha'); diff --git a/htdocs/accountancy/expensereport/lines.php b/htdocs/accountancy/expensereport/lines.php index 28a44d23a5e..7ab29657172 100644 --- a/htdocs/accountancy/expensereport/lines.php +++ b/htdocs/accountancy/expensereport/lines.php @@ -26,7 +26,6 @@ */ require '../../main.inc.php'; -// Class require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php'; require_once DOL_DOCUMENT_ROOT . '/expensereport/class/expensereport.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; @@ -34,14 +33,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; -// Langs -$langs->load("compta"); -$langs->load("bills"); -$langs->load("other"); -$langs->load("main"); -$langs->load("accountancy"); -$langs->load("trips"); -$langs->load("productbatch"); +$langs->loadLangs(array("compta","bills","other","accountancy","trips","productbatch")); $account_parent = GETPOST('account_parent','int'); $changeaccount = GETPOST('changeaccount'); diff --git a/htdocs/accountancy/expensereport/list.php b/htdocs/accountancy/expensereport/list.php index 2a24aa2f656..a4d2ed81b56 100644 --- a/htdocs/accountancy/expensereport/list.php +++ b/htdocs/accountancy/expensereport/list.php @@ -27,7 +27,6 @@ */ require '../../main.inc.php'; -// Class require_once DOL_DOCUMENT_ROOT . '/expensereport/class/expensereport.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php'; require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingaccount.class.php'; @@ -35,14 +34,8 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; -// Langs -$langs->load("compta"); -$langs->load("bills"); -$langs->load("other"); -$langs->load("trips"); -$langs->load("main"); -$langs->load("accountancy"); -$langs->load("productbatch"); +// Load traductions files requiredby by page +$langs->loadLangs(array("bills","compta","accountancy","other","trips","productbatch")); $action=GETPOST('action','alpha'); $massaction=GETPOST('massaction','alpha'); @@ -345,7 +338,6 @@ if ($result) { $expensereport_static = new ExpenseReport($db); $form = new Form($db); - $var = true; while ( $i < min($num_lines, $limit) ) { $objp = $db->fetch_object($result); diff --git a/htdocs/accountancy/index.php b/htdocs/accountancy/index.php index cad9547ec4c..8de7209ef93 100644 --- a/htdocs/accountancy/index.php +++ b/htdocs/accountancy/index.php @@ -26,26 +26,12 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php'; -// Langs -$langs->load("compta"); -$langs->load("bills"); -$langs->load("other"); -$langs->load("main"); -$langs->load("accountancy"); +$langs->loadLangs(array("compta","bills","other","accountancy","loans","banks","admin","dict")); // Security check if ($user->societe_id > 0) accessforbidden(); -$langs->load("admin"); -$langs->load("dict"); -$langs->load("bills"); -$langs->load("accountancy"); -$langs->load("compta"); -$langs->load("banks"); -$langs->load("loans"); - - /* * Actions */ diff --git a/htdocs/accountancy/supplier/card.php b/htdocs/accountancy/supplier/card.php index f74165251f3..847181b79cb 100644 --- a/htdocs/accountancy/supplier/card.php +++ b/htdocs/accountancy/supplier/card.php @@ -28,13 +28,10 @@ */ require '../../main.inc.php'; -// Class require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.facture.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php'; -// Langs -$langs->load("bills"); -$langs->load("accountancy"); +$langs->loadLangs(array("bills","accountancy")); $action = GETPOST('action', 'alpha'); $cancel = GETPOST('cancel', 'alpha'); diff --git a/htdocs/accountancy/supplier/lines.php b/htdocs/accountancy/supplier/lines.php index a99cdcf3bd6..11b6df35c2e 100644 --- a/htdocs/accountancy/supplier/lines.php +++ b/htdocs/accountancy/supplier/lines.php @@ -26,7 +26,6 @@ */ require '../../main.inc.php'; -// Class require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php'; require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.facture.class.php'; require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php'; @@ -35,13 +34,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; -// Langs -$langs->load("compta"); -$langs->load("bills"); -$langs->load("other"); -$langs->load("main"); -$langs->load("accountancy"); -$langs->load("productbatch"); +$langs->loadLangs(array("compta","bills","other","accountancy","productbatch")); $account_parent = GETPOST('account_parent'); $changeaccount = GETPOST('changeaccount'); diff --git a/htdocs/accountancy/supplier/list.php b/htdocs/accountancy/supplier/list.php index e03781b178b..c055b7d2e77 100644 --- a/htdocs/accountancy/supplier/list.php +++ b/htdocs/accountancy/supplier/list.php @@ -27,7 +27,6 @@ */ require '../../main.inc.php'; -// Class require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.facture.class.php'; require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.product.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php'; @@ -36,13 +35,8 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; -// Langs -$langs->load("compta"); -$langs->load("bills"); -$langs->load("other"); -$langs->load("main"); -$langs->load("accountancy"); -$langs->load("productbatch"); +// Load traductions files requiredby by page +$langs->loadLangs(array("bills","compta","accountancy","other","productbatch")); $action=GETPOST('action','alpha'); $massaction=GETPOST('massaction','alpha'); diff --git a/htdocs/admin/defaultvalues.php b/htdocs/admin/defaultvalues.php index 790445f7032..5c17fd32eb0 100644 --- a/htdocs/admin/defaultvalues.php +++ b/htdocs/admin/defaultvalues.php @@ -1,6 +1,6 @@ - * Copyright (C) 2017 Regis Houssin +/* Copyright (C) 2017 Laurent Destailleur + * Copyright (C) 2017-2018 Regis Houssin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -212,9 +212,9 @@ print "
\n"; if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage; if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; if ($optioncss != '') $param.='&optioncss='.$optioncss; -if (defaulturl) $param.='&defaulturl='.urlencode(defaulturl); -if (defaultkey) $param.='&defaultkey='.urlencode(defaultkey); -if (defaultvalue) $param.='&defaultvalue='.urlencode(defaultvalue); +if ($defaulturl) $param.='&defaulturl='.urlencode($defaulturl); +if ($defaultkey) $param.='&defaultkey='.urlencode($defaultkey); +if ($defaultvalue) $param.='&defaultvalue='.urlencode($defaultvalue); print '
entity) && $debug)?'?debug=1':'').'" method="POST">'; diff --git a/htdocs/admin/tools/dolibarr_export.php b/htdocs/admin/tools/dolibarr_export.php index 7b2c8805f55..c876d7cfd9a 100644 --- a/htdocs/admin/tools/dolibarr_export.php +++ b/htdocs/admin/tools/dolibarr_export.php @@ -1,6 +1,6 @@ - * Copyright (C) 2006-2012 Regis Houssin +/* Copyright (C) 2006-2018 Laurent Destailleur + * Copyright (C) 2006-2018 Regis Houssin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -36,7 +36,7 @@ $sortorder = GETPOST('sortorder','alpha'); $page = GETPOST('page','int'); if (! $sortorder) $sortorder="DESC"; if (! $sortfield) $sortfield="date"; -if ($page < 0) { $page = 0; } +if (empty($page) || $page == -1) { $page = 0; } $limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit; $offset = $limit * $page; diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index 08bc1b4a34b..3d1fa3dcaef 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -7,11 +7,8 @@ * Copyright (C) 2013 Cédric Salvador * Copyright (C) 2013 Alexandre Spangaro * Copyright (C) 2015 Jean-François Ferry -<<<<<<< HEAD - * Copyright (C) 2018 Nicolas ZABOURI -======= + * Copyright (C) 2018 Nicolas ZABOURI * Copyright (C) 2018 Juanjo Menent ->>>>>>> branch '7.0' of git@github.com:Dolibarr/dolibarr.git * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index c83cdcfb288..a25f1b9e584 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -1588,7 +1588,7 @@ else if ($action != 'editline' || GETPOST('rowid') != $objp->rowid) { - print '
'; // Date planned @@ -1721,14 +1721,14 @@ else if (is_array($extralabelslines) && count($extralabelslines)>0) { $line = new ContratLigne($db); $line->fetch_optionals($objp->rowid); - print $line->showOptionals($extrafieldsline, 'view', array('style'=>$bcnd[$var], 'colspan'=>$colspan), '', '', empty($conf->global->MAIN_EXTRAFIELDS_IN_ONE_TD)?0:1); + print $line->showOptionals($extrafieldsline, 'view', array('style'=>'class="oddeven"', 'colspan'=>$colspan), '', '', empty($conf->global->MAIN_EXTRAFIELDS_IN_ONE_TD)?0:1); } } // Ligne en mode update else { // Ligne carac - print "
'; if ($objp->fk_product) { @@ -1783,7 +1783,7 @@ else if($conf->global->PRODUCT_USE_UNITS) $colspan++; // Ligne dates prevues - print "
'; print $langs->trans("DateStartPlanned").' '; $form->select_date($db->jdate($objp->date_debut),"date_start_update",$usehm,$usehm,($db->jdate($objp->date_debut)>0?0:1),"update"); @@ -1795,7 +1795,7 @@ else if (is_array($extralabelslines) && count($extralabelslines)>0) { $line = new ContratLigne($db); $line->fetch_optionals($objp->rowid); - print $line->showOptionals($extrafieldsline, 'edit', array('style'=>$bcnd[$var], 'colspan'=>$colspan), '', '', empty($conf->global->MAIN_EXTRAFIELDS_IN_ONE_TD)?0:1); + print $line->showOptionals($extrafieldsline, 'edit', array('style'=>'class="oddeven"', 'colspan'=>$colspan), '', '', empty($conf->global->MAIN_EXTRAFIELDS_IN_ONE_TD)?0:1); } } @@ -1808,7 +1808,7 @@ else if ($object->statut > 0) { - print '

'; - print ''; + print ''; print ''; print ''; print "\n"; - print ''; + print ''; print ''; + print ''; print ''; @@ -1981,7 +1981,7 @@ else print ''; - print ''; + print ''; print ''; print ''; - print ''; + print ''; print ''; print '
'.$langs->trans("ServiceStatus").': '.$object->lines[$cursorline-1]->getLibStatut(4).''; if ($user->societe_id == 0) @@ -1913,7 +1913,7 @@ else print '
'; // Si pas encore active @@ -1969,7 +1969,7 @@ else } } - print '
'.$langs->trans("DateServiceActivate").''; print $form->select_date($dateactstart,'',$usehm,$usehm,'',"active",1,0,1); print '
'.$langs->trans("Comment").''; print '   '; @@ -2026,7 +2026,7 @@ else $now=dol_now(); if ($dateactend > $now) $dateactend=$now; - print '
'; + print '
'; if ($objp->statut >= 4) { if ($objp->statut == 4) @@ -2039,7 +2039,7 @@ else print ''; print '
'.$langs->trans("Comment").''; print '   '; @@ -2079,8 +2079,6 @@ else // Form to add new line if ($action != 'editline') { - $var = true; - $forcetoshowtitlelines=1; // Add free products/services @@ -2201,8 +2199,7 @@ else $urlsource = $_SERVER["PHP_SELF"] . "?id=" . $object->id; $genallowed = $user->rights->contrat->lire; $delallowed = $user->rights->contrat->creer; - - $var = true; + print $formfile->showdocuments('contract', $filename, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 1, 0, 0, 28, 0, '', 0, '', $soc->default_lang); diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 815b6b18bbf..c912ae98b4c 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -3923,23 +3923,26 @@ abstract class CommonObject $var = true; $i = 0; - foreach ($this->lines as $line) + if (! empty($this->lines)) { - if (is_object($hookmanager) && (($line->product_type == 9 && ! empty($line->special_code)) || ! empty($line->fk_parent_line))) + foreach ($this->lines as $line) { - if (empty($line->fk_parent_line)) + if (is_object($hookmanager) && (($line->product_type == 9 && ! empty($line->special_code)) || ! empty($line->fk_parent_line))) { - $parameters=array('line'=>$line,'var'=>$var,'i'=>$i); - $action=''; - $hookmanager->executeHooks('printOriginObjectLine',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks + if (empty($line->fk_parent_line)) + { + $parameters=array('line'=>$line,'var'=>$var,'i'=>$i); + $action=''; + $hookmanager->executeHooks('printOriginObjectLine',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks + } + } + else + { + $this->printOriginLine($line, $var, $restrictlist); } - } - else - { - $this->printOriginLine($line, $var, $restrictlist); - } - $i++; + $i++; + } } } diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index a370684b191..555ad503693 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -3,6 +3,7 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2010-2011 Juanjo Menent * Copyright (C) 2015-2017 Marcos García + * Copyright (C) 2015-2017 Nicolas ZABOURI * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -1110,7 +1111,8 @@ class FormMail extends Form elseif ($type_template=='fichinter_send') { $defaultmessage=$outputlangs->transnoentities("PredefinedMailContentSendFichInter"); } elseif ($type_template=='thirdparty') { $defaultmessage=$outputlangs->transnoentities("PredefinedMailContentThirdparty"); } elseif ($type_template=='user') { $defaultmessage=$outputlangs->transnoentities("PredefinedMailContentUser"); } - + elseif (!empty($type_template)) { $defaultmessage=$outputlangs->transnoentities("PredefinedMailContent".ucfirst($type_template)); } + $ret->label = 'default'; $ret->lang = $outputlangs->defaultlang; $ret->topic = ''; diff --git a/htdocs/core/class/html.formticketsup.class.php b/htdocs/core/class/html.formticketsup.class.php index 9090fae90ca..b076a0923eb 100644 --- a/htdocs/core/class/html.formticketsup.class.php +++ b/htdocs/core/class/html.formticketsup.class.php @@ -150,7 +150,7 @@ class FormTicketsup } print ''; - print '
'; + dol_fiche_head(''); print ''; @@ -183,7 +183,7 @@ class FormTicketsup print ''; if (! empty($conf->use_javascript_ajax) && ! empty($conf->global->COMPANY_USE_SEARCH_TO_SELECT)) { $htmlname = 'socid'; @@ -443,7 +443,7 @@ class FormTicketsup $ticketstat->loadCacheTypesTickets(); - print ''; if ($empty) { print ''; } @@ -543,7 +543,7 @@ class FormTicketsup $ticketstat->loadCacheCategoriesTickets(); - print ''; if ($empty) { print ''; } @@ -612,7 +612,7 @@ class FormTicketsup print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); } - print ajax_combobox('select'.$htmlname); + print ajax_combobox('select'.$htmlname,'',0,0,'off'); } /** @@ -644,7 +644,7 @@ class FormTicketsup $ticketstat->loadCacheSeveritiesTickets(); - print ''; if ($empty) { print ''; } @@ -864,7 +864,7 @@ class FormTicketsup // Destinataires print ''."\n"; // Detect if we need a fetch on each output line $needToFetchEachLine=0; -foreach ($extrafields->attributes[$object->table_element]['computed'] as $key => $val) -{ - if (preg_match('/\$object/',$val)) $needToFetchEachLine++; // There is at least one compute field that use $object +if (! empty($extrafields->attributes[$object->table_element]['computed'])) { + foreach ($extrafields->attributes[$object->table_element]['computed'] as $key => $val) + { + if (preg_match('/\$object/',$val)) $needToFetchEachLine++; // There is at least one compute field that use $object + } } - // Loop on record // -------------------------------------------------------------------- $i=0;
' . $langs->trans("ThirdParty") . ''; $events = array(); $events[] = array('method' => 'getContacts', 'url' => dol_buildpath('/core/ajax/contacts.php', 1), 'htmlname' => 'contactid', 'params' => array('add-customer-contact' => 'disabled')); - print $form->select_company($this->withfromsocid, 'socid', '', 1, 1, '', $events); + print $form->select_company($this->withfromsocid, 'socid', '', 1, 1, '', $events, 0, 'minwidth200'); print '