Browse Source

Merge branch 'develop' into patch-532

Laurent Destailleur 2 years ago
parent
commit
fd37811544
100 changed files with 183 additions and 88 deletions
  1. 6 0
      .tx/config
  2. 1 0
      COPYRIGHT
  3. 24 24
      ChangeLog
  4. 5 6
      build/exe/doliwamp/config.inc.php.install
  5. 0 1
      dev/tools/test/namespacemig/main.inc.php
  6. 1 0
      htdocs/accountancy/admin/account.php
  7. 1 0
      htdocs/accountancy/admin/accountmodel.php
  8. 1 0
      htdocs/accountancy/admin/card.php
  9. 1 0
      htdocs/accountancy/admin/categories.php
  10. 5 2
      htdocs/accountancy/admin/categories_list.php
  11. 1 0
      htdocs/accountancy/admin/closure.php
  12. 1 0
      htdocs/accountancy/admin/fiscalyear.php
  13. 1 0
      htdocs/accountancy/admin/fiscalyear_card.php
  14. 1 0
      htdocs/accountancy/admin/fiscalyear_info.php
  15. 1 0
      htdocs/accountancy/admin/index.php
  16. 1 0
      htdocs/accountancy/admin/journals_list.php
  17. 1 0
      htdocs/accountancy/admin/subaccount.php
  18. 1 0
      htdocs/accountancy/bookkeeping/balance.php
  19. 1 0
      htdocs/accountancy/bookkeeping/card.php
  20. 1 0
      htdocs/accountancy/bookkeeping/list.php
  21. 1 0
      htdocs/accountancy/bookkeeping/listbyaccount.php
  22. 4 3
      htdocs/accountancy/class/accountancycategory.class.php
  23. 1 0
      htdocs/accountancy/closure/index.php
  24. 1 0
      htdocs/accountancy/customer/index.php
  25. 1 0
      htdocs/accountancy/expensereport/index.php
  26. 1 0
      htdocs/accountancy/journal/sellsjournal.php
  27. 2 1
      htdocs/accountancy/journal/variousjournal.php
  28. 1 0
      htdocs/accountancy/supplier/index.php
  29. 1 0
      htdocs/adherents/admin/member.php
  30. 1 0
      htdocs/adherents/admin/member_emails.php
  31. 1 0
      htdocs/adherents/admin/member_extrafields.php
  32. 1 0
      htdocs/adherents/admin/member_type_extrafields.php
  33. 1 0
      htdocs/adherents/admin/website.php
  34. 1 0
      htdocs/adherents/agenda.php
  35. 2 2
      htdocs/adherents/canvas/default/tpl/adherentcard_view.tpl.php
  36. 15 15
      htdocs/adherents/card.php
  37. 2 2
      htdocs/adherents/class/adherent.class.php
  38. 3 3
      htdocs/adherents/class/api_members.class.php
  39. 1 1
      htdocs/adherents/class/api_subscriptions.class.php
  40. 5 4
      htdocs/adherents/document.php
  41. 1 0
      htdocs/adherents/htpasswd.php
  42. 3 2
      htdocs/adherents/ldap.php
  43. 7 7
      htdocs/adherents/list.php
  44. 4 4
      htdocs/adherents/note.php
  45. 1 0
      htdocs/adherents/stats/byproperties.php
  46. 1 0
      htdocs/adherents/stats/geo.php
  47. 1 0
      htdocs/adherents/stats/index.php
  48. 6 5
      htdocs/adherents/subscription.php
  49. 1 0
      htdocs/adherents/subscription/card.php
  50. 1 0
      htdocs/adherents/subscription/info.php
  51. 1 0
      htdocs/adherents/subscription/list.php
  52. 2 1
      htdocs/adherents/type.php
  53. 1 0
      htdocs/adherents/type_ldap.php
  54. 1 0
      htdocs/adherents/type_translation.php
  55. 3 2
      htdocs/adherents/vcard.php
  56. 1 0
      htdocs/admin/accountant.php
  57. 1 0
      htdocs/admin/accounting.php
  58. 1 0
      htdocs/admin/agenda.php
  59. 1 0
      htdocs/admin/agenda_extrafields.php
  60. 1 0
      htdocs/admin/agenda_extsites.php
  61. 1 0
      htdocs/admin/agenda_other.php
  62. 1 0
      htdocs/admin/agenda_reminder.php
  63. 1 0
      htdocs/admin/agenda_xcal.php
  64. 1 0
      htdocs/admin/bank_extrafields.php
  65. 1 0
      htdocs/admin/barcode.php
  66. 1 0
      htdocs/admin/bom.php
  67. 1 0
      htdocs/admin/bom_extrafields.php
  68. 1 0
      htdocs/admin/boxes.php
  69. 1 0
      htdocs/admin/chequereceipts.php
  70. 3 2
      htdocs/admin/clicktodial.php
  71. 1 0
      htdocs/admin/commande.php
  72. 1 0
      htdocs/admin/commande_fournisseur_dispatch_extrafields.php
  73. 1 0
      htdocs/admin/company.php
  74. 1 0
      htdocs/admin/company_socialnetworks.php
  75. 1 0
      htdocs/admin/compta.php
  76. 1 0
      htdocs/admin/confexped.php
  77. 1 0
      htdocs/admin/const.php
  78. 1 0
      htdocs/admin/contract.php
  79. 1 0
      htdocs/admin/dav.php
  80. 1 0
      htdocs/admin/debugbar.php
  81. 1 0
      htdocs/admin/defaultvalues.php
  82. 1 0
      htdocs/admin/delais.php
  83. 1 0
      htdocs/admin/delivery_extrafields.php
  84. 1 0
      htdocs/admin/deliverydet_extrafields.php
  85. 2 1
      htdocs/admin/dict.php
  86. 1 0
      htdocs/admin/ecm_directories_extrafields.php
  87. 1 0
      htdocs/admin/ecm_files_extrafields.php
  88. 1 0
      htdocs/admin/emailcollector_card.php
  89. 1 0
      htdocs/admin/emailcollector_list.php
  90. 1 0
      htdocs/admin/eventorganization_confbooth_extrafields.php
  91. 1 0
      htdocs/admin/events.php
  92. 1 0
      htdocs/admin/expedition.php
  93. 1 0
      htdocs/admin/expedition_extrafields.php
  94. 1 0
      htdocs/admin/expeditiondet_extrafields.php
  95. 1 0
      htdocs/admin/expensereport.php
  96. 1 0
      htdocs/admin/expensereport_extrafields.php
  97. 1 0
      htdocs/admin/expensereport_ik.php
  98. 1 0
      htdocs/admin/expensereport_rules.php
  99. 1 0
      htdocs/admin/export.php
  100. 1 0
      htdocs/admin/external_rss.php

