diff --git a/dev/initdata/purge-data.php b/dev/initdata/purge-data.php index 5a1e7b3afc3..2bdf200225b 100755 --- a/dev/initdata/purge-data.php +++ b/dev/initdata/purge-data.php @@ -44,8 +44,7 @@ include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; include_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; include_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; -$langs->load("main"); -$langs->load("errors"); +$langs->loadLangs(array("main", "errors")); // Global variables $version=DOL_VERSION; diff --git a/htdocs/admin/system/filecheck.php b/htdocs/admin/system/filecheck.php index 10cffafb9a9..e978ac85b55 100644 --- a/htdocs/admin/system/filecheck.php +++ b/htdocs/admin/system/filecheck.php @@ -307,7 +307,7 @@ if (! $error && $xml) } else { - $out.=''.$langs->trans("None").''; + $out.=''.$langs->trans("None").''; } $out.=''; $out.=''; diff --git a/htdocs/comm/propal/stats/index.php b/htdocs/comm/propal/stats/index.php index 00db6264377..b7f6bd68493 100644 --- a/htdocs/comm/propal/stats/index.php +++ b/htdocs/comm/propal/stats/index.php @@ -65,9 +65,7 @@ $langs->loadLangs(array('orders', 'companies', 'other', 'suppliers', 'supplier_p $form=new Form($db); $formpropal=new FormPropal($db); -$langs->load('propal'); -$langs->load('other'); -$langs->load("companies"); +$langs->loadLangs(array('propal', 'other', 'companies')); if ($mode == 'customer') { diff --git a/htdocs/core/class/html.formprojet.class.php b/htdocs/core/class/html.formprojet.class.php index 50a6d2d6656..04cc6705623 100644 --- a/htdocs/core/class/html.formprojet.class.php +++ b/htdocs/core/class/html.formprojet.class.php @@ -626,11 +626,16 @@ class FormProjets if ($num > 0) { $sellist = ''; $newcardbutton=''; //if ($user->rights->mymodule->creer) //{ - $newcardbutton=''.$langs->trans('New').''; + $newcardbutton=''.$langs->trans('New').''; $newcardbutton.= ''; $newcardbutton.= ''; //} diff --git a/htdocs/projet/admin/project_extrafields.php b/htdocs/projet/admin/project_extrafields.php index 8f39a20f762..15ccd50bf76 100644 --- a/htdocs/projet/admin/project_extrafields.php +++ b/htdocs/projet/admin/project_extrafields.php @@ -30,8 +30,7 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; -$langs->load("project"); -$langs->load("admin"); +$langs->loadLangs(array("project", "admin")); $extrafields = new ExtraFields($db); $form = new Form($db); diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index 3303d63ef81..1da887ea7a9 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -548,11 +548,8 @@ if (! $showdatefilter) // Show balance for whole project -$langs->load("suppliers"); -$langs->load("bills"); -$langs->load("orders"); -$langs->load("proposals"); -$langs->load("margins"); +$langs->loadLangs(array("suppliers", "bills", "orders", "proposals", "margins")); + if (!empty($conf->stock->enabled)) $langs->load('stocks'); print load_fiche_titre($langs->trans("Profit"), '', 'title_accountancy'); diff --git a/htdocs/public/cron/cron_run_jobs.php b/htdocs/public/cron/cron_run_jobs.php index 49e1a2de561..320a8e3895a 100644 --- a/htdocs/public/cron/cron_run_jobs.php +++ b/htdocs/public/cron/cron_run_jobs.php @@ -44,8 +44,7 @@ dol_include_once("/cron/class/cronjob.class.php"); global $langs, $conf; // Language Management -$langs->load("admin"); -$langs->load("cron"); +$langs->loadLangs(array("admin", "cron")); /* * View diff --git a/htdocs/public/demo/index.php b/htdocs/public/demo/index.php index 61919c54b1a..f9169bb47d2 100644 --- a/htdocs/public/demo/index.php +++ b/htdocs/public/demo/index.php @@ -30,9 +30,7 @@ define("NOCSRFCHECK",1); // We accept to go on this page from external web site. require '../../main.inc.php'; require_once '../../core/lib/functions2.lib.php'; -$langs->load("main"); -$langs->load("install"); -$langs->load("other"); +$langs->loadLangs(array("main", "install", "other")); $conf->dol_hide_topmenu=GETPOST('dol_hide_topmenu','int'); $conf->dol_hide_leftmenu=GETPOST('dol_hide_leftmenu','int'); diff --git a/htdocs/public/emailing/mailing-unsubscribe.php b/htdocs/public/emailing/mailing-unsubscribe.php index 1dc1477e7b4..c27cb024aab 100644 --- a/htdocs/public/emailing/mailing-unsubscribe.php +++ b/htdocs/public/emailing/mailing-unsubscribe.php @@ -53,8 +53,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; global $user, $conf, $langs; -$langs->load("main"); -$langs->load("mails"); +$langs->loadLangs(array("main", "mails")); $tag=GETPOST('tag'); $unsuscrib=GETPOST('unsuscrib'); diff --git a/htdocs/public/members/public_card.php b/htdocs/public/members/public_card.php index 5dee0eb49a3..eda1aaf2c68 100644 --- a/htdocs/public/members/public_card.php +++ b/htdocs/public/members/public_card.php @@ -43,10 +43,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; if (empty($conf->adherent->enabled)) accessforbidden('',0,0,1); -$langs->load("main"); -$langs->load("members"); -$langs->load("companies"); -$langs->load("other"); +$langs->loadLangs(array("main", "members", "companies", "other")); $id=GETPOST('id','int'); $object = new Adherent($db); diff --git a/htdocs/public/members/public_list.php b/htdocs/public/members/public_list.php index 1f9a4406028..6ba46182427 100644 --- a/htdocs/public/members/public_list.php +++ b/htdocs/public/members/public_list.php @@ -40,10 +40,7 @@ require '../../main.inc.php'; if (empty($conf->adherent->enabled)) accessforbidden('',0,0,1); -$langs->load("main"); -$langs->load("members"); -$langs->load("companies"); -$langs->load("other"); +$langs->loadLangs(array("main", "members", "companies", "other")); /** diff --git a/htdocs/public/onlinesign/newonlinesign.php b/htdocs/public/onlinesign/newonlinesign.php index 43508cfe177..e8db916ad91 100644 --- a/htdocs/public/onlinesign/newonlinesign.php +++ b/htdocs/public/onlinesign/newonlinesign.php @@ -44,13 +44,7 @@ require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; // Security check // No check on module enabled. Done later according to $validpaymentmethod -$langs->load("main"); -$langs->load("other"); -$langs->load("dict"); -$langs->load("bills"); -$langs->load("companies"); -$langs->load("errors"); -$langs->load("paybox"); // File with generic data +$langs->loadLangs(array("main", "other", "dict", "bills", "companies", "errors", "paybox")); $action=GETPOST('action','alpha'); diff --git a/htdocs/public/paybox/paymentko.php b/htdocs/public/paybox/paymentko.php index feb4070c16b..ef642a5b80b 100644 --- a/htdocs/public/paybox/paymentko.php +++ b/htdocs/public/paybox/paymentko.php @@ -39,15 +39,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php'; // Security check if (empty($conf->paybox->enabled)) accessforbidden('',0,0,1); -$langs->load("main"); -$langs->load("other"); -$langs->load("dict"); -$langs->load("bills"); -$langs->load("companies"); -$langs->load("paybox"); -$langs->load("paypal"); -$langs->load("stripe"); - +$langs->loadLangs(array("main", "other", "dict", "bills", "companies", "paybox", "paypal", "stripe")); $object = new stdClass(); // For triggers diff --git a/htdocs/public/paybox/paymentok.php b/htdocs/public/paybox/paymentok.php index 9e711ade51b..41eef8784bc 100644 --- a/htdocs/public/paybox/paymentok.php +++ b/htdocs/public/paybox/paymentok.php @@ -39,14 +39,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php'; // Security check if (empty($conf->paybox->enabled)) accessforbidden('',0,0,1); -$langs->load("main"); -$langs->load("other"); -$langs->load("dict"); -$langs->load("bills"); -$langs->load("companies"); -$langs->load("paybox"); -$langs->load("paypal"); -$langs->load("stripe"); +$langs->loadLangs(array("main", "other", "dict", "bills", "companies", "paybox", "paypal", "stripe")); /*$source=GETPOST('source'); $ref=GETPOST('ref'); diff --git a/htdocs/public/payment/paymentko.php b/htdocs/public/payment/paymentko.php index 01bee23d124..33fc1fb5101 100644 --- a/htdocs/public/payment/paymentko.php +++ b/htdocs/public/payment/paymentko.php @@ -44,14 +44,7 @@ if (! empty($conf->paypal->enabled)) require_once DOL_DOCUMENT_ROOT.'/paypal/lib/paypalfunctions.lib.php'; } -$langs->load("main"); -$langs->load("other"); -$langs->load("dict"); -$langs->load("bills"); -$langs->load("companies"); -$langs->load("paybox"); -$langs->load("paypal"); -$langs->load("stripe"); +$langs->loadLangs(array("main", "other", "dict", "bills", "companies", "paybox", "paypal", "stripe")); if (! empty($conf->paypal->enabled)) { diff --git a/htdocs/public/paypal/paymentko.php b/htdocs/public/paypal/paymentko.php index 3e555379849..03645244e91 100644 --- a/htdocs/public/paypal/paymentko.php +++ b/htdocs/public/paypal/paymentko.php @@ -43,14 +43,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php'; // Security check if (empty($conf->paypal->enabled)) accessforbidden('',0,0,1); -$langs->load("main"); -$langs->load("other"); -$langs->load("dict"); -$langs->load("bills"); -$langs->load("companies"); -$langs->load("paybox"); -$langs->load("paypal"); -$langs->load("stripe"); +$langs->loadLangs(array("main", "other", "dict", "bills", "companies", "paybox", "paypal", "stripe")); $PAYPALTOKEN=GETPOST('TOKEN'); if (empty($PAYPALTOKEN)) $PAYPALTOKEN=GETPOST('token'); diff --git a/htdocs/public/stripe/paymentko.php b/htdocs/public/stripe/paymentko.php index ff1abfae9e4..be285cfc628 100644 --- a/htdocs/public/stripe/paymentko.php +++ b/htdocs/public/stripe/paymentko.php @@ -36,14 +36,7 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php'; -$langs->load("main"); -$langs->load("other"); -$langs->load("dict"); -$langs->load("bills"); -$langs->load("companies"); -$langs->load("paybox"); -$langs->load("paypal"); -$langs->load("stripe"); +$langs->loadLangs(array("main", "other", "dict", "bills", "companies", "paybox", "paypal", "stripe")); $FULLTAG=GETPOST('FULLTAG'); if (empty($FULLTAG)) $FULLTAG=GETPOST('fulltag'); diff --git a/htdocs/public/stripe/paymentok.php b/htdocs/public/stripe/paymentok.php index 52b3dac8a7f..4bce7dd62ce 100644 --- a/htdocs/public/stripe/paymentok.php +++ b/htdocs/public/stripe/paymentok.php @@ -36,13 +36,7 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php'; -$langs->load("main"); -$langs->load("other"); -$langs->load("dict"); -$langs->load("bills"); -$langs->load("companies"); -$langs->load("paybox"); -$langs->load("paypal"); +$langs->loadLangs(array("main", "other", "dict", "bills", "companies", "paybox", "paypal")); $FULLTAG=GETPOST('FULLTAG'); if (empty($FULLTAG)) $FULLTAG=GETPOST('fulltag'); diff --git a/htdocs/resource/agenda.php b/htdocs/resource/agenda.php new file mode 100644 index 00000000000..23f1c9f913b --- /dev/null +++ b/htdocs/resource/agenda.php @@ -0,0 +1,175 @@ + + * Copyright (C) 2005 Brice Davoleau + * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2006-2015 Laurent Destailleur + * Copyright (C) 2007 Patrick Raguin + * Copyright (C) 2010 Juanjo Menent + * Copyright (C) 2015 Marcos García + * Copyright (C) 2018 Florain Henry . + */ + +/** + * \file htdocs/product/agenda.php + * \ingroup product + * \brief Page of product events + */ + +require '../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/resource.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/resource/class/dolresource.class.php'; + +// Load translation files required by the page +$langs->load("companies"); + +if (GETPOST('actioncode','array')) +{ + $actioncode=GETPOST('actioncode','array',3); + if (! count($actioncode)) $actioncode='0'; +} +else +{ + $actioncode=GETPOST("actioncode","alpha",3)?GETPOST("actioncode","alpha",3):(GETPOST("actioncode")=='0'?'0':(empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT)?'':$conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT)); +} +$search_agenda_label=GETPOST('search_agenda_label'); + +// Security check +$id = GETPOST('id','int'); +$ref = GETPOST('ref', 'alpha'); +if ($user->societe_id) $id=$user->societe_id; +// Protection if external user +if ($user->socid > 0) +{ + accessforbidden(); +} + +if( ! $user->rights->resource->read) +{ + accessforbidden(); +} + +$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit; +$sortfield = GETPOST("sortfield",'alpha'); +$sortorder = GETPOST("sortorder",'alpha'); +$page = GETPOST("page",'int'); +if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 +$offset = $limit * $page; +$pageprev = $page - 1; +$pagenext = $page + 1; +if (! $sortfield) $sortfield='a.datep,a.id'; +if (! $sortorder) $sortorder='DESC,DESC'; + +// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context +$hookmanager->initHooks(array('agendaresource')); + + +/* + * Actions + */ + +$parameters=array('id'=>$id); +$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks +if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); + +if (empty($reshook)) +{ + // Cancel + if (GETPOST('cancel','alpha') && ! empty($backtopage)) + { + header("Location: ".$backtopage); + exit; + } + + // Purge search criteria + if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers + { + $actioncode=''; + $search_agenda_label=''; + } +} + + + +/* + * View + */ + +$contactstatic = new Contact($db); + +$form = new Form($db); + +if ($id > 0 || $ref) +{ + require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; + require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; + + $langs->load("companies"); + + + $object = new Dolresource($db); + $result = $object->fetch($id); + + $title=$langs->trans("Agenda"); + if (! empty($conf->global->MAIN_HTML_TITLE) && preg_match('/productnameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->ref." - ".$title; + llxHeader('',$title); + + if (! empty($conf->notification->enabled)) $langs->load("mails"); + $type = $langs->trans('ResourceSingular'); + + $head = resource_prepare_head($object); + + $titre=$langs->trans("ResourceSingular"); + dol_fiche_head($head, 'agenda', $titre, -1, $picto); + + $linkback = ''.$langs->trans("BackToList").''; + + $shownav = 1; + if ($user->societe_id && ! in_array('resource', explode(',',$conf->global->MAIN_MODULES_FOR_EXTERNAL))) $shownav=0; + + dol_banner_tab($object, 'id', $linkback, $shownav, 'id'); + + print '
'; + + print '
'; + + print '
'; + + dol_fiche_end(); + + if (! empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read) )) + { + print '
'; + + $param='&id='.$id; + if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage; + if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; + + print_barre_liste($langs->trans("ActionsOnResource"), 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, '', 0, -1, '', 0, $morehtmlcenter, '', 0, 1, 1); + + // List of all actions + $filters=array(); + $filters['search_agenda_label']=$search_agenda_label; + + // TODO Replace this with same code than into list.php + show_actions_done($conf,$langs,$db,$object,null,0,$actioncode, '', $filters, $sortfield, $sortorder); + } +} + +// End of page +llxFooter(); +$db->close(); diff --git a/htdocs/societe/admin/contact_extrafields.php b/htdocs/societe/admin/contact_extrafields.php index 34bdb688835..5eaba3c1cb1 100644 --- a/htdocs/societe/admin/contact_extrafields.php +++ b/htdocs/societe/admin/contact_extrafields.php @@ -28,8 +28,7 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; -$langs->load("companies"); -$langs->load("admin"); +$langs->loadLangs(array("companies", "admin")); $extrafields = new ExtraFields($db); $form = new Form($db); diff --git a/htdocs/societe/admin/societe.php b/htdocs/societe/admin/societe.php index f07922b1781..3a7b26505c7 100644 --- a/htdocs/societe/admin/societe.php +++ b/htdocs/societe/admin/societe.php @@ -29,8 +29,7 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; -$langs->load("admin"); -$langs->load('other'); +$langs->loadLangs(array("admin", "other")); $action=GETPOST('action','alpha'); $value=GETPOST('value','alpha'); diff --git a/htdocs/societe/admin/societe_extrafields.php b/htdocs/societe/admin/societe_extrafields.php index 39f3ab53866..0835df13e22 100644 --- a/htdocs/societe/admin/societe_extrafields.php +++ b/htdocs/societe/admin/societe_extrafields.php @@ -28,9 +28,7 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; -$langs->load("companies"); -$langs->load("admin"); -$langs->load("members"); +$langs->loadLangs(array("companies", "admin", "members")); $extrafields = new ExtraFields($db); $form = new Form($db); diff --git a/htdocs/societe/document.php b/htdocs/societe/document.php index 25478e133af..a9aae7a8654 100644 --- a/htdocs/societe/document.php +++ b/htdocs/societe/document.php @@ -32,9 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; -$langs->load("companies"); -$langs->load('other'); - +$langs->loadLangs(array("companies", "other")); $action=GETPOST('action','aZ09'); $confirm=GETPOST('confirm'); diff --git a/htdocs/societe/notify/card.php b/htdocs/societe/notify/card.php index fb4b51f17c8..b5de5c77456 100644 --- a/htdocs/societe/notify/card.php +++ b/htdocs/societe/notify/card.php @@ -30,10 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/triggers/interface_50_modNotification_Notification.class.php'; -$langs->load("companies"); -$langs->load("mails"); -$langs->load("admin"); -$langs->load("other"); +$langs->loadLangs(array("companies", "mails", "admin", "other")); $socid = GETPOST("socid",'int'); $action = GETPOST('action','aZ09'); diff --git a/htdocs/societe/notify/index.php b/htdocs/societe/notify/index.php index 9980cf19a2a..129131ff5c6 100644 --- a/htdocs/societe/notify/index.php +++ b/htdocs/societe/notify/index.php @@ -23,8 +23,7 @@ */ require '../../main.inc.php'; -$langs->load("companies"); -$langs->load("banks"); +$langs->loadLangs(array("companies", "banks")); // S�curit� acc�s client if ($user->societe_id > 0) diff --git a/htdocs/societe/price.php b/htdocs/societe/price.php index 45d7f9ad020..0fbc4368a87 100644 --- a/htdocs/societe/price.php +++ b/htdocs/societe/price.php @@ -38,9 +38,7 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { $prodcustprice = new Productcustomerprice($db); } -$langs->load("products"); -$langs->load("companies"); -$langs->load("bills"); +$langs->loadLangs(array("products", "companies", "bills")); $action = GETPOST('action', 'alpha'); $search_prod = GETPOST('search_prod','alpha'); diff --git a/htdocs/societe/project.php b/htdocs/societe/project.php index dd06346ca33..f92d274fe46 100644 --- a/htdocs/societe/project.php +++ b/htdocs/societe/project.php @@ -31,8 +31,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; -$langs->load("companies"); -$langs->load("projects"); +$langs->loadLangs(array("companies", "projects")); // Security check $socid = GETPOST('socid','int'); diff --git a/htdocs/societe/societecontact.php b/htdocs/societe/societecontact.php index a2f09f9b77d..edfa2f28d5c 100644 --- a/htdocs/societe/societecontact.php +++ b/htdocs/societe/societecontact.php @@ -32,8 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; -$langs->load("orders"); -$langs->load("companies"); +$langs->loadLangs(array("orders", "companies")); $id=GETPOST('id','int')?GETPOST('id','int'):GETPOST('socid','int'); $ref=GETPOST('ref','alpha'); diff --git a/htdocs/support/index.php b/htdocs/support/index.php index ab5d62df39e..bc0ef1a79c5 100644 --- a/htdocs/support/index.php +++ b/htdocs/support/index.php @@ -34,9 +34,7 @@ if ($pos == '/') $pos = ''; // si $pos vaut /, on le met a '' if (! defined('DOL_URL_ROOT')) define('DOL_URL_ROOT', $pos); // URL racine relative -$langs->load("other"); -$langs->load("help"); - +$langs->loadLangs(array("other", $langs->load("help"))); /* * View diff --git a/htdocs/support/online.php b/htdocs/support/online.php index 0f2dca142fc..01b2cb4dbd1 100644 --- a/htdocs/support/online.php +++ b/htdocs/support/online.php @@ -30,9 +30,7 @@ if ($pos == '/') $pos = ''; // si $pos vaut /, on le met a '' define('DOL_URL_ROOT', $pos); // URL racine relative -$langs->load("other"); -$langs->load("help"); - +$langs->loadLangs(array("other", "help")); /* * View diff --git a/htdocs/takepos/admin/orderprinters.php b/htdocs/takepos/admin/orderprinters.php index 646eef127bf..4c72031b41b 100644 --- a/htdocs/takepos/admin/orderprinters.php +++ b/htdocs/takepos/admin/orderprinters.php @@ -32,10 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/treeview.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; -$langs->load("main"); -$langs->load("categories"); -$langs->load("takepos"); -$langs->load("printing"); +$langs->loadLangs(array("main"), "categories", "takepos", "printing"); if (! $user->rights->categorie->lire) accessforbidden(); diff --git a/htdocs/takepos/admin/setup.php b/htdocs/takepos/admin/setup.php index 702f9d8bc07..453ecf64609 100644 --- a/htdocs/takepos/admin/setup.php +++ b/htdocs/takepos/admin/setup.php @@ -37,9 +37,7 @@ if (! empty($_REQUEST['CASHDESK_ID_THIRDPARTY_id'])) // Security check if (!$user->admin) accessforbidden(); -$langs->load("admin"); -$langs->load("cashdesk"); - +$langs->loadLangs(array("admin", "cashdesk")); /* * Actions diff --git a/htdocs/takepos/freezone.php b/htdocs/takepos/freezone.php index f97d46518e3..702c59541a3 100644 --- a/htdocs/takepos/freezone.php +++ b/htdocs/takepos/freezone.php @@ -27,8 +27,7 @@ if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1'); require '../main.inc.php'; // Load $user and permissions -$langs->load("bills"); -$langs->load("cashdesk"); +$langs->loadLangs(array("bills", "cashdesk")); $place = GETPOST('place','int'); diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index 91b43dad675..f0e5d21770c 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -29,8 +29,7 @@ require '../main.inc.php'; // Load $user and permissions require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; -$langs->load("bills"); -$langs->load("cashdesk"); +$langs->loadLangs(array("bills", "cashdesk")); $id = GETPOST('id','int'); $action = GETPOST('action','alpha'); diff --git a/htdocs/takepos/pay.php b/htdocs/takepos/pay.php index 5f3b27b95be..c0bfc35294a 100644 --- a/htdocs/takepos/pay.php +++ b/htdocs/takepos/pay.php @@ -49,9 +49,7 @@ else{ top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss); -$langs->load("main"); -$langs->load("bills"); -$langs->load("cashdesk"); +$langs->loadLangs(array("main", "bills", "cashdesk")); ?>