Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur 2022-08-30 18:46:31 +02:00
commit 499810c822
36 changed files with 844 additions and 666 deletions

View File

@ -20,6 +20,7 @@ WARNING:
Following changes may create regressions for some external modules, but were necessary to make Dolibarr better:
* The signature of method getNomUrl() of class ProductFournisseur has been modified to match the signature of method Product
* Trigger ORDER_SUPPLIER_DISPATCH is removed, use ORDER_SUPPLIER_RECEIVE and/or LINEORDER_SUPPLIER_DISPATCH instead.
***** ChangeLog for 16.0.0 compared to 15.0.0 *****

View File

@ -23,6 +23,8 @@
* \brief Home accounting module
*/
// Load Dolibarr environment
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';

View File

@ -29,6 +29,8 @@
* \brief Page of a member
*/
// Load Dolibarr environment
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
@ -44,9 +46,12 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
// Load translation files required by the page
$langs->loadLangs(array("companies", "bills", "members", "users", "other", "paypal"));
// Get parameters
$action = GETPOST('action', 'aZ09');
$cancel = GETPOST('cancel', 'alpha');
$backtopage = GETPOST('backtopage', 'alpha');

View File

@ -27,19 +27,24 @@
* \brief Home page of membership module
*/
// Load Dolibarr environment
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php';
require_once DOL_DOCUMENT_ROOT.'/adherents/class/subscription.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
// Load translation files required by the page
$langs->loadLangs(array("companies", "members"));
$hookmanager = new HookManager($db);
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array
$hookmanager->initHooks(array('membersindex'));
// Load translation files required by the page
$langs->loadLangs(array("companies", "members"));
// Security check
$result = restrictedArea($user, 'adherent');

View File

@ -27,14 +27,20 @@
* \brief Page to list all members of foundation
*/
// Load Dolibarr environment
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
// Load translation files required by the page
$langs->loadLangs(array("members", "companies"));
// Get parameters
$action = GETPOST('action', 'aZ09');
$massaction = GETPOST('massaction', 'alpha');
$show_files = GETPOST('show_files', 'int');
@ -42,6 +48,8 @@ $confirm = GETPOST('confirm', 'alpha');
$toselect = GETPOST('toselect', 'array');
$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'memberslist'; // To manage different context of search
// Search fields
$search = GETPOST("search", 'alpha');
$search_ref = GETPOST("search_ref", 'alpha');
$search_lastname = GETPOST("search_lastname", 'alpha');

View File

@ -23,25 +23,34 @@
* \brief Tab for note of a member
*/
// Load Dolibarr environment
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php';
// Load translation files required by the page
$langs->loadLangs(array("companies", "members", "bills"));
// Get parameters
$action = GETPOST('action', 'aZ09');
$id = GETPOST('id', 'int');
$ref = GETPOST('ref', 'alphanohtml');
// Initialize objects
$object = new Adherent($db);
$result = $object->fetch($id);
if ($result > 0) {
$adht = new AdherentType($db);
$result = $adht->fetch($object->typeid);
}
$permissionnote = $user->rights->adherent->creer; // Used by the include of actions_setnotes.inc.php
// Fetch object

File diff suppressed because it is too large Load Diff

View File

