Standardize and update code

This commit is contained in:
Philippe GRAND 2018-09-08 12:57:11 +02:00
parent c65505fdca
commit a6b25093e7
2 changed files with 3 additions and 13 deletions

View File

@ -32,11 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
// Load translation files required by the page
$langs->loadLangs(array('admin', 'languages', 'other'));
$langs->load("companies");
$langs->load("products");
$langs->load("members");
$langs->loadLangs(array('admin', 'languages', 'other', 'companies', 'products', 'members'));
if (! $user->admin) accessforbidden();

View File

@ -4,7 +4,7 @@
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2012 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2013-2018 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
*
* This program is free software; you can redistribute it and/or modify
@ -32,17 +32,11 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/fourn.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
// Load translation files required by the page
$langs->load("orders");
$langs->loadLangs(array("admin", "other", "bills", "orders", "suppliers"));
if (!$user->admin)
accessforbidden();
$langs->load("admin");
$langs->load("other");
$langs->load("bills");
$langs->load("orders");
$langs->load("suppliers");
$extrafields = new ExtraFields($db);
$form = new Form($db);