Merge branch 'develop' into develop#5

This commit is contained in:
Hystepik 2022-09-12 10:16:31 +02:00 committed by GitHub
commit 56a0044974
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
907 changed files with 3444 additions and 1249 deletions

View File

@ -33,6 +33,7 @@ PEAR Mail_MIME 1.8.9 BSD Yes
ParseDown 1.6 MIT License Yes Markdown parser
PCLZip 2.8.4 LGPL-3+ Yes Library to zip/unzip files
PHPDebugBar 1.15.1 MIT License Yes Used only by the module "debugbar" for developers
PHP-Imap 2.7.2 MIT License Yes Library to use IMAP with OAuth
PHPSpreadSheet 1.8.2 LGPL-2.1+ Yes Read/Write XLS files, read ODS files
php-iban 4.1 LGPL-3+ Yes Parse and validate IBAN (and IIBAN) bank account information in PHP
PHPoAuthLib 0.8.2 MIT License Yes Library to provide oauth1 and oauth2 to different service

View File

@ -59,66 +59,60 @@ NEW: Add margin info in proposal and order list
NEW: Add massaction "Edit Extrafield" for Product
NEW: Add more fields to detect duplicate during import of thirdparties
NEW: Add option to foce delivery on email for purchase order receipt to yes
NEW: Add param boder table for md theme
NEW: Add param border table for md theme
NEW: Add param color button action
NEW: Add possibility to create contract from invoice
NEW: Add possibility with constant MAIN_LOGIN_BADCHARUNAUTHORIZED to define bad character unauthorized into login name
NEW: Add private and public notes on tax files.
NEW: Add status "Obsolete" to KM articles
NEW: Add substitutions "user numbers"
NEW: allow a ticket to be automatically marked as read when created from backend.
NEW: allow cut&paste as real numeric value to excel
NEW: A public form to send a message and create a lead is available
NEW: automatically set totally received status in reception
NEW: Auto set invoice paid when adding credit not and remain to pay is 0
NEW: Availibility dictionnary has a new column unit and number
NEW: Can change value of AWP during the inventory
NEW: Can enter price with tax for predefined products on purchase objects
NEW: Can filter on a thirdparty on product statistics
NEW: Can removed doc templates from setup page of thirdparty
NEW: Can set the parent company during the creation of thirdparty (action=add of societe/card.php)
NEW: Can use ! to make a search that exclude a string
NEW: Change in theme colors does not need to use the refresh button
NEW: clean values and amount in FEC import
NEW: const MAIL_MASS_ACTION_ADD_LAST_IF_MAIN_DOC_NOT_FOUND for mailing mass action
NEW: Contact filter project list
NEW: Create contract from invoice
NEW: create third-party with contact if not found on public ticket
NEW: Database: Can store the session into database (instead of beeing managed by PHP)
NEW: Database: Some core tables are created only at module activation
NEW: Default value for MAIN_SECURITY_CSRF_WITH_TOKEN is now 2 (GET are also protected agains CSRF attacks)
NEW: deposit payment terms: add field into dictionary admin page to define default percentage of deposit.
NEW: Dictionaries - add possibility to manage countries in EEC
NEW: Dictionaries - Availibility dictionnary has a new column unit and number
NEW: Display errors in a message box after generating documents
NEW: Display physical and virtual stock of the products when creating OF from a BOM
NEW: Display product ref in "Object link" product tab for BOM
NEW: Enhance the import. Can use 'auto' for the ref (import of orders)
NEW: Events on Proposal to Return to Draft
NEW: Page to list expense report payments
NEW: JS inventory autocalc input
NEW: language support for more emailing target selectors
NEW: leave requests: add field into type dictionary to block request if balance is negative
NEW: MAIN_MAIL_AUTOCOPY_TO can accept several email and special keys
NEW: MAIN_SEARCH_CAT_OR_BY_DEFAULT const for search by category
NEW: Mass action "Close shipments"
NEW: Module BOM - Add tabs for nets Bom
NEW: Module BOM - Add the possibility to add sub-BOMs to BOM
NEW: Module Recruitment - Add a public page with all list of open job positions.
NEW: Module Recruitment - Add a public page with list of all open job positions.
NEW: Module Recruitment - Add a tab with list of application on the jobposition file.
NEW: Module Website - supports now the multicompany module
NEW: More mode for THEME_TOPMENU_DISABLE_IMAGE (2, 3, ...)
NEW: Add option to move checkbox column as first column on Thirdparty list (only few screens)
NEW: on redirect of page in website module, GET parameters are kept.
NEW: optional display warning icons on ticket list
NEW: payment conditions enabling semi-automatic deposit creation (Issue #18439)
NEW: possibility to consume multiple batch
NEW: Reverse movement product consumption
NEW: Send email to the supplier order contact
NEW: add permission to report time on timesheet
NEW: SEPA XML - option to place payment Type Info at Credit transfer Transaction level
NEW: Some core tables are created only at module activation
NEW: Knowledge Management - Add status "Obsolete" to KM articles
NEW: MRP - split consumption line on MO
NEW: MRP - Display physical and virtual stock of the products when creating OF from a BOM
NEW: MRP - Display product ref in "Object link" product tab for BOM
NEW: Proposals - option update prices on proposal cloning
NEW: stock filter in reassort lists
NEW: stock limit in stock export CSV
NEW: SEPA XML - option to place payment Type Info at Credit transfer Transaction level
NEW: Stocks - stock filter in reassort lists
NEW: Stocks - stock limit in stock export CSV
NEW: Supplier order - Show ref supplier of reception in linked object block
NEW: support user_modif in order
NEW: Surveys - Show number of votes into the label of tab "Results" of a survey
@ -128,20 +122,24 @@ NEW: TakePOS - show product reference
NEW: TakePOS - add constant to hide categories
NEW: TakePOS - add constant to show category description
NEW: TakePOS - add constant to show only the products in stock
NEW: Third-Parties - Add rules "customer accountancy code" is mandatory to validate invoice
NEW: Third-Parties - Can set the parent company during the creation of thirdparty (action=add of societe/card.php)
NEW: Tickets - create Third-party with contact if not found on public ticket
NEW: Tickets - option to default check "notify tier at creation"
NEW: Tickets - Trigger: allow to automatically send messages on new tickets
NEW: Tickets - optional display warning icons on ticket list
NEW: Websites Module - supports now the multicompany module
NEW: Websites Module - on redirect of page in website module, GET parameters are kept.
NEW: The backup tools has an "lowmemory" option for mysqldump on large database
NEW: The 'reposition' class works on ajax constantonoff that make redirects
NEW: Thirdparty - Add rules "customer accountancy code" is mandatory to validate invoice
NEW: thumbnail field in product list
NEW: total mark rate in list
NEW: uncheck "send message" by default on a ticket when private messages has been checked
NEW: VAT Report by month - Show detail by rate and also by code
NEW: Can store the session into database (instead of beeing managed by PHP)
NEW: Added MMK currency (Myanmar Kyat)
NEW: On a form to send an email, we show all emails of contacts of object
Modules
Modules state
NEW: Module Partnership Management
NEW: Module Event Organization Management
@ -164,7 +162,7 @@ NEW: Creation of the function select_bom() used to display bom select list
NEW: Add trigger and event on completely received status change
NEW: Add utility function send backup by mail
NEW: add WordPress OAuth to save a token (not SSO)
NEW: A module can embed a sql script run at each Dolibarr upgrade
NEW: A module can embed a SQL script run at each Dolibarr upgrade
NEW: Add param to keep the robot=index meta tag on public pages
NEW: Add method hintindex() in database handlers.
NEW: add modifications for new function "$db->prefix()"
@ -209,9 +207,11 @@ NEW: TakePOS - add hook doaction in TakePOS invoice
Config Options:
NEW: Add hidden option on contract PDF line to hide qty and price
NEW: Option INVOICEREC_SET_AUTOFILL_DATE_START/END
NEW: Option MAIL_MASS_ACTION_ADD_LAST_IF_MAIN_DOC_NOT_FOUND to send last document in mass mailing action
NEW: Option MAIL_MASS_ACTION_ADD_LAST_IF_MAIN_DOC_NOT_FOUND to send last document in mass mailing action
NEW: Option MAIN_API_DEBUG to save API logs into a file
NEW: Option MAIN_MAIL_AUTOCOPY_TO can accept several email and special keys
NEW: Option MAIN_SEARCH_CAT_OR_BY_DEFAULT const for search by category
NEW: Option INVOICEREC_SET_AUTOFILL_DATE_START/END
WARNING:

View File

@ -1,5 +1,4 @@
<?php
/* !!! DO NOT EDIT THIS FILE, EDIT config.inc.php INSTEAD !!! */
// vim: expandtab sw=4 ts=4 sts=4:
@ -139,7 +138,7 @@ $cfg['UseDbSearch'] = TRUE; // whether to enable the "database sea
$cfg['IgnoreMultiSubmitErrors'] = FALSE; // if set to true, PMA continues computing multiple-statement queries
// even if one of the queries failed
$cfg['VerboseMultiSubmit'] = TRUE; // if set to true, PMA will show the affected rows of EACH statement on
// multiple-statement queries. See the libraries/import.php file for
// multiple-statement queries. See the libraries/import.php file for
// hardcoded defaults on how many queries a statement may contain!
$cfg['AllowArbitraryServer'] = FALSE; // allow login to any user entered server in cookie based auth
@ -195,7 +194,7 @@ $cfg['CharEditing'] = 'input';
// textarea - allows newlines in fields
$cfg['InsertRows'] = 2; // How many rows can be inserted at one time
$cfg['ForeignKeyDropdownOrder'] = // Sort order for items in a foreign-key dropdown box.
$cfg['ForeignKeyDropdownOrder'] = // Sort order for items in a foreign-key dropdown box.
array( 'content-id', 'id-content'); // 'content' is the referenced data, 'id' is the key value.
$cfg['ForeignKeyMaxLimit'] = 100; // A dropdown will be used if fewer items are present
@ -488,7 +487,7 @@ $cfg['ShowBrowseComments'] = TRUE; // shows stored relation-comments in
$cfg['ShowPropertyComments']= TRUE; // shows stored relation-comments in 'table property' mode.
$cfg['RepeatCells'] = 100; // repeat header names every X cells? (0 = deactivate)
$cfg['EditInWindow'] = TRUE; // Set to TRUE if Edit link should open the query to edit in the query window (assuming Javascript is enabled), and to FALSE if we should edit in the right panel
$cfg['EditInWindow'] = TRUE; // Set to TRUE if Edit link should open the query to edit in the query window (assuming Javascript is enabled), and to FALSE if we should edit in the right panel
$cfg['QueryWindowWidth'] = 550; // Width of Query window
$cfg['QueryWindowHeight'] = 310; // Height of Query window
$cfg['QueryHistoryDB'] = FALSE; // Set to TRUE if you want DB-based query history.
@ -561,7 +560,7 @@ $cfg['SQLQuery']['Refresh'] = TRUE; // Refresh the results page
*/
$cfg['UploadDir'] = ''; // Directory for uploaded files that can be executed by
// phpMyAdmin. For example './upload'. Leave empty for
// no upload directory support. Use %u for username
// no upload directory support. Use %u for username
// inclusion.
$cfg['SaveDir'] = ''; // Directory where phpMyAdmin can save exported data on
// server. For example './save'. Leave empty for no save
@ -645,7 +644,7 @@ $cfg['ColumnTypes'] = array(
);
// Attributes
// Note: the "ON UPDATE CURRENT_TIMESTAMP" attribute is added dynamically
// Note: the "ON UPDATE CURRENT_TIMESTAMP" attribute is added dynamically
// for MySQL >= 4.1.2, in libraries/tbl_properties.inc.php
$cfg['AttributeTypes'] = array(

View File

@ -1,5 +1,4 @@
<?php
/*spl_autoload_register(function ($class_name) {
//var_dump('class='.$class_name);
require $class_name;

View File

@ -23,6 +23,7 @@
* \brief List accounting account
*/
// Load Dolibarr environment
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
@ -59,7 +60,7 @@ $permissiontodelete = $user->hasRight('accounting', 'chartofaccount');
if ($user->socid > 0) {
accessforbidden();
}
if (empty($user->rights->accounting->chartofaccount)) {
if (!$user->hasRight('accounting', 'chartofaccount')) {
accessforbidden();
}

View File

@ -32,6 +32,7 @@
* \brief Page to administer model of chart of accounts
*/
// Load Dolibarr environment
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
@ -78,7 +79,7 @@ $search_country_id = GETPOST('search_country_id', 'int');
if ($user->socid > 0) {
accessforbidden();
}
if (empty($user->rights->accounting->chartofaccount)) {
if (!$user->hasRight('accounting', 'chartofaccount')) {
accessforbidden();
}

View File

@ -23,6 +23,7 @@
* \brief Card of accounting account
*/
// Load Dolibarr environment
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php';
@ -48,7 +49,7 @@ $label = GETPOST('label', 'alpha');
if ($user->socid > 0) {
accessforbidden();
}
if (empty($user->rights->accounting->chartofaccount)) {
if (!$user->hasRight('accounting', 'chartofaccount')) {
accessforbidden();
}

View File

@ -22,6 +22,7 @@
* \brief Page to assign mass categories to accounts
*/
// Load Dolibarr environment
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountancycategory.class.php';
@ -44,7 +45,7 @@ if ($cat_id == 0) {
}
// Security check
if (empty($user->rights->accounting->chartofaccount)) {
if (!$user->hasRight('accounting', 'chartofaccount')) {
accessforbidden();
}

View File

@ -22,6 +22,7 @@
* \brief Page to administer data tables
*/
// Load Dolibarr environment
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
@ -42,7 +43,7 @@ $rowid = GETPOST('rowid', 'alpha');
$code = GETPOST('code', 'alpha');
// Security access
if (empty($user->rights->accounting->chartofaccount)) {
if (!$user->hasRight('accounting', 'chartofaccount')) {
accessforbidden();
}

View File

@ -22,6 +22,7 @@
* \brief Setup page to configure accounting expert module
*/
// Load Dolibarr environment
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
@ -31,7 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php';
$langs->loadLangs(array("compta", "admin", "accountancy"));
// Security check
if (empty($user->rights->accounting->chartofaccount)) {
if (!$user->hasRight('accounting', 'chartofaccount')) {
accessforbidden();
}

View File

@ -38,7 +38,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php';
$langs->loadLangs(array("compta", "bills", "admin", "accountancy", "salaries", "loan"));
// Security check
if (empty($user->rights->accounting->chartofaccount)) {
if (!$user->hasRight('accounting', 'chartofaccount')) {
accessforbidden();
}

View File

@ -36,7 +36,7 @@ require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountancyexport.class.php';
$langs->loadLangs(array("compta", "bills", "admin", "accountancy"));
// Security access
if (empty($user->rights->accounting->chartofaccount)) {
if (!$user->hasRight('accounting', 'chartofaccount')) {
accessforbidden();
}

View File

@ -21,6 +21,7 @@
* \brief Setup page to configure fiscal year
*/
// Load Dolibarr environment
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/fiscalyear.class.php';

View File

@ -22,6 +22,7 @@
* \brief Page to show a fiscal year
*/
// Load Dolibarr environment
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/fiscalyear.lib.php';

View File

@ -21,6 +21,7 @@
* \brief Page to show info of a fiscal year
*/
// Load Dolibarr environment
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/fiscalyear.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';

View File

@ -29,6 +29,7 @@
* \brief Setup page to configure accounting expert module
*/
// Load Dolibarr environment
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
@ -38,7 +39,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
$langs->loadLangs(array("compta", "bills", "admin", "accountancy", "other"));
// Security access
if (empty($user->rights->accounting->chartofaccount)) {
if (!$user->hasRight('accounting', 'chartofaccount')) {
accessforbidden();
}

View File

@ -26,6 +26,7 @@ if (!defined('CSRFCHECK_WITH_TOKEN')) {
define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET
}
// Load Dolibarr environment
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
@ -45,7 +46,7 @@ $rowid = GETPOST('rowid', 'alpha');
$code = GETPOST('code', 'alpha');
// Security access
if (empty($user->rights->accounting->chartofaccount)) {
if (!$user->hasRight('accounting', 'chartofaccount')) {
accessforbidden();
}

View File

@ -23,6 +23,7 @@
* \brief List of accounting sub-account (auxiliary accounts)
*/
// Load Dolibarr environment
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
@ -47,7 +48,7 @@ $search_type = GETPOST('search_type', 'int');
if ($user->socid > 0) {
accessforbidden();
}
if (empty($user->rights->accounting->chartofaccount)) {
if (!$user->hasRight('accounting', 'chartofaccount')) {
accessforbidden();
}

View File

@ -24,6 +24,7 @@
* \brief Balance of book keeping
*/
// Load Dolibarr environment
require '../../main.inc.php';
// Class

View File

@ -25,6 +25,7 @@
* \brief Page to show book-entry
*/
// Load Dolibarr environment
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/bookkeeping.class.php';

View File

@ -25,6 +25,7 @@
* \brief List operation of book keeping
*/
// Load Dolibarr environment
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountancyexport.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';

View File

@ -25,6 +25,7 @@
* \brief List operation of ledger ordered by account number
*/
// Load Dolibarr environment
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';

View File

@ -1123,14 +1123,13 @@ class BookKeeping extends CommonObject
/**
* Load object in memory from the database
*
* @param string $sortorder Sort Order
* @param string $sortfield Sort field
* @param int $limit offset limit
* @param int $offset offset limit
* @param array $filter filter array
* @param string $filtermode filter mode (AND or OR)
*
* @return int <0 if KO, >0 if OK
* @param string $sortorder Sort Order
* @param string $sortfield Sort field
* @param int $limit offset limit
* @param int $offset offset limit
* @param array $filter filter array
* @param string $filtermode filter mode (AND or OR)
* @return int <0 if KO, >0 if OK
*/
public function fetchAllBalance($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, array $filter = array(), $filtermode = 'AND')
{
@ -1151,7 +1150,7 @@ class BookKeeping extends CommonObject
foreach ($filter as $key => $value) {
if ($key == 't.doc_date') {
$sqlwhere[] = $key." = '".$this->db->idate($value)."'";
} elseif ($key == 't.doc_date>=' || $key == 't.doc_date<=') {
} elseif ($key == 't.doc_date>=' || $key == 't.doc_date<=' || $key == 't.doc_date>' || $key == 't.doc_date<') {
$sqlwhere[] = $key."'".$this->db->idate($value)."'";
} elseif ($key == 't.numero_compte>=' || $key == 't.numero_compte<=' || $key == 't.subledger_account>=' || $key == 't.subledger_account<=') {
$sqlwhere[] = $key."'".$this->db->escape($value)."'";

View File

@ -21,6 +21,7 @@
* \brief Home closure page
*/
// 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

@ -26,6 +26,7 @@
* \brief Home customer journalization page
*/
// 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

@ -24,6 +24,7 @@
* \brief Home expense report ventilation
*/
// 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

@ -44,7 +44,7 @@ if ($user->socid > 0) {
if (!isModEnabled('accounting')) {
accessforbidden();
}
if (empty($user->rights->accounting->mouvements->lire)) {
if (!$user->hasRight('accounting', 'mouvements', 'lire')) {
accessforbidden();
}
*/

View File

@ -30,6 +30,7 @@
* \brief Page with sells journal
*/
// Load Dolibarr environment
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/report.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';

View File

@ -21,6 +21,7 @@
* \brief Page of a journal
*/
// 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';
@ -51,7 +52,7 @@ if ($result > 0) {
} elseif ($result < 0) {
dol_print_error('', $object->error, $object->errors);
} elseif ($result == 0) {
accessforbidden($langs->trans('ErrorRecordNotFound'));
accessforbidden('ErrorRecordNotFound');
}
$hookmanager->initHooks(array('globaljournal', $object->nature.'journal'));

View File

@ -24,6 +24,7 @@
* \brief Home supplier journalization page
*/
// 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

@ -30,6 +30,7 @@
* \brief Page to setup the module Foundation
*/
// Load Dolibarr environment
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';

View File

@ -29,6 +29,7 @@
* \brief Page to setup the module Foundation
*/
// Load Dolibarr environment
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';

View File

@ -24,6 +24,7 @@
* \brief Page to setup extra fields of members
*/
// Load Dolibarr environment
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';

View File

@ -27,6 +27,7 @@
* \brief Page to setup extra fields of members
*/
// Load Dolibarr environment
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';

View File

@ -24,6 +24,7 @@
* \brief File of main public page for member module
*/
// Load Dolibarr environment
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';

View File

@ -26,6 +26,7 @@
* \brief Page of members events
*/
// Load Dolibarr environment
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';

View File

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2010-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2012 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2012-2022 Philippe Grand <philippe.grand@atoo-net.com>
*
* 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
@ -124,7 +124,7 @@ if (!empty($this->control->tpl['action_delete'])) {
if (empty($user->socid)) {
echo '<div class="tabsAction">';
if ($user->rights->adherent->creer) {
if ($user->hasRight('adherent', 'creer')) {
echo '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$this->control->tpl['id'].'&action=edit&token='.newToken().'&canvas='.$canvas.'">'.$langs->trans('Modify').'</a>';
}

View File

@ -110,10 +110,10 @@ if ($id > 0 || !empty($ref)) {
}
// Define variables to determine what the current user can do on the members
$canaddmember = $user->rights->adherent->creer;
$canaddmember = $user->hasRight('adherent', 'creer');
// Define variables to determine what the current user can do on the properties of a member
if ($id) {
$caneditfieldmember = $user->rights->adherent->creer;
$caneditfieldmember = $user->hasRight('adherent', 'creer');
}
// Security check
@ -246,7 +246,7 @@ if (empty($reshook)) {
}
}
if ($action == 'update' && !$cancel && $user->rights->adherent->creer) {
if ($action == 'update' && !$cancel && $user->hasRight('adherent', 'creer')) {
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
$birthdate = '';
@ -421,7 +421,7 @@ if (empty($reshook)) {
}
}
if ($action == 'add' && $user->rights->adherent->creer) {
if ($action == 'add' && $user->hasRight('adherent', 'creer')) {
if ($canvas) {
$object->canvas = $canvas;
}
@ -629,7 +629,7 @@ if (empty($reshook)) {
}
}
if ($user->rights->adherent->creer && $action == 'confirm_valid' && $confirm == 'yes') {
if ($user->hasRight('adherent', 'creer') && $action == 'confirm_valid' && $confirm == 'yes') {
$error = 0;
$db->begin();
@ -854,7 +854,7 @@ if (empty($reshook)) {
}
}
if ($user->rights->adherent->creer && $action == 'confirm_add_spip' && $confirm == 'yes') {
if ($user->hasRight('adherent', 'creer') && $action == 'confirm_add_spip' && $confirm == 'yes') {
if (!count($object->errors)) {
if (!$mailmanspip->add_to_spip($object)) {
setEventMessages($langs->trans('AddIntoSpipError').': '.$mailmanspip->error, null, 'errors');
@ -867,7 +867,7 @@ if (empty($reshook)) {
// Actions to build doc
$upload_dir = $conf->adherent->dir_output;
$permissiontoadd = $user->rights->adherent->creer;
$permissiontoadd = $user->hasRight('adherent', 'creer');
include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
// Actions to send emails
@ -1222,7 +1222,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
// Type
print '<tr><td class="fieldrequired">'.$langs->trans("Type").'</td><td>';
if ($user->rights->adherent->creer) {
if ($user->hasRight('adherent', 'creer')) {
print $form->selectarray("typeid", $adht->liste_array(), (GETPOSTISSET("typeid") ? GETPOST("typeid", 'int') : $object->typeid), 0, 0, 0, '', 0, 0, 0, '', '', 1);
} else {
print $adht->getNomUrl(1);
@ -1820,7 +1820,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
// Third party Dolibarr
if (isModEnabled('societe')) {
print '<tr><td>';
$editenable = $user->rights->adherent->creer;
$editenable = $user->hasRight('adherent', 'creer');
print $form->editfieldkey('LinkedToDolibarrThirdParty', 'thirdparty', '', $object, $editenable);
print '</td><td colspan="2" class="valeur">';
if ($action == 'editthirdparty') {
@ -1857,7 +1857,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
// Login Dolibarr - Link to user
print '<tr><td>';
$editenable = $user->rights->adherent->creer && $user->rights->user->user->creer;
$editenable = $user->hasRight('adherent', 'creer') && $user->rights->user->user->creer;
print $form->editfieldkey('LinkedToDolibarrUser', 'login', '', $object, $editenable);
print '</td><td colspan="2" class="valeur">';
if ($action == 'editlogin') {
@ -1901,7 +1901,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
// Send card by email
// TODO Remove this to replace with a template
/*
if ($user->rights->adherent->creer) {
if ($user->hasRight('adherent', 'creer')) {
if (Adherent::STATUS_VALIDATED == $object->statut) {
if ($object->email) print '<a class="butAction" href="card.php?rowid='.$object->id.'&action=sendinfo">'.$langs->trans("SendCardByMail")."</a>\n";
else print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NoEMail")).'">'.$langs->trans("SendCardByMail")."</a>\n";
@ -1913,7 +1913,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
}*/
// Modify
if (!empty($user->rights->adherent->creer)) {
if ($user->hasRight('adherent', 'creer')) {
print '<a class="butAction" href="card.php?rowid='.$id.'&action=edit&token='.newToken().'">'.$langs->trans("Modify").'</a>'."\n";
} else {
print '<span class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans("Modify").'</span>'."\n";
@ -1921,7 +1921,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
// Validate
if (Adherent::STATUS_DRAFT == $object->statut) {
if ($user->rights->adherent->creer) {
if ($user->hasRight('adherent', 'creer')) {
print '<a class="butAction" href="card.php?rowid='.$id.'&action=valid">'.$langs->trans("Validate").'</a>'."\n";
} else {
print '<span class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans("Validate").'</span>'."\n";
@ -1930,7 +1930,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
// Reactivate
if (Adherent::STATUS_RESILIATED == $object->statut || Adherent::STATUS_EXCLUDED == $object->statut) {
if ($user->rights->adherent->creer) {
if ($user->hasRight('adherent', 'creer')) {
print '<a class="butAction" href="card.php?rowid='.$id.'&action=valid">'.$langs->trans("Reenable")."</a>\n";
} else {
print '<span class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans("Reenable").'</span>'."\n";
@ -2022,7 +2022,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
$filedir = $conf->adherent->dir_output.'/'.get_exdir(0, 0, 0, 1, $object, 'member');
$urlsource = $_SERVER['PHP_SELF'].'?id='.$object->id;
$genallowed = $user->rights->adherent->lire;
$delallowed = $user->rights->adherent->creer;
$delallowed = $user->hasRight('adherent', 'creer');
print $formfile->showdocuments('member', $filename, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 1, 0, 0, 28, 0, '', '', '', (empty($object->default_lang) ? '' : $object->default_lang), '', $object);
$somethingshown = $formfile->numoffiles;

View File

@ -2,7 +2,7 @@
/* Copyright (C) 2016 Xebax Christy <xebax@wanadoo.fr>
* Copyright (C) 2017 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2020 Thibault FOUCART<support@ptibogxiv.net>
* Copyright (C) 2020 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2020 Frédéric France <frederic.france@netlogic.fr>
*
* 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
@ -286,7 +286,7 @@ class Members extends DolibarrApi
*/
public function post($request_data = null)
{
if (!DolibarrApiAccess::$user->rights->adherent->creer) {
if (!DolibarrApiAccess::$user->hasRight('adherent', 'creer')) {
throw new RestException(401);
}
// Check mandatory fields
@ -311,7 +311,7 @@ class Members extends DolibarrApi
*/
public function put($id, $request_data = null)
{
if (!DolibarrApiAccess::$user->rights->adherent->creer) {
if (!DolibarrApiAccess::$user->hasRight('adherent', 'creer')) {
throw new RestException(401);
}

View File

@ -173,7 +173,7 @@ class Subscriptions extends DolibarrApi
*/
public function put($id, $request_data = null)
{
if (!DolibarrApiAccess::$user->rights->adherent->creer) {
if (!DolibarrApiAccess::$user->hasRight('adherent', 'creer')) {
throw new RestException(401);
}

View File

@ -25,6 +25,7 @@
* \ingroup societe
*/
// Load Dolibarr environment
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
@ -87,10 +88,10 @@ if ($id > 0 || !empty($ref)) {
}
// Define variables to determine what the current user can do on the members
$canaddmember = $user->rights->adherent->creer;
$canaddmember = $user->hasRight('adherent', 'creer');
// Define variables to determine what the current user can do on the properties of a member
if ($id) {
$caneditfieldmember = $user->rights->adherent->creer;
$caneditfieldmember = $user->hasRight('adherent', 'creer');
}
$permissiontoadd = $canaddmember;
@ -186,8 +187,8 @@ if ($id > 0) {
print dol_get_fiche_end();
$modulepart = 'member';
$permissiontoadd = $user->rights->adherent->creer;
$permtoedit = $user->rights->adherent->creer;
$permissiontoadd = $user->hasRight('adherent', 'creer');
$permtoedit = $user->hasRight('adherent', 'creer');
$param = '&id='.$object->id;
include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
print "<br><br>";

View File

@ -23,6 +23,7 @@
* \brief Export page htpasswd of the membership file
*/
// Load Dolibarr environment
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php';

View File

@ -22,6 +22,7 @@
* \brief Page fiche LDAP adherent
*/
// Load Dolibarr environment
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/ldap.lib.php';
@ -62,10 +63,10 @@ if ($id > 0 || !empty($ref)) {
}
// Define variables to determine what the current user can do on the members
$canaddmember = $user->rights->adherent->creer;
$canaddmember = $user->hasRight('adherent', 'creer');
// Define variables to determine what the current user can do on the properties of a member
if ($id) {
$caneditfieldmember = $user->rights->adherent->creer;
$caneditfieldmember = $user->hasRight('adherent', 'creer');
}
// Security check

View File

@ -232,7 +232,7 @@ if (empty($reshook)) {
}
// Close
if ($massaction == 'close' && $user->rights->adherent->creer) {
if ($massaction == 'close' && $user->hasRight('adherent', 'creer')) {
$tmpmember = new Adherent($db);
$error = 0;
$nbclose = 0;
@ -262,7 +262,7 @@ if (empty($reshook)) {
}
// Create external user
if ($massaction == 'createexternaluser' && $user->rights->adherent->creer && $user->rights->user->user->creer) {
if ($massaction == 'createexternaluser' && $user->hasRight('adherent', 'creer') && $user->rights->user->user->creer) {
$tmpmember = new Adherent($db);
$error = 0;
$nbcreated = 0;
@ -302,7 +302,7 @@ if (empty($reshook)) {
$objectlabel = 'Members';
$permissiontoread = $user->rights->adherent->lire;
$permissiontodelete = $user->rights->adherent->supprimer;
$permissiontoadd = $user->rights->adherent->creer;
$permissiontoadd = $user->hasRight('adherent', 'creer');
$uploaddir = $conf->adherent->dir_output;
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
}
@ -617,7 +617,7 @@ $arrayofmassactions = array(
//'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"),
//'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"),
);
if ($user->rights->adherent->creer) {
if ($user->hasRight('adherent', 'creer')) {
$arrayofmassactions['close'] = img_picto('', 'close_title', 'class="pictofixedwidth"').$langs->trans("Resiliate");
}
if ($user->rights->adherent->supprimer) {
@ -626,7 +626,7 @@ if ($user->rights->adherent->supprimer) {
if ($user->rights->societe->creer) {
$arrayofmassactions['preaffecttag'] = img_picto('', 'category', 'class="pictofixedwidth"').$langs->trans("AffectTag");
}
if ($user->rights->adherent->creer && $user->rights->user->user->creer) {
if ($user->hasRight('adherent', 'creer') && $user->rights->user->user->creer) {
$arrayofmassactions['createexternaluser'] = img_picto('', 'user', 'class="pictofixedwidth"').$langs->trans("CreateExternalUser");
}
if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete', 'preaffecttag'))) {
@ -635,7 +635,7 @@ if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'pr
$massactionbutton = $form->selectMassAction('', $arrayofmassactions);
$newcardbutton = '';
if ($user->rights->adherent->creer) {
if ($user->hasRight('adherent', 'creer')) {
$newcardbutton .= dolGetButtonTitle($langs->trans('NewMember'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/adherents/card.php?action=create');
}

View File

@ -51,7 +51,7 @@ if ($result > 0) {
}
$permissionnote = $user->rights->adherent->creer; // Used by the include of actions_setnotes.inc.php
$permissionnote = $user->hasRight('adherent', 'creer'); // Used by the include of actions_setnotes.inc.php
// Fetch object
if ($id > 0 || !empty($ref)) {
@ -71,10 +71,10 @@ if ($id > 0 || !empty($ref)) {
}
// Define variables to determine what the current user can do on the members
$canaddmember = $user->rights->adherent->creer;
$canaddmember = $user->hasRight('adherent', 'creer');
// Define variables to determine what the current user can do on the properties of a member
if ($id) {
$caneditfieldmember = $user->rights->adherent->creer;
$caneditfieldmember = $user->hasRight('adherent', 'creer');
}
$hookmanager->initHooks(array('membernote'));
@ -155,7 +155,7 @@ if ($id) {
$cssclass = 'titlefield';
$permission = $user->rights->adherent->creer; // Used by the include of notes.tpl.php
$permission = $user->hasRight('adherent', 'creer'); // Used by the include of notes.tpl.php
include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php';

View File

@ -21,6 +21,7 @@
* \brief Page with statistics on members
*/
// 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';

View File

@ -21,6 +21,7 @@
* \brief Page with geographical statistics on members
*/
// Load Dolibarr environment
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';

View File

@ -23,6 +23,7 @@
* \brief Page of subscription members statistics
*/
// Load Dolibarr environment
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherentstats.class.php';

View File

@ -27,6 +27,7 @@
* \brief tab for Adding, editing, deleting a member's memberships
*/
// Load Dolibarr environment
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
@ -112,10 +113,10 @@ if ($id > 0 || !empty($ref)) {
}
// Define variables to determine what the current user can do on the members
$canaddmember = $user->rights->adherent->creer;
$canaddmember = $user->hasRight('adherent', 'creer');
// Define variables to determine what the current user can do on the properties of a member
if ($id) {
$caneditfieldmember = $user->rights->adherent->creer;
$caneditfieldmember = $user->hasRight('adherent', 'creer');
}
// Security check
@ -594,7 +595,7 @@ if ($rowid > 0) {
print '<table class="nobordernopadding" width="100%"><tr><td>';
print $langs->trans("LinkedToDolibarrThirdParty");
print '</td>';
if ($action != 'editthirdparty' && $user->rights->adherent->creer) {
if ($action != 'editthirdparty' && $user->hasRight('adherent', 'creer')) {
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editthirdparty&token='.newToken().'&rowid='.$object->id.'">'.img_edit($langs->trans('SetLinkToThirdParty'), 1).'</a></td>';
}
print '</tr></table>';
@ -636,7 +637,7 @@ if ($rowid > 0) {
print '<table class="nobordernopadding" width="100%"><tr><td>';
print $langs->trans("LinkedToDolibarrUser");
print '</td>';
if ($action != 'editlogin' && $user->rights->adherent->creer) {
if ($action != 'editlogin' && $user->hasRight('adherent', 'creer')) {
print '<td class="right">';
if ($user->rights->user->user->creer) {
print '<a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editlogin&token='.newToken().'&rowid='.$object->id.'">'.img_edit($langs->trans('SetLinkToUser'), 1).'</a>';

View File

@ -22,6 +22,7 @@
* \brief Page to add/edit/remove a member subscription
*/
// 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';

View File

@ -22,6 +22,7 @@
* \brief Page with information of subscriptions of a member
*/
// Load Dolibarr environment
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';

View File

@ -23,6 +23,7 @@
* \brief list of subscription
*/
// 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';

View File

@ -29,6 +29,7 @@
* \brief Member's type setup
*/
// 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';
@ -753,7 +754,7 @@ if ($rowid > 0) {
// Actions
print '<td class="center">';
if ($user->rights->adherent->creer) {
if ($user->hasRight('adherent', 'creer')) {
print '<a class="editfielda marginleftonly" href="card.php?rowid='.$objp->rowid.'&action=edit&token='.newToken().'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?rowid='.$object->id).'">'.img_edit().'</a>';
}
if ($user->rights->adherent->supprimer) {

View File

@ -22,6 +22,7 @@
* \brief Page fiche LDAP members types
*/
// 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';

View File

@ -25,6 +25,7 @@
* \brief Member translation page
*/
// Load Dolibarr environment
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';

View File

@ -25,6 +25,7 @@
* \brief Vcard tab of a member
*/
// Load Dolibarr environment
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
@ -53,10 +54,10 @@ if ($id > 0 || !empty($ref)) {
}
// Define variables to determine what the current user can do on the members
$canaddmember = $user->rights->adherent->creer;
$canaddmember = $user->hasRight('adherent', 'creer');
// Define variables to determine what the current user can do on the properties of a member
if ($id) {
$caneditfieldmember = $user->rights->adherent->creer;
$caneditfieldmember = $user->hasRight('adherent', 'creer');
}
// Security check

View File

@ -21,6 +21,7 @@
* \brief Setup page to configure accountant / auditor
*/
// Load Dolibarr environment
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';

View File

@ -21,6 +21,7 @@
* \brief Setup page to configure accounting module
*/
// Load Dolibarr environment
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';

View File

@ -25,6 +25,7 @@
* \brief Autocreate actions for agenda module setup page
*/
// Load Dolibarr environment
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/agenda.lib.php';

View File

@ -26,6 +26,7 @@
* \brief Page to setup extra fields of agenda
*/
// Load Dolibarr environment
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/agenda.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';

View File

@ -25,6 +25,7 @@
* \brief Page to setup external calendars for agenda module
*/
// Load Dolibarr environment
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';

View File

@ -26,6 +26,7 @@
* \brief Autocreate actions for agenda module setup page
*/
// Load Dolibarr environment
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/agenda.lib.php';

View File

@ -21,6 +21,7 @@
* \brief Page to setup agenda reminder options
*/
// Load Dolibarr environment
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/agenda.lib.php';

View File

@ -24,6 +24,7 @@
* \brief Page to setup miscellaneous options of agenda module
*/
// Load Dolibarr environment
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/agenda.lib.php';

View File

@ -26,6 +26,7 @@
* \brief Page to setup extra fields of bank
*/
// Load Dolibarr environment
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';

View File

@ -24,6 +24,7 @@
* \brief Page to setup barcode module
*/
// Load Dolibarr environment
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formbarcode.class.php';

View File

@ -21,6 +21,7 @@
* \brief Setup page of module BOM
*/
// Load Dolibarr environment
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';

View File

@ -26,6 +26,7 @@
* \brief Page to setup extra fields of BOM
*/
// Load Dolibarr environment
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/bom/lib/bom.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';

View File

@ -23,6 +23,7 @@
* \brief Page to setup boxes
*/
// Load Dolibarr environment
require '../main.inc.php';
include_once DOL_DOCUMENT_ROOT.'/core/boxes/modules_boxes.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/infobox.class.php';

View File

@ -25,6 +25,7 @@
* \brief Page to setup the bank module
*/
// Load Dolibarr environment
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';

View File

@ -23,6 +23,7 @@
* \brief Page to setup module ClickToDial
*/
// Load Dolibarr environment
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
@ -35,8 +36,8 @@ if (!$user->admin) {
$action = GETPOST('action', 'aZ09');
if (!in_array('clicktodial', $conf->modules)) {
accessforbidden($langs->trans("WarningModuleNotActive", $langs->transnoentitiesnoconv("Module58Name")));
if (!isModEnabled('clicktodial')) {
accessforbidden($langs->transnoentitiesnoconv("WarningModuleNotActive", $langs->transnoentitiesnoconv("Module58Name")));
}

View File

@ -31,6 +31,7 @@
* \brief Setup page of module Order
*/
// Load Dolibarr environment
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';

View File

@ -30,6 +30,7 @@
* \brief Page to setup extra fields of reception
*/
// Load Dolibarr environment
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/reception.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';

View File

@ -27,6 +27,7 @@
* \brief Setup page to configure company/foundation
*/
// Load Dolibarr environment
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';

View File

@ -28,6 +28,7 @@
* \brief Setup page to configure company social networks
*/
// Load Dolibarr environment
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';

View File

@ -27,6 +27,7 @@
* \brief Page to setup accountancy module
*/
// Load Dolibarr environment
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';

View File

@ -25,6 +25,7 @@
* \brief Page to setup sending module
*/
// Load Dolibarr environment
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/expedition.lib.php';

View File

@ -24,6 +24,7 @@
* \brief Admin page to define miscellaneous constants
*/
// Load Dolibarr environment
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/security.lib.php';

View File

@ -22,6 +22,7 @@
* \brief Setup page of module Contracts
*/
// Load Dolibarr environment
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';

View File

@ -21,6 +21,7 @@
* \brief Page to setup DAV server
*/
// Load Dolibarr environment
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/dav/dav.lib.php';
@ -76,14 +77,14 @@ print '<input type="hidden" name="token" value="'.newToken().'">';
$head = dav_admin_prepare_head();
print dol_get_fiche_head($head, 'webdav', '', -1, 'action');
print dol_get_fiche_head($head, 'webdav', '', -1, '');
if ($action == 'edit') {
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="update">';
print '<table class="noborder centpercent">';
print '<table class="noborder centpercent nomarginbottom">';
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
foreach ($arrayofparameters as $key => $val) {
@ -96,7 +97,7 @@ if ($action == 'edit') {
$label = $langs->trans($key);
if ($key == 'DAV_RESTICT_ON_IP') {
$label = $langs->trans("RESTRICT_ON_IP");
$label .= ' '.$langs->trans("Example").': '.$langs->trans("IPListExample");
$tooltiphelp .= ' '.$langs->trans("Example").': '.$langs->trans("IPListExample");
}
print $form->textwithpicto($label, $tooltiphelp);
print '</td><td>';
@ -119,19 +120,19 @@ if ($action == 'edit') {
print '</form>';
print '<br>';
} else {
print '<table class="noborder centpercent">';
print '<table class="noborder centpercent nomarginbottom">';
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
foreach ($arrayofparameters as $key => $val) {
print '<tr class="oddeven"><td class="titlefieldmiddle">';
print '<tr class="oddeven"><td>';
$tooltiphelp = (($langs->trans($key.'Tooltip') != $key.'Tooltip') ? $langs->trans($key.'Tooltip') : '');
$label = $langs->trans($key);
if ($key == 'DAV_RESTICT_ON_IP') {
$label = $langs->trans("RESTRICT_ON_IP");
$label .= ' <span class="opacitymedium">'.$langs->trans("Example").': '.$langs->trans("IPListExample").'</span>';
$tooltiphelp .= ' <span class="opacitymedium">'.$langs->trans("Example").': '.$langs->trans("IPListExample").'</span>';
}
print $form->textwithpicto($label, $tooltiphelp);
print '</td><td>';
print '</td><td class="minwidth200">';
if ($key == 'DAV_ALLOW_PRIVATE_DIR') {
print $langs->trans("AlwaysActive");
} elseif ($key == 'DAV_ALLOW_PUBLIC_DIR' || $key == 'DAV_ALLOW_ECM_DIR') {

View File

@ -24,6 +24,7 @@
* \brief Setup page for debugbar module
*/
// Load Dolibarr environment
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';

View File

@ -26,6 +26,7 @@
* Mandatory fields are stored into $user->default_values[url]['mandatory']['querystring'|'_noquery_'][paramkey]=paramvalue
*/
// 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';
@ -294,6 +295,7 @@ if ($mode != 'focus' && $mode != 'mandatory') {
if ($mode != 'sortorder') {
$substitutionarray = getCommonSubstitutionArray($langs, 2, array('object', 'objectamount')); // Must match list into GETPOST
unset($substitutionarray['__USER_SIGNATURE__']);
unset($substitutionarray['__SENDEREMAIL_SIGNATURE__']);
$texthelp = $langs->trans("FollowingConstantsWillBeSubstituted").'<br>';
foreach ($substitutionarray as $key => $val) {
$texthelp .= $key.' -> '.$val.'<br>';

View File

@ -25,6 +25,7 @@
* \brief Page to setup late delays
*/
// Load Dolibarr environment
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';

View File

@ -27,6 +27,7 @@
* \brief Page to setup extra fields of delivery
*/
// Load Dolibarr environment
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/expedition.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';

View File

@ -29,6 +29,7 @@
* \brief Page to setup extra fields of delivery
*/
// Load Dolibarr environment
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/expedition.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';

View File

@ -34,6 +34,7 @@
* \brief Page to administer data tables
*/
// Load Dolibarr environment
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
@ -54,13 +55,13 @@ $entity = GETPOST('entity', 'int');
$code = GETPOST('code', 'alpha');
$allowed = $user->admin;
if ($id == 7 && !empty($user->rights->accounting->chartofaccount)) {
if ($id == 7 && $user->hasRight('accounting', 'chartofaccount')) {
$allowed = 1; // Tax page allowed to manager of chart account
}
if ($id == 10 && !empty($user->rights->accounting->chartofaccount)) {
if ($id == 10 && $user->hasRight('accounting', 'chartofaccount')) {
$allowed = 1; // Vat page allowed to manager of chart account
}
if ($id == 17 && !empty($user->rights->accounting->chartofaccount)) {
if ($id == 17 && $user->hasRight('accounting', 'chartofaccount')) {
$allowed = 1; // Dictionary with type of expense report and accounting account allowed to manager of chart account
}
if (!$allowed) {
@ -513,7 +514,7 @@ $tabcond[27] = isModEnabled("societe");
$tabcond[28] = isModEnabled('holiday');
$tabcond[29] = isModEnabled('project');
$tabcond[30] = isModEnabled('label');
//$tabcond[31]= !empty($conf->accounting->enabled);
//$tabcond[31]= isModEnabled('accounting');
$tabcond[32] = (isModEnabled('holiday') || isModEnabled('hrm'));
$tabcond[33] = isModEnabled('hrm');
$tabcond[34] = isModEnabled('hrm');
@ -2076,7 +2077,7 @@ if ($id > 0) {
} elseif (in_array($value, array('recuperableonly'))) {
$class = "center";
} elseif ($value == 'accountancy_code' || $value == 'accountancy_code_sell' || $value == 'accountancy_code_buy') {
if (!empty($conf->accounting->enabled)) {
if (isModEnabled('accounting')) {
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php';
$tmpaccountingaccount = new AccountingAccount($db);
$tmpaccountingaccount->fetch(0, $valuetoshow, 1);
@ -2485,7 +2486,7 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '')
print '</td>';
} elseif ($value == 'accountancy_code' || $value == 'accountancy_code_sell' || $value == 'accountancy_code_buy') {
print '<td>';
if (!empty($conf->accounting->enabled)) {
if (isModEnabled('accounting')) {
$fieldname = $value;
$accountancy_account = (!empty($obj->$fieldname) ? $obj->$fieldname : 0);
print $formaccounting->select_account($accountancy_account, '.'. $value, 1, '', 1, 1, 'maxwidth200 maxwidthonsmartphone');

View File

@ -28,6 +28,7 @@
* \brief Page to setup extra fields of ecm
*/
// Load Dolibarr environment
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/ecm.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';

View File

@ -28,6 +28,7 @@
* \brief Page to setup extra fields of ecm
*/
// Load Dolibarr environment
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/ecm.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';

View File

@ -22,6 +22,7 @@
* \brief Page to create/edit/view emailcollector
*/
// Load Dolibarr environment
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/agenda.lib.php';

View File

@ -21,6 +21,7 @@
* \brief List page for emailcollector
*/
// Load Dolibarr environment
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/agenda.lib.php';

View File

@ -21,6 +21,7 @@
* \brief Page to setup extra fields of EventOrganization
*/
// Load Dolibarr environment
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/eventorganization.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';

View File

@ -22,6 +22,7 @@
* \brief Log event setup page
*/
// Load Dolibarr environment
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/agenda.lib.php';

View File

@ -28,6 +28,7 @@
* \brief Page d'administration/configuration du module Expedition
*/
// Load Dolibarr environment
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';

View File

@ -27,6 +27,7 @@
* \brief Page to setup extra fields of expedition
*/
// Load Dolibarr environment
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/expedition.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';

View File

@ -29,6 +29,7 @@
* \brief Page to setup extra fields of expedition
*/
// Load Dolibarr environment
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/expedition.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';

View File

@ -28,6 +28,7 @@
* \brief Setup page of module ExpenseReport
*/
// Load Dolibarr environment
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';

View File

@ -26,6 +26,7 @@
* \brief Page to setup extra fields of expensereport
*/
// Load Dolibarr environment
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/expensereport.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';

View File

@ -24,6 +24,7 @@
* \brief Page to display expense tax ik
*/
// Load Dolibarr environment
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/expensereport.lib.php';

View File

@ -25,6 +25,7 @@
* \brief Page to display expense tax ik
*/
// Load Dolibarr environment
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/expensereport.lib.php';

View File

@ -28,6 +28,7 @@
* \brief config Page module Export
*/
// Load Dolibarr environment
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';

Some files were not shown because too many files have changed in this diff Show More