+ 6 - 0
.tx/config

@@ -98,6 +98,12 @@ source_file = htdocs/langs/en_US/cron.lang
 source_lang = en_US
 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]
 file_filter = htdocs/langs/<lang>/deliveries.lang
 source_file = htdocs/langs/en_US/deliveries.lang

+ 1 - 0
COPYRIGHT

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

+ 24 - 24
ChangeLog

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

+ 5 - 6
build/exe/doliwamp/config.inc.php.install

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

+ 0 - 1
dev/tools/test/namespacemig/main.inc.php

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

+ 1 - 0
htdocs/accountancy/admin/account.php

@@ -23,6 +23,7 @@
  * \brief		List accounting account
  */
 
+// Load Dolibarr environment
 require '../../main.inc.php';
 require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
 require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';

+ 1 - 0
htdocs/accountancy/admin/accountmodel.php

@@ -32,6 +32,7 @@
  *		\brief      Page to administer model of chart of accounts
  */
 
+// Load Dolibarr environment
 require '../../main.inc.php';
 require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
 require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';

+ 1 - 0
htdocs/accountancy/admin/card.php

@@ -23,6 +23,7 @@
  *  \brief      Card of accounting account
  */
 
+// Load Dolibarr environment
 require '../../main.inc.php';
 require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
 require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php';