@ -124,7 +124,7 @@ class AgendaEvents extends DolibarrApi
if (!DolibarrApiAccess::$user->rights->societe->client->voir && !$socid) {
$search_sale = DolibarrApiAccess::$user->id;
}
if (empty($conf->societe->enabled)) {
if (!isModEnabled('societe')) {
$search_sale = 0; // If module thirdparty not enabled, sale representative is something that does not exists
}

View File

@ -25,6 +25,8 @@
* \brief Home page of customer order module
*/
// Load Dolibarr environment
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/notify.class.php';
@ -32,6 +34,11 @@ require_once DOL_DOCUMENT_ROOT.'/societe/class/client.class.php';
require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/order.lib.php';
// Load translation files required by the page
$langs->loadLangs(array('orders', 'bills'));
if (!$user->rights->commande->lire) {
accessforbidden();
}
@ -41,8 +48,6 @@ $hookmanager = new HookManager($db);
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array
$hookmanager->initHooks(array('ordersindex'));
// Load translation files required by the page
$langs->loadLangs(array('orders', 'bills'));
// Security check
$socid = GETPOST('socid', 'int');

View File

@ -236,7 +236,7 @@ class InterfaceZapierTriggers extends DolibarrTriggers
// case 'ORDER_SUPPLIER_REFUSE':
// case 'ORDER_SUPPLIER_CANCEL':
// case 'ORDER_SUPPLIER_SENTBYMAIL':
// case 'ORDER_SUPPLIER_DISPATCH':
// case 'ORDER_SUPPLIER_RECEIVE':
// case 'LINEORDER_SUPPLIER_DISPATCH':
// case 'LINEORDER_SUPPLIER_CREATE':
// case 'LINEORDER_SUPPLIER_UPDATE':

View File

@ -460,7 +460,7 @@ if ($action == 'create') {
print $form->selectyesno("public", $public_donation, 1);
print "</td></tr>\n";
if (empty($conf->societe->enabled) || empty($conf->global->DONATION_USE_THIRDPARTIES)) {
if (!isModEnabled('societe') || empty($conf->global->DONATION_USE_THIRDPARTIES)) {
print "<tr>".'<td>'.$langs->trans("Company").'</td><td><input type="text" name="societe" value="'.dol_escape_htmltag(GETPOST("societe")).'" class="maxwidth200"></td></tr>';
print "<tr>".'<td>'.$langs->trans("Lastname").'</td><td><input type="text" name="lastname" value="'.dol_escape_htmltag(GETPOST("lastname")).'" class="maxwidth200"></td></tr>';
print "<tr>".'<td>'.$langs->trans("Firstname").'</td><td><input type="text" name="firstname" value="'.dol_escape_htmltag(GETPOST("firstname")).'" class="maxwidth200"></td></tr>';

View File

@ -314,7 +314,7 @@ if (!empty($conf->global->ECM_AUTO_TREE_ENABLED)) {
$rowspan++; $sectionauto[] = array('position'=>10, 'level'=>1, 'module'=>'product', 'test'=>(isModEnabled("product") || isModEnabled("service")), 'label'=>$langs->trans("ProductsAndServices"), 'desc'=>$langs->trans("ECMDocsByProducts"));
}
if (isModEnabled("societe")) {
$rowspan++; $sectionauto[] = array('position'=>20, 'level'=>1, 'module'=>'company', 'test'=>$conf->societe->enabled, 'label'=>$langs->trans("ThirdParties"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("ThirdParties")));
$rowspan++; $sectionauto[] = array('position'=>20, 'level'=>1, 'module'=>'company', 'test'=>isModEnabled('societe'), 'label'=>$langs->trans("ThirdParties"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("ThirdParties")));
}
if (isModEnabled("propal")) {
$rowspan++; $sectionauto[] = array('position'=>30, 'level'=>1, 'module'=>'propal', 'test'=>$conf->propal->enabled, 'label'=>$langs->trans("Proposals"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Proposals")));

View File

@ -117,7 +117,7 @@ if (isModEnabled("product") || isModEnabled("service")) {
$langs->load("products"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'product', 'test'=>(isModEnabled("product") || isModEnabled("service")), 'label'=>$langs->trans("ProductsAndServices"), 'desc'=>$langs->trans("ECMDocsByProducts"));
}
if (isModEnabled("societe")) {
$rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'company', 'test'=>$conf->societe->enabled, 'label'=>$langs->trans("ThirdParties"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("ThirdParties")));
$rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'company', 'test'=>isModEnabled('societe'), 'label'=>$langs->trans("ThirdParties"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("ThirdParties")));
}
if (isModEnabled("propal")) {
$rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'propal', 'test'=>$conf->propal->enabled, 'label'=>$langs->trans("Proposals"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Proposals")));

View File

@ -373,19 +373,6 @@ if ($action == 'dispatch' && $permissiontoreceive) {
}
}
if (!$error) {
global $conf, $langs, $user;
// Call trigger
$result = $object->call_trigger('ORDER_SUPPLIER_DISPATCH', $user);
// End call triggers
if ($result < 0) {
setEventMessages($object->error, $object->errors, 'errors');
$error++;
}
}
if ($result >= 0 && !$error) {
$db->commit();

View File

@ -177,7 +177,7 @@ class InterfaceMyModuleTriggers extends DolibarrTriggers
//case 'ORDER_SUPPLIER_REFUSE':
//case 'ORDER_SUPPLIER_CANCEL':
//case 'ORDER_SUPPLIER_SENTBYMAIL':
//case 'ORDER_SUPPLIER_DISPATCH':
//case 'ORDER_SUPPLIER_RECEIVE':
//case 'LINEORDER_SUPPLIER_DISPATCH':
//case 'LINEORDER_SUPPLIER_CREATE':
//case 'LINEORDER_SUPPLIER_UPDATE':

View File

@ -41,6 +41,8 @@
* \brief Page to show product
*/
// Load Dolibarr environment
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/canvas.class.php';
@ -88,6 +90,7 @@ $mesg = ''; $error = 0; $errors = array();
$refalreadyexists = 0;
// Get parameters
$id = GETPOST('id', 'int');
$ref = (GETPOSTISSET('ref') ? GETPOST('ref', 'alpha') : null);
$type = (GETPOSTISSET('type') ? GETPOST('type', 'int') : Product::TYPE_PRODUCT);
@ -107,6 +110,7 @@ $accountancy_code_buy_intra = GETPOST('accountancy_code_buy_intra', 'alpha');
$accountancy_code_buy_export = GETPOST('accountancy_code_buy_export', 'alpha');
$checkmandatory = GETPOST('accountancy_code_buy_export', 'alpha');
// by default 'alphanohtml' (better security); hidden conf MAIN_SECURITY_ALLOW_UNSECURED_LABELS_WITH_HTML allows basic html
$label_security_check = empty($conf->global->MAIN_SECURITY_ALLOW_UNSECURED_LABELS_WITH_HTML) ? 'alphanohtml' : 'restricthtml';

View File

@ -28,6 +28,8 @@
* \brief Page des documents joints sur les produits
*/
// Load Dolibarr environment
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php';
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
@ -38,9 +40,12 @@ if (!empty($conf->global->PRODUIT_PDF_MERGE_PROPAL)) {
require_once DOL_DOCUMENT_ROOT.'/product/class/propalmergepdfproduct.class.php';
}
// Load translation files required by the page
$langs->loadLangs(array('other', 'products'));
// Get parameters
$id = GETPOST('id', 'int');
$ref = GETPOST('ref', 'alpha');
$action = GETPOST('action', 'aZ09');
@ -74,7 +79,7 @@ if (!$sortfield) {
$sortfield = "position_name";
}
// Initialize objects
$object = new Product($db);
if ($id > 0 || !empty($ref)) {
$result = $object->fetch($id, $ref);
@ -93,6 +98,7 @@ if ($id > 0 || !empty($ref)) {
}
}
}
$modulepart = 'produit';

View File

@ -28,6 +28,8 @@
* \brief Homepage products and services
*/
// Load Dolibarr environment
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
@ -47,6 +49,7 @@ $langs->loadLangs(array('products', 'stocks'));
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array of hooks
$hookmanager->initHooks(array('productindex'));
// Initialize objects
$product_static = new Product($db);
// Security check

View File

@ -33,6 +33,8 @@
* \brief Page to list products and services
*/
// Load Dolibarr environment
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php';
@ -51,12 +53,15 @@ if (!empty($conf->productbatch->enabled)) {
$langs->load("productbatch");
}
// Get parameters
$action = GETPOST('action', 'aZ09');
$massaction = GETPOST('massaction', 'alpha');
$show_files = GETPOST('show_files', 'int');
$confirm = GETPOST('confirm', 'alpha');
$toselect = GETPOST('toselect', 'array');
// Search Criterias
$sall = trim((GETPOST('search_all', 'alphanohtml') != '') ?GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml'));
$search_id = GETPOST("search_id", 'alpha');
$search_ref = GETPOST("search_ref", 'alpha');

View File

@ -199,7 +199,7 @@ foreach ($object->fields as $key => $val) {
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
// Add non object fields to fields for list
$arrayfields['s.nom'] = array('label'=>$langs->trans("ThirdParty"), 'checked'=>1, 'position'=>21, 'enabled'=>(empty($conf->societe->enabled) ? 0 : 1));
$arrayfields['s.nom'] = array('label'=>$langs->trans("ThirdParty"), 'checked'=>1, 'position'=>21, 'enabled'=>(!isModEnabled('societe') ? 0 : 1));
$arrayfields['s.name_alias'] = array('label'=>"AliasNameShort", 'checked'=>0, 'position'=>22);
$arrayfields['commercial'] = array('label'=>$langs->trans("SaleRepresentativesOfThirdParty"), 'checked'=>0, 'position'=>23);
$arrayfields['c.assigned'] = array('label'=>$langs->trans("AssignedTo"), 'checked'=>-1, 'position'=>120);

View File

@ -34,6 +34,8 @@
* \brief Third party card page
*/
// Load Dolibarr environment
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php';
@ -62,7 +64,10 @@ if (! empty($conf->eventorganization->enabled)) {
}
// Load translation files required by the page
$langs->loadLangs(array("companies", "commercial", "bills", "banks", "users"));
if (!empty($conf->adherent->enabled)) {
$langs->load("members");
}
@ -81,13 +86,15 @@ if (!empty($conf->accounting->enabled)) {
$error = 0; $errors = array();
// Get parameters
$action = (GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view');
$cancel = GETPOST('cancel', 'alpha');
$backtopage = GETPOST('backtopage', 'alpha');
$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha');
$backtopagejsfields = GETPOST('backtopagejsfields', 'alpha');
$dol_openinpopup = GETPOST('dol_openinpopup', 'aZ09');
$confirm = GETPOST('confirm', 'alpha');
$confirm = GETPOST('confirm', 'alpha');
$socid = GETPOST('socid', 'int') ?GETPOST('socid', 'int') : GETPOST('id', 'int');
if ($user->socid) {
@ -96,6 +103,7 @@ if ($user->socid) {
if (empty($socid) && $action == 'view') {
$action = 'create';
}
$id = $socid;
$object = new Societe($db);
@ -128,12 +136,13 @@ if (!empty($canvas)) {
$objcanvas->getCanvas('thirdparty', 'card', $canvas);
}
$permissiontoread = $user->rights->societe->lire;
$permissiontoadd = $user->rights->societe->creer; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
// Permissions
$permissiontoread = $user->rights->societe->lire;
$permissiontoadd = $user->rights->societe->creer; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
$permissiontodelete = $user->rights->societe->supprimer || ($permissiontoadd && isset($object->status) && $object->status == 0);
$permissionnote = $user->rights->societe->creer; // Used by the include of actions_setnotes.inc.php
$permissiondellink = $user->rights->societe->creer; // Used by the include of actions_dellink.inc.php
$upload_dir = $conf->societe->multidir_output[isset($object->entity) ? $object->entity : 1];
$permissionnote = $user->rights->societe->creer; // Used by the include of actions_setnotes.inc.php
$permissiondellink = $user->rights->societe->creer; // Used by the include of actions_dellink.inc.php
$upload_dir = $conf->societe->multidir_output[isset($object->entity) ? $object->entity : 1];
// Security check
$result = restrictedArea($user, 'societe', $socid, '&societe', '', 'fk_soc', 'rowid', 0);

View File

@ -550,7 +550,7 @@ class Thirdparties extends DolibarrApi
{
global $conf;
if (empty($conf->societe->enabled)) {
if (!isModEnabled('societe')) {
throw new RestException(501, 'Module "Thirdparties" needed for this request');
}

View File

@ -26,12 +26,18 @@
* \brief Add a tab on thirdparty view to list all products/services bought or sells by thirdparty
*/
// Load Dolibarr environment
require "../main.inc.php";
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/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php';
// Load translation files required by the page
$langs->loadLangs(array("companies", "bills", "orders", "suppliers", "propal", "interventions", "contracts", "products"));
$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'thirdpartylist';
// Security check
@ -46,11 +52,11 @@ if ($socid > 0) {
}
// Sort & Order fields
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST('sortfield', 'aZ09comma');
$sortorder = GETPOST('sortorder', 'aZ09comma');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
$optioncss = GETPOST('optioncss', 'alpha');
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST('sortfield', 'aZ09comma');
$sortorder = GETPOST('sortorder', 'aZ09comma');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
$optioncss = GETPOST('optioncss', 'alpha');
if (empty($page) || $page == -1) {
$page = 0;
@ -78,12 +84,11 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x'
$year = '';
$month = '';
}
// Customer or supplier selected in drop box
$thirdTypeSelect = GETPOST("third_select_id", 'az09');
$type_element = GETPOST('type_element') ? GETPOST('type_element') : '';
// Load translation files required by the page
$langs->loadLangs(array("companies", "bills", "orders", "suppliers", "propal", "interventions", "contracts", "products"));
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$hookmanager->initHooks(array('consumptionthirdparty', 'globalcard'));

View File

@ -31,6 +31,7 @@
* \brief Page of contacts of thirdparties
*/
// Load Dolibarr environment
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php';
@ -46,7 +47,9 @@ if (!empty($conf->adherent->enabled)) {
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
}
// Load translation files required by the page
$langs->loadLangs(array("companies", "commercial", "bills", "banks", "users"));
if (!empty($conf->categorie->enabled)) {
$langs->load("categories");
}
@ -59,18 +62,23 @@ if (!empty($conf->notification->enabled)) {
$mesg = ''; $error = 0; $errors = array();
// Get parameters
$action = (GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view');
$cancel = GETPOST('cancel', 'alpha');
$cancel = GETPOST('cancel', 'alpha');
$backtopage = GETPOST('backtopage', 'alpha');
$confirm = GETPOST('confirm');
$socid = GETPOST('socid', 'int') ?GETPOST('socid', 'int') : GETPOST('id', 'int');
$confirm = GETPOST('confirm');
$socid = GETPOST('socid', 'int') ?GETPOST('socid', 'int') : GETPOST('id', 'int');
if ($user->socid) {
$socid = $user->socid;
}
if (empty($socid) && $action == 'view') {
$action = 'create';
}
// Initialize objects
$object = new Societe($db);
$extrafields = new ExtraFields($db);

View File

@ -26,30 +26,36 @@
* \ingroup societe
*/
// Load Dolibarr environment
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
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';
// Load translation files required by the page
$langs->loadLangs(array("companies", "other"));
$action = GETPOST('action', 'aZ09');
$confirm = GETPOST('confirm');
$id = (GETPOST('socid', 'int') ? GETPOST('socid', 'int') : GETPOST('id', 'int'));
$ref = GETPOST('ref', 'alpha');
// Get parameters
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST('sortfield', 'aZ09comma');
$sortorder = GETPOST('sortorder', 'aZ09comma');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
$action = GETPOST('action', 'aZ09');
$confirm = GETPOST('confirm');
$id = (GETPOST('socid', 'int') ? GETPOST('socid', 'int') : GETPOST('id', 'int'));
$ref = GETPOST('ref', 'alpha');
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST('sortfield', 'aZ09comma');
$sortorder = GETPOST('sortorder', 'aZ09comma');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : 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;
$offset = $limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
if (!empty($conf->global->MAIN_DOC_SORT_FIELD)) {
$sortfield = $conf->global->MAIN_DOC_SORT_FIELD;
@ -65,6 +71,7 @@ if (!$sortfield) {
$sortfield = "position_name";
}
// Initialize objects
$object = new Societe($db);
if ($id > 0 || !empty($ref)) {
$result = $object->fetch($id, $ref);

View File

@ -27,16 +27,21 @@
* \brief Home page for third parties area
*/
// Load Dolibarr environment
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
$hookmanager = new HookManager($db);
// Load translation files required by the page
$langs->load("companies");
// Initialize technical object to manage hooks. Note that conf->hooks_modules contains array
$hookmanager = new HookManager($db);
$hookmanager->initHooks(array('thirdpartiesindex'));
$langs->load("companies");
$socid = GETPOST('socid', 'int');
if ($user->socid) {
@ -51,6 +56,7 @@ $thirdparty_static = new Societe($db);
if (!isset($form) || !is_object($form)) {
$form = new Form($db);
}
// Load $resultboxes
$resultboxes = FormOther::getBoxesArea($user, "3");

View File

@ -34,6 +34,8 @@
* \brief Page to show list of third parties
*/
// Load Dolibarr environment
require_once '../main.inc.php';
include_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
@ -42,20 +44,27 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
require_once DOL_DOCUMENT_ROOT.'/societe/class/client.class.php';
// Load translation files required by the page
$langs->loadLangs(array("companies", "commercial", "customers", "suppliers", "bills", "compta", "categories", "cashdesk"));
$action = GETPOST('action', 'aZ09');
// Get parameters
$action = GETPOST('action', 'aZ09');
$massaction = GETPOST('massaction', 'alpha');
$show_files = GETPOST('show_files', 'int');
$confirm = GETPOST('confirm', 'alpha');
$toselect = GETPOST('toselect', 'array');
$confirm = GETPOST('confirm', 'alpha');
$toselect = GETPOST('toselect', 'array');
$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'thirdpartylist';
$optioncss = GETPOST('optioncss', 'alpha');
$optioncss = GETPOST('optioncss', 'alpha');
if ($contextpage == 'poslist') {
$optioncss = 'print';
}
$mode = GETPOST("mode", 'alpha');
// search fields
$search_all = trim(GETPOST('search_all', 'alphanohtml') ?GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml'));
$search_cti = preg_replace('/^0+/', '', preg_replace('/[^0-9]/', '', GETPOST('search_cti', 'alphanohtml'))); // Phone number without any special chars
@ -98,6 +107,7 @@ $search_stcomm = GETPOST('search_stcomm', 'int');
$search_import_key = trim(GETPOST("search_import_key", "alpha"));
$search_parent_name = trim(GETPOST('search_parent_name', 'alpha'));
$type = GETPOST('type', 'alpha');
$place = GETPOST('place', 'aZ09') ? GETPOST('place', 'aZ09') : '0'; // $place is string id of table for Bar or Restaurant

View File

@ -26,20 +26,28 @@
* \ingroup societe
*/
// Load Dolibarr environment
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
$action = GETPOST('action', 'aZ09');
// Load translation files required by the page
$langs->load("companies");
$id = GETPOST('id') ?GETPOST('id', 'int') : GETPOST('socid', 'int');
// Get parameters
$id = GETPOST('id') ?GETPOST('id', 'int') : GETPOST('socid', 'int');
$action = GETPOST('action', 'aZ09');
// Initialize objects
$object = new Societe($db);
if ($id > 0) {
$object->fetch($id);
}
// Permissions
$permissionnote = $user->rights->societe->creer; // Used by the include of actions_setnotes.inc.php
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
@ -50,6 +58,7 @@ if ($user->socid > 0) {
unset($action);
$socid = $user->socid;
}
$result = restrictedArea($user, 'societe', $object->id, '&societe');

View File

@ -29,6 +29,8 @@
* \brief Tab of payment modes for the customer
*/
// Load Dolibarr environment
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php';
@ -40,8 +42,11 @@ require_once DOL_DOCUMENT_ROOT.'/societe/class/societeaccount.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.php';
require_once DOL_DOCUMENT_ROOT.'/stripe/class/stripe.class.php';
// Load translation files required by the page
$langs->loadLangs(array("companies", "commercial", "banks", "bills", 'paypal', 'stripe', 'withdrawals'));
// Security check
$socid = GETPOST("socid", "int");
if ($user->socid) {
@ -49,12 +54,15 @@ if ($user->socid) {
}
$result = restrictedArea($user, 'societe', '', '');
// Get parameters
$id = GETPOST("id", "int");
$source = GETPOST("source", "alpha"); // source can be a source or a paymentmode
$ribid = GETPOST("ribid", "int");
$action = GETPOST("action", 'alpha', 3);
$cancel = GETPOST('cancel', 'alpha');
// Initialize objects
$object = new Societe($db);
$object->fetch($socid);
@ -70,6 +78,7 @@ $extrafields->fetch_name_optionals_label($object->table_element);
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$hookmanager->initHooks(array('thirdpartybancard', 'globalcard'));
// Permissions
$permissiontoread = $user->rights->societe->lire;
$permissiontoadd = $user->rights->societe->creer; // Used by the include of actions_addupdatedelete.inc.php and actions_builddoc.inc.php

View File

@ -26,6 +26,8 @@
* \brief Page to show product prices by customer
*/
// Load Dolibarr environment
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php';
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
@ -38,13 +40,17 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) {
$prodcustprice = new Productcustomerprice($db);
}
// Load translation files required by the page
$langs->loadLangs(array("products", "companies", "bills"));
$action = GETPOST('action', 'aZ09');
$search_prod = GETPOST('search_prod', 'alpha');
$cancel = GETPOST('cancel', 'alpha');
$search_label = GETPOST('search_label', 'alpha');
$search_price = GETPOST('search_price');
// Get parameters
$action = GETPOST('action', 'aZ09');
$search_prod = GETPOST('search_prod', 'alpha');
$cancel = GETPOST('cancel', 'alpha');
$search_label = GETPOST('search_label', 'alpha');
$search_price = GETPOST('search_price');
$search_price_ttc = GETPOST('search_price_ttc');
// Security check
@ -54,6 +60,7 @@ if ($user->socid) {
}
$result = restrictedArea($user, 'societe', $socid, '&societe');
// Initialize objects
$object = new Societe($db);
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context

View File

@ -28,11 +28,14 @@
* \brief Page of third party projects
*/
// Load Dolibarr environment
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->loadLangs(array("companies", "projects"));
// Load translation files required by the page
$langs->loadLangs(array('companies', 'projects'));
// Security check
$socid = GETPOST('socid', 'int');

View File

@ -26,14 +26,18 @@
* \brief Onglet de gestion des contacts additionnel d'une société
*/
// Load Dolibarr environment
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
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->loadLangs(array("orders", "companies"));
// Load translation files required by the page
$langs->loadLangs(array('companies', 'orders'));
// Get parameters
$id = GETPOST('id', 'int') ?GETPOST('id', 'int') : GETPOST('socid', 'int');
$ref = GETPOST('ref', 'alpha');
$action = GETPOST('action', 'aZ09');
@ -62,6 +66,8 @@ if ($user->socid) {
}
$result = restrictedArea($user, 'societe', $id, '');
// Initialize objects
$object = new Societe($db);
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context

View File

@ -28,6 +28,8 @@
* \brief Page of web sites accounts
*/
// Load Dolibarr environment
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
@ -35,13 +37,17 @@ require_once DOL_DOCUMENT_ROOT.'/societe/class/societeaccount.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
// Load translation files required by the page
$langs->loadLangs(array("companies", "website"));
$action = GETPOST('action', 'aZ09') ?GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ...
$show_files = GETPOST('show_files', 'int');
$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'websitelist'; // To manage different context of search
$backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page
$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
// Get parameters
$action = GETPOST('action', 'aZ09') ?GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ...
$show_files = GETPOST('show_files', 'int');
$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'websitelist'; // To manage different context of search
$backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page
$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
// Security check
$id = GETPOST('id', 'int') ?GETPOST('id', 'int') : GETPOST('socid', 'int');

View File

@ -21,11 +21,12 @@
* \brief Page with events on ticket
*/
// Load Dolibarr environment
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/ticket/class/actions_ticket.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formticket.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/ticket.lib.php';
require_once DOL_DOCUMENT_ROOT."/core/lib/company.lib.php";
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
@ -40,12 +41,12 @@ $track_id = GETPOST('track_id', 'alpha', 3);
$socid = GETPOST('socid', 'int');
$action = GETPOST('action', 'aZ09');
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST('sortfield', 'aZ09comma');
$sortorder = GETPOST('sortorder', 'aZ09comma');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
$page = is_numeric($page) ? $page : 0;
$page = $page == -1 ? 0 : $page;
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
$page = is_numeric($page) ? $page : 0;
$page = $page == -1 ? 0 : $page;
if (!$sortfield) {
$sortfield = "a.datep,a.id";
}
@ -64,6 +65,7 @@ if (GETPOST('actioncode', 'array')) {
} 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');
$object = new Ticket($db);

View File

@ -30,6 +30,7 @@ if (!defined('DISABLE_JS_GRAHP')) define('DISABLE_JS_GRAPH', 1);
//header('X-XSS-Protection:0'); // Disable XSS filtering protection of some browsers (note: use of Content-Security-Policy is more efficient). Disabled as deprecated.
// Load Dolibarr environment
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
@ -45,8 +46,10 @@ require_once DOL_DOCUMENT_ROOT.'/website/class/website.class.php';
require_once DOL_DOCUMENT_ROOT.'/website/class/websitepage.class.php';
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
// Load translation files required by the page
$langs->loadLangs(array("admin", "other", "website", "errors"));
// Security check
if (!$user->rights->website->read) {
accessforbidden();
}

View File

@ -32,9 +32,9 @@ require_once DOL_DOCUMENT_ROOT.'/website/lib/websiteaccount.lib.php';
$langs->loadLangs(array("website", "other"));
// Get parameters
$id = GETPOST('id', 'int');
$id = GETPOST('id', 'int');
$ref = GETPOST('ref', 'alpha');
$action = GETPOST('action', 'aZ09');
$action = GETPOST('action', 'aZ09');
$confirm = GETPOST('confirm', 'alpha');
$cancel = GETPOST('cancel', 'aZ09');
$backtopage = GETPOST('backtopage', 'alpha');
@ -43,7 +43,7 @@ $backtopage = GETPOST('backtopage', 'alpha');
$object = new SocieteAccount($db);
$extrafields = new ExtraFields($db);
$diroutputmassaction = $conf->website->dir_output.'/temp/massgeneration/'.$user->id;
$hookmanager->initHooks(array('websiteaccountcard')); // Note that conf->hooks_modules contains array
$hookmanager->initHooks(array('websiteaccountcard')); // Note that conf->hooks_modules contains array
// Fetch optionals attributes and labels
$extrafields->fetch_name_optionals_label($object->table_element);
@ -68,9 +68,10 @@ if (empty($action) && empty($id) && empty($ref)) {
//if ($user->socid > 0) $socid = $user->socid;
//$result = restrictedArea($user, 'website', $id);
$permissionnote = $user->rights->websiteaccount->write; // Used by the include of actions_setnotes.inc.php
$permissiondellink = $user->rights->websiteaccount->write; // Used by the include of actions_dellink.inc.php
$permissiontoadd = $user->rights->websiteaccount->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
// Permissions
$permissionnote = $user->rights->websiteaccount->write; // Used by the include of actions_setnotes.inc.php
$permissiondellink = $user->rights->websiteaccount->write; // Used by the include of actions_dellink.inc.php
$permissiontoadd = $user->rights->websiteaccount->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
// Load object
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once.