Merge branch 'develop' into develop_NEW_Service_DefaultWorkstation

This commit is contained in:
Laurent Destailleur
2022-09-13 01:38:49 +02:00
committed by GitHub
1088 changed files with 8461 additions and 4806 deletions

View File

@@ -98,6 +98,12 @@ source_file = htdocs/langs/en_US/cron.lang
source_lang = en_US source_lang = en_US
type = MOZILLAPROPERTIES type = MOZILLAPROPERTIES
[dolibarr.datapolicy]
file_filter = htdocs/langs/<lang>/datapolicy.lang
source_file = htdocs/langs/en_US/datapolicy.lang
source_lang = en_US
type = MOZILLAPROPERTIES
[dolibarr.deliveries] [dolibarr.deliveries]
file_filter = htdocs/langs/<lang>/deliveries.lang file_filter = htdocs/langs/<lang>/deliveries.lang
source_file = htdocs/langs/en_US/deliveries.lang source_file = htdocs/langs/en_US/deliveries.lang

View File

@@ -33,6 +33,7 @@ PEAR Mail_MIME 1.8.9 BSD Yes
ParseDown 1.6 MIT License Yes Markdown parser ParseDown 1.6 MIT License Yes Markdown parser
PCLZip 2.8.4 LGPL-3+ Yes Library to zip/unzip files 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 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 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 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 PHPoAuthLib 0.8.2 MIT License Yes Library to provide oauth1 and oauth2 to different service

View File

@@ -29,8 +29,8 @@ For users:
--------------- ---------------
NEW: PHP 8.1 compatibility: NEW: PHP 8.1 compatibility:
Warning: Application works correctly with PHP8 and 8.1 but you may experience a lot of PHP warning into the PHP server log files (depending Warning!! Application works correctly with PHP8 and 8.1 but you will experience a lot of PHP warnings into the PHP server
on the PHP setup). Removal of all PHP warnings on server side is planned for v17. log files (depending on your PHP setup). Removal of all PHP warnings on server side is planned for v17.
NEW: Support for recurring purchase invoices. NEW: Support for recurring purchase invoices.
NEW: #20292 Include German public holidays NEW: #20292 Include German public holidays
NEW: Can show ZATCA QR-Code on PDFs NEW: Can show ZATCA QR-Code on PDFs
@@ -53,72 +53,62 @@ NEW: Add column "Total HT" to products array on document creation card
NEW: Add configuration for text color of button action NEW: Add configuration for text color of button action
NEW: Add entity filter in exports NEW: Add entity filter in exports
NEW: Show the event block on recurring invoices #20870 NEW: Show the event block on recurring invoices #20870
NEW: Add filter "opportunity status" on statistics of projects.
NEW: Add firstname, lastname and max number of attendees for module "Event Organization" NEW: Add firstname, lastname and max number of attendees for module "Event Organization"
NEW: Add margin info in proposal and order list NEW: Add margin info in proposal and order list
NEW: Add massaction "Edit Extrafield" for Product NEW: Add massaction "Edit Extrafield" for Product
NEW: Add more fields to detect duplicate during import of thirdparties 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 option to foce delivery on email for purchase order receipt to yes
NEW: Add param boder table for md theme
NEW: Add param color button action
NEW: Add possibility to create contract from invoice 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 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 private and public notes on tax files.
NEW: Add status "Obsolete" to KM articles
NEW: Add substitutions "user numbers" NEW: Add substitutions "user numbers"
NEW: allow a ticket to be automatically marked as read when created from backend. 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: allow cut&paste as real numeric value to excel
NEW: A public form to send a message and create a lead is available NEW: A public form to send a message and create a lead is available
NEW: automatically set totally received status in reception NEW: automatically set totally received status in reception
NEW: Auto set invoice paid when adding credit not and remain to pay is 0 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 enter price with tax for predefined products on purchase objects
NEW: Can filter on a thirdparty on product statistics NEW: Can filter on a thirdparty on product statistics
NEW: Can removed doc templates from setup page of thirdparty 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: 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: clean values and amount in FEC import
NEW: const MAIL_MASS_ACTION_ADD_LAST_IF_MAIN_DOC_NOT_FOUND for mailing mass action NEW: const MAIL_MASS_ACTION_ADD_LAST_IF_MAIN_DOC_NOT_FOUND for mailing mass action
NEW: Contact filter project list NEW: Contact filter project list
NEW: Create contract from invoice 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: 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: 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 - 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 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: Enhance the import. Can use 'auto' for the ref (import of orders)
NEW: Events on Proposal to Return to Draft NEW: Events on Proposal to Return to Draft
NEW: Page to list expense report payments NEW: Page to list expense report payments
NEW: JS inventory autocalc input NEW: JS inventory autocalc input
NEW: language support for more emailing target selectors NEW: language support for more emailing target selectors
NEW: leave requests: add field into type dictionary to block request if balance is negative 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: Mass action "Close shipments"
NEW: Module BOM - Add tabs for nets Bom NEW: Module BOM - add tabs for nets Bom
NEW: Module BOM - Add the possibility to add sub-BOMs to 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 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: 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: payment conditions enabling semi-automatic deposit creation (Issue #18439)
NEW: possibility to consume multiple batch NEW: possibility to consume multiple batch
NEW: Reverse movement product consumption NEW: Reverse movement product consumption
NEW: Send email to the supplier order contact NEW: Send email to the supplier order contact
NEW: add permission to report time on timesheet NEW: add permission to report time on timesheet
NEW: SEPA XML - option to place payment Type Info at Credit transfer Transaction level NEW: Knowledge Management - add status "Obsolete" to KM articles
NEW: Some core tables are created only at module activation
NEW: MRP - split consumption line on MO 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: Projects - add filter "opportunity status" on statistics of projects.
NEW: Proposals - option update prices on proposal cloning NEW: Proposals - option update prices on proposal cloning
NEW: stock filter in reassort lists NEW: SEPA XML - option to place payment Type Info at Credit transfer Transaction level
NEW: stock limit in stock export CSV NEW: Stocks - stock filter in reassort lists
NEW: Stocks - stock limit in stock export CSV
NEW: Stocks - Inventory - can change value of AWP during the inventory
NEW: Supplier order - Show ref supplier of reception in linked object block NEW: Supplier order - Show ref supplier of reception in linked object block
NEW: support user_modif in order NEW: support user_modif in order
NEW: Surveys - Show number of votes into the label of tab "Results" of a survey NEW: Surveys - Show number of votes into the label of tab "Results" of a survey
@@ -128,20 +118,28 @@ NEW: TakePOS - show product reference
NEW: TakePOS - add constant to hide categories NEW: TakePOS - add constant to hide categories
NEW: TakePOS - add constant to show category description NEW: TakePOS - add constant to show category description
NEW: TakePOS - add constant to show only the products in stock NEW: TakePOS - add constant to show only the products in stock
NEW: Themes - add param color button action
NEW: Themes - Change in theme colors does not need to use the refresh button
NEW: Themes - more mode for THEME_TOPMENU_DISABLE_IMAGE (2, 3, ...)
NEW: Themes - MD - add param border table for md theme
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 - option to default check "notify tier at creation"
NEW: Tickets - Trigger: allow to automatically send messages on new tickets 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 backup tools has an "lowmemory" option for mysqldump on large database
NEW: The 'reposition' class works on ajax constantonoff that make redirects 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: thumbnail field in product list
NEW: total mark rate in list NEW: total mark rate in list
NEW: uncheck "send message" by default on a ticket when private messages has been checked 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: 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: Added MMK currency (Myanmar Kyat)
NEW: On a form to send an email, we show all emails of contacts of object 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 Partnership Management
NEW: Module Event Organization 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 trigger and event on completely received status change
NEW: Add utility function send backup by mail NEW: Add utility function send backup by mail
NEW: add WordPress OAuth to save a token (not SSO) 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 param to keep the robot=index meta tag on public pages
NEW: Add method hintindex() in database handlers. NEW: Add method hintindex() in database handlers.
NEW: add modifications for new function "$db->prefix()" NEW: add modifications for new function "$db->prefix()"
@@ -209,9 +207,11 @@ NEW: TakePOS - add hook doaction in TakePOS invoice
Config Options: Config Options:
NEW: Add hidden option on contract PDF line to hide qty and price 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: WARNING:

View File

@@ -1,5 +1,4 @@
<?php <?php
/* !!! DO NOT EDIT THIS FILE, EDIT config.inc.php INSTEAD !!! */ /* !!! DO NOT EDIT THIS FILE, EDIT config.inc.php INSTEAD !!! */
// vim: expandtab sw=4 ts=4 sts=4: // 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 $cfg['IgnoreMultiSubmitErrors'] = FALSE; // if set to true, PMA continues computing multiple-statement queries
// even if one of the queries failed // even if one of the queries failed
$cfg['VerboseMultiSubmit'] = TRUE; // if set to true, PMA will show the affected rows of EACH statement on $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! // hardcoded defaults on how many queries a statement may contain!
$cfg['AllowArbitraryServer'] = FALSE; // allow login to any user entered server in cookie based auth $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 // textarea - allows newlines in fields
$cfg['InsertRows'] = 2; // How many rows can be inserted at one time $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. 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 $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['ShowPropertyComments']= TRUE; // shows stored relation-comments in 'table property' mode.
$cfg['RepeatCells'] = 100; // repeat header names every X cells? (0 = deactivate) $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['QueryWindowWidth'] = 550; // Width of Query window
$cfg['QueryWindowHeight'] = 310; // Height of Query window $cfg['QueryWindowHeight'] = 310; // Height of Query window
$cfg['QueryHistoryDB'] = FALSE; // Set to TRUE if you want DB-based query history. $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 $cfg['UploadDir'] = ''; // Directory for uploaded files that can be executed by
// phpMyAdmin. For example './upload'. Leave empty for // phpMyAdmin. For example './upload'. Leave empty for
// no upload directory support. Use %u for username // no upload directory support. Use %u for username
// inclusion. // inclusion.
$cfg['SaveDir'] = ''; // Directory where phpMyAdmin can save exported data on $cfg['SaveDir'] = ''; // Directory where phpMyAdmin can save exported data on
// server. For example './save'. Leave empty for no save // server. For example './save'. Leave empty for no save
@@ -645,7 +644,7 @@ $cfg['ColumnTypes'] = array(
); );
// Attributes // 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 // for MySQL >= 4.1.2, in libraries/tbl_properties.inc.php
$cfg['AttributeTypes'] = array( $cfg['AttributeTypes'] = array(

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -22,6 +22,7 @@
* \brief Page to administer data tables * \brief Page to administer data tables
*/ */
// Load Dolibarr environment
require '../../main.inc.php'; require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php'; 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.formcompany.class.php';
@@ -42,7 +43,7 @@ $rowid = GETPOST('rowid', 'alpha');
$code = GETPOST('code', 'alpha'); $code = GETPOST('code', 'alpha');
// Security access // Security access
if (empty($user->rights->accounting->chartofaccount)) { if (!$user->hasRight('accounting', 'chartofaccount')) {
accessforbidden(); accessforbidden();
} }
@@ -885,9 +886,11 @@ function fieldListAccountingCategories($fieldlist, $obj = '', $tabname = '', $co
$fieldname = 'country'; $fieldname = 'country';
if ($context == 'add') { if ($context == 'add') {
$fieldname = 'country_id'; $fieldname = 'country_id';
print $form->select_country(GETPOST('country_id', 'int'), $fieldname, '', 28, 'maxwidth200 maxwidthonsmartphone'); $preselectcountrycode = GETPOSTISSET('country_id') ? GETPOST('country_id', 'int') : $mysoc->country_code;
print $form->select_country($preselectcountrycode, $fieldname, '', 28, 'maxwidth200 maxwidthonsmartphone');
} else { } else {
print $form->select_country((!empty($obj->country_code) ? $obj->country_code : (!empty($obj->country) ? $obj->country : $mysoc->country_code)), $fieldname, '', 28, 'maxwidth200 maxwidthonsmartphone'); $preselectcountrycode = (empty($obj->country_code) ? (empty($obj->country) ? $mysoc->country_code : $obj->country) : $obj->country_code);
print $form->select_country($preselectcountrycode, $fieldname, '', 28, 'maxwidth200 maxwidthonsmartphone');
} }
print '</td>'; print '</td>';
} elseif ($fieldlist[$field] == 'country_id') { } elseif ($fieldlist[$field] == 'country_id') {

View File

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

View File

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

View File

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

View File

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

View File

@@ -29,6 +29,7 @@
* \brief Setup page to configure accounting expert module * \brief Setup page to configure accounting expert module
*/ */
// Load Dolibarr environment
require '../../main.inc.php'; require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/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")); $langs->loadLangs(array("compta", "bills", "admin", "accountancy", "other"));
// Security access // Security access
if (empty($user->rights->accounting->chartofaccount)) { if (!$user->hasRight('accounting', 'chartofaccount')) {
accessforbidden(); 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 define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET
} }
// Load Dolibarr environment
require '../../main.inc.php'; require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php'; 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.formcompany.class.php';
@@ -45,7 +46,7 @@ $rowid = GETPOST('rowid', 'alpha');
$code = GETPOST('code', 'alpha'); $code = GETPOST('code', 'alpha');
// Security access // Security access
if (empty($user->rights->accounting->chartofaccount)) { if (!$user->hasRight('accounting', 'chartofaccount')) {
accessforbidden(); accessforbidden();
} }

View File

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

View File

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

View File

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

View File

@@ -25,6 +25,7 @@
* \brief List operation of book keeping * \brief List operation of book keeping
*/ */
// Load Dolibarr environment
require '../../main.inc.php'; require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountancyexport.class.php'; require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountancyexport.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.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 * \brief List operation of ledger ordered by account number
*/ */
// Load Dolibarr environment
require '../../main.inc.php'; require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';

View File

@@ -785,12 +785,13 @@ class AccountancyCategory // extends CommonObject
} }
/** /**
* Return list of custom groups that are active * Return list of custom groups.
* *
* @param int $categorytype -1=All, 0=Only non computed groups, 1=Only computed groups * @param int $categorytype -1=All, 0=Only non computed groups, 1=Only computed groups
* @param int $active 1= active, 0=not active
* @return array|int Array of groups or -1 if error * @return array|int Array of groups or -1 if error
*/ */
public function getCats($categorytype = -1) public function getCats($categorytype = -1, $active = 1)
{ {
global $conf, $mysoc; global $conf, $mysoc;
@@ -801,7 +802,7 @@ class AccountancyCategory // extends CommonObject
$sql = "SELECT c.rowid, c.code, c.label, c.formula, c.position, c.category_type, c.sens"; $sql = "SELECT c.rowid, c.code, c.label, c.formula, c.position, c.category_type, c.sens";
$sql .= " FROM ".MAIN_DB_PREFIX."c_accounting_category as c"; $sql .= " FROM ".MAIN_DB_PREFIX."c_accounting_category as c";
$sql .= " WHERE c.active = 1"; $sql .= " WHERE c.active = " . (int) $active;
$sql .= " AND c.entity = ".$conf->entity; $sql .= " AND c.entity = ".$conf->entity;
if ($categorytype >= 0) { if ($categorytype >= 0) {
$sql .= " AND c.category_type = 1"; $sql .= " AND c.category_type = 1";

View File

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

View File

@@ -21,6 +21,7 @@
* \brief Home closure page * \brief Home closure page
*/ */
// Load Dolibarr environment
require '../../main.inc.php'; require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';

View File

@@ -26,6 +26,7 @@
* \brief Home customer journalization page * \brief Home customer journalization page
*/ */
// Load Dolibarr environment
require '../../main.inc.php'; require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';

View File

@@ -24,6 +24,7 @@
* \brief Home expense report ventilation * \brief Home expense report ventilation
*/ */
// Load Dolibarr environment
require '../../main.inc.php'; require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.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')) { if (!isModEnabled('accounting')) {
accessforbidden(); accessforbidden();
} }
if (empty($user->rights->accounting->mouvements->lire)) { if (!$user->hasRight('accounting', 'mouvements', 'lire')) {
accessforbidden(); accessforbidden();
} }
*/ */

View File

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

View File

@@ -21,6 +21,7 @@
* \brief Page of a journal * \brief Page of a journal
*/ */
// Load Dolibarr environment
require '../../main.inc.php'; require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
@@ -51,7 +52,7 @@ if ($result > 0) {
} elseif ($result < 0) { } elseif ($result < 0) {
dol_print_error('', $object->error, $object->errors); dol_print_error('', $object->error, $object->errors);
} elseif ($result == 0) { } elseif ($result == 0) {
accessforbidden($langs->trans('ErrorRecordNotFound')); accessforbidden('ErrorRecordNotFound');
} }
$hookmanager->initHooks(array('globaljournal', $object->nature.'journal')); $hookmanager->initHooks(array('globaljournal', $object->nature.'journal'));

View File

@@ -24,6 +24,7 @@
* \brief Home supplier journalization page * \brief Home supplier journalization page
*/ */
// Load Dolibarr environment
require '../../main.inc.php'; require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.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 * \brief Page to setup the module Foundation
*/ */
// Load Dolibarr environment
require '../../main.inc.php'; require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/member.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 * \brief Page to setup the module Foundation
*/ */
// Load Dolibarr environment
require '../../main.inc.php'; require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/member.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 * \brief Page to setup extra fields of members
*/ */
// Load Dolibarr environment
require '../../main.inc.php'; require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.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 * \brief Page to setup extra fields of members
*/ */
// Load Dolibarr environment
require '../../main.inc.php'; require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.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 * \brief File of main public page for member module
*/ */
// Load Dolibarr environment
require '../../main.inc.php'; require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';

View File

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

View File

@@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2010-2012 Regis Houssin <regis.houssin@inodbox.com> /* 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 * 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 * 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)) { if (empty($user->socid)) {
echo '<div class="tabsAction">'; 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>'; 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 // 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 // Define variables to determine what the current user can do on the properties of a member
if ($id) { if ($id) {
$caneditfieldmember = $user->rights->adherent->creer; $caneditfieldmember = $user->hasRight('adherent', 'creer');
} }
// Security check // 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'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
$birthdate = ''; $birthdate = '';
@@ -421,7 +421,7 @@ if (empty($reshook)) {
} }
} }
if ($action == 'add' && $user->rights->adherent->creer) { if ($action == 'add' && $user->hasRight('adherent', 'creer')) {
if ($canvas) { if ($canvas) {
$object->canvas = $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; $error = 0;
$db->begin(); $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 (!count($object->errors)) {
if (!$mailmanspip->add_to_spip($object)) { if (!$mailmanspip->add_to_spip($object)) {
setEventMessages($langs->trans('AddIntoSpipError').': '.$mailmanspip->error, null, 'errors'); setEventMessages($langs->trans('AddIntoSpipError').': '.$mailmanspip->error, null, 'errors');
@@ -867,7 +867,7 @@ if (empty($reshook)) {
// Actions to build doc // Actions to build doc
$upload_dir = $conf->adherent->dir_output; $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'; include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
// Actions to send emails // Actions to send emails
@@ -1222,7 +1222,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
// Type // Type
print '<tr><td class="fieldrequired">'.$langs->trans("Type").'</td><td>'; 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); print $form->selectarray("typeid", $adht->liste_array(), (GETPOSTISSET("typeid") ? GETPOST("typeid", 'int') : $object->typeid), 0, 0, 0, '', 0, 0, 0, '', '', 1);
} else { } else {
print $adht->getNomUrl(1); print $adht->getNomUrl(1);
@@ -1820,7 +1820,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
// Third party Dolibarr // Third party Dolibarr
if (isModEnabled('societe')) { if (isModEnabled('societe')) {
print '<tr><td>'; print '<tr><td>';
$editenable = $user->rights->adherent->creer; $editenable = $user->hasRight('adherent', 'creer');
print $form->editfieldkey('LinkedToDolibarrThirdParty', 'thirdparty', '', $object, $editenable); print $form->editfieldkey('LinkedToDolibarrThirdParty', 'thirdparty', '', $object, $editenable);
print '</td><td colspan="2" class="valeur">'; print '</td><td colspan="2" class="valeur">';
if ($action == 'editthirdparty') { if ($action == 'editthirdparty') {
@@ -1857,7 +1857,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
// Login Dolibarr - Link to user // Login Dolibarr - Link to user
print '<tr><td>'; 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 $form->editfieldkey('LinkedToDolibarrUser', 'login', '', $object, $editenable);
print '</td><td colspan="2" class="valeur">'; print '</td><td colspan="2" class="valeur">';
if ($action == 'editlogin') { if ($action == 'editlogin') {
@@ -1901,7 +1901,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
// Send card by email // Send card by email
// TODO Remove this to replace with a template // 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 (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"; 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"; 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 // 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"; print '<a class="butAction" href="card.php?rowid='.$id.'&action=edit&token='.newToken().'">'.$langs->trans("Modify").'</a>'."\n";
} else { } else {
print '<span class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans("Modify").'</span>'."\n"; 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 // Validate
if (Adherent::STATUS_DRAFT == $object->statut) { 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"; print '<a class="butAction" href="card.php?rowid='.$id.'&action=valid">'.$langs->trans("Validate").'</a>'."\n";
} else { } else {
print '<span class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans("Validate").'</span>'."\n"; 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 // Reactivate
if (Adherent::STATUS_RESILIATED == $object->statut || Adherent::STATUS_EXCLUDED == $object->statut) { 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"; print '<a class="butAction" href="card.php?rowid='.$id.'&action=valid">'.$langs->trans("Reenable")."</a>\n";
} else { } else {
print '<span class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans("Reenable").'</span>'."\n"; 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'); $filedir = $conf->adherent->dir_output.'/'.get_exdir(0, 0, 0, 1, $object, 'member');
$urlsource = $_SERVER['PHP_SELF'].'?id='.$object->id; $urlsource = $_SERVER['PHP_SELF'].'?id='.$object->id;
$genallowed = $user->rights->adherent->lire; $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); 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; $somethingshown = $formfile->numoffiles;

View File

@@ -335,8 +335,8 @@ class Adherent extends CommonObject
'public' => array('type' => 'smallint(6)', 'label' => 'Public', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 145), 'public' => array('type' => 'smallint(6)', 'label' => 'Public', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 145),
'datefin' => array('type' => 'datetime', 'label' => 'DateEnd', 'enabled' => 1, 'visible' => -1, 'position' => 150), 'datefin' => array('type' => 'datetime', 'label' => 'DateEnd', 'enabled' => 1, 'visible' => -1, 'position' => 150),
'default_lang' =>array('type'=>'varchar(6)', 'label'=>'Default lang', 'enabled'=>1, 'visible'=>-1, 'position'=> 153), 'default_lang' =>array('type'=>'varchar(6)', 'label'=>'Default lang', 'enabled'=>1, 'visible'=>-1, 'position'=> 153),
'note_private' => array('type' => 'text', 'label' => 'NotePublic', 'enabled' => 1, 'visible' => 0, 'position' => 155), 'note_public' => array('type' => 'text', 'label' => 'NotePublic', 'enabled' => 1, 'visible' => 0, 'position' => 155),
'note_public' => array('type' => 'text', 'label' => 'NotePrivate', 'enabled' => 1, 'visible' => 0, 'position' => 160), 'note_private' => array('type' => 'text', 'label' => 'NotePrivate', 'enabled' => 1, 'visible' => 0, 'position' => 160),
'datevalid' => array('type' => 'datetime', 'label' => 'DateValidation', 'enabled' => 1, 'visible' => -1, 'position' => 165), 'datevalid' => array('type' => 'datetime', 'label' => 'DateValidation', 'enabled' => 1, 'visible' => -1, 'position' => 165),
'datec' => array('type' => 'datetime', 'label' => 'DateCreation', 'enabled' => 1, 'visible' => -1, 'position' => 170), 'datec' => array('type' => 'datetime', 'label' => 'DateCreation', 'enabled' => 1, 'visible' => -1, 'position' => 170),
'tms' => array('type' => 'timestamp', 'label' => 'DateModification', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 175), 'tms' => array('type' => 'timestamp', 'label' => 'DateModification', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 175),

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -232,7 +232,7 @@ if (empty($reshook)) {
} }
// Close // Close
if ($massaction == 'close' && $user->rights->adherent->creer) { if ($massaction == 'close' && $user->hasRight('adherent', 'creer')) {
$tmpmember = new Adherent($db); $tmpmember = new Adherent($db);
$error = 0; $error = 0;
$nbclose = 0; $nbclose = 0;
@@ -262,7 +262,7 @@ if (empty($reshook)) {
} }
// Create external user // 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); $tmpmember = new Adherent($db);
$error = 0; $error = 0;
$nbcreated = 0; $nbcreated = 0;
@@ -302,7 +302,7 @@ if (empty($reshook)) {
$objectlabel = 'Members'; $objectlabel = 'Members';
$permissiontoread = $user->rights->adherent->lire; $permissiontoread = $user->rights->adherent->lire;
$permissiontodelete = $user->rights->adherent->supprimer; $permissiontodelete = $user->rights->adherent->supprimer;
$permissiontoadd = $user->rights->adherent->creer; $permissiontoadd = $user->hasRight('adherent', 'creer');
$uploaddir = $conf->adherent->dir_output; $uploaddir = $conf->adherent->dir_output;
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
} }
@@ -350,7 +350,7 @@ $sql .= " FROM ".MAIN_DB_PREFIX."adherent as d";
if (!empty($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) { if (!empty($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) {
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (d.rowid = ef.fk_object)"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (d.rowid = ef.fk_object)";
} }
if ((!empty($search_categ) && $search_categ > 0) || !empty($catid)) { if ((!empty($search_categ) && ($search_categ > 0 || $search_categ == -2)) || !empty($catid)) {
// We need this table joined to the select in order to filter by categ // We need this table joined to the select in order to filter by categ
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_member as cm ON d.rowid = cm.fk_member"; $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_member as cm ON d.rowid = cm.fk_member";
} }
@@ -617,7 +617,7 @@ $arrayofmassactions = array(
//'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"), //'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"),
//'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"), //'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"); $arrayofmassactions['close'] = img_picto('', 'close_title', 'class="pictofixedwidth"').$langs->trans("Resiliate");
} }
if ($user->rights->adherent->supprimer) { if ($user->rights->adherent->supprimer) {
@@ -626,7 +626,7 @@ if ($user->rights->adherent->supprimer) {
if ($user->rights->societe->creer) { if ($user->rights->societe->creer) {
$arrayofmassactions['preaffecttag'] = img_picto('', 'category', 'class="pictofixedwidth"').$langs->trans("AffectTag"); $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"); $arrayofmassactions['createexternaluser'] = img_picto('', 'user', 'class="pictofixedwidth"').$langs->trans("CreateExternalUser");
} }
if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete', 'preaffecttag'))) { 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); $massactionbutton = $form->selectMassAction('', $arrayofmassactions);
$newcardbutton = ''; $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'); $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 // Fetch object
if ($id > 0 || !empty($ref)) { 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 // 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 // Define variables to determine what the current user can do on the properties of a member
if ($id) { if ($id) {
$caneditfieldmember = $user->rights->adherent->creer; $caneditfieldmember = $user->hasRight('adherent', 'creer');
} }
$hookmanager->initHooks(array('membernote')); $hookmanager->initHooks(array('membernote'));
@@ -155,7 +155,7 @@ if ($id) {
$cssclass = 'titlefield'; $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'; include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php';

View File

@@ -21,6 +21,7 @@
* \brief Page with statistics on members * \brief Page with statistics on members
*/ */
// Load Dolibarr environment
require '../../main.inc.php'; require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.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.class.php';

View File

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

View File

@@ -23,6 +23,7 @@
* \brief Page of subscription members statistics * \brief Page of subscription members statistics
*/ */
// Load Dolibarr environment
require '../../main.inc.php'; require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherentstats.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 * \brief tab for Adding, editing, deleting a member's memberships
*/ */
// Load Dolibarr environment
require '../main.inc.php'; require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.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 // 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 // Define variables to determine what the current user can do on the properties of a member
if ($id) { if ($id) {
$caneditfieldmember = $user->rights->adherent->creer; $caneditfieldmember = $user->hasRight('adherent', 'creer');
} }
// Security check // Security check
@@ -594,7 +595,7 @@ if ($rowid > 0) {
print '<table class="nobordernopadding" width="100%"><tr><td>'; print '<table class="nobordernopadding" width="100%"><tr><td>';
print $langs->trans("LinkedToDolibarrThirdParty"); print $langs->trans("LinkedToDolibarrThirdParty");
print '</td>'; 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 '<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>'; print '</tr></table>';
@@ -636,7 +637,7 @@ if ($rowid > 0) {
print '<table class="nobordernopadding" width="100%"><tr><td>'; print '<table class="nobordernopadding" width="100%"><tr><td>';
print $langs->trans("LinkedToDolibarrUser"); print $langs->trans("LinkedToDolibarrUser");
print '</td>'; print '</td>';
if ($action != 'editlogin' && $user->rights->adherent->creer) { if ($action != 'editlogin' && $user->hasRight('adherent', 'creer')) {
print '<td class="right">'; print '<td class="right">';
if ($user->rights->user->user->creer) { 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>'; print '<a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editlogin&token='.newToken().'&rowid='.$object->id.'">'.img_edit($langs->trans('SetLinkToUser'), 1).'</a>';
@@ -1072,7 +1073,7 @@ if ($rowid > 0) {
// Payment mode // Payment mode
print '<tr class="bankswitchclass"><td class="fieldrequired">'.$langs->trans("PaymentMode").'</td><td>'; print '<tr class="bankswitchclass"><td class="fieldrequired">'.$langs->trans("PaymentMode").'</td><td>';
$form->select_types_paiements(GETPOST('operation'), 'operation', '', 2, 1, 0, 0, 1, 'minwidth200'); print $form->select_types_paiements(GETPOST('operation'), 'operation', '', 2, 1, 0, 0, 1, 'minwidth200', 1);
print "</td></tr>\n"; print "</td></tr>\n";
// Date of payment // Date of payment

View File

@@ -22,6 +22,7 @@
* \brief Page to add/edit/remove a member subscription * \brief Page to add/edit/remove a member subscription
*/ */
// Load Dolibarr environment
require '../../main.inc.php'; require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.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.class.php';

View File

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

View File

@@ -23,6 +23,7 @@
* \brief list of subscription * \brief list of subscription
*/ */
// Load Dolibarr environment
require '../../main.inc.php'; require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.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.'/adherents/class/adherent_type.class.php';

View File

@@ -29,6 +29,7 @@
* \brief Member's type setup * \brief Member's type setup
*/ */
// Load Dolibarr environment
require '../main.inc.php'; require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.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.class.php';
@@ -753,7 +754,7 @@ if ($rowid > 0) {
// Actions // Actions
print '<td class="center">'; 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>'; 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) { if ($user->rights->adherent->supprimer) {

View File

@@ -22,6 +22,7 @@
* \brief Page fiche LDAP members types * \brief Page fiche LDAP members types
*/ */
// Load Dolibarr environment
require '../main.inc.php'; require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.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.class.php';

View File

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

View File

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

View File

@@ -21,6 +21,7 @@
* \brief Setup page to configure accountant / auditor * \brief Setup page to configure accountant / auditor
*/ */
// Load Dolibarr environment
require '../main.inc.php'; require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.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 * \brief Setup page to configure accounting module
*/ */
// Load Dolibarr environment
require '../main.inc.php'; require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.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 * \brief Autocreate actions for agenda module setup page
*/ */
// Load Dolibarr environment
require '../main.inc.php'; require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/agenda.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 * \brief Page to setup extra fields of agenda
*/ */
// Load Dolibarr environment
require '../main.inc.php'; require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/agenda.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/agenda.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.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 * \brief Page to setup external calendars for agenda module
*/ */
// Load Dolibarr environment
require '../main.inc.php'; require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.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 * \brief Autocreate actions for agenda module setup page
*/ */
// Load Dolibarr environment
require '../main.inc.php'; require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/agenda.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 * \brief Page to setup agenda reminder options
*/ */
// Load Dolibarr environment
require '../main.inc.php'; require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/agenda.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 * \brief Page to setup miscellaneous options of agenda module
*/ */
// Load Dolibarr environment
require '../main.inc.php'; require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/agenda.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 * \brief Page to setup extra fields of bank
*/ */
// Load Dolibarr environment
require '../main.inc.php'; require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';

View File

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

View File

@@ -21,6 +21,7 @@
* \brief Setup page of module BOM * \brief Setup page of module BOM
*/ */
// Load Dolibarr environment
require '../main.inc.php'; require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.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 * \brief Page to setup extra fields of BOM
*/ */
// Load Dolibarr environment
require '../main.inc.php'; require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/bom/lib/bom.lib.php'; require_once DOL_DOCUMENT_ROOT.'/bom/lib/bom.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';

View File

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

View File

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

View File

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

View File

@@ -31,6 +31,7 @@
* \brief Setup page of module Order * \brief Setup page of module Order
*/ */
// Load Dolibarr environment
require '../main.inc.php'; require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.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 * \brief Page to setup extra fields of reception
*/ */
// Load Dolibarr environment
require '../main.inc.php'; require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/reception.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/reception.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';

View File

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

View File

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

View File

@@ -25,6 +25,7 @@
* \brief Page to setup sending module * \brief Page to setup sending module
*/ */
// Load Dolibarr environment
require '../main.inc.php'; require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/expedition.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 * \brief Admin page to define miscellaneous constants
*/ */
// Load Dolibarr environment
require '../main.inc.php'; require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/security.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/security.lib.php';

View File

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

View File

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

View File

@@ -24,6 +24,7 @@
* \brief Setup page for debugbar module * \brief Setup page for debugbar module
*/ */
// Load Dolibarr environment
require '../main.inc.php'; require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.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 * Mandatory fields are stored into $user->default_values[url]['mandatory']['querystring'|'_noquery_'][paramkey]=paramvalue
*/ */
// Load Dolibarr environment
require '../main.inc.php'; require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
@@ -294,6 +295,7 @@ if ($mode != 'focus' && $mode != 'mandatory') {
if ($mode != 'sortorder') { if ($mode != 'sortorder') {
$substitutionarray = getCommonSubstitutionArray($langs, 2, array('object', 'objectamount')); // Must match list into GETPOST $substitutionarray = getCommonSubstitutionArray($langs, 2, array('object', 'objectamount')); // Must match list into GETPOST
unset($substitutionarray['__USER_SIGNATURE__']); unset($substitutionarray['__USER_SIGNATURE__']);
unset($substitutionarray['__SENDEREMAIL_SIGNATURE__']);
$texthelp = $langs->trans("FollowingConstantsWillBeSubstituted").'<br>'; $texthelp = $langs->trans("FollowingConstantsWillBeSubstituted").'<br>';
foreach ($substitutionarray as $key => $val) { foreach ($substitutionarray as $key => $val) {
$texthelp .= $key.' -> '.$val.'<br>'; $texthelp .= $key.' -> '.$val.'<br>';

View File

@@ -25,6 +25,7 @@
* \brief Page to setup late delays * \brief Page to setup late delays
*/ */
// Load Dolibarr environment
require '../main.inc.php'; require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.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 * \brief Page to setup extra fields of delivery
*/ */
// Load Dolibarr environment
require '../main.inc.php'; require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/expedition.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/expedition.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.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 * \brief Page to setup extra fields of delivery
*/ */
// Load Dolibarr environment
require '../main.inc.php'; require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/expedition.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/expedition.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';

View File

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

View File

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

View File

@@ -21,6 +21,7 @@
* \brief List page for emailcollector * \brief List page for emailcollector
*/ */
// Load Dolibarr environment
require '../main.inc.php'; require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/agenda.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 * \brief Page to setup extra fields of EventOrganization
*/ */
// Load Dolibarr environment
require '../main.inc.php'; require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/eventorganization.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/eventorganization.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';

View File

@@ -22,6 +22,7 @@
* \brief Log event setup page * \brief Log event setup page
*/ */
// Load Dolibarr environment
require '../main.inc.php'; require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/agenda.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 * \brief Page d'administration/configuration du module Expedition
*/ */
// Load Dolibarr environment
require '../main.inc.php'; require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.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 * \brief Page to setup extra fields of expedition
*/ */
// Load Dolibarr environment
require '../main.inc.php'; require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/expedition.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/expedition.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.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 * \brief Page to setup extra fields of expedition
*/ */
// Load Dolibarr environment
require '../main.inc.php'; require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/expedition.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/expedition.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';

View File

@@ -28,6 +28,7 @@
* \brief Setup page of module ExpenseReport * \brief Setup page of module ExpenseReport
*/ */
// Load Dolibarr environment
require '../main.inc.php'; require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.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 * \brief Page to setup extra fields of expensereport
*/ */
// Load Dolibarr environment
require '../main.inc.php'; require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/expensereport.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/expensereport.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';

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