+ 1 - 0
htdocs/accountancy/admin/categories.php

@@ -22,6 +22,7 @@
  * \brief	Page to assign mass categories to accounts
  */
 
+// Load Dolibarr environment
 require '../../main.inc.php';
 require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
 require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountancycategory.class.php';

+ 5 - 2
htdocs/accountancy/admin/categories_list.php

@@ -22,6 +22,7 @@
  *		\brief      Page to administer data tables
  */
 
+// Load Dolibarr environment
 require '../../main.inc.php';
 require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
 require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
@@ -885,9 +886,11 @@ function fieldListAccountingCategories($fieldlist, $obj = '', $tabname = '', $co
 			$fieldname = 'country';
 			if ($context == 'add') {
 				$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 {
-				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>';
 		} elseif ($fieldlist[$field] == 'country_id') {

+ 1 - 0
htdocs/accountancy/admin/closure.php

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

+ 1 - 0
htdocs/accountancy/admin/fiscalyear.php

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

+ 1 - 0
htdocs/accountancy/admin/fiscalyear_card.php

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

+ 1 - 0
htdocs/accountancy/admin/fiscalyear_info.php

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

+ 1 - 0
htdocs/accountancy/admin/index.php

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

+ 1 - 0
htdocs/accountancy/admin/journals_list.php

@@ -26,6 +26,7 @@ if (!defined('CSRFCHECK_WITH_TOKEN')) {
 	define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET
 }
 
+// Load Dolibarr environment
 require '../../main.inc.php';
 require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
 require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';

+ 1 - 0
htdocs/accountancy/admin/subaccount.php

@@ -23,6 +23,7 @@
  * \brief		List of accounting sub-account (auxiliary accounts)
  */
 
+// Load Dolibarr environment
 require '../../main.inc.php';
 require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
 require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';

+ 1 - 0
htdocs/accountancy/bookkeeping/balance.php

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

+ 1 - 0
htdocs/accountancy/bookkeeping/card.php

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

+ 1 - 0
htdocs/accountancy/bookkeeping/list.php

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

+ 1 - 0
htdocs/accountancy/bookkeeping/listbyaccount.php

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

+ 4 - 3
htdocs/accountancy/class/accountancycategory.class.php

@@ -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			$active				1= active, 0=not active
 	 * @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;
 
@@ -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 .= " 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;
 		if ($categorytype >= 0) {
 			$sql .= " AND c.category_type = 1";

+ 1 - 0
htdocs/accountancy/closure/index.php

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

+ 1 - 0
htdocs/accountancy/customer/index.php

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

+ 1 - 0
htdocs/accountancy/expensereport/index.php

@@ -24,6 +24,7 @@
  * \brief		Home expense report ventilation
  */
 
+// Load Dolibarr environment
 require '../../main.inc.php';
 require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
 require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';

+ 1 - 0
htdocs/accountancy/journal/sellsjournal.php

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

+ 2 - 1
htdocs/accountancy/journal/variousjournal.php

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

+ 1 - 0
htdocs/accountancy/supplier/index.php

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

+ 1 - 0
htdocs/adherents/admin/member.php

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

+ 1 - 0
htdocs/adherents/admin/member_emails.php

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

+ 1 - 0
htdocs/adherents/admin/member_extrafields.php

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

+ 1 - 0
htdocs/adherents/admin/member_type_extrafields.php

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

+ 1 - 0
htdocs/adherents/admin/website.php

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

+ 1 - 0
htdocs/adherents/agenda.php

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

+ 2 - 2
htdocs/adherents/canvas/default/tpl/adherentcard_view.tpl.php

@@ -1,6 +1,6 @@
 <?php
 /* Copyright (C) 2010-2012 Regis Houssin  <regis.houssin@inodbox.com>
- * Copyright (C) 2012      Philippe Grand <philippe.grand@atoo-net.com>
+ * Copyright (C) 2012-2022 Philippe Grand <philippe.grand@atoo-net.com>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -124,7 +124,7 @@ if (!empty($this->control->tpl['action_delete'])) {
 if (empty($user->socid)) {
 	echo '<div class="tabsAction">';
 
-	if ($user->rights->adherent->creer) {
+	if ($user->hasRight('adherent', 'creer')) {
 		echo '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$this->control->tpl['id'].'&action=edit&token='.newToken().'&canvas='.$canvas.'">'.$langs->trans('Modify').'</a>';
 	}
 

+ 15 - 15
htdocs/adherents/card.php

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

+ 2 - 2
htdocs/adherents/class/adherent.class.php

@@ -335,8 +335,8 @@ class Adherent extends CommonObject
 		'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),
 		'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' => 'NotePrivate', 'enabled' => 1, 'visible' => 0, 'position' => 160),
+		'note_public' => array('type' => 'text', 'label' => 'NotePublic', 'enabled' => 1, 'visible' => 0, 'position' => 155),
+		'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),
 		'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),

+ 3 - 3
htdocs/adherents/class/api_members.class.php

@@ -2,7 +2,7 @@
 /* Copyright (C) 2016	Xebax Christy	<xebax@wanadoo.fr>
  * Copyright (C) 2017	Regis Houssin	<regis.houssin@inodbox.com>
  * Copyright (C) 2020	Thibault FOUCART<support@ptibogxiv.net>
- * Copyright (C) 2020		Frédéric France		<frederic.france@netlogic.fr>
+ * Copyright (C) 2020	Frédéric France	<frederic.france@netlogic.fr>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -286,7 +286,7 @@ class Members extends DolibarrApi
 	 */
 	public function post($request_data = null)
 	{
-		if (!DolibarrApiAccess::$user->rights->adherent->creer) {
+		if (!DolibarrApiAccess::$user->hasRight('adherent', 'creer')) {
 			throw new RestException(401);
 		}
 		// Check mandatory fields
@@ -311,7 +311,7 @@ class Members extends DolibarrApi
 	 */
 	public function put($id, $request_data = null)
 	{
-		if (!DolibarrApiAccess::$user->rights->adherent->creer) {
+		if (!DolibarrApiAccess::$user->hasRight('adherent', 'creer')) {
 			throw new RestException(401);
 		}
 

+ 1 - 1
htdocs/adherents/class/api_subscriptions.class.php

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

+ 5 - 4
htdocs/adherents/document.php

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

+ 1 - 0
htdocs/adherents/htpasswd.php

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

+ 3 - 2
htdocs/adherents/ldap.php

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

+ 7 - 7
htdocs/adherents/list.php

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

+ 4 - 4
htdocs/adherents/note.php

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

+ 1 - 0
htdocs/adherents/stats/byproperties.php

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

+ 1 - 0
htdocs/adherents/stats/geo.php

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

+ 1 - 0
htdocs/adherents/stats/index.php

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

+ 6 - 5
htdocs/adherents/subscription.php

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

+ 1 - 0
htdocs/adherents/subscription/card.php

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

+ 1 - 0
htdocs/adherents/subscription/info.php

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

+ 1 - 0
htdocs/adherents/subscription/list.php

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

+ 2 - 1
htdocs/adherents/type.php

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

+ 1 - 0
htdocs/adherents/type_ldap.php

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

+ 1 - 0
htdocs/adherents/type_translation.php

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

+ 3 - 2
htdocs/adherents/vcard.php

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

+ 1 - 0
htdocs/admin/accountant.php

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

+ 1 - 0
htdocs/admin/accounting.php

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

+ 1 - 0
htdocs/admin/agenda.php

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

+ 1 - 0
htdocs/admin/agenda_extrafields.php

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

+ 1 - 0
htdocs/admin/agenda_extsites.php

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

+ 1 - 0
htdocs/admin/agenda_other.php

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

+ 1 - 0
htdocs/admin/agenda_reminder.php

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

+ 1 - 0
htdocs/admin/agenda_xcal.php

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

+ 1 - 0
htdocs/admin/bank_extrafields.php

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

+ 1 - 0
htdocs/admin/barcode.php

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

+ 1 - 0
htdocs/admin/bom.php

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

+ 1 - 0
htdocs/admin/bom_extrafields.php

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

+ 1 - 0
htdocs/admin/boxes.php

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

+ 1 - 0
htdocs/admin/chequereceipts.php

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

+ 3 - 2
htdocs/admin/clicktodial.php

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

+ 1 - 0
htdocs/admin/commande.php

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

+ 1 - 0
htdocs/admin/commande_fournisseur_dispatch_extrafields.php

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

+ 1 - 0
htdocs/admin/company.php

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

+ 1 - 0
htdocs/admin/company_socialnetworks.php

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

+ 1 - 0
htdocs/admin/compta.php

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

+ 1 - 0
htdocs/admin/confexped.php

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

+ 1 - 0
htdocs/admin/const.php

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

+ 1 - 0
htdocs/admin/contract.php

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

+ 1 - 0
htdocs/admin/dav.php

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

+ 1 - 0
htdocs/admin/debugbar.php

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

+ 1 - 0
htdocs/admin/defaultvalues.php

@@ -26,6 +26,7 @@
  *       			Mandatory fields are stored into $user->default_values[url]['mandatory']['querystring'|'_noquery_'][paramkey]=paramvalue
  */
 
+// Load Dolibarr environment
 require '../main.inc.php';
 require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
 require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';

+ 1 - 0
htdocs/admin/delais.php

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

+ 1 - 0
htdocs/admin/delivery_extrafields.php

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

+ 1 - 0
htdocs/admin/deliverydet_extrafields.php

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

+ 2 - 1
htdocs/admin/dict.php

@@ -34,6 +34,7 @@
  *		\brief      Page to administer data tables
  */
 
+// Load Dolibarr environment
 require '../main.inc.php';
 require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
 require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
@@ -2086,7 +2087,7 @@ if ($id > 0) {
 							} elseif ($value == 'fk_tva') {
 								foreach ($form->cache_vatrates as $key => $Tab) {
 									if ($form->cache_vatrates[$key]['rowid'] == $valuetoshow) {
-										$valuetoshow = $form->cache_vatrates[$key]['libtva'];
+										$valuetoshow = $form->cache_vatrates[$key]['label'];
 										break;
 									}
 								}

+ 1 - 0
htdocs/admin/ecm_directories_extrafields.php

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

+ 1 - 0
htdocs/admin/ecm_files_extrafields.php

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

+ 1 - 0
htdocs/admin/emailcollector_card.php

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

+ 1 - 0
htdocs/admin/emailcollector_list.php

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

+ 1 - 0
htdocs/admin/eventorganization_confbooth_extrafields.php

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

+ 1 - 0
htdocs/admin/events.php

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

+ 1 - 0
htdocs/admin/expedition.php

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

+ 1 - 0
htdocs/admin/expedition_extrafields.php

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

+ 1 - 0
htdocs/admin/expeditiondet_extrafields.php

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

+ 1 - 0
htdocs/admin/expensereport.php

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

+ 1 - 0
htdocs/admin/expensereport_extrafields.php

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

+ 1 - 0
htdocs/admin/expensereport_ik.php

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

+ 1 - 0
htdocs/admin/expensereport_rules.php

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

+ 1 - 0
htdocs/admin/export.php

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

+ 1 - 0
htdocs/admin/external_rss.php

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

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