diff --git a/.editorconfig b/.editorconfig
index 7df89a90eb3..cdaf5b3af2e 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -22,3 +22,7 @@ indent_style = tab
indent_style = tab
[*.md]
trim_trailing_whitespace = false
+[*.sql]
+indent_style = tab
+trim_trailing_whitespace = true
+indent_size = 4
diff --git a/ChangeLog b/ChangeLog
index dc13087832a..bda30ca8caa 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -29,9 +29,10 @@ For users:
----------
NEW: Compatibility with PHP 8.2
NEW: Module Workstation (used to enhance the module BOM and Manufacturing Order) is now stable
+NEW: Add a CLI tool to regenerate all documents
NEW: Add a confirmation popup when deleting extrafields
NEW: Add type 'icon' type for extrafields
-NEW: Close #20930 Use ajax for state loading after country change
+NEW: #20930 Use ajax for state loading after country change
NEW: #23331 Add support for parent projects (#24856)
NEW: #22531 Expense report - Add two fields into export : Qty & Unit price (excl.) (#26309)
NEW: #22626 date filter thirdparties contracts projects (#22707)
@@ -42,54 +43,51 @@ NEW: Accountancy: Add quick navigation with keyboard shortcut on ledger (#26221)
NEW: Accountancy: FEC/FEC2 format export with attachments (#26192)
NEW: Accountancy: Option to choose length of lettering code
NEW: Accountancy: Chart of accounts ES PCG08-PYME-CAT in catalan language
-NEW: Add a button to create a product or a service from an order or an invoice (#26173)
-NEW: Add a button to re-encrypt data of a dolcrypt extrafield password
-NEW: Add a CLI tool to regenerate all documents
-NEW: Add a goto url from smartphone search page
-NEW: Add all id prof checker on thirdparty for code compta customer and supplier
-NEW: Add a protection on purgeFiles
-NEW: Add chart of accounts PCG08-PYME-CAT for ES in catalan language
-NEW: add constant to check if qty shipped not greater than qty ordered
-NEW: Add context for the movement stock (role toconsume/toproduce) on mrp
-NEW: Add contract link on ticket
-NEW: Add culum Technical ID in list of details lines of an order (#26164)
-NEW: Add custom compute for exports
-NEW: Add custom Text on footer total (#26334)
-NEW: Add different picto for each type of extrafields (date, string, ...)
-NEW: Added of a popup on validation instead of a database fielld to know if the user wants to include subwarehouse
-NEW: Added of the field "include_sub_warehouse" in the table "llx_inventory"
-NEW: Added VAT free & VAT amounts on payment input
-NEW: Add ext payment system ID in the payment page with link to Stripe
-NEW: Add field TechnicalID in list of users
-NEW: Add filter on status of line of a dictionary
-NEW: Add get_substitutionarray_other() on shipping odt (#25080)
-NEW: add IdProfCheck on thirdparty for BE (xxxx.xxx.xxx)
-NEW: Add index on prelevement_demande
-NEW: Add invoice subtype in customer invoice (#26543) and template invoice (SQL part) (#26535)
-NEW: Add label to price level when changing price (#26240)
-NEW: Add modifications of template invoices into agenda
-NEW: Add more company information (ProfId7 to 10) (#25266)
-NEW: Add more information to holiday mailings (#25461)
-NEW: Add more param on fetch() to prepare perf optimization
-NEW: Add more tables activated by module activation only
-NEW: Add new field into $fields array + Creation of the function getChildWarehouse()
-NEW: Add option for cancel consumed and produced lines (delete lines and rollback stocks) when delete or cancel an manufacturing order (#26254)
-NEW: Add option in PDF for purchase order and quotation to hide prices
-NEW: Add option TAKEPOS_HIDE_PRODUCT_PRICES to hide prices in TakePOS
-NEW: add order supplier submit notif
-NEW: add parent product column on list
-NEW: Add picto in product/service list in object lines (#25511)
-NEW: Add possibility to choose separator #21426
-NEW: Add preselected update keys attribute to import class and select it by default if filled
-NEW: Add recurring behaviour
-NEW: add recursive deletion option for child m os (#26102)
-NEW: Add refactoring user permission (#26162)
-NEW: add sorting of product price list by customer (#26483)
-NEW: Add tab Events/Agenda on recurring invoices
-NEW: Add the formEditObjectLine hook on commande card and invoice card
-NEW: Add the picto phone of thirdparty on the kanban view of projects
-NEW: Add the status of partnership to select partnership for emailing
-NEW: add Ticket tab on contract
+NEW: added a button to create a product or a service from an order or an invoice (#26173)
+NEW: added a button to re-encrypt data of a dolcrypt extrafield password
+NEW: added a goto url from smartphone search page
+NEW: added all id prof checker on thirdparty for code compta customer and supplier
+NEW: added protection on purgeFiles
+NEW: added a constant to check if qty shipped not greater than qty ordered
+NEW: added context for the movement stock (role toconsume/toproduce) on mrp
+NEW: added contract link on ticket
+NEW: added column 'Technical ID' in list of details lines of an order (#26164)
+NEW: added custom compute for exports
+NEW: added custom text on footer total (#26334)
+NEW: added different picto for each type of extrafields (date, string, ...)
+NEW: added a popup on validation instead of a database field to know if the user wants to include subwarehouse
+NEW: added the field "include_sub_warehouse" in the table "llx_inventory"
+NEW: added VAT free & VAT amounts on payment input
+NEW: added ext payment system ID in the payment page with link to Stripe
+NEW: added field Technical ID in list of users
+NEW: added filter on status of line of a dictionary
+NEW: added get_substitutionarray_other() on shipping odt (#25080)
+NEW: added IdProfCheck on thirdparty for BE (xxxx.xxx.xxx)
+NEW: added index on prelevement_demande
+NEW: added invoice subtype in customer invoice (#26543) and template invoice (SQL part) (#26535)
+NEW: added a label to price level when changing price (#26240)
+NEW: added modifications of template invoices into agenda
+NEW: added more company information (ProfId7 to 10) (#25266)
+NEW: added more information to holiday mailings (#25461)
+NEW: added more param on fetch() to prepare perf optimization
+NEW: added more tables activated by module activation only
+NEW: added new field into $fields array + Creation of the function getChildWarehouse()
+NEW: added option for cancel consumed and produced lines (delete lines and rollback stocks) when delete or cancel an manufacturing order (#26254)
+NEW: added option in PDF for purchase order and quotation to hide prices
+NEW: added order supplier submit notif
+NEW: added parent product column on list
+NEW: added picto in product/service list in object lines (#25511)
+NEW: added possibility to choose separator #21426
+NEW: added preselected update keys attribute to import class and select it by default if filled
+NEW: added recurring behaviour
+NEW: added recursive deletion option for child MOs (#26102)
+NEW: added refactoring user permission (#26162)
+NEW: added sorting of product price list by customer (#26483)
+NEW: added tab Events/Agenda on recurring invoices
+NEW: added the formEditObjectLine hook on commande card and invoice card
+NEW: added the picto phone of thirdparty on the kanban view of projects
+NEW: added the status of partnership to select partnership for emailing
+NEW: added Ticket tab on contract
NEW: Agenda: agenda per user use quarter hour split instead of half hour split
NEW: Allow generation of delivery note through REST-API (#26226)
NEW: Allow sync of currency rates with currency layer by default.
@@ -108,6 +106,7 @@ NEW: clone skill object (#26526)
NEW: column in table prelevement_lignes for fk_user (#26196)
NEW: CONF allow modify ticket classification even if closed
NEW: conf to display date entry stock exped and sort in date order (#22625)
+NEW: Contract: Merge the "Create ..." buttons on contract into one.
NEW: create a product from a free line in a document (#22324)
NEW: customize position in complete_head_from_modules (#26406)
NEW: Date d'entree en stock sur les exped au moment de la création -> Stock date on exped at time of creation
@@ -118,19 +117,20 @@ NEW: Donations: Generic doc template for donations (#26338)
NEW: drop down for action button show a simple button if only 1 action
NEW: Enhance github_commits_perversion to get more stats on git commits
NEW: Enhance IPN to support payment_intent.succeeded for both card/ban
-NEW: Exports: add product barcode on stock exports
+NEW: Exports: added product barcode on stock exports
NEW: extrafields password accepts 'dolcrypt' algorithm (reversible algo)
NEW: Factorize a lot of code for numbering modules
NEW: filter on from/to period rather than month/year (#26378)
-NEW: FontAwesome - Add possibility to select another version
-NEW: Can generate SEPA files for salaries (#26541)
+NEW: FontAwesome - added possibility to select another version
NEW: Get list evaluation with skills details in user fiche (#26510)
NEW: hidden conf to disable use of dns_get_record (which can become unresponsive) (#26339)
+NEW: HR: PDF Generation for each Human Resource Evaluations
NEW: improved resource data structure
-NEW: Intervention: close notification for interventions
+NEW: Interventions: close notification for interventions
NEW: Inventory: include sub warehouse in inventory
NEW: Inventory: inventory without virtual products (kits)
NEW: Invoices: subtypes for customers and vendors (#26233)
+NEW: Invoices: start and end date for due date filter on invoice list
NEW: Invoice time from task, make task note better display in invoice line
NEW: lazy load to substitute project variables (#26451)
NEW: LDAP: Active Directory UserAccountControl (#25507)
@@ -140,7 +140,6 @@ NEW: Manage rate indirect. (#26449)
NEW: Manufacturing Order: add edit line on MO (#26122)
NEW: memorize model name for PDF hooks
NEW: Menu editor is responsive
-NEW: Merge the "Create ..." buttons on contract into one.
NEW: ModuleBuilder: Can modify the picto into ModuleBuilder
NEW: ModuleBuilder: Form for add object's property on ModuleBuilder
NEW: More accurate tooltip on what admin permissions are
@@ -151,7 +150,7 @@ NEW: no need to create invoice supplier object on supplier card for standalone c
NEW: Open-Surveys: Add a public page to list all open surveys
NEW: Option to show label, ref+label or only ref of product in TakePOS
NEW: payment full amount detail tooltip
-NEW: Payment: Can edit both the Test and Live stripe customer account on payment
+NEW: Payments: Can edit both the Test and Live stripe customer account on payment
NEW: possibility to deselect line when create a recurring invoice + missing to use fk_parent_line
NEW: Projects: List - use select2 multiselect for status
NEW: Projects: massactions to delete projects
@@ -162,11 +161,11 @@ NEW: Retrieve VAT details from the Greek Ministry of Finance GSIS SOAP web servi
NEW: Right for stats orders (#24607)
NEW: rights and check access to create portal accounts
NEW: Row in list higher height (#26177)
+NEW: Salaries: Can generate SEPA files for salaries (#26541)
NEW: Save date of RUM creation when creating a Stripe SEPA mandate
-NEW: Shipment: can include service (for information and invoicing) (#26407)
+NEW: Shipments: can include service (for information and invoicing) (#26407)
NEW: Show id of module on the tooltip module help page
NEW: show VAT free amount on payment input close #26208 (#26209)
-NEW: start and end date for due date filter on invoice list
NEW: Sub total in list (#26165)
NEW: Support html content for combo list of email recipient
NEW: TakePOS: add constant to check qty asked is available (#24820)
@@ -174,6 +173,7 @@ NEW: TakePOS: add constant to choose contact instead of customer (#24807)
NEW: TakePOS: amount label with or without tax in free product (#24829)
NEW: TakePOS: compatibility with lots and serials (#26426)
NEW: TakePOS: use default customer, category and product when enable TakePOS (#25031)
+NEW: TakePOS: added option TAKEPOS_HIDE_PRODUCT_PRICES to hide prices in TakePOS
NEW: Tickets: add and list external contributors on ticket public interface
NEW: Third-Parties: add total line to third-parties list (#26148)
NEW: Tooltips are using ajax by default
@@ -187,12 +187,7 @@ NEW: use account address in sepa mandate (#23642)
NEW: VAT rate - Add entity
NEW: Website: Support of js into the Dolibarr server preview
NEW: When an user unset the batch management of products, transformation of each batch stock movement in global stock movement
-NEW: PDF Generation for each Human Resource Evaluations.
-SEC: #25512 applicative anti bruteforce - security on too many login attempts (#25520)
-SEC: Add action confirm_... as sensitive to need a CSRF token
-SEC: Disable not used PHP streams
-SEC: Add option MAIN_RESTRICTHTML_ONLY_VALID_HTML_TIDY
For developers or integrators:
@@ -201,6 +196,12 @@ For developers or integrators:
QUAL Reduce very seriously the technical debt (using PHPStan, Psalm and Rector)
NEW Tool in dev/tools/rector to autofix code using style coding practice rules
+SECURITY
+SEC: #25512 applicative anti bruteforce - security on too many login attempts (#25520)
+SEC: added action confirm_... as sensitive to need a CSRF token
+SEC: Disable not used PHP streams
+SEC: added option MAIN_RESTRICTHTML_ONLY_VALID_HTML_TIDY
+
PERFORMANCE
PERF: Removed a useless fetch_thirdparty
PERF: Perf avoid 2 useless fetch into the triggers of agenda.
@@ -253,7 +254,7 @@ NEW: add a $notrigger param to Product::updatePrice() method (#26404)
NEW: add a rule to fix empty($conf->global->...) into !getDolGlobal...
NEW: add column extraparams on societe_rib
NEW: add phpunit for REST API of contacts
-NEW: add barcode function to check if EAN13 is valid
+NEW: add barcode function to check if EAN13 is valid
WARNING:
@@ -270,7 +271,7 @@ The following changes may create regressions for some external modules, but were
* The property ->user_creation to store ID of user of creation has been renamed into ->user_creation_id.
* The property ->user_modification to store ID of user of modification has been renamed into ->user_modification_id.
* The private array ->status_short, ->statuts and ->status_long are now array ->labelStatusShort and ->labelStatus everywhere.
-* The duplicate property ->user_creat, ->date_creat, ->date_valid have been removed (use instead user_creation, date_creation, date_validation).
+* The duplicate property ->user_creat, ->date_creat, ->date_valid have been removed (use instead user_creation, date_creation, date_validation).
* The method get_substitutionarray_shipment_lines() has been removed. Use the generic get_substitutionarray_lines() instead.
* The method ProductcustomerPrice->fetch_all_log() has been renamed into camel case ->fetchAllLog()
* It was possible to use a variable $soc or $right inside a PHP code condition of some extrafields properties, this is no more true (this 2 variables are no more global variables).
@@ -488,7 +489,7 @@ NEW: Accountancy - Quadratus export with attachments in accountancy export
NEW: Accountancy - Can filter on a custom group of accounts. Perf or ledger list.
NEW: Accountancy - Can select the export format during export of journals
NEW: Accountancy - sort of column of custom group of account
-NEW: Can upload a file with drag and drop on purchase invoice, vats, salaries and social contributions
+NEW: Can upload a file with drag and drop on purchase invoice, vats, salaries and social contributions
NEW: Authentication: #22740 add OpenID Connect impl
NEW: Authentication: add experimental support for Google OAuth2 connection
NEW: Authentication: can now edit service name for OAuth token
@@ -676,14 +677,14 @@ WARNING:
Following changes may create regressions for some external modules, but were necessary to make Dolibarr better:
* Minimal PHP version is now PHP 7.1 instead of PHP 7.0
-* Sensitive data like keys in setup pages, that need encryption (for example the API keys of users, the CRON security key, the keys into the Stripe module, or
+* Sensitive data like keys in setup pages, that need encryption (for example the API keys of users, the CRON security key, the keys into the Stripe module, or
external modules setup pages that store sensitive keys or password), are using the $dolibarr_main_instance_unique_id as part of the key for encryption. So,
if you restore or duplicate the data from another instance dump, you must also
-update this parameter in the conf.php file to allow decryption in the new instance, or
+update this parameter in the conf.php file to allow decryption in the new instance, or
better, you must reenter the sensitive data into the setup pages of the new instance to resave them correctly.
-Note that to find all the parameters that are encrypted into the setup database, you can do a "SELECT * FROM llx_const WHERE value LIKE '%dolcrypt%';"
+Note that to find all the parameters that are encrypted into the setup database, you can do a "SELECT * FROM llx_const WHERE value LIKE '%dolcrypt%';"
* The deprecated method "escapeunderscore()" of database handlers has been removed. You must use "escapeforlike()" instead.
-* The method "nb_expedition()" has been renamed into "countNbOfShipments()"
+* The method "nb_expedition()" has been renamed into "countNbOfShipments()"
* Revert default type of hooks. Default is now 'addreplace' hooks (and exception become 'output' hooks, that become deprecated).
* Deprecated property libelle removed from entrepot class.
* The type 'text' in ->fields property does not accept html content anymore. Use the type 'html' for that.
@@ -1085,7 +1086,7 @@ WARNING:
Following changes may create regressions for some external modules, but were necessary to make Dolibarr better:
* Minimal PHP version is now PHP 7.0 instead of PHP 5.6
* Core has introduced a Universal Filter Syntax for search criteria. Example: ((((field1:=:value1) OR (field2:in:1,2,3)) AND ...). In rare case, some filters
- could be provided by URL parameters. For such cases (societe/ajax/company.php), use of Universal Filter Syntax become mandatory.
+ could be provided by URL parameters. For such cases (societe/ajax/company.php), use of Universal Filter Syntax become mandatory.
* The signature of method getNomUrl() of class ProductFournisseur has been modified to match the signature of method Product->getNomUrl()
* Trigger ORDER_SUPPLIER_DISPATCH is removed, use ORDER_SUPPLIER_RECEIVE and/or LINEORDER_SUPPLIER_DISPATCH instead.
* All functions fetch_all() have been set to deprecated for naming consistency, use fetchAll() instead.
@@ -1163,7 +1164,7 @@ FIX: #23019 Impossible to add task times to an existing draft invoice
FIX: #23072
FIX: #23075
FIX: #23087
-FIX: #23115
+FIX: #23115
FIX: #23116
FIX: #23117
FIX: #23281
@@ -7550,7 +7551,7 @@ FIX: #4583 Incorrect call of Categories::containing throws a DoliDB error
FIX: #4649 Wrong parameters order
FIX: #4768
FIX: #4785
-FIX: Add a test to show bugged module with a bad declaration of dictionaries to avoid to see clean module to be breaked.
+FIX: Add a test to show bugged module with a bad declaration of dictionaries to avoid clean modules to be broken.
FIX: add Croatia into list of country in EEC
FIX: add missing global def for ttc column
FIX: ajax error with multicompany module
diff --git a/README.md b/README.md
index 1d7ea4b321c..481dee5890c 100644
--- a/README.md
+++ b/README.md
@@ -33,7 +33,7 @@ If you have low technical skills and you're looking to install Dolibarr ERP/CRM
- [DoliWamp for Windows](https://wiki.dolibarr.org/index.php/Dolibarr_for_Windows_(DoliWamp))
- [DoliDeb for Debian](https://wiki.dolibarr.org/index.php/Dolibarr_for_Ubuntu_or_Debian)
-- DoliRpm for Redhat, Fedora, OpenSuse, Mandriva or Mageia
+- DoliRpm for Red Hat, Fedora, OpenSuse, Mandriva or Mageia
Releases can be downloaded from [official website](https://www.dolibarr.org/).
@@ -45,19 +45,19 @@ On GNU/Linux, first check if your distribution has already packaged Dolibarr.
#### Generic install steps
-- Check that your installed PHP version is supported [see PHP support](https://wiki.dolibarr.org/index.php/Releases).
+- Verify that your installed PHP version is supported [see PHP support](https://wiki.dolibarr.org/index.php/Releases).
-- Uncompress the downloaded .zip archive to copy the "dolibarr/htdocs" directory and all its files inside your web server root or get the files directly from GitHub (recommended if you know git as it makes it easier if you want to upgrade later):
+- Uncompress the downloaded .zip archive to copy the `dolibarr/htdocs` directory and all its files inside your web server root or get the files directly from GitHub (recommended if you know git as it makes it easier if you want to upgrade later):
`git clone https://github.com/dolibarr/dolibarr -b x.y` (where x.y is the main version like 3.6, 9.0, ...)
-- Set up your web server to use "*dolibarr/htdocs*" as root if your web server does not have an already defined directory to point to.
+- Set up your web server to use `dolibarr/htdocs` as root if your web server does not already define a directory to point to.
- Create an empty `htdocs/conf/conf.php` file and set *write* permissions for your web server user (*write* permission will be removed once install is finished)
- From your browser, go to the dolibarr "install/" page
- The URL will depends on how your web setup was set up to point to your dolibarr installation. It may look like:
+ The URL will depend on how your web configuration directs to your dolibarr installation. It may look like:
`http://localhost/dolibarr/htdocs/install/`
@@ -71,18 +71,20 @@ On GNU/Linux, first check if your distribution has already packaged Dolibarr.
- Follow the installer instructions
-### SaaS/Cloud setup
+### SaaS/Cloud Setup
-If you don't have time to install it yourself, you can try some commercial 'ready to use' Cloud offers (See [https://saas.dolibarr.org](https://saas.dolibarr.org)). However, this third solution is not free.
+If you lack the time to install it yourself, consider exploring commercial 'ready-to-use' Cloud offerings (refer to https://saas.dolibarr.org). Keep in mind that this third option comes with associated costs.
## UPGRADING
Dolibarr supports upgrading, usually without the need for any (commercial) support (depending on if you use any commercial extensions). It supports upgrading all the way from any version after 2.8 without breakage. This is unique in the ERP ecosystem and a benefit our users highly appreciate!
+Follow these step-by-step instructions to seamlessly upgrade Dolibarr to the latest version:
+
- At first make a backup of your Dolibarr files & then [see](https://wiki.dolibarr.org/index.php/Installation_-_Upgrade#Upgrade_Dolibarr)
-- Check that your installed PHP version is supported by the new version [see PHP support](https://wiki.dolibarr.org/index.php/Releases).
-- Overwrite all old files from the 'dolibarr' directory with files provided into the new version's package.
-- At first next access, Dolibarr will redirect you to the "install/" page to follow the upgrade process.
+- Verify that your installed PHP version is supported by the new version [see PHP support](https://wiki.dolibarr.org/index.php/Releases).
+- Overwrite all old files from the 'dolibarr' directory with files provided in the new version's package.
+- At your next access, Dolibarr will redirect you to the "install/" page to follow the upgrade process.
If an `install.lock` file exists to lock any other upgrade process, the application will ask you to remove the file manually (you should find the `install.lock` file in the directory used to store generated and uploaded documents, in most cases, it is the directory called "*documents*").
## WHAT'S NEW
@@ -114,7 +116,7 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog)
- Customer Orders management
- Contracts/Subscription management
- Interventions management
-- Ticket System (+ Knowledge management)
+- Ticket System (+ Knowledge management)
- Partnership management
- Shipping management
- Customer Invoices/Credit notes and payment management
@@ -123,10 +125,10 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog)
Supplier/Purchase Management
- Suppliers/Vendors + Contacts
-- Supplier (price) requests
+- Supplier (pricing) requests
- Purchase Orders management
- Delivery/Reception
-- Supplier Invoices/credit notes and payment management
+- Supplier Invoices/Credit notes and payment management
- INCOTERMS
Finance/Accounting
@@ -142,7 +144,7 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog)
Collaboration
-- Shared calendar/agenda (with ical and vcal import/export for third-party tools integration)
+- Shared calendar/agenda (with `ical` and `vcal` import/export for third-party tools integration)
- Projects & Tasks management
- Event organization
- Ticket System
@@ -150,7 +152,7 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog)
HR - Human Resources Management
-- Employee's leaves management
+- Employee leave management
- Expense reports
- Recruitment management
- Employee/staff management
@@ -178,7 +180,7 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog)
- Multi-Language Support (Localization in most major languages)
- Multi-users and groups with finely-grained rights
- Multi-Currency
-- Multi-Company (by adding of an external module)
+- Multi-Company (by adding an external module)
- Very user-friendly and easy to use
- Customizable dashboards
- Highly customizable: enable only the modules you need, add user personalized fields, choose your skin, several menu managers (can be used by internal users as a back-office with a particular menu, or by external users as a front-office with another one)
@@ -192,7 +194,7 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog)
- Argentina invoice numbering using A,B,C...
- ZATCA e-invoicing QR-Code
- Compatible with [European directives](https://europa.eu/legislation_summaries/taxation/l31057_en.htm) (2006/112/CE ... 2010/45/UE)
- - Compatible with data privacy rules (Europe GDPR, ...)
+ - Compatible with data privacy rules (Europe's GDPR, ...)
- ...
- Flexible PDF & ODT generation for invoices, proposals, orders...
- ...
@@ -215,7 +217,7 @@ These are features that Dolibarr does **not** yet fully support:
- Tasks dependencies in projects
- Payroll module
-- No native embedded Webmail, but you can send emails to contacts in Dolibarr with e.g. offers, invoices, etc.
+- Native embedded Webmail, but you can send email to contacts in Dolibarr with e.g. offers, invoices, etc.
- Dolibarr can't do coffee (yet)
## DOCUMENTATION
@@ -225,7 +227,7 @@ Administrator, user, developer and translator's documentation are available alon
## CONTRIBUTING
This project exists thanks to all the people who contribute.
-Please read the instructions on how to contribute (report a bug/error, a feature request, send code ...) [[Contribute](https://github.com/Dolibarr/dolibarr/blob/develop/.github/CONTRIBUTING.md)]
+Please read the instructions on how to contribute (report a bug/error, a feature request, send code, ...) [[Contributing](https://github.com/Dolibarr/dolibarr/blob/develop/.github/CONTRIBUTING.md)]
A View on Contributors:
diff --git a/dev/tools/rector/README.md b/dev/tools/rector/README.md
index c28f7a8d6c5..6ad928af5eb 100644
--- a/dev/tools/rector/README.md
+++ b/dev/tools/rector/README.md
@@ -18,11 +18,13 @@ composer install
##### To make changes (Add --dry-run for test mode only)
```shell
+cd dev/tools/rector
./vendor/bin/rector process --dry-run
```
##### To make changes on a given directory
```shell
+cd dev/tools/rector
./vendor/bin/rector process [--dry-run] [--clear-cache] ../../../htdocs/core/
```
diff --git a/dev/tools/rector/rector.php b/dev/tools/rector/rector.php
index 5b07d1da6cc..dceb00bfb4b 100644
--- a/dev/tools/rector/rector.php
+++ b/dev/tools/rector/rector.php
@@ -49,12 +49,13 @@ return static function (RectorConfig $rectorConfig): void {
$rectorConfig->rule(Rector\CodeQuality\Rector\FuncCall\FloatvalToTypeCastRector::class);
$rectorConfig->rule(Rector\CodeQuality\Rector\FuncCall\BoolvalToTypeCastRector::class);
$rectorConfig->rule(Rector\CodeQuality\Rector\NotEqual\CommonNotEqualRector::class);
- //$rectorconfig->rule(Rector\CodeQuality\Rector\If_\CompleteMissingIfElseBracketRector::class);
+ //Not yet ready: $rectorconfig->rule(Rector\CodeQuality\Rector\If_\CompleteMissingIfElseBracketRector::class);
$rectorConfig->rule(Rector\CodeQuality\Rector\For_\ForRepeatedCountToOwnVariableRector::class);
+ $rectorConfig->rule(Dolibarr\Rector\Renaming\EmptyGlobalToFunction::class);
+ $rectorConfig->rule(Dolibarr\Rector\Renaming\EmptyUserRightsToFunction::class);
$rectorConfig->rule(Dolibarr\Rector\Renaming\GlobalToFunction::class);
$rectorConfig->rule(Dolibarr\Rector\Renaming\UserRightsToFunction::class);
- $rectorConfig->rule(Dolibarr\Rector\Renaming\EmptyGlobalToFunction::class);
// Add all predefined rules to migrate to up to php 71.
// Warning this break tab spacing of arrays on several lines
diff --git a/dev/tools/rector/src/Renaming/EmptyGlobalToFunction.php b/dev/tools/rector/src/Renaming/EmptyGlobalToFunction.php
index 0bd1575adcd..36260563908 100644
--- a/dev/tools/rector/src/Renaming/EmptyGlobalToFunction.php
+++ b/dev/tools/rector/src/Renaming/EmptyGlobalToFunction.php
@@ -52,10 +52,10 @@ class EmptyGlobalToFunction extends AbstractRector
public function getRuleDefinition(): RuleDefinition
{
return new RuleDefinition(
- 'Change $conf->global to getDolGlobal',
+ 'Change empty($conf->global->...) to getDolGlobal',
[new CodeSample(
- '$conf->global->CONSTANT',
- 'getDolGlobalInt(\'CONSTANT\')'
+ 'empty($conf->global->CONSTANT)',
+ '!getDolGlobalInt(\'CONSTANT\')'
)]
);
}
@@ -82,10 +82,10 @@ class EmptyGlobalToFunction extends AbstractRector
if (!$node->expr instanceof Node\Expr\Empty_) {
return null;
}
- // node is !empty(...) so we set node to ...
- $newnode = $node->expr->expr;
+ // node is !empty(...) so we set newnode to ...
+ $newnode = $node->expr->expr; // newnode is conf->global->...
- $tmpglobal = $newnode->var;
+ $tmpglobal = $newnode->var; // tmpglobal is global->...
if (is_null($tmpglobal)) {
return null;
}
@@ -93,7 +93,7 @@ class EmptyGlobalToFunction extends AbstractRector
return null;
}
- $tmpconf = $tmpglobal->var;
+ $tmpconf = $tmpglobal->var; // tmpconf is conf->
if (!$this->isName($tmpconf, 'conf')) {
return null;
}
@@ -113,10 +113,10 @@ class EmptyGlobalToFunction extends AbstractRector
if ($node instanceof Node\Expr\Empty_) {
- // node is empty(...) so we set node to ...
- $newnode = $node->expr;
+ // node is empty(...) so we set newnode to ...
+ $newnode = $node->expr; // newnode is conf->global->...
- $tmpglobal = $newnode->var;
+ $tmpglobal = $newnode->var; // tmpglobal is global->...
if (is_null($tmpglobal)) {
return null;
}
@@ -124,7 +124,7 @@ class EmptyGlobalToFunction extends AbstractRector
return null;
}
- $tmpconf = $tmpglobal->var;
+ $tmpconf = $tmpglobal->var; // tmpconf is conf->
if (!$this->isName($tmpconf, 'conf')) {
return null;
}
diff --git a/dev/tools/rector/src/Renaming/EmptyUserRightsToFunction.php b/dev/tools/rector/src/Renaming/EmptyUserRightsToFunction.php
new file mode 100644
index 00000000000..a1b4f2f56de
--- /dev/null
+++ b/dev/tools/rector/src/Renaming/EmptyUserRightsToFunction.php
@@ -0,0 +1,283 @@
+binaryOpManipulator = $binaryOpManipulator;
+ }
+
+ /**
+ * getRuleDefinition
+ *
+ * @return RuleDefinition
+ * @throws PoorDocumentationException
+ */
+ public function getRuleDefinition(): RuleDefinition
+ {
+ return new RuleDefinition(
+ 'Change empty(\$user->rights->module->permission) to !\$user->hasRight(\'module\', \'permission\')',
+ [new CodeSample(
+ 'empty($user->rights->module->permission)',
+ '!$user->hasRight(\'module\', \'permission\')'
+ )]
+ );
+ }
+
+ /**
+ * Return a node type from https://github.com/rectorphp/php-parser-nodes-docs/
+ *
+ * @return string[]
+ */
+ public function getNodeTypes(): array
+ {
+ return [Node\Expr\BooleanNot::class, Node\Expr\Empty_::class];
+ }
+
+ /**
+ * refactor
+ *
+ * @param Node $node A node
+ * @return FuncCall|BooleanNot
+ */
+ public function refactor(Node $node)
+ {
+ if ($node instanceof Node\Expr\BooleanNot) {
+ if (!$node->expr instanceof Node\Expr\Empty_) {
+ return null;
+ }
+ // node is !empty(...) so we set newnode to ...
+ $newnode = $node->expr->expr;
+
+ $tmpperm = $newnode->var; //name of tmpperm is modulex
+ if (is_null($tmpperm)) {
+ return null;
+ }
+
+ $tmprights = $tmpperm->var; // name of tmprights is 'rights'
+ if (is_null($tmprights)) {
+ return null;
+ }
+ if (!$this->isName($tmprights, 'rights')) {
+ $tmprights2 = $tmprights->var; // name of tmprights is 'rights'
+ if (is_null($tmprights2)) {
+ return null;
+ }
+ if (!$this->isName($tmprights2, 'rights')) {
+ return null;
+ }
+ $tmprights = $tmprights2;
+ }
+
+ $tmpuser = $tmprights->var; // name of tmpuser is 'user'
+ if (!$this->isName($tmpuser, 'user')) {
+ return null;
+ }
+
+ $data = $this->getRights($newnode);
+ if (!isset($data)) {
+ return;
+ }
+
+ $args = [new Arg($data['module']), new Arg($data['perm1'])];
+ if (!empty($data['perm2'])) {
+ $args[] = new Arg($data['perm2']);
+ }
+ $method = $this->nodeFactory->createMethodCall($data['user'], 'hasRight', $args);
+
+ return $method;
+ }
+
+ if ($node instanceof Node\Expr\Empty_) {
+ // node is empty(...) so we set newnode to ...
+ $newnode = $node->expr; // name of node is perm
+
+ $tmpperm = $newnode->var; //name of tmpperm is modulex
+ if (is_null($tmpperm)) {
+ return null;
+ }
+
+ $tmprights = $tmpperm->var; // name of tmprights is 'rights'
+ if (is_null($tmprights)) {
+ return null;
+ }
+ if (!$this->isName($tmprights, 'rights')) {
+ $tmprights2 = $tmprights->var; // name of tmprights is 'rights'
+ if (is_null($tmprights2)) {
+ return null;
+ }
+ if (!$this->isName($tmprights2, 'rights')) {
+ return null;
+ }
+ $tmprights = $tmprights2;
+ }
+
+ $tmpuser = $tmprights->var; // name of tmpuser is 'user'
+ if (!$this->isName($tmpuser, 'user')) {
+ return null;
+ }
+
+ $data = $this->getRights($newnode);
+ if (!isset($data)) {
+ return;
+ }
+
+ $args = [new Arg($data['module']), new Arg($data['perm1'])];
+ if (!empty($data['perm2'])) {
+ $args[] = new Arg($data['perm2']);
+ }
+ $method = $this->nodeFactory->createMethodCall($data['user'], 'hasRight', $args);
+
+ return new Node\Expr\BooleanNot($method);
+ }
+
+ return null;
+ }
+
+ /**
+ * Get nodes with check empty
+ *
+ * @param BooleanAnd $booleanAnd A BooleandAnd
+ * @return TwoNodeMatch|null
+ */
+ private function resolveTwoNodeMatch(BooleanAnd $booleanAnd): ?TwoNodeMatch
+ {
+ return $this->binaryOpManipulator->matchFirstAndSecondConditionNode(
+ $booleanAnd,
+ // $conf->global == $value
+ function (Node $node): bool {
+ if (!$node instanceof Equal) {
+ return \false;
+ }
+ return $this->isGlobalVar($node->left);
+ },
+ // !empty(...) || isset(...)
+ function (Node $node): bool {
+ if ($node instanceof BooleanNot && $node->expr instanceof Empty_) {
+ return $this->isGlobalVar($node->expr->expr);
+ }
+ if (!$node instanceof Isset_) {
+ return $this->isGlobalVar($node);
+ }
+ return \true;
+ }
+ );
+ }
+
+ /**
+ * Check if node is a global access with format conf->global->XXX
+ *
+ * @param Node $node A node
+ * @return bool Return true if noe is conf->global->XXX
+ */
+ private function isGlobalVar($node)
+ {
+ if (!$node instanceof PropertyFetch) {
+ return false;
+ }
+ if (!$this->isName($node->var, 'global')) {
+ return false;
+ }
+ $global = $node->var;
+ if (!$global instanceof PropertyFetch) {
+ return false;
+ }
+ if (!$this->isName($global->var, 'conf')) {
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ * @param Node $node Node to be parsed
+ * @return Node|void Return the name of the constant
+ */
+ private function getConstName($node)
+ {
+ if ($node instanceof PropertyFetch && $node->name instanceof Node\Expr) {
+ return $node->name;
+ }
+ $name = $this->getName($node);
+ if (empty($name)) {
+ return;
+ }
+ return new String_($name);
+ }
+
+ /**
+ * @param \PhpParser\Node\Expr\PropertyFetch $node node
+ * @return array|null
+ */
+ private function getRights(Node\Expr\PropertyFetch $node)
+ {
+ $perm2 = '';
+ if (!$node->var instanceof Node\Expr\PropertyFetch) {
+ return null;
+ }
+ // Add a test to avoid rector error on html.formsetup.class.php
+ if (!$node->name instanceof Node\Expr\Variable && is_null($this->getName($node))) {
+ //var_dump($node);
+ return null;
+ //exit;
+ }
+ $perm1 = $node->name instanceof Node\Expr\Variable ? $node->name : new String_($this->getName($node));
+ $moduleNode = $node->var;
+ if (!$moduleNode instanceof Node\Expr\PropertyFetch) {
+ return null;
+ }
+ if (!$moduleNode->var instanceof Node\Expr\PropertyFetch) {
+ return null;
+ }
+ if (!$this->isName($moduleNode->var, 'rights')) {
+ $perm2 = $perm1;
+ $perm1 = $moduleNode->name instanceof Node\Expr\Variable ? $moduleNode->name : new String_($this->getName($moduleNode));
+ $moduleNode = $moduleNode->var;
+ }
+ $module = $moduleNode->name instanceof Node\Expr\Variable ? $moduleNode->name : new String_($this->getName($moduleNode));
+ $rights = $moduleNode->var;
+ if (!$this->isName($rights, 'rights') || !isset($perm1) || !isset($module)) {
+ return null;
+ }
+ if (!$rights->var instanceof Node\Expr\Variable) {
+ return null;
+ }
+ $user = $rights->var;
+ return compact('user', 'module', 'perm1', 'perm2');
+ }
+}
diff --git a/dev/tools/rector/src/Renaming/GlobalToFunction.php b/dev/tools/rector/src/Renaming/GlobalToFunction.php
index fd1a3d7dd66..302a2ff4a2a 100644
--- a/dev/tools/rector/src/Renaming/GlobalToFunction.php
+++ b/dev/tools/rector/src/Renaming/GlobalToFunction.php
@@ -88,6 +88,7 @@ class GlobalToFunction extends AbstractRector
public function refactor(Node $node)
{
if ($node instanceof Node\Expr\Assign) {
+ // var is left of = and expr is right
if (!isset($node->var)) {
return;
}
diff --git a/dev/tools/rector/src/Renaming/UserRightsToFunction.php b/dev/tools/rector/src/Renaming/UserRightsToFunction.php
index 5a141ddad5b..b655e3b82a8 100644
--- a/dev/tools/rector/src/Renaming/UserRightsToFunction.php
+++ b/dev/tools/rector/src/Renaming/UserRightsToFunction.php
@@ -10,6 +10,10 @@ use Rector\Core\PhpParser\Node\NodeFactory;
use Rector\Core\Rector\AbstractRector;
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
+use PhpParser\Node\Expr\BinaryOp\BooleanAnd;
+use PhpParser\Node\Expr\BinaryOp\Concat;
+use PhpParser\Node\Expr\BinaryOp\Equal;
+
/**
* Class to refactor User rights
@@ -50,6 +54,7 @@ class UserRightsToFunction extends AbstractRector
Node\Expr\Assign::class,
Node\Expr\PropertyFetch::class,
Node\Expr\BooleanNot::class,
+ Node\Expr\BinaryOp\BooleanAnd::class,
Node\Expr\Empty_::class,
Node\Expr\Isset_::class,
Node\Stmt\ClassMethod::class
@@ -74,40 +79,112 @@ class UserRightsToFunction extends AbstractRector
}
}
}
+
if ($node instanceof Node\Expr\Assign) {
- return NodeTraverser::DONT_TRAVERSE_CURRENT_AND_CHILDREN;
+ // var is left of = and expr is right of =
+ if (!isset($node->var)) {
+ return;
+ }
+
+ if (!$node->expr instanceof Node\Expr\PropertyFetch) {
+ return;
+ }
+
+ $data = $this->getRights($node->expr);
+ if (!isset($data)) {
+ return;
+ }
+ $args = [new Arg($data['module']), new Arg($data['perm1'])];
+ if (!empty($data['perm2'])) {
+ $args[] = new Arg($data['perm2']);
+ }
+ $node->expr = $this->nodeFactory->createMethodCall($data['user'], 'hasRight', $args);
+
+ return $node;
}
+
+ if ($node instanceof Node\Expr\BinaryOp\BooleanAnd) {
+ /*$nodes = $this->resolveTwoNodeMatch($node);
+ if (!isset($nodes)) {
+ return;
+ }
+
+ $node = $nodes->getFirstExpr();
+ */
+ $mustprocesstheleft = false;
+ $mustprocesstheright = false;
+
+ if ($node->left instanceof Node\Expr\PropertyFetch) {
+ $data = $this->getRights($node->left);
+ if (isset($data)) {
+ $mustprocesstheleft = true;
+ }
+ }
+ if (empty($mustprocesstheleft) && $node->right instanceof Node\Expr\PropertyFetch) {
+ $data = $this->getRights($node->right);
+ if (isset($data)) {
+ $mustprocesstheright = true;
+ }
+ }
+
+ if (isset($data)) {
+ $args = [new Arg($data['module']), new Arg($data['perm1'])];
+ if (!empty($data['perm2'])) {
+ $args[] = new Arg($data['perm2']);
+ }
+
+ if ($mustprocesstheleft && !empty($data['module'])) {
+ $node->left = $this->nodeFactory->createMethodCall($data['user'], 'hasRight', $args);
+ }
+ if ($mustprocesstheright && !empty($data['module'])) {
+ $node->right = $this->nodeFactory->createMethodCall($data['user'], 'hasRight', $args);
+ }
+ }
+
+ return $node;
+ }
+
+ $caseok = false; // Will be true if we can make the replacement. We must not do it for assignment like when $user->right->aaa->bbb = ...
+
$isInverse = false;
if ($node instanceof Node\Expr\BooleanNot) {
if (!$node->expr instanceof Node\Expr\Empty_) {
return null;
}
$node = $node->expr->expr;
+ $caseok = true;
}
if ($node instanceof Node\Expr\Empty_) {
$node = $node->expr;
$isInverse = true;
+ $caseok = true;
}
if ($node instanceof Node\Expr\Isset_) {
// Take first arg for isset (No code found with multiple isset).
$node = $node->vars[0];
+ $caseok = true;
}
if (!$node instanceof Node\Expr\PropertyFetch) {
- return;
+ return null;
}
- $data = $this->getRights($node);
- if (!isset($data)) {
- return;
+
+ if ($caseok) {
+ $data = $this->getRights($node);
+ if (!isset($data)) {
+ return;
+ }
+ $args = [new Arg($data['module']), new Arg($data['perm1'])];
+ if (!empty($data['perm2'])) {
+ $args[] = new Arg($data['perm2']);
+ }
+ $method = $this->nodeFactory->createMethodCall($data['user'], 'hasRight', $args);
+ if ($isInverse) {
+ return new Node\Expr\BooleanNot($method);
+ }
+ return $method;
+ } else {
+ return null;
}
- $args = [new Arg($data['module']), new Arg($data['perm1'])];
- if (!empty($data['perm2'])) {
- $args[] = new Arg($data['perm2']);
- }
- $method = $this->nodeFactory->createMethodCall($data['user'], 'hasRight', $args);
- if ($isInverse) {
- return new Node\Expr\BooleanNot($method);
- }
- return $method;
}
/**
@@ -150,4 +227,34 @@ class UserRightsToFunction extends AbstractRector
$user = $rights->var;
return compact('user', 'module', 'perm1', 'perm2');
}
+
+ /**
+ * Get nodes with check empty
+ *
+ * @param BooleanAnd $booleanAnd A BooleandAnd
+ * @return TwoNodeMatch|null
+ */
+ private function resolveTwoNodeMatch(BooleanAnd $booleanAnd): ?TwoNodeMatch
+ {
+ return $this->binaryOpManipulator->matchFirstAndSecondConditionNode(
+ $booleanAnd,
+ // Function to check if we are in the case $conf->global->... == $value
+ function (Node $node): bool {
+ if (!$node instanceof Equal) {
+ return \false;
+ }
+ return $this->isGlobalVar($node->left);
+ },
+ // !empty(...) || isset(...)
+ function (Node $node): bool {
+ if ($node instanceof BooleanNot && $node->expr instanceof Empty_) {
+ return $this->isGlobalVar($node->expr->expr);
+ }
+ if (!$node instanceof Isset_) {
+ return $this->isGlobalVar($node);
+ }
+ return \true;
+ }
+ );
+ }
}
diff --git a/htdocs/.gitignore b/htdocs/.gitignore
index 0749df8a2bb..d0fe62f2e73 100644
--- a/htdocs/.gitignore
+++ b/htdocs/.gitignore
@@ -1,3 +1,4 @@
+/aaa*
/allscreens*
/ancot*
/bootstrap*
diff --git a/htdocs/accountancy/admin/index.php b/htdocs/accountancy/admin/index.php
index 636026e526c..ea93f6751fa 100644
--- a/htdocs/accountancy/admin/index.php
+++ b/htdocs/accountancy/admin/index.php
@@ -374,7 +374,7 @@ if (getDolGlobalInt('ACCOUNTING_MANAGE_ZERO')) {
}
print '';
-// Param a user $user->rights->accounting->chartofaccount can access
+// Param a user $user->hasRights('accounting', 'chartofaccount') can access
foreach ($list as $key) {
print '
';
@@ -404,7 +404,7 @@ print '
';
print '
'.$langs->trans('BindingOptions').'
';
print "
\n";
-// Param a user $user->rights->accounting->chartofaccount can access
+// Param a user $user->hasRights('accounting', 'chartofaccount') can access
foreach ($list_binding as $key) {
print '
';
diff --git a/htdocs/accountancy/class/api_accountancy.class.php b/htdocs/accountancy/class/api_accountancy.class.php
index 8e6649b6e4b..652abb731de 100644
--- a/htdocs/accountancy/class/api_accountancy.class.php
+++ b/htdocs/accountancy/class/api_accountancy.class.php
@@ -92,7 +92,7 @@ class Accountancy extends DolibarrApi
global $conf, $langs;
// check rights
- if (!DolibarrApiAccess::$user->rights->accounting->mouvements->export) {
+ if (!DolibarrApiAccess::$user->hasRight('accounting', 'mouvements', 'export')) {
throw new RestException(401, 'No permission to export accounting');
}
diff --git a/htdocs/adherents/class/adherentstats.class.php b/htdocs/adherents/class/adherentstats.class.php
index 0416a03de81..f99b20f86d5 100644
--- a/htdocs/adherents/class/adherentstats.class.php
+++ b/htdocs/adherents/class/adherentstats.class.php
@@ -69,7 +69,6 @@ class AdherentStats extends Stats
$this->where .= " m.statut != -1";
$this->where .= " AND p.fk_adherent = m.rowid AND m.entity IN (".getEntity('adherent').")";
- //if (empty($user->rights->societe->client->voir) && !$user->socid) $this->where .= " AND p.fk_soc = sc.fk_soc AND sc.fk_user = " .((int) $user->id);
if ($this->memberid) {
$this->where .= " AND m.rowid = ".((int) $this->memberid);
}
diff --git a/htdocs/adherents/class/subscription.class.php b/htdocs/adherents/class/subscription.class.php
index 0b3618b4e32..99101b2c07b 100644
--- a/htdocs/adherents/class/subscription.class.php
+++ b/htdocs/adherents/class/subscription.class.php
@@ -43,7 +43,7 @@ class Subscription extends CommonObject
public $table_element = 'subscription';
/**
- * @var int Does myobject support multicompany module ? 0=No test on entity, 1=Test with field entity, 2=Test with link by fk_soc, 'field@table'=Test with link by field@table
+ * @var string Does myobject support multicompany module ? 0=No test on entity, 1=Test with field entity, 2=Test with link by fk_soc, 'field@table'=Test with link by field@table
*/
public $ismultientitymanaged = 'fk_adherent@adherent';
diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php
index 2114f6107c0..1eda77b6587 100644
--- a/htdocs/adherents/list.php
+++ b/htdocs/adherents/list.php
@@ -335,6 +335,38 @@ if (empty($reshook)) {
}
}
+ // Create external user
+ if ($action == 'createsubscription_confirm' && $confirm == "yes" && $user->hasRight('adherent', 'creer')) {
+ $tmpmember = new Adherent($db);
+ $adht = new AdherentType($db);
+ $error = 0;
+ $nbcreated = 0;
+ $now = dol_now();
+ $amount = price2num(GETPOST('amount', 'alpha'));
+ $db->begin();
+ foreach ($toselect as $id) {
+ $res = $tmpmember->fetch($id);
+ if ($res > 0) {
+ $result = $tmpmember->subscription($now, $amount);
+ if ($result < 0) {
+ $error++;
+ } else {
+ $nbcreated++;
+ }
+ } else {
+ $error++;
+ }
+ }
+
+ if (!$error) {
+ setEventMessages($langs->trans("XSubsriptionCreated", $nbcreated), null, 'mesgs');
+ $db->commit();
+ } else {
+ setEventMessages($langs->trans("XSubsriptionError", $error), null, 'mesgs');
+ $db->rollback();
+ }
+ }
+
// Mass actions
$objectclass = 'Adherent';
$objectlabel = 'Members';
@@ -706,6 +738,9 @@ if (isModEnabled('category') && $user->hasRight('adherent', 'creer')) {
if ($user->hasRight('adherent', 'creer') && $user->hasRight('user', 'user', 'creer')) {
$arrayofmassactions['createexternaluser'] = img_picto('', 'user', 'class="pictofixedwidth"').$langs->trans("CreateExternalUser");
}
+if ($user->hasRight('adherent', 'creer')) {
+ $arrayofmassactions['createsubscription'] = img_picto('', 'payment', 'class="pictofixedwidth"').$langs->trans("CreateSubscription");
+}
if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete', 'preaffecttag'))) {
$arrayofmassactions = array();
}
@@ -740,6 +775,34 @@ $topicmail = "Information";
$modelmail = "member";
$objecttmp = new Adherent($db);
$trackid = 'mem'.$object->id;
+if ($massaction == 'createsubscription') {
+ $tmpmember = new Adherent($db);
+ $adht = new AdherentType($db);
+ $amount = 0;
+ foreach ($toselect as $id) {
+ $now = dol_now();
+ $tmpmember->fetch($id);
+ $res = $adht->fetch($tmpmember->typeid);
+ if ($res > 0) {
+ $amounttmp = $adht->amount;
+ if (!empty($tmpmember->last_subscription_amount) && !GETPOSTISSET('newamount') && is_numeric($amounttmp)) {
+ $amounttmp = max($tmpmember->last_subscription_amount, $amount);
+ }
+ $amount = max(0, $amounttmp, $amount);
+ } else {
+ $error++;
+ }
+ }
+
+ $date = dol_print_date(dol_now(), "%d/%m/%Y");
+ $formquestion = array(
+ array('label' => $langs->trans("DateSubscription"), 'type' => 'other', 'value' => $date),
+ array('label' => $langs->trans("Amount"), 'type' => 'text', 'value' => price($amount, 0, '', 0), 'name' => 'amount'),
+ array('type' => 'separator'),
+ array('label' => $langs->trans("MoreActions"), 'type' => 'other', 'value' => $langs->trans("None").' '.img_warning($langs->trans("WarningNoComplementaryActionDone"))),
+ );
+ print $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans("ConfirmMassSubsriptionCreation"), $langs->trans("ConfirmMassSubsriptionCreationQuestion", count($toselect)), "createsubscription_confirm", $formquestion, '', 0, 200, 500, 1);
+}
include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php';
if ($search_all) {
diff --git a/htdocs/admin/emailcollector_list.php b/htdocs/admin/emailcollector_list.php
index 84da0f49c03..833e822c288 100644
--- a/htdocs/admin/emailcollector_list.php
+++ b/htdocs/admin/emailcollector_list.php
@@ -133,9 +133,6 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
$object->fields = dol_sort_array($object->fields, 'position');
$arrayfields = dol_sort_array($arrayfields, 'position');
-/*$permissiontoread = $user->rights->emailcollector->read;
-$permissiontoadd = $user->rights->emailcollector->write;
-$permissiontodelete = $user->rights->emailcollector->delete;*/
$permissiontoread = $user->admin;
$permissiontoadd = $user->admin;
$permissiontodelete = $user->admin;
diff --git a/htdocs/admin/fckeditor.php b/htdocs/admin/fckeditor.php
index 92a235fc178..71105f078b5 100644
--- a/htdocs/admin/fckeditor.php
+++ b/htdocs/admin/fckeditor.php
@@ -126,16 +126,19 @@ if (GETPOST('save', 'alpha')) {
$error++;
}
} else {
- $error++;
+ $error = -1; // -1 means a warning message
}
- if (!$error) {
+ if ($error == 0) {
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
+ } elseif ($error == -1) {
+ setEventMessages($langs->trans("EmptyMessageNotAllowedError"), null, 'warnings');
} else {
setEventMessages($langs->trans("Error").' '.$db->lasterror(), null, 'errors');
}
}
+
/*
* View
*/
diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php
index 51c35a615be..13545002911 100644
--- a/htdocs/admin/mails_templates.php
+++ b/htdocs/admin/mails_templates.php
@@ -1061,7 +1061,7 @@ if ($num) {
$obj = $db->fetch_object($resql);
if ($obj) {
- if ($action == 'edit' && ($rowid == (!empty($obj->rowid) ? $obj->rowid : $obj->code))) {
+ if (($action == 'edit' || $action == 'preview') && ($rowid == (!empty($obj->rowid) ? $obj->rowid : $obj->code))) {
print '
';
if ($canbemodified) {
print ''.img_edit().'';
+ } else {
+ print ''.img_view().'';
}
if ($iserasable) {
print ''.img_delete().'';
@@ -1351,7 +1357,7 @@ $db->close();
* @param array $fieldlist Array of fields
* @param Object $obj If we show a particular record, obj is filled with record fields
* @param string $tabname Name of SQL table
- * @param string $context 'add'=Output field for the "add form", 'edit'=Output field for the "edit form", 'hide'=Output field for the "add form" but we don't want it to be rendered
+ * @param string $context 'add'=Output field for the "add form", 'edit'=Output field for the "edit form", 'preview'=show in readonly the template, 'hide'=Output field for the "add form" but we don't want it to be rendered
* @return void
*/
function fieldList($fieldlist, $obj = null, $tabname = '', $context = '')
@@ -1368,7 +1374,7 @@ function fieldList($fieldlist, $obj = null, $tabname = '', $context = '')
print '
';
} elseif ($value == 'fk_user') {
print '
';
- if ($user->admin) {
+ if ($user->admin && $context != 'preview') {
print $form->select_dolusers(empty($obj->$value) ? '' : $obj->$value, 'fk_user', 1, null, 0, ($user->admin ? '' : 'hierarchyme'), null, 0, 0, 0, '', 0, '', 'minwidth75 maxwidth100');
} else {
if ($context == 'add') { // I am not admin and we show the add form
@@ -1390,7 +1396,7 @@ function fieldList($fieldlist, $obj = null, $tabname = '', $context = '')
print '
';
} elseif ($value == 'lang') {
print '
';
- if (getDolGlobalInt('MAIN_MULTILANGS')) {
+ if (getDolGlobalInt('MAIN_MULTILANGS') && $context != 'preview') {
$selectedlang = GETPOSTISSET('langcode') ? GETPOST('langcode', 'aZ09') : $langs->defaultlang;
if ($context == 'edit') {
$selectedlang = $obj->lang;
@@ -1410,7 +1416,7 @@ function fieldList($fieldlist, $obj = null, $tabname = '', $context = '')
} elseif ($value == 'type_template') {
// Le type de template
print '
';
- if ($context == 'edit' && !empty($obj->type_template) && !in_array($obj->type_template, array_keys($elementList))) {
+ if (($context == 'edit' && !empty($obj->type_template) && !in_array($obj->type_template, array_keys($elementList))) || $context == 'preview') {
// Current template type is an unknown type, so we must keep it as it is.
print '';
print $obj->type_template;
@@ -1422,6 +1428,8 @@ function fieldList($fieldlist, $obj = null, $tabname = '', $context = '')
//print '
';
@@ -650,6 +654,14 @@ if ($status == 'done' || $status == '100') {
if ($status == 'todo') {
$sql .= " AND (a.percent >= 0 AND a.percent < 100)";
}
+// Search in categories, -1 is all and -2 is no categories
+if ($search_categ_cus != -1) {
+ if ($search_categ_cus == -2) {
+ $sql .= " AND NOT EXISTS (SELECT ca.fk_actioncomm FROM ".MAIN_DB_PREFIX."categorie_actioncomm as ca WHERE ca.fk_actioncomm = a.id)";
+ } elseif ($search_categ_cus > 0) {
+ $sql .= " AND EXISTS (SELECT ca.fk_actioncomm FROM ".MAIN_DB_PREFIX."categorie_actioncomm as ca WHERE ca.fk_actioncomm = a.id AND ca.fk_categorie IN (".$db->sanitize($search_categ_cus)."))";
+ }
+}
// Sort on date
$sql .= $db->order("fk_user_action, datep");
//print $sql;
diff --git a/htdocs/comm/mailing/advtargetemailing.php b/htdocs/comm/mailing/advtargetemailing.php
index fa08d145abf..73fc1826706 100644
--- a/htdocs/comm/mailing/advtargetemailing.php
+++ b/htdocs/comm/mailing/advtargetemailing.php
@@ -459,7 +459,7 @@ if ($object->fetch($id) >= 0) {
print "
";
// Show email selectors
- if ($object->statut == 0 && $user->hasRight('mailing', 'creer')) {
+ if ($object->status == 0 && $user->hasRight('mailing', 'creer')) {
include DOL_DOCUMENT_ROOT.'/core/tpl/advtarget.tpl.php';
}
}
diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php
index e4d199d5ff6..3b7497bdc7a 100644
--- a/htdocs/comm/mailing/card.php
+++ b/htdocs/comm/mailing/card.php
@@ -161,7 +161,7 @@ if (empty($reshook)) {
setEventMessages($langs->trans("NotEnoughPermissions"), null, 'warnings');
$action = '';
} else {
- if ($object->statut == 0) {
+ if ($object->status == 0) {
dol_print_error(null, 'ErrorMailIsNotValidated');
exit;
}
@@ -546,6 +546,7 @@ if (empty($reshook)) {
if ($action == 'add') {
$mesgs = array();
+ $object->messtype = (string) GETPOST("messtype");
$object->email_from = (string) GETPOST("from", 'alphawithlgt'); // Must allow 'name '
$object->email_replyto = (string) GETPOST("replyto", 'alphawithlgt'); // Must allow 'name '
$object->email_errorsto = (string) GETPOST("errorsto", 'alphawithlgt'); // Must allow 'name '
@@ -558,7 +559,7 @@ if (empty($reshook)) {
if (!$object->title) {
$mesgs[] = $langs->trans("ErrorFieldRequired", $langs->transnoentities("MailTitle"));
}
- if (!$object->sujet) {
+ if ($object->messtype != 'sms' && !$object->sujet) {
$mesgs[] = $langs->trans("ErrorFieldRequired", $langs->transnoentities("MailTopic"));
}
if (!$object->body) {
@@ -644,12 +645,14 @@ if (empty($reshook)) {
if (!$isupload) {
$mesgs = array();
+
+ //$object->messtype = (string) GETPOST("messtype"); // We must not be able to change the messtype
$object->sujet = (string) GETPOST("sujet");
$object->body = (string) GETPOST("bodyemail", 'restricthtml');
$object->bgcolor = preg_replace('/^#/', '', (string) GETPOST("bgcolor"));
$object->bgimage = (string) GETPOST("bgimage");
- if (!$object->sujet) {
+ if ($object->messtype != 'sms' && !$object->sujet) {
$mesgs[] = $langs->trans("ErrorFieldRequired", $langs->transnoentities("MailTopic"));
}
if (!$object->body) {
@@ -776,7 +779,7 @@ if ($action == 'create') {
$htmltext .= '';
- $availablelink = $form->textwithpicto(''.$langs->trans("AvailableVariables").'', $htmltext, 1, 'help', '', 0, 2, 'availvar');
+ $availablelink = $form->textwithpicto(''.$langs->trans("AvailableVariables").'', $htmltext, 1, 'helpclickable', '', 0, 2, 'availvar');
//print ''.img_picto($langs->trans("ClickToShowDescription"), $imginfo).'';
@@ -789,9 +792,40 @@ if ($action == 'create') {
print '
';
+ }
$trackid = ''; // TODO To avoid conflicts with 2 mass emailing, we should set a trackid here, even if we use another one into email header.
dol_init_file_process($upload_dir, $trackid);
// Joined files
- $addfileaction = 'addfile';
- print '
'.$langs->trans("MailFile").'
';
- print '
';
- // List of files
- $listofpaths = dol_dir_list($upload_dir, 'all', 0, '', '', 'name', SORT_ASC, 0);
+ if ($object->messtype != 'sms') {
+ $addfileaction = 'addfile';
+ print '
'.$langs->trans("MailFile").'
';
+ print '
';
+ // List of files
+ $listofpaths = dol_dir_list($upload_dir, 'all', 0, '', '', 'name', SORT_ASC, 0);
- // TODO Trick to have param removedfile containing nb of image to delete. But this does not works without javascript
- $out .= ''."\n";
- $out .= ''."\n";
- if (count($listofpaths)) {
- foreach ($listofpaths as $key => $val) {
- $out .= '
';
+ // TODO Trick to have param removedfile containing nb of image to delete. But this does not works without javascript
+ $out .= ''."\n";
+ $out .= ''."\n";
+ if (count($listofpaths)) {
+ foreach ($listofpaths as $key => $val) {
+ $out .= '
';
print '';
- if ($obj->statut == $object::STATUS_DRAFT) { // Not sent yet
+ if ($obj->status == $object::STATUS_DRAFT) { // Not sent yet
if ($user->hasRight('mailing', 'creer')) {
print ''.img_delete($langs->trans("RemoveRecipient")).'';
}
}
- /*if ($obj->statut == -1) // Sent with error
+ /*if ($obj->status == -1) // Sent with error
{
print ''.$langs->trans("Retry").'';
}*/
@@ -834,7 +856,7 @@ if ($object->fetch($id) >= 0) {
// Date sent
print '
';
- if ($obj->statut != $object::STATUS_DRAFT) {
+ if ($obj->status != $object::STATUS_DRAFT) {
// Date sent
print $obj->date_envoi;
}
@@ -842,10 +864,10 @@ if ($object->fetch($id) >= 0) {
// Status of recipient sending email (Warning != status of emailing)
print '
';
diff --git a/htdocs/comm/mailing/class/html.formadvtargetemailing.class.php b/htdocs/comm/mailing/class/html.formadvtargetemailing.class.php
index 0cf26f4820b..70f7c9ba975 100644
--- a/htdocs/comm/mailing/class/html.formadvtargetemailing.class.php
+++ b/htdocs/comm/mailing/class/html.formadvtargetemailing.class.php
@@ -169,10 +169,10 @@ class FormAdvTargetEmailing extends Form
if (getDolGlobalString('USER_HIDE_INACTIVE_IN_COMBOBOX')) {
$sql_usr .= " AND u2.statut <> 0";
}
- if (!empty($conf->global->USER_HIDE_NONEMPLOYEE_IN_COMBOBOX)) {
+ if (getDolGlobalString('USER_HIDE_NONEMPLOYEE_IN_COMBOBOX')) {
$sql_usr .= " AND u2.employee<>0 ";
}
- if (!empty($conf->global->USER_HIDE_EXTERNAL_IN_COMBOBOX)) {
+ if (getDolGlobalString('USER_HIDE_EXTERNAL_IN_COMBOBOX')) {
$sql_usr .= " AND u2.fk_soc IS NULL ";
}
$sql_usr .= " ORDER BY name ASC";
diff --git a/htdocs/comm/mailing/class/mailing.class.php b/htdocs/comm/mailing/class/mailing.class.php
index e7058d81216..7e18ce5f477 100644
--- a/htdocs/comm/mailing/class/mailing.class.php
+++ b/htdocs/comm/mailing/class/mailing.class.php
@@ -46,6 +46,11 @@ class Mailing extends CommonObject
*/
public $picto = 'email';
+ /**
+ * @var string Type of message ('email', 'sms')
+ */
+ public $messtype;
+
/**
* @var string title
*/
@@ -83,9 +88,15 @@ class Mailing extends CommonObject
/**
* @var int status
+ * @deprecated
*/
public $statut; // Status 0=Draft, 1=Validated, 2=Sent partially, 3=Sent completely
+ /**
+ * @var int status
+ */
+ public $status; // Status 0=Draft, 1=Validated, 2=Sent partially, 3=Sent completely
+
/**
* @var string email from
*/
@@ -126,47 +137,11 @@ class Mailing extends CommonObject
*/
public $joined_file4;
- /**
- * @var int id of user create
- * @deprecated
- */
- public $user_creation;
-
- /**
- * @var int id of user create
- * @deprecated
- */
- public $user_creat;
-
- /**
- * @var int id of user validate
- * @deprecated
- */
- public $user_validation;
-
- /**
- * @var int id of user validate
- * @deprecated
- */
- public $user_valid;
-
- /**
- * @var integer|string date_creation
- * @deprecated
- */
- public $date_creat;
-
/**
* @var integer|string date_creation
*/
public $date_creation;
- /**
- * @var int date validate
- * @deprecated
- */
- public $date_valid;
-
/**
* @var int date validate
*/
@@ -215,8 +190,6 @@ class Mailing extends CommonObject
*/
public function __construct($db)
{
- global $langs;
-
$this->db = $db;
// List of language codes for status
@@ -253,12 +226,13 @@ class Mailing extends CommonObject
$this->email_from = trim($this->email_from);
if (!$this->email_from) {
- $this->error = $langs->trans("ErrorMailFromRequired");
+ $this->error = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("From"));
return -1;
}
$error = 0;
$now = dol_now();
+
$this->db->begin();
$sql = "INSERT INTO ".MAIN_DB_PREFIX."mailing";
@@ -270,6 +244,7 @@ class Mailing extends CommonObject
}
dol_syslog(__METHOD__, LOG_DEBUG);
+
$resql = $this->db->query($sql);
if ($resql) {
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."mailing");
@@ -323,6 +298,7 @@ class Mailing extends CommonObject
$sql = "UPDATE ".MAIN_DB_PREFIX."mailing ";
$sql .= " SET titre = '".$this->db->escape($this->title)."'";
+ $sql .= ", messtype = '".$this->db->escape($this->messtype)."'";
$sql .= ", sujet = '".$this->db->escape($this->sujet)."'";
$sql .= ", body = '".$this->db->escape($this->body)."'";
$sql .= ", email_from = '".$this->db->escape($this->email_from)."'";
@@ -370,11 +346,9 @@ class Mailing extends CommonObject
*/
public function fetch($rowid, $ref = '')
{
- global $conf;
-
- $sql = "SELECT m.rowid, m.titre as title, m.sujet, m.body, m.bgcolor, m.bgimage, m.evenunsubscribe";
+ $sql = "SELECT m.rowid, m.messtype, m.titre as title, m.sujet, m.body, m.bgcolor, m.bgimage, m.evenunsubscribe";
$sql .= ", m.email_from, m.email_replyto, m.email_errorsto";
- $sql .= ", m.statut, m.nbemail";
+ $sql .= ", m.statut as status, m.nbemail";
$sql .= ", m.fk_user_creat, m.fk_user_valid";
$sql .= ", m.date_creat";
$sql .= ", m.date_valid";
@@ -396,9 +370,13 @@ class Mailing extends CommonObject
$this->id = $obj->rowid;
$this->ref = $obj->rowid;
- $this->statut = $obj->statut;
- $this->nbemail = $obj->nbemail;
$this->title = $obj->title;
+ $this->messtype = $obj->messtype;
+
+ $this->statut = $obj->status; // deprecated
+ $this->status = $obj->status;
+
+ $this->nbemail = $obj->nbemail;
$this->sujet = $obj->sujet;
if (getDolGlobalString('FCKEDITOR_ENABLE_MAILING') && dol_textishtml(dol_html_entity_decode($obj->body, ENT_COMPAT | ENT_HTML5))) {
@@ -418,14 +396,16 @@ class Mailing extends CommonObject
$this->user_creation_id = $obj->fk_user_creat;
$this->user_validation_id = $obj->fk_user_valid;
- $this->date_creat = $this->db->jdate($obj->date_creat);
$this->date_creation = $this->db->jdate($obj->date_creat);
- $this->date_valid = $this->db->jdate($obj->date_valid);
$this->date_validation = $this->db->jdate($obj->date_valid);
$this->date_envoi = $this->db->jdate($obj->date_envoi);
$this->extraparams = (array) json_decode($obj->extraparams, true);
+ if ($this->messtype == 'sms') {
+ $this->picto = 'phone';
+ }
+
return 1;
} else {
dol_syslog(get_class($this)."::fetch Erreur -1");
@@ -460,6 +440,7 @@ class Mailing extends CommonObject
// Load source object
$object->fetch($fromid);
$object->id = 0;
+ $object->status = 0;
$object->statut = 0;
// Clear fields
@@ -482,9 +463,7 @@ class Mailing extends CommonObject
$object->user_creation_id = $user->id;
$object->user_validation_id = '';
- $object->date_creat = '';
- $object->date_valid = '';
- $object->date_envoi = '';
+ $object->date_envoi = null;
}
// Create clone
@@ -723,7 +702,8 @@ class Mailing extends CommonObject
*/
public function refreshNbOfTargets()
{
- $sql = "SELECT COUNT(rowid) as nb FROM ".MAIN_DB_PREFIX."mailing_cibles";
+ $sql = "SELECT COUNT(rowid) as nb";
+ $sql .= " FROM ".MAIN_DB_PREFIX."mailing_cibles";
$sql .= " WHERE fk_mailing = ".((int) $this->id);
$resql = $this->db->query($sql);
@@ -760,14 +740,14 @@ class Mailing extends CommonObject
*/
public function getTooltipContentArray($params)
{
- global $conf, $langs;
+ global $langs;
- $nofetch = !empty($params['nofetch']);
+ //$nofetch = !empty($params['nofetch']);
$langs->load('mails');
$datas = array();
$datas['picto'] = img_picto('', $this->picto).' '.$langs->trans("ShowEMailing").'';
- if (isset($this->statut)) {
+ if (isset($this->status)) {
$datas['picto'] .= ' '.$this->getLibStatut(5);
}
$datas['ref'] = ' '.$langs->trans('Ref').': '.$this->ref;
@@ -876,7 +856,7 @@ class Mailing extends CommonObject
*/
public function getLibStatut($mode = 0)
{
- return $this->LibStatut($this->statut, $mode);
+ return $this->LibStatut($this->status, $mode);
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
diff --git a/htdocs/comm/mailing/index.php b/htdocs/comm/mailing/index.php
index 7aabd8dc2e3..8fee4a7935f 100644
--- a/htdocs/comm/mailing/index.php
+++ b/htdocs/comm/mailing/index.php
@@ -152,7 +152,7 @@ print '
';
* List of last emailings
*/
$limit = 10;
-$sql = "SELECT m.rowid, m.titre as title, m.nbemail, m.statut as status, m.date_creat";
+$sql = "SELECT m.rowid, m.titre as title, m.nbemail, m.statut as status, m.date_creat, m.messtype";
$sql .= " FROM ".MAIN_DB_PREFIX."mailing as m";
$sql .= " WHERE m.entity = ".$conf->entity;
$sql .= " ORDER BY m.date_creat DESC";
@@ -163,9 +163,18 @@ if ($result) {
print '
';
print '
';
print '
'.$langs->trans("LastMailings", $limit).'
';
+ if (getDolGlobalInt('EMAILINGS_SUPPORT_ALSO_SMS')) {
+ print '
';
print '';
// Status
@@ -522,7 +563,7 @@ while ($i < $imaxinloop) {
if ($filteremail) {
print $object::libStatutDest($obj->sendstatut, 2);
} else {
- print $object->LibStatut($obj->statut, 5);
+ print $object->LibStatut($obj->status, 5);
}
print '';
diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php
index 408d13837ab..cfc18095d6d 100644
--- a/htdocs/comm/propal/card.php
+++ b/htdocs/comm/propal/card.php
@@ -119,11 +119,11 @@ $usercanread = $user->hasRight("propal", "lire");
$usercancreate = $user->hasRight("propal", "creer");
$usercandelete = $user->hasRight("propal", "supprimer");
-$usercanclose = ((!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $usercancreate) || (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && !empty($user->rights->propal->propal_advance->close)));
-$usercanvalidate = ((!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $usercancreate) || (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && !empty($user->rights->propal->propal_advance->validate)));
-$usercansend = (!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') || (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && !empty($user->rights->propal->propal_advance->send)));
+$usercanclose = ((!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $usercancreate) || (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('propal', 'propal_advance', 'close')));
+$usercanvalidate = ((!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $usercancreate) || (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('propal', 'propal_advance', 'validate')));
+$usercansend = (!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') || (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('propal', 'propal_advance', 'send')));
-$usermustrespectpricemin = ((getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && empty($user->rights->produit->ignore_price_min_advance)) || !getDolGlobalString('MAIN_USE_ADVANCED_PERMS'));
+$usermustrespectpricemin = ((getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && !$user->hasRight('produit', 'ignore_price_min_advance')) || !getDolGlobalString('MAIN_USE_ADVANCED_PERMS'));
$usercancreateorder = $user->hasRight('commande', 'creer');
$usercancreateinvoice = $user->hasRight('facture', 'creer');
$usercancreatecontract = $user->hasRight('contrat', 'creer');
diff --git a/htdocs/comm/propal/class/api_proposals.class.php b/htdocs/comm/propal/class/api_proposals.class.php
index 762027e1475..aa1e3d0e980 100644
--- a/htdocs/comm/propal/class/api_proposals.class.php
+++ b/htdocs/comm/propal/class/api_proposals.class.php
@@ -174,7 +174,7 @@ class Proposals extends DolibarrApi
// If the internal user must only see his customers, force searching by him
$search_sale = 0;
- if (!DolibarrApiAccess::$user->rights->hasRight('societe', 'client', 'voir') && !$socids) {
+ if (!DolibarrApiAccess::$user->hasRight('societe', 'client', 'voir') && !$socids) {
$search_sale = DolibarrApiAccess::$user->id;
}
@@ -247,7 +247,7 @@ class Proposals extends DolibarrApi
*/
public function post($request_data = null)
{
- if (!DolibarrApiAccess::$user->rights->propal->creer) {
+ if (!DolibarrApiAccess::$user->hasRight('propal', 'creer')) {
throw new RestException(401, "Insuffisant rights");
}
// Check mandatory fields
@@ -330,7 +330,7 @@ class Proposals extends DolibarrApi
*/
public function postLine($id, $request_data = null)
{
- if (!DolibarrApiAccess::$user->rights->propal->creer) {
+ if (!DolibarrApiAccess::$user->hasRight('propal', 'creer')) {
throw new RestException(403);
}
@@ -396,7 +396,7 @@ class Proposals extends DolibarrApi
*/
public function postLines($id, $request_data = null)
{
- if (!DolibarrApiAccess::$user->rights->propal->creer) {
+ if (!DolibarrApiAccess::$user->hasRight('propal', 'creer')) {
throw new RestException(403);
}
@@ -476,7 +476,7 @@ class Proposals extends DolibarrApi
*/
public function putLine($id, $lineid, $request_data = null)
{
- if (!DolibarrApiAccess::$user->rights->propal->creer) {
+ if (!DolibarrApiAccess::$user->hasRight('propal', 'creer')) {
throw new RestException(403);
}
@@ -554,7 +554,7 @@ class Proposals extends DolibarrApi
*/
public function deleteLine($id, $lineid)
{
- if (!DolibarrApiAccess::$user->rights->propal->creer) {
+ if (!DolibarrApiAccess::$user->hasRight('propal', 'creer')) {
throw new RestException(403);
}
@@ -590,7 +590,7 @@ class Proposals extends DolibarrApi
*/
public function postContact($id, $contactid, $type)
{
- if (!DolibarrApiAccess::$user->rights->propal->creer) {
+ if (!DolibarrApiAccess::$user->hasRight('propal', 'creer')) {
throw new RestException(403);
}
@@ -638,7 +638,7 @@ class Proposals extends DolibarrApi
*/
public function deleteContact($id, $contactid, $type)
{
- if (!DolibarrApiAccess::$user->rights->propal->creer) {
+ if (!DolibarrApiAccess::$user->hasRight('propal', 'creer')) {
throw new RestException(403);
}
@@ -676,7 +676,7 @@ class Proposals extends DolibarrApi
*/
public function put($id, $request_data = null)
{
- if (!DolibarrApiAccess::$user->rights->propal->creer) {
+ if (!DolibarrApiAccess::$user->hasRight('propal', 'creer')) {
throw new RestException(403);
}
@@ -726,7 +726,7 @@ class Proposals extends DolibarrApi
*/
public function delete($id)
{
- if (!DolibarrApiAccess::$user->rights->propal->supprimer) {
+ if (!DolibarrApiAccess::$user->hasRight('propal', 'supprimer')) {
throw new RestException(403);
}
$result = $this->propal->fetch($id);
@@ -760,7 +760,7 @@ class Proposals extends DolibarrApi
*/
public function settodraft($id)
{
- if (!DolibarrApiAccess::$user->rights->propal->creer) {
+ if (!DolibarrApiAccess::$user->hasRight('propal', 'creer')) {
throw new RestException(403);
}
$result = $this->propal->fetch($id);
@@ -816,7 +816,7 @@ class Proposals extends DolibarrApi
*/
public function validate($id, $notrigger = 0)
{
- if (!DolibarrApiAccess::$user->rights->propal->creer) {
+ if (!DolibarrApiAccess::$user->hasRight('propal', 'creer')) {
throw new RestException(403);
}
$result = $this->propal->fetch($id);
@@ -863,7 +863,7 @@ class Proposals extends DolibarrApi
*/
public function close($id, $status, $note_private = '', $notrigger = 0)
{
- if (!DolibarrApiAccess::$user->rights->propal->creer) {
+ if (!DolibarrApiAccess::$user->hasRight('propal', 'creer')) {
throw new RestException(403);
}
$result = $this->propal->fetch($id);
@@ -907,7 +907,7 @@ class Proposals extends DolibarrApi
*/
public function setinvoiced($id)
{
- if (!DolibarrApiAccess::$user->rights->propal->creer) {
+ if (!DolibarrApiAccess::$user->hasRight('propal', 'creer')) {
throw new RestException(403);
}
$result = $this->propal->fetch($id);
diff --git a/htdocs/comm/propal/document.php b/htdocs/comm/propal/document.php
index 9c83eafad02..00ec2367c8a 100644
--- a/htdocs/comm/propal/document.php
+++ b/htdocs/comm/propal/document.php
@@ -74,7 +74,7 @@ if (!$sortfield) {
$object = new Propal($db);
$object->fetch($id, $ref);
-$permissiontoadd = $user->rights->propal->creer;
+$permissiontoadd = $user->hasRight('propal', 'creer');
// Security check
$socid = '';
@@ -174,8 +174,8 @@ if ($object->id > 0) {
print dol_get_fiche_end();
$modulepart = 'propal';
- $permissiontoadd = $user->rights->propal->creer;
- $permtoedit = $user->rights->propal->creer;
+ $permissiontoadd = $user->hasRight('propal', 'creer');
+ $permtoedit = $user->hasRight('propal', 'creer');
$param = '&id='.$object->id;
include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
} else {
diff --git a/htdocs/comm/propal/note.php b/htdocs/comm/propal/note.php
index 36eb458f252..bc408a1c6de 100644
--- a/htdocs/comm/propal/note.php
+++ b/htdocs/comm/propal/note.php
@@ -66,7 +66,7 @@ $usercancreate = $user->hasRight("propal", "creer");
* Actions
*/
-$permissionnote = $user->rights->propal->creer; // Used by the include of actions_setnotes.inc.php
+$permissionnote = $user->hasRight('propal', 'creer'); // Used by the include of actions_setnotes.inc.php
$parameters = array();
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
diff --git a/htdocs/comm/remx.php b/htdocs/comm/remx.php
index 3d7e1d5e3db..068fdff9052 100644
--- a/htdocs/comm/remx.php
+++ b/htdocs/comm/remx.php
@@ -69,9 +69,6 @@ if (GETPOST('cancel', 'alpha') && !empty($backtopage)) {
}
if ($action == 'confirm_split' && GETPOST("confirm", "alpha") == 'yes' && $permissiontocreate) {
- //if ($user->rights->societe->creer)
- //if ($user->hasRight('facture', 'creer'))
-
$amount_ttc_1 = GETPOST('amount_ttc_1', 'alpha');
$amount_ttc_1 = price2num($amount_ttc_1);
$amount_ttc_2 = GETPOST('amount_ttc_2', 'alpha');
@@ -160,9 +157,6 @@ if ($action == 'confirm_split' && GETPOST("confirm", "alpha") == 'yes' && $permi
}
if ($action == 'setremise' && $permissiontocreate) {
- //if ($user->rights->societe->creer)
- //if ($user->hasRight('facture', 'creer'))
-
$amount = price2num(GETPOST('amount', 'alpha'), '', 2);
$desc = GETPOST('desc', 'alpha');
$tva_tx = GETPOST('tva_tx', 'alpha');
@@ -200,9 +194,6 @@ if ($action == 'setremise' && $permissiontocreate) {
}
if (GETPOST('action', 'aZ09') == 'confirm_remove' && GETPOST("confirm") == 'yes' && $permissiontocreate) {
- //if ($user->rights->societe->creer)
- //if ($user->hasRight('facture', 'creer'))
-
$db->begin();
$discount = new DiscountAbsolute($db);
diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php
index f3881a10aff..236a4675187 100644
--- a/htdocs/commande/card.php
+++ b/htdocs/commande/card.php
@@ -129,7 +129,7 @@ $usercancancel = ((!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user
$usercansend = (!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') || $user->hasRight('commande', 'order_advance', 'send'));
$usercangeneretedoc = (!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') || $user->hasRight('commande', 'order_advance', 'generetedoc'));
-$usermustrespectpricemin = ((getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && empty($user->rights->produit->ignore_price_min_advance)) || !getDolGlobalString('MAIN_USE_ADVANCED_PERMS'));
+$usermustrespectpricemin = ((getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && !$user->hasRight('produit', 'ignore_price_min_advance')) || !getDolGlobalString('MAIN_USE_ADVANCED_PERMS'));
$usercancreatepurchaseorder = ($user->hasRight('fournisseur', 'commande', 'creer') || $user->hasRight('supplier_order', 'creer'));
$permissionnote = $usercancreate; // Used by the include of actions_setnotes.inc.php
diff --git a/htdocs/commande/class/api_orders.class.php b/htdocs/commande/class/api_orders.class.php
index 2e6ed740f7c..d70dab85cb7 100644
--- a/htdocs/commande/class/api_orders.class.php
+++ b/htdocs/commande/class/api_orders.class.php
@@ -176,7 +176,7 @@ class Orders extends DolibarrApi
// If the internal user must only see his customers, force searching by him
$search_sale = 0;
- if (!DolibarrApiAccess::$user->rights->societe->client->voir && !$socids) {
+ if (!DolibarrApiAccess::$user->hasRight('societe', 'client', 'voir') && !$socids) {
$search_sale = DolibarrApiAccess::$user->id;
}
@@ -264,7 +264,7 @@ class Orders extends DolibarrApi
*/
public function post($request_data = null)
{
- if (!DolibarrApiAccess::$user->rights->commande->creer) {
+ if (!DolibarrApiAccess::$user->hasRight('commande', 'creer')) {
throw new RestException(401, "Insuffisant rights");
}
// Check mandatory fields
@@ -337,7 +337,7 @@ class Orders extends DolibarrApi
*/
public function postLine($id, $request_data = null)
{
- if (!DolibarrApiAccess::$user->rights->commande->creer) {
+ if (!DolibarrApiAccess::$user->hasRight('commande', 'creer')) {
throw new RestException(403);
}
@@ -404,7 +404,7 @@ class Orders extends DolibarrApi
*/
public function putLine($id, $lineid, $request_data = null)
{
- if (!DolibarrApiAccess::$user->rights->commande->creer) {
+ if (!DolibarrApiAccess::$user->hasRight('commande', 'creer')) {
throw new RestException(403);
}
@@ -472,7 +472,7 @@ class Orders extends DolibarrApi
*/
public function deleteLine($id, $lineid)
{
- if (!DolibarrApiAccess::$user->rights->commande->creer) {
+ if (!DolibarrApiAccess::$user->hasRight('commande', 'creer')) {
throw new RestException(403);
}
@@ -541,7 +541,7 @@ class Orders extends DolibarrApi
*/
public function postContact($id, $contactid, $type)
{
- if (!DolibarrApiAccess::$user->rights->commande->creer) {
+ if (!DolibarrApiAccess::$user->hasRight('commande', 'creer')) {
throw new RestException(403);
}
@@ -589,7 +589,7 @@ class Orders extends DolibarrApi
*/
public function deleteContact($id, $contactid, $type)
{
- if (!DolibarrApiAccess::$user->rights->commande->creer) {
+ if (!DolibarrApiAccess::$user->hasRight('commande', 'creer')) {
throw new RestException(403);
}
@@ -631,7 +631,7 @@ class Orders extends DolibarrApi
*/
public function put($id, $request_data = null)
{
- if (!DolibarrApiAccess::$user->rights->commande->creer) {
+ if (!DolibarrApiAccess::$user->hasRight('commande', 'creer')) {
throw new RestException(403);
}
@@ -678,7 +678,7 @@ class Orders extends DolibarrApi
*/
public function delete($id)
{
- if (!DolibarrApiAccess::$user->rights->commande->supprimer) {
+ if (!DolibarrApiAccess::$user->hasRight('commande', 'supprimer')) {
throw new RestException(403);
}
$result = $this->commande->fetch($id);
@@ -726,7 +726,7 @@ class Orders extends DolibarrApi
*/
public function validate($id, $idwarehouse = 0, $notrigger = 0)
{
- if (!DolibarrApiAccess::$user->rights->commande->creer) {
+ if (!DolibarrApiAccess::$user->hasRight('commande', 'creer')) {
throw new RestException(403);
}
$result = $this->commande->fetch($id);
@@ -777,7 +777,7 @@ class Orders extends DolibarrApi
*/
public function reopen($id)
{
- if (!DolibarrApiAccess::$user->rights->commande->creer) {
+ if (!DolibarrApiAccess::$user->hasRight('commande', 'creer')) {
throw new RestException(403);
}
if (empty($id)) {
@@ -813,7 +813,7 @@ class Orders extends DolibarrApi
*/
public function setinvoiced($id)
{
- if (!DolibarrApiAccess::$user->rights->commande->creer) {
+ if (!DolibarrApiAccess::$user->hasRight('commande', 'creer')) {
throw new RestException(403);
}
if (empty($id)) {
@@ -854,7 +854,7 @@ class Orders extends DolibarrApi
*/
public function close($id, $notrigger = 0)
{
- if (!DolibarrApiAccess::$user->rights->commande->creer) {
+ if (!DolibarrApiAccess::$user->hasRight('commande', 'creer')) {
throw new RestException(403);
}
$result = $this->commande->fetch($id);
@@ -899,7 +899,7 @@ class Orders extends DolibarrApi
*/
public function settodraft($id, $idwarehouse = -1)
{
- if (!DolibarrApiAccess::$user->rights->commande->creer) {
+ if (!DolibarrApiAccess::$user->hasRight('commande', 'creer')) {
throw new RestException(403);
}
$result = $this->commande->fetch($id);
@@ -954,7 +954,7 @@ class Orders extends DolibarrApi
if (!DolibarrApiAccess::$user->hasRight('propal', 'lire')) {
throw new RestException(403);
}
- if (!DolibarrApiAccess::$user->rights->commande->creer) {
+ if (!DolibarrApiAccess::$user->hasRight('commande', 'creer')) {
throw new RestException(403);
}
if (empty($proposalid)) {
@@ -992,7 +992,7 @@ class Orders extends DolibarrApi
public function getOrderShipments($id)
{
require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php';
- if (!DolibarrApiAccess::$user->rights->expedition->lire) {
+ if (!DolibarrApiAccess::$user->hasRight('expedition', 'lire')) {
throw new RestException(403);
}
$obj_ret = array();
@@ -1048,7 +1048,7 @@ class Orders extends DolibarrApi
public function createOrderShipment($id, $warehouse_id)
{
require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php';
- if (!DolibarrApiAccess::$user->rights->expedition->creer) {
+ if (!DolibarrApiAccess::$user->hasRight('expedition', 'creer')) {
throw new RestException(403);
}
if ($warehouse_id <= 0) {
diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php
index dc4df918c7b..a5b1446524c 100644
--- a/htdocs/commande/class/commande.class.php
+++ b/htdocs/commande/class/commande.class.php
@@ -776,8 +776,8 @@ class Commande extends CommonOrder
$error = 0;
- $usercanclose = ((!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && !empty($user->rights->commande->creer))
- || (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && !empty($user->rights->commande->order_advance->close)));
+ $usercanclose = ((!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('commande', 'creer'))
+ || (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('commande', 'order_advance', 'close')));
if ($usercanclose) {
if ($this->statut == self::STATUS_CLOSED) {
diff --git a/htdocs/commande/document.php b/htdocs/commande/document.php
index c529cade054..864375fbf5d 100644
--- a/htdocs/commande/document.php
+++ b/htdocs/commande/document.php
@@ -179,8 +179,8 @@ if ($id > 0 || !empty($ref)) {
print dol_get_fiche_end();
$modulepart = 'commande';
- $permissiontoadd = $user->rights->commande->creer;
- $permtoedit = $user->rights->commande->creer;
+ $permissiontoadd = $user->hasRight('commande', 'creer');
+ $permtoedit = $user->hasRight('commande', 'creer');
$param = '&id='.$object->id.'&entity='.(empty($object->entity) ? $conf->entity : $object->entity);
include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
} else {
diff --git a/htdocs/commande/note.php b/htdocs/commande/note.php
index 368a8333317..33fd5fd60e3 100644
--- a/htdocs/commande/note.php
+++ b/htdocs/commande/note.php
@@ -54,7 +54,7 @@ $result = restrictedArea($user, 'commande', $id, '');
$usercancreate = $user->hasRight("commande", "creer");
-$permissionnote = $user->rights->commande->creer; // Used by the include of actions_setnotes.inc.php
+$permissionnote = $user->hasRight('commande', 'creer'); // Used by the include of actions_setnotes.inc.php
$object = new Commande($db);
diff --git a/htdocs/compta/accounting-files.php b/htdocs/compta/accounting-files.php
index e7679dcec72..dd4a6c50c75 100644
--- a/htdocs/compta/accounting-files.php
+++ b/htdocs/compta/accounting-files.php
@@ -136,13 +136,13 @@ $error = 0;
$listofchoices = array(
'selectinvoices'=>array('label'=>'Invoices', 'picto'=>'bill', 'lang'=>'bills', 'enabled' => isModEnabled('facture'), 'perms' => $user->hasRight('facture', 'lire')),
- 'selectsupplierinvoices'=>array('label'=>'BillsSuppliers', 'picto'=>'supplier_invoice', 'lang'=>'bills', 'enabled' => isModEnabled('supplier_invoice'), 'perms' => !empty($user->rights->fournisseur->facture->lire)),
- 'selectexpensereports'=>array('label'=>'ExpenseReports', 'picto'=>'expensereport', 'lang'=>'trips', 'enabled' => isModEnabled('expensereport'), 'perms' => !empty($user->rights->expensereport->lire)),
- 'selectdonations'=>array('label'=>'Donations', 'picto'=>'donation', 'lang'=>'donation', 'enabled' => isModEnabled('don'), 'perms' => !empty($user->rights->don->lire)),
- 'selectsocialcontributions'=>array('label'=>'SocialContributions', 'picto'=>'bill', 'enabled' => isModEnabled('tax'), 'perms' => !empty($user->rights->tax->charges->lire)),
- 'selectpaymentsofsalaries'=>array('label'=>'SalariesPayments', 'picto'=>'salary', 'lang'=>'salaries', 'enabled' => isModEnabled('salaries'), 'perms' => !empty($user->rights->salaries->read)),
- 'selectvariouspayment'=>array('label'=>'VariousPayment', 'picto'=>'payment', 'enabled' => isModEnabled('banque'), 'perms' => !empty($user->rights->banque->lire)),
- 'selectloanspayment'=>array('label'=>'PaymentLoan','picto'=>'loan', 'enabled' => isModEnabled('don'), 'perms' => !empty($user->rights->loan->read)),
+ 'selectsupplierinvoices'=>array('label'=>'BillsSuppliers', 'picto'=>'supplier_invoice', 'lang'=>'bills', 'enabled' => isModEnabled('supplier_invoice'), 'perms' => $user->hasRight('fournisseur', 'facture', 'lire')),
+ 'selectexpensereports'=>array('label'=>'ExpenseReports', 'picto'=>'expensereport', 'lang'=>'trips', 'enabled' => isModEnabled('expensereport'), 'perms' => $user->hasRight('expensereport', 'lire')),
+ 'selectdonations'=>array('label'=>'Donations', 'picto'=>'donation', 'lang'=>'donation', 'enabled' => isModEnabled('don'), 'perms' => $user->hasRight('don', 'lire')),
+ 'selectsocialcontributions'=>array('label'=>'SocialContributions', 'picto'=>'bill', 'enabled' => isModEnabled('tax'), 'perms' => $user->hasRight('tax', 'charges', 'lire')),
+ 'selectpaymentsofsalaries'=>array('label'=>'SalariesPayments', 'picto'=>'salary', 'lang'=>'salaries', 'enabled' => isModEnabled('salaries'), 'perms' => $user->hasRight('salaries', 'read')),
+ 'selectvariouspayment'=>array('label'=>'VariousPayment', 'picto'=>'payment', 'enabled' => isModEnabled('banque'), 'perms' => $user->hasRight('banque', 'lire')),
+ 'selectloanspayment'=>array('label'=>'PaymentLoan','picto'=>'loan', 'enabled' => isModEnabled('don'), 'perms' => $user->hasRight('loan', 'read')),
);
diff --git a/htdocs/compta/bank/account_statement_document.php b/htdocs/compta/bank/account_statement_document.php
index a07759ad504..bd210826e37 100644
--- a/htdocs/compta/bank/account_statement_document.php
+++ b/htdocs/compta/bank/account_statement_document.php
@@ -119,7 +119,7 @@ if (GETPOST("rel") == 'prev') {
$found = true;
}
-$permissiontoadd = $user->rights->banque->modifier; // Used by the include of actions_dellink.inc.php
+$permissiontoadd = $user->hasRight('banque', 'modifier'); // Used by the include of actions_dellink.inc.php
/*
@@ -184,8 +184,8 @@ if ($id > 0 || !empty($ref)) {
$modulepart = 'bank';
- $permissiontoadd = $user->rights->banque->modifier;
- $permtoedit = $user->rights->banque->modifier;
+ $permissiontoadd = $user->hasRight('banque', 'modifier');
+ $permtoedit = $user->hasRight('banque', 'modifier');
$param = '&id='.$object->id.'&num='.urlencode($numref);
$moreparam = '&num='.urlencode($numref);
$relativepathwithnofile = $id."/statement/".dol_sanitizeFileName($numref)."/";
diff --git a/htdocs/compta/bank/bankentries_list.php b/htdocs/compta/bank/bankentries_list.php
index c12b7801f43..fbe7f7c247a 100644
--- a/htdocs/compta/bank/bankentries_list.php
+++ b/htdocs/compta/bank/bankentries_list.php
@@ -235,7 +235,7 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x'
if (empty($reshook)) {
$objectclass = 'Account';
$objectlabel = 'BankTransaction';
- $permissiontoread = !empty($user->rights->banque->lire);
+ $permissiontoread = $user->hasRight('banque', 'lire');
$permissiontodelete = $user->hasRight('banque', 'modifier');
$uploaddir = $conf->bank->dir_output;
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
@@ -787,7 +787,6 @@ if ($resql) {
//'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"),
//'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"),
);
- //if ($user->rights->bank->supprimer) $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete");
if (in_array($massaction, array('presend', 'predelete'))) {
$arrayofmassactions = array();
}
diff --git a/htdocs/compta/bank/class/api_bankaccounts.class.php b/htdocs/compta/bank/class/api_bankaccounts.class.php
index b8f9f208e5a..830273e2563 100644
--- a/htdocs/compta/bank/class/api_bankaccounts.class.php
+++ b/htdocs/compta/bank/class/api_bankaccounts.class.php
@@ -67,7 +67,7 @@ class BankAccounts extends DolibarrApi
{
$list = array();
- if (!DolibarrApiAccess::$user->rights->banque->lire) {
+ if (!DolibarrApiAccess::$user->hasRight('banque', 'lire')) {
throw new RestException(403);
}
@@ -129,7 +129,7 @@ class BankAccounts extends DolibarrApi
*/
public function get($id)
{
- if (!DolibarrApiAccess::$user->rights->banque->lire) {
+ if (!DolibarrApiAccess::$user->hasRight('banque', 'lire')) {
throw new RestException(403);
}
@@ -150,7 +150,7 @@ class BankAccounts extends DolibarrApi
*/
public function post($request_data = null)
{
- if (!DolibarrApiAccess::$user->rights->banque->configurer) {
+ if (!DolibarrApiAccess::$user->hasRight('banque', 'configurer')) {
throw new RestException(403);
}
// Check mandatory fields
@@ -201,7 +201,7 @@ class BankAccounts extends DolibarrApi
*/
public function transfer($bankaccount_from_id = 0, $bankaccount_to_id = 0, $date = null, $description = "", $amount = 0.0, $amount_to = 0.0)
{
- if (!DolibarrApiAccess::$user->rights->banque->configurer) {
+ if (!DolibarrApiAccess::$user->hasRight('banque', 'configurer')) {
throw new RestException(403);
}
@@ -325,7 +325,7 @@ class BankAccounts extends DolibarrApi
*/
public function put($id, $request_data = null)
{
- if (!DolibarrApiAccess::$user->rights->banque->configurer) {
+ if (!DolibarrApiAccess::$user->hasRight('banque', 'configurer')) {
throw new RestException(403);
}
@@ -363,7 +363,7 @@ class BankAccounts extends DolibarrApi
*/
public function delete($id)
{
- if (!DolibarrApiAccess::$user->rights->banque->configurer) {
+ if (!DolibarrApiAccess::$user->hasRight('banque', 'configurer')) {
throw new RestException(403);
}
$account = new Account($this->db);
@@ -436,7 +436,7 @@ class BankAccounts extends DolibarrApi
{
$list = array();
- if (!DolibarrApiAccess::$user->rights->banque->lire) {
+ if (!DolibarrApiAccess::$user->hasRight('banque', 'lire')) {
throw new RestException(403);
}
@@ -499,7 +499,7 @@ class BankAccounts extends DolibarrApi
*/
public function addLine($id, $date, $type, $label, $amount, $category = 0, $cheque_number = '', $cheque_writer = '', $cheque_bank = '', $accountancycode = '', $datev = null, $num_releve = '')
{
- if (!DolibarrApiAccess::$user->rights->banque->modifier) {
+ if (!DolibarrApiAccess::$user->hasRight('banque', 'modifier')) {
throw new RestException(403);
}
@@ -552,7 +552,7 @@ class BankAccounts extends DolibarrApi
*/
public function addLink($id, $line_id, $url_id, $url, $label, $type)
{
- if (!DolibarrApiAccess::$user->rights->banque->modifier) {
+ if (!DolibarrApiAccess::$user->hasRight('banque', 'modifier')) {
throw new RestException(403);
}
@@ -595,7 +595,7 @@ class BankAccounts extends DolibarrApi
{
$list = array();
- if (!DolibarrApiAccess::$user->rights->banque->lire) {
+ if (!DolibarrApiAccess::$user->hasRight('banque', 'lire')) {
throw new RestException(403);
}
diff --git a/htdocs/compta/bank/class/paymentvarious.class.php b/htdocs/compta/bank/class/paymentvarious.class.php
index 5215cb53170..f74034a103b 100644
--- a/htdocs/compta/bank/class/paymentvarious.class.php
+++ b/htdocs/compta/bank/class/paymentvarious.class.php
@@ -60,18 +60,50 @@ class PaymentVarious extends CommonObject
* @var int timestamp
*/
public $tms;
+
+ /**
+ * @var int timestamp
+ */
public $datep;
+
+ /**
+ * @var int timestamp
+ */
public $datev;
/**
- * @var int sens of operation
+ * @var int<0,1> Payment direction (debit or credit)
*/
public $sens;
+
+ /**
+ * @var float
+ */
public $amount;
+
+ /**
+ * @var int Payment type (fk_typepayment)
+ */
public $type_payment;
+
+ /**
+ * @var string Payment reference
+ */
public $num_payment;
+
+ /**
+ * @var string Name of cheque writer
+ */
public $chqemetteur;
+
+ /**
+ * @var string Bank of cheque writer
+ */
public $chqbank;
+
+ /**
+ * @var int Category id
+ */
public $category_transaction;
/**
@@ -499,7 +531,7 @@ class PaymentVarious extends CommonObject
$result = $this->db->query($sql);
if ($result) {
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."payment_various");
- $this->ref = $this->id;
+ $this->ref = (string) $this->id;
if ($this->id > 0) {
if (isModEnabled("banque") && !empty($this->amount)) {
diff --git a/htdocs/compta/bank/document.php b/htdocs/compta/bank/document.php
index 522b2d56939..5e3eef6e06e 100644
--- a/htdocs/compta/bank/document.php
+++ b/htdocs/compta/bank/document.php
@@ -76,7 +76,7 @@ if ($id > 0 || !empty($ref)) {
$result = restrictedArea($user, 'banque', $object->id, 'bank_account', '', '');
-$permissiontoadd = $user->rights->banque->modifier; // Used by the include of actions_dellink.inc.php
+$permissiontoadd = $user->hasRight('banque', 'modifier'); // Used by the include of actions_dellink.inc.php
/*
@@ -139,8 +139,8 @@ if ($id > 0 || !empty($ref)) {
$modulepart = 'bank';
- $permissiontoadd = $user->rights->banque->modifier;
- $permtoedit = $user->rights->banque->modifier;
+ $permissiontoadd = $user->hasRight('banque', 'modifier');
+ $permtoedit = $user->hasRight('banque', 'modifier');
$param = '&id='.$object->id;
include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
} else {
diff --git a/htdocs/compta/bank/line.php b/htdocs/compta/bank/line.php
index 41875945a1b..0679b01951c 100644
--- a/htdocs/compta/bank/line.php
+++ b/htdocs/compta/bank/line.php
@@ -375,7 +375,7 @@ if ($result) {
$i++;
// Bank account
- print '
'.$langs->trans("Account").'
';
+ print '
'.$langs->trans("BankAccount").'
';
print '
';
// $objp->fk_account may be not > 0 if data was lost by an old bug. In such a case, we let a chance to user to fix it.
if (($objp->rappro || $bankline->getVentilExportCompta()) && $objp->fk_account > 0) {
@@ -495,9 +495,6 @@ if ($result) {
print '
';
}
- //$user->rights->banque->modifier=false;
- //$user->rights->banque->consolidate=true;
-
// Type of payment / Number
print "
";
// Code to adjust value date with plus and less picto using an Ajax call instead of a full reload of page
- /* Not yet ready. We must manage inline replacemet of input date field
+ /* Not yet ready. We must manage inline replacement of input date field
$urlajax = DOL_URL_ROOT.'/core/ajax/bankconciliate.php?token='.currentToken();
print '
+
">
-
id.'&mainmenu=home';
-/**
- * Show list
- */
+
+// Show list of contact links
+
print '
';
}
diff --git a/htdocs/ecm/file_note.php b/htdocs/ecm/file_note.php
index 4b4df1321ea..6624936141b 100644
--- a/htdocs/ecm/file_note.php
+++ b/htdocs/ecm/file_note.php
@@ -106,9 +106,9 @@ if ($result < 0) {
exit;
}
-$permissionnote = $user->rights->ecm->setup; // Used by the include of actions_setnotes.inc.php
+$permissionnote = $user->hasRight('ecm', 'setup'); // Used by the include of actions_setnotes.inc.php
-$permissiontoread = $user->rights->ecm->read;
+$permissiontoread = $user->hasRight('ecm', 'read');
if (!$permissiontoread) {
accessforbidden();
diff --git a/htdocs/ecm/search.php b/htdocs/ecm/search.php
index 889d205cf74..ca847e61fee 100644
--- a/htdocs/ecm/search.php
+++ b/htdocs/ecm/search.php
@@ -85,7 +85,7 @@ if (!empty($section)) {
}
}
-$permissiontoread = $user->rights->ecm->read;
+$permissiontoread = $user->hasRight('ecm', 'read');
if (!$permissiontoread) {
accessforbidden();
diff --git a/htdocs/emailcollector/class/emailcollector.class.php b/htdocs/emailcollector/class/emailcollector.class.php
index e36f7fced7d..a69a9d1f36b 100644
--- a/htdocs/emailcollector/class/emailcollector.class.php
+++ b/htdocs/emailcollector/class/emailcollector.class.php
@@ -2672,7 +2672,7 @@ class EmailCollector extends CommonObject
if (!dol_is_dir($destdir)) {
dol_mkdir($destdir);
}
- if (!empty($conf->global->MAIN_IMAP_USE_PHPIMAP)) {
+ if (getDolGlobalString('MAIN_IMAP_USE_PHPIMAP')) {
foreach ($attachments as $attachment) {
$attachment->save($destdir.'/');
}
diff --git a/htdocs/eventorganization/conferenceorbooth_card.php b/htdocs/eventorganization/conferenceorbooth_card.php
index 21d38f947b6..9364a637788 100644
--- a/htdocs/eventorganization/conferenceorbooth_card.php
+++ b/htdocs/eventorganization/conferenceorbooth_card.php
@@ -86,11 +86,11 @@ if (empty($action) && empty($id) && empty($ref)) {
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once.
// Permissions
-$permissiontoread = $user->rights->eventorganization->read;
-$permissiontoadd = $user->rights->eventorganization->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
+$permissiontoread = $user->hasRight('eventorganization', 'read');
+$permissiontoadd = $user->hasRight('eventorganization', 'write'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
$permissiontodelete = $user->rights->eventorganization->delete || ($permissiontoadd && isset($object->status) && $object->status == $object::STATUS_DRAFT);
-$permissionnote = $user->rights->eventorganization->write; // Used by the include of actions_setnotes.inc.php
-$permissiondellink = $user->rights->eventorganization->write; // Used by the include of actions_dellink.inc.php
+$permissionnote = $user->hasRight('eventorganization', 'write'); // Used by the include of actions_setnotes.inc.php
+$permissiondellink = $user->hasRight('eventorganization', 'write'); // Used by the include of actions_dellink.inc.php
$upload_dir = $conf->eventorganization->multidir_output[isset($object->entity) ? $object->entity : 1];
// Security check
@@ -632,8 +632,8 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
$relativepath = $objref.'/'.$objref.'.pdf';
$filedir = $conf->eventorganization->dir_output.'/'.$object->element.'/'.$objref;
$urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id;
- $genallowed = $user->rights->eventorganization->read; // If you can read, you can build the PDF to read content
- $delallowed = $user->rights->eventorganization->write; // If you can create/edit, you can remove a file on card
+ $genallowed = $user->hasRight('eventorganization', 'read'); // If you can read, you can build the PDF to read content
+ $delallowed = $user->hasRight('eventorganization', 'write'); // If you can create/edit, you can remove a file on card
print $formfile->showdocuments('eventorganization', $object->element.'/'.$objref, $filedir, $urlsource, 0, $delallowed, $object->model_pdf, 0, 0, 0, 28, 0, '', '', '', $langs->defaultlang);
}
diff --git a/htdocs/eventorganization/conferenceorbooth_contact.php b/htdocs/eventorganization/conferenceorbooth_contact.php
index b02996ebff8..b365fc7aec8 100644
--- a/htdocs/eventorganization/conferenceorbooth_contact.php
+++ b/htdocs/eventorganization/conferenceorbooth_contact.php
@@ -77,11 +77,11 @@ if ($user->socid > 0) {
$isdraft = (($object->status== $object::STATUS_DRAFT) ? 1 : 0);
$result = restrictedArea($user, 'eventorganization', $object->id, '', '', 'fk_soc', 'rowid', $isdraft);
-$permissiontoread = $user->rights->eventorganization->read;
-$permissiontoadd = $user->rights->eventorganization->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
+$permissiontoread = $user->hasRight('eventorganization', 'read');
+$permissiontoadd = $user->hasRight('eventorganization', 'write'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
$permissiontodelete = $user->rights->eventorganization->delete || ($permissiontoadd && isset($object->status) && $object->status == $object::STATUS_DRAFT);
-$permissionnote = $user->rights->eventorganization->write; // Used by the include of actions_setnotes.inc.php
-$permissiondellink = $user->rights->eventorganization->write; // Used by the include of actions_dellink.inc.php
+$permissionnote = $user->hasRight('eventorganization', 'write'); // Used by the include of actions_setnotes.inc.php
+$permissiondellink = $user->hasRight('eventorganization', 'write'); // Used by the include of actions_dellink.inc.php
$upload_dir = $conf->eventorganization->multidir_output[isset($object->entity) ? $object->entity : 1];
// Security check
diff --git a/htdocs/eventorganization/conferenceorbooth_document.php b/htdocs/eventorganization/conferenceorbooth_document.php
index b341e6a2134..2e759c02658 100644
--- a/htdocs/eventorganization/conferenceorbooth_document.php
+++ b/htdocs/eventorganization/conferenceorbooth_document.php
@@ -91,11 +91,11 @@ if ($id > 0 || !empty($ref)) {
}
// Permissions
-$permissiontoread = $user->rights->eventorganization->read;
-$permissiontoadd = $user->rights->eventorganization->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
+$permissiontoread = $user->hasRight('eventorganization', 'read');
+$permissiontoadd = $user->hasRight('eventorganization', 'write'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
$permissiontodelete = $user->rights->eventorganization->delete || ($permissiontoadd && isset($object->status) && $object->status == $object::STATUS_DRAFT);
-$permissionnote = $user->rights->eventorganization->write; // Used by the include of actions_setnotes.inc.php
-$permissiondellink = $user->rights->eventorganization->write; // Used by the include of actions_dellink.inc.php
+$permissionnote = $user->hasRight('eventorganization', 'write'); // Used by the include of actions_setnotes.inc.php
+$permissiondellink = $user->hasRight('eventorganization', 'write'); // Used by the include of actions_dellink.inc.php
$upload_dir = $conf->eventorganization->multidir_output[isset($object->entity) ? $object->entity : 1];
// Security check
@@ -395,10 +395,6 @@ if ($object->id) {
print dol_get_fiche_end();
$modulepart = 'eventorganization';
- //$permission = $user->rights->eventorganization->conferenceorbooth->write;
- $permission = 1;
- //$permtoedit = $user->rights->eventorganization->conferenceorbooth->write;
- $permtoedit = 1;
$param = '&id='.$object->id;
//$param = '';
if ($withproject) {
diff --git a/htdocs/eventorganization/conferenceorbooth_list.php b/htdocs/eventorganization/conferenceorbooth_list.php
index 39f88d01a66..6c9f2b0525a 100644
--- a/htdocs/eventorganization/conferenceorbooth_list.php
+++ b/htdocs/eventorganization/conferenceorbooth_list.php
@@ -134,9 +134,9 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
$object->fields = dol_sort_array($object->fields, 'position');
$arrayfields = dol_sort_array($arrayfields, 'position');
-$permissiontoread = $user->rights->eventorganization->read;
-$permissiontoadd = $user->rights->eventorganization->write;
-$permissiontodelete = $user->rights->eventorganization->delete;
+$permissiontoread = $user->hasRight('eventorganization', 'read');
+$permissiontoadd = $user->hasRight('eventorganization', 'write');
+$permissiontodelete = $user->hasRight('eventorganization', 'delete');
// Security check
if (!isModEnabled('eventorganization')) {
diff --git a/htdocs/eventorganization/conferenceorboothattendee_card.php b/htdocs/eventorganization/conferenceorboothattendee_card.php
index d0cc03cde79..a80dfe8075e 100644
--- a/htdocs/eventorganization/conferenceorboothattendee_card.php
+++ b/htdocs/eventorganization/conferenceorboothattendee_card.php
@@ -113,11 +113,11 @@ if ($object->fk_project > 0) {
}
// Permissions
-$permissiontoread = $user->rights->eventorganization->read;
-$permissiontoadd = $user->rights->eventorganization->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
+$permissiontoread = $user->hasRight('eventorganization', 'read');
+$permissiontoadd = $user->hasRight('eventorganization', 'write'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
$permissiontodelete = $user->rights->eventorganization->delete || ($permissiontoadd && isset($object->status) && $object->status == $object::STATUS_DRAFT);
-$permissionnote = $user->rights->eventorganization->write; // Used by the include of actions_setnotes.inc.php
-$permissiondellink = $user->rights->eventorganization->write; // Used by the include of actions_dellink.inc.php
+$permissionnote = $user->hasRight('eventorganization', 'write'); // Used by the include of actions_setnotes.inc.php
+$permissiondellink = $user->hasRight('eventorganization', 'write'); // Used by the include of actions_dellink.inc.php
$upload_dir = $conf->eventorganization->multidir_output[isset($object->entity) ? $object->entity : 1];
@@ -637,8 +637,8 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
$relativepath = $objref.'/'.$objref.'.pdf';
$filedir = $conf->eventorganization->dir_output.'/'.$object->element.'/'.$objref;
$urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id;
- $genallowed = $user->rights->eventorganization->conferenceorboothattendee->read; // If you can read, you can build the PDF to read content
- $delallowed = $user->rights->eventorganization->conferenceorboothattendee->write; // If you can create/edit, you can remove a file on card
+ $genallowed = $user->hasRight('eventorganization', 'conferenceorboothattendee', 'read'); // If you can read, you can build the PDF to read content
+ $delallowed = $user->hasRight('eventorganization', 'conferenceorboothattendee', 'write'); // If you can create/edit, you can remove a file on card
print $formfile->showdocuments('eventorganization:ConferenceOrBoothAttendee', $object->element.'/'.$objref, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 1, 0, 0, 28, 0, '', '', '', $langs->defaultlang);
}
diff --git a/htdocs/eventorganization/conferenceorboothattendee_list.php b/htdocs/eventorganization/conferenceorboothattendee_list.php
index 006b870fd93..5164436088f 100644
--- a/htdocs/eventorganization/conferenceorboothattendee_list.php
+++ b/htdocs/eventorganization/conferenceorboothattendee_list.php
@@ -143,9 +143,9 @@ $object->fields = dol_sort_array($object->fields, 'position');
$arrayfields = dol_sort_array($arrayfields, 'position');
// Permissions
-$permissiontoread = $user->rights->eventorganization->read;
-$permissiontoadd = $user->rights->eventorganization->write;
-$permissiontodelete = $user->rights->eventorganization->delete;
+$permissiontoread = $user->hasRight('eventorganization', 'read');
+$permissiontoadd = $user->hasRight('eventorganization', 'write');
+$permissiontodelete = $user->hasRight('eventorganization', 'delete');
// Security check
if (empty($conf->eventorganization->enabled)) {
diff --git a/htdocs/eventorganization/conferenceorboothattendee_note.php b/htdocs/eventorganization/conferenceorboothattendee_note.php
index 8dba83ebadf..0ca03d3bcc4 100644
--- a/htdocs/eventorganization/conferenceorboothattendee_note.php
+++ b/htdocs/eventorganization/conferenceorboothattendee_note.php
@@ -106,8 +106,8 @@ if ($id > 0 || !empty($ref)) {
}
// Permissions
-$permissionnote = $user->rights->eventorganization->conferenceorboothattendee->write; // Used by the include of actions_setnotes.inc.php
-$permissiontoadd = $user->rights->eventorganization->conferenceorboothattendee->write; // Used by the include of actions_addupdatedelete.inc.php
+$permissionnote = $user->hasRight('eventorganization', 'conferenceorboothattendee', 'write'); // Used by the include of actions_setnotes.inc.php
+$permissiontoadd = $user->hasRight('eventorganization', 'conferenceorboothattendee', 'write'); // Used by the include of actions_addupdatedelete.inc.php
diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php
index 6bf40733ed9..6826801e965 100644
--- a/htdocs/expedition/card.php
+++ b/htdocs/expedition/card.php
@@ -125,8 +125,8 @@ if ($user->socid) {
$result = restrictedArea($user, 'expedition', $object->id, '');
-$permissiondellink = $user->rights->expedition->delivery->creer; // Used by the include of actions_dellink.inc.php
-$permissiontoadd = $user->rights->expedition->creer;
+$permissiondellink = $user->hasRight('expedition', 'delivery', 'creer'); // Used by the include of actions_dellink.inc.php
+$permissiontoadd = $user->hasRight('expedition', 'creer');
/*
@@ -2730,8 +2730,8 @@ if ($action == 'create') {
$urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id;
- $genallowed = $user->rights->expedition->lire;
- $delallowed = $user->rights->expedition->creer;
+ $genallowed = $user->hasRight('expedition', 'lire');
+ $delallowed = $user->hasRight('expedition', 'creer');
print $formfile->showdocuments('expedition', $objectref, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 1, 0, 0, 28, 0, '', '', '', $soc->default_lang);
diff --git a/htdocs/expedition/class/api_shipments.class.php b/htdocs/expedition/class/api_shipments.class.php
index fe3c778153f..d46d7e57ea5 100644
--- a/htdocs/expedition/class/api_shipments.class.php
+++ b/htdocs/expedition/class/api_shipments.class.php
@@ -64,7 +64,7 @@ class Shipments extends DolibarrApi
*/
public function get($id)
{
- if (!DolibarrApiAccess::$user->rights->expedition->lire) {
+ if (!DolibarrApiAccess::$user->hasRight('expedition', 'lire')) {
throw new RestException(403);
}
@@ -103,7 +103,7 @@ class Shipments extends DolibarrApi
{
global $db, $conf;
- if (!DolibarrApiAccess::$user->rights->expedition->lire) {
+ if (!DolibarrApiAccess::$user->hasRight('expedition', 'lire')) {
throw new RestException(403);
}
@@ -114,7 +114,7 @@ class Shipments extends DolibarrApi
// If the internal user must only see his customers, force searching by him
$search_sale = 0;
- if (!DolibarrApiAccess::$user->rights->societe->client->voir && !$socids) {
+ if (!DolibarrApiAccess::$user->hasRight('societe', 'client', 'voir') && !$socids) {
$search_sale = DolibarrApiAccess::$user->id;
}
@@ -182,7 +182,7 @@ class Shipments extends DolibarrApi
*/
public function post($request_data = null)
{
- if (!DolibarrApiAccess::$user->rights->expedition->creer) {
+ if (!DolibarrApiAccess::$user->hasRight('expedition', 'creer')) {
throw new RestException(401, "Insuffisant rights");
}
// Check mandatory fields
@@ -224,7 +224,7 @@ class Shipments extends DolibarrApi
/*
public function getLines($id)
{
- if(! DolibarrApiAccess::$user->rights->expedition->lire) {
+ if(! DolibarrApiAccess::$user->hasRight('expedition', 'lire')) {
throw new RestException(403);
}
@@ -258,7 +258,7 @@ class Shipments extends DolibarrApi
/*
public function postLine($id, $request_data = null)
{
- if(! DolibarrApiAccess::$user->rights->expedition->creer) {
+ if(! DolibarrApiAccess::$user->hasRight('expedition', 'creer')) {
throw new RestException(403);
}
@@ -326,7 +326,7 @@ class Shipments extends DolibarrApi
/*
public function putLine($id, $lineid, $request_data = null)
{
- if (! DolibarrApiAccess::$user->rights->expedition->creer) {
+ if (! DolibarrApiAccess::$user->hasRight('expedition', 'creer')) {
throw new RestException(403);
}
@@ -393,7 +393,7 @@ class Shipments extends DolibarrApi
*/
public function deleteLine($id, $lineid)
{
- if (!DolibarrApiAccess::$user->rights->expedition->creer) {
+ if (!DolibarrApiAccess::$user->hasRight('expedition', 'creer')) {
throw new RestException(403);
}
@@ -426,7 +426,7 @@ class Shipments extends DolibarrApi
*/
public function put($id, $request_data = null)
{
- if (!DolibarrApiAccess::$user->rights->expedition->creer) {
+ if (!DolibarrApiAccess::$user->hasRight('expedition', 'creer')) {
throw new RestException(403);
}
@@ -467,7 +467,7 @@ class Shipments extends DolibarrApi
*/
public function delete($id)
{
- if (!DolibarrApiAccess::$user->rights->expedition->supprimer) {
+ if (!DolibarrApiAccess::$user->hasRight('expedition', 'supprimer')) {
throw new RestException(403);
}
$result = $this->shipment->fetch($id);
@@ -512,7 +512,7 @@ class Shipments extends DolibarrApi
*/
public function validate($id, $notrigger = 0)
{
- if (!DolibarrApiAccess::$user->rights->expedition->creer) {
+ if (!DolibarrApiAccess::$user->hasRight('expedition', 'creer')) {
throw new RestException(403);
}
$result = $this->shipment->fetch($id);
@@ -558,7 +558,7 @@ class Shipments extends DolibarrApi
public function setinvoiced($id)
{
- if(! DolibarrApiAccess::$user->rights->expedition->creer) {
+ if(! DolibarrApiAccess::$user->hasRight('expedition', 'creer')) {
throw new RestException(403);
}
if(empty($id)) {
@@ -597,10 +597,10 @@ class Shipments extends DolibarrApi
require_once DOL_DOCUMENT_ROOT . '/commande/class/commande.class.php';
- if(! DolibarrApiAccess::$user->rights->expedition->lire) {
+ if(! DolibarrApiAccess::$user->hasRight('expedition', 'lire')) {
throw new RestException(403);
}
- if(! DolibarrApiAccess::$user->rights->expedition->creer) {
+ if(! DolibarrApiAccess::$user->hasRight('expedition', 'creer')) {
throw new RestException(403);
}
if(empty($proposalid)) {
@@ -634,7 +634,7 @@ class Shipments extends DolibarrApi
*/
public function close($id, $notrigger = 0)
{
- if (!DolibarrApiAccess::$user->rights->expedition->creer) {
+ if (!DolibarrApiAccess::$user->hasRight('expedition', 'creer')) {
throw new RestException(403);
}
diff --git a/htdocs/expedition/dispatch.php b/htdocs/expedition/dispatch.php
index cc3a31140ee..72c74a3f357 100644
--- a/htdocs/expedition/dispatch.php
+++ b/htdocs/expedition/dispatch.php
@@ -299,7 +299,7 @@ if ($action == 'updatelines' && $usercancreate) {
}
}
- // If module stock is enabled and the stock decrease is done on edtion of this page
+ // If module stock is enabled and the stock decrease is done on edition of this page
/*
if (!$error && GETPOST($ent, 'int') > 0 && isModEnabled('stock') && !empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT_DISPATCH_ORDER)) {
$mouv = new MouvementStock($db);
diff --git a/htdocs/expedition/document.php b/htdocs/expedition/document.php
index f8aef745d16..fdc58396d3d 100644
--- a/htdocs/expedition/document.php
+++ b/htdocs/expedition/document.php
@@ -95,7 +95,7 @@ if ($user->socid) {
}
$result = restrictedArea($user, 'expedition', $object->id, '');
-$permissiontoadd = $user->rights->expedition->creer; // Used by the include of actions_dellink.inc.php
+$permissiontoadd = $user->hasRight('expedition', 'creer'); // Used by the include of actions_dellink.inc.php
/*
@@ -185,8 +185,8 @@ if ($id > 0 || !empty($ref)) {
print dol_get_fiche_end();
$modulepart = 'expedition';
- $permissiontoadd = $user->rights->expedition->creer;
- $permtoedit = $user->rights->expedition->creer;
+ $permissiontoadd = $user->hasRight('expedition', 'creer');
+ $permtoedit = $user->hasRight('expedition', 'creer');
$param = '&id='.$object->id;
include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
} else {
diff --git a/htdocs/expedition/list.php b/htdocs/expedition/list.php
index 2f58d6cd36a..a3e117c8662 100644
--- a/htdocs/expedition/list.php
+++ b/htdocs/expedition/list.php
@@ -207,9 +207,9 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x'
if (empty($reshook)) {
$objectclass = 'Expedition';
$objectlabel = 'Sendings';
- $permissiontoread = $user->rights->expedition->lire;
- $permissiontoadd = $user->rights->expedition->creer;
- $permissiontodelete = $user->rights->expedition->supprimer;
+ $permissiontoread = $user->hasRight('expedition', 'lire');
+ $permissiontoadd = $user->hasRight('expedition', 'creer');
+ $permissiontodelete = $user->hasRight('expedition', 'supprimer');
$uploaddir = $conf->expedition->dir_output.'/sending';
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
@@ -1224,8 +1224,8 @@ $urlsource = $_SERVER['PHP_SELF'].'?sortfield='.$sortfield.'&sortorder='.$sorto
$urlsource .= str_replace('&', '&', $param);
$filedir = $diroutputmassaction;
-$genallowed = $user->rights->expedition->lire;
-$delallowed = $user->rights->expedition->creer;
+$genallowed = $user->hasRight('expedition', 'lire');
+$delallowed = $user->hasRight('expedition', 'creer');
$title = '';
print $formfile->showdocuments('massfilesarea_sendings', '', $filedir, $urlsource, 0, $delallowed, '', 1, 1, 0, 48, 1, $param, $title, '', '', '', null, $hidegeneratedfilelistifempty);
diff --git a/htdocs/expedition/note.php b/htdocs/expedition/note.php
index 78fbcc8685b..b2e6db874ba 100644
--- a/htdocs/expedition/note.php
+++ b/htdocs/expedition/note.php
@@ -64,7 +64,7 @@ if ($id > 0 || !empty($ref)) {
$upload_dir = $conf->expedition->dir_output."/sending/".dol_sanitizeFileName($object->ref);
}
-$permissionnote = $user->rights->expedition->creer; // Used by the include of actions_setnotes.inc.php
+$permissionnote = $user->hasRight('expedition', 'creer'); // Used by the include of actions_setnotes.inc.php
// Security check
if ($user->socid) {
diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php
index 86a661d59c2..1b4a82db1b4 100644
--- a/htdocs/expensereport/card.php
+++ b/htdocs/expensereport/card.php
@@ -113,9 +113,9 @@ include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be includ
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$hookmanager->initHooks(array('expensereportcard', 'globalcard'));
-$permissionnote = $user->rights->expensereport->creer; // Used by the include of actions_setnotes.inc.php
-$permissiondellink = $user->rights->expensereport->creer; // Used by the include of actions_dellink.inc.php
-$permissiontoadd = $user->rights->expensereport->creer; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
+$permissionnote = $user->hasRight('expensereport', 'creer'); // Used by the include of actions_setnotes.inc.php
+$permissiondellink = $user->hasRight('expensereport', 'creer'); // Used by the include of actions_dellink.inc.php
+$permissiontoadd = $user->hasRight('expensereport', 'creer'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
$upload_dir = $conf->expensereport->dir_output.'/'.dol_sanitizeFileName($object->ref);
@@ -150,7 +150,7 @@ if ($user->socid) {
}
$result = restrictedArea($user, 'expensereport', $object->id, 'expensereport');
-$permissiontoadd = $user->rights->expensereport->creer; // Used by the include of actions_dellink.inc.php
+$permissiontoadd = $user->hasRight('expensereport', 'creer'); // Used by the include of actions_dellink.inc.php
/*
@@ -2853,8 +2853,8 @@ if ($action != 'presend') {
$filename = dol_sanitizeFileName($object->ref);
$filedir = $conf->expensereport->dir_output."/".dol_sanitizeFileName($object->ref);
$urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id;
- $genallowed = $user->rights->expensereport->creer;
- $delallowed = $user->rights->expensereport->creer;
+ $genallowed = $user->hasRight('expensereport', 'creer');
+ $delallowed = $user->hasRight('expensereport', 'creer');
$var = true;
print $formfile->showdocuments('expensereport', $filename, $filedir, $urlsource, $genallowed, $delallowed);
$somethingshown = $formfile->numoffiles;
diff --git a/htdocs/expensereport/class/api_expensereports.class.php b/htdocs/expensereport/class/api_expensereports.class.php
index 27f7601e9ef..a16d6646eb9 100644
--- a/htdocs/expensereport/class/api_expensereports.class.php
+++ b/htdocs/expensereport/class/api_expensereports.class.php
@@ -64,7 +64,7 @@ class ExpenseReports extends DolibarrApi
*/
public function get($id)
{
- if (!DolibarrApiAccess::$user->rights->expensereport->lire) {
+ if (!DolibarrApiAccess::$user->hasRight('expensereport', 'lire')) {
throw new RestException(403);
}
@@ -99,7 +99,7 @@ class ExpenseReports extends DolibarrApi
{
global $db, $conf;
- if (!DolibarrApiAccess::$user->rights->expensereport->lire) {
+ if (!DolibarrApiAccess::$user->hasRight('expensereport', 'lire')) {
throw new RestException(403);
}
@@ -163,7 +163,7 @@ class ExpenseReports extends DolibarrApi
*/
public function post($request_data = null)
{
- if (!DolibarrApiAccess::$user->rights->expensereport->creer) {
+ if (!DolibarrApiAccess::$user->hasRight('expensereport', 'creer')) {
throw new RestException(401, "Insuffisant rights");
}
@@ -205,7 +205,7 @@ class ExpenseReports extends DolibarrApi
/*
public function getLines($id)
{
- if(! DolibarrApiAccess::$user->rights->expensereport->lire) {
+ if(! DolibarrApiAccess::$user->hasRight('expensereport', 'lire')) {
throw new RestException(403);
}
@@ -239,7 +239,7 @@ class ExpenseReports extends DolibarrApi
/*
public function postLine($id, $request_data = null)
{
- if(! DolibarrApiAccess::$user->rights->expensereport->creer) {
+ if(! DolibarrApiAccess::$user->hasRight('expensereport', 'creer')) {
throw new RestException(403);
}
@@ -307,7 +307,7 @@ class ExpenseReports extends DolibarrApi
/*
public function putLine($id, $lineid, $request_data = null)
{
- if(! DolibarrApiAccess::$user->rights->expensereport->creer) {
+ if(! DolibarrApiAccess::$user->hasRight('expensereport', 'creer')) {
throw new RestException(403);
}
@@ -371,7 +371,7 @@ class ExpenseReports extends DolibarrApi
/*
public function deleteLine($id, $lineid)
{
- if(! DolibarrApiAccess::$user->rights->expensereport->creer) {
+ if(! DolibarrApiAccess::$user->hasRight('expensereport', 'creer')) {
throw new RestException(403);
}
@@ -408,7 +408,7 @@ class ExpenseReports extends DolibarrApi
*/
public function put($id, $request_data = null)
{
- if (!DolibarrApiAccess::$user->rights->expensereport->creer) {
+ if (!DolibarrApiAccess::$user->hasRight('expensereport', 'creer')) {
throw new RestException(403);
}
@@ -449,7 +449,7 @@ class ExpenseReports extends DolibarrApi
*/
public function delete($id)
{
- if (!DolibarrApiAccess::$user->rights->expensereport->supprimer) {
+ if (!DolibarrApiAccess::$user->hasRight('expensereport', 'supprimer')) {
throw new RestException(403);
}
@@ -459,7 +459,7 @@ class ExpenseReports extends DolibarrApi
}
if (!DolibarrApi::_checkAccessToResource('expensereport', $this->expensereport->id)) {
- throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
+ throw new RestException(403, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
}
if (!$this->expensereport->delete(DolibarrApiAccess::$user)) {
@@ -492,7 +492,7 @@ class ExpenseReports extends DolibarrApi
/*
public function validate($id, $idwarehouse=0)
{
- if(! DolibarrApiAccess::$user->rights->expensereport->creer) {
+ if(! DolibarrApiAccess::$user->hasRight('expensereport', 'creer')) {
throw new RestException(403);
}
diff --git a/htdocs/expensereport/class/paymentexpensereport.class.php b/htdocs/expensereport/class/paymentexpensereport.class.php
index 7ffe3f3987d..6ce84881a73 100644
--- a/htdocs/expensereport/class/paymentexpensereport.class.php
+++ b/htdocs/expensereport/class/paymentexpensereport.class.php
@@ -754,7 +754,7 @@ class PaymentExpenseReport extends CommonObject
$return .= ' '.$langs->trans("Type").' : '.$this->fk_typepayment.'';
}
if (property_exists($this, 'fk_bank') && !is_null($this->fk_bank)) {
- $return .= ' '.$langs->trans("Account").' : '.$this->fk_bank.'';
+ $return .= ' '.$langs->trans("BankAccount").' : '.$this->fk_bank.'';
}
if (property_exists($this, 'amount')) {
$return .= ' '.$langs->trans("Amount").' : '.price($this->amount).'';
diff --git a/htdocs/expensereport/document.php b/htdocs/expensereport/document.php
index cdc82a205e3..d801b93b484 100644
--- a/htdocs/expensereport/document.php
+++ b/htdocs/expensereport/document.php
@@ -95,7 +95,7 @@ if ($object->id > 0) {
}
}
-$permissiontoadd = $user->rights->expensereport->creer; // Used by the include of actions_dellink.inc.php
+$permissiontoadd = $user->hasRight('expensereport', 'creer'); // Used by the include of actions_dellink.inc.php
/*
@@ -156,8 +156,8 @@ if ($object->id) {
$modulepart = 'expensereport';
- $permissiontoadd = $user->rights->expensereport->creer;
- $permtoedit = $user->rights->expensereport->creer;
+ $permissiontoadd = $user->hasRight('expensereport', 'creer');
+ $permtoedit = $user->hasRight('expensereport', 'creer');
$param = '&id='.$object->id;
include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
} else {
diff --git a/htdocs/expensereport/list.php b/htdocs/expensereport/list.php
index 0d371731c90..47364111920 100644
--- a/htdocs/expensereport/list.php
+++ b/htdocs/expensereport/list.php
@@ -238,8 +238,8 @@ if (empty($reshook)) {
// Mass actions
$objectclass = 'ExpenseReport';
$objectlabel = 'ExpenseReport';
- $permissiontoread = $user->rights->expensereport->lire;
- $permissiontodelete = $user->rights->expensereport->supprimer;
+ $permissiontoread = $user->hasRight('expensereport', 'lire');
+ $permissiontodelete = $user->hasRight('expensereport', 'supprimer');
$uploaddir = $conf->expensereport->dir_output;
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
}
@@ -497,8 +497,8 @@ if ($resql) {
$childids = $user->getAllChildIds(1);
- $canedit = ((in_array($user_id, $childids) && $user->rights->expensereport->creer)
- || ($conf->global->MAIN_USE_ADVANCED_PERMS && $user->rights->expensereport->writeall_advance));
+ $canedit = ((in_array($user_id, $childids) && $user->hasRight('expensereport', 'creer'))
+ || ($conf->global->MAIN_USE_ADVANCED_PERMS && $user->hasRight('expensereport', 'writeall_advance')));
// Buttons for actions
if ($canedit) {
@@ -1010,8 +1010,8 @@ if ($resql) {
$urlsource .= str_replace('&', '&', $param);
$filedir = $diroutputmassaction;
- $genallowed = $user->rights->expensereport->lire;
- $delallowed = $user->rights->expensereport->creer;
+ $genallowed = $user->hasRight('expensereport', 'lire');
+ $delallowed = $user->hasRight('expensereport', 'creer');
print $formfile->showdocuments('massfilesarea_expensereport', '', $filedir, $urlsource, 0, $delallowed, '', 1, 1, 0, 48, 1, $param, $title, '', '', '', null, $hidegeneratedfilelistifempty);
}
diff --git a/htdocs/expensereport/note.php b/htdocs/expensereport/note.php
index 3b10af46bc5..b13291998df 100644
--- a/htdocs/expensereport/note.php
+++ b/htdocs/expensereport/note.php
@@ -55,7 +55,7 @@ if (!$object->fetch($id, $ref) > 0) {
dol_print_error($db);
}
-$permissionnote = $user->rights->expensereport->creer; // Used by the include of actions_setnotes.inc.php
+$permissionnote = $user->hasRight('expensereport', 'creer'); // Used by the include of actions_setnotes.inc.php
if ($object->id > 0) {
// Check current user can read this expense report
diff --git a/htdocs/expensereport/payment/list.php b/htdocs/expensereport/payment/list.php
index 5b67b635ff4..ee6ad1dc38c 100644
--- a/htdocs/expensereport/payment/list.php
+++ b/htdocs/expensereport/payment/list.php
@@ -107,7 +107,7 @@ $arrayfields = array(
'u.login' =>array('label'=>"User", 'checked'=>1, 'position'=>30),
'c.libelle' =>array('label'=>"Type", 'checked'=>1, 'position'=>40),
'pndf.num_payment' =>array('label'=>"Numero", 'checked'=>1, 'position'=>50, 'tooltip'=>"ChequeOrTransferNumber"),
- 'ba.label' =>array('label'=>"Account", 'checked'=>1, 'position'=>60, 'enable'=>(isModEnabled("banque"))),
+ 'ba.label' =>array('label'=>"BankAccount", 'checked'=>1, 'position'=>60, 'enable'=>(isModEnabled("banque"))),
'pndf.amount' =>array('label'=>"Amount", 'checked'=>1, 'position'=>70),
);
$arrayfields = dol_sort_array($arrayfields, 'position');
diff --git a/htdocs/expensereport/tpl/expensereport_addfile.tpl.php b/htdocs/expensereport/tpl/expensereport_addfile.tpl.php
index 6aea588a506..ff2fd3d4285 100644
--- a/htdocs/expensereport/tpl/expensereport_addfile.tpl.php
+++ b/htdocs/expensereport/tpl/expensereport_addfile.tpl.php
@@ -13,7 +13,7 @@ if ($action == 'editline') {
print '
';
$modulepart = 'expensereport';
-$permission = $user->rights->expensereport->creer;
+$permission = $user->hasRight('expensereport', 'creer');
// We define var to enable the feature to add prefix of uploaded files
$savingdocmask = '';
diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php
index 971eea5a1eb..c069e2d15b2 100644
--- a/htdocs/fichinter/card.php
+++ b/htdocs/fichinter/card.php
@@ -744,7 +744,7 @@ if (empty($reshook)) {
// Actions to build doc
$upload_dir = $conf->ficheinter->dir_output;
- $permissiontoadd = $user->rights->ficheinter->creer;
+ $permissiontoadd = $user->hasRight('ficheinter', 'creer');
include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
if ($action == 'update_extras') {
@@ -1747,8 +1747,8 @@ if ($action == 'create') {
$filename = dol_sanitizeFileName($object->ref);
$filedir = $conf->ficheinter->dir_output."/".$filename;
$urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id;
- $genallowed = $user->rights->ficheinter->lire;
- $delallowed = $user->rights->ficheinter->creer;
+ $genallowed = $user->hasRight('ficheinter', 'lire');
+ $delallowed = $user->hasRight('ficheinter', 'creer');
print $formfile->showdocuments('ficheinter', $filename, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 1, 0, 0, 28, 0, '', '', '', $soc->default_lang);
// Show links to link elements
diff --git a/htdocs/fichinter/class/api_interventions.class.php b/htdocs/fichinter/class/api_interventions.class.php
index 1b8fe55f45a..b8c5b4f187f 100644
--- a/htdocs/fichinter/class/api_interventions.class.php
+++ b/htdocs/fichinter/class/api_interventions.class.php
@@ -78,7 +78,7 @@ class Interventions extends DolibarrApi
*/
public function get($id)
{
- if (!DolibarrApiAccess::$user->rights->ficheinter->lire) {
+ if (!DolibarrApiAccess::$user->hasRight('ficheinter', 'lire')) {
throw new RestException(403);
}
@@ -112,7 +112,7 @@ class Interventions extends DolibarrApi
*/
public function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids = '', $sqlfilters = '', $properties = '')
{
- if (!DolibarrApiAccess::$user->rights->ficheinter->lire) {
+ if (!DolibarrApiAccess::$user->hasRight('ficheinter', 'lire')) {
throw new RestException(403);
}
@@ -123,7 +123,7 @@ class Interventions extends DolibarrApi
// If the internal user must only see his customers, force searching by him
$search_sale = 0;
- if (!DolibarrApiAccess::$user->rights->societe->client->voir && !$socids) {
+ if (!DolibarrApiAccess::$user->hasRight('societe', 'client', 'voir') && !$socids) {
$search_sale = DolibarrApiAccess::$user->id;
}
@@ -190,7 +190,7 @@ class Interventions extends DolibarrApi
*/
public function post($request_data = null)
{
- if (!DolibarrApiAccess::$user->rights->ficheinter->creer) {
+ if (!DolibarrApiAccess::$user->hasRight('ficheinter', 'creer')) {
throw new RestException(401, "Insuffisant rights");
}
// Check mandatory fields
@@ -225,7 +225,7 @@ class Interventions extends DolibarrApi
/* TODO
public function getLines($id)
{
- if(! DolibarrApiAccess::$user->rights->ficheinter->lire) {
+ if(! DolibarrApiAccess::$user->hasRight('ficheinter', 'lire')) {
throw new RestException(403);
}
@@ -258,7 +258,7 @@ class Interventions extends DolibarrApi
*/
public function postLine($id, $request_data = null)
{
- if (!DolibarrApiAccess::$user->rights->ficheinter->creer) {
+ if (!DolibarrApiAccess::$user->hasRight('ficheinter', 'creer')) {
throw new RestException(401, "Insuffisant rights");
}
// Check mandatory fields
@@ -305,7 +305,7 @@ class Interventions extends DolibarrApi
*/
public function delete($id)
{
- if (!DolibarrApiAccess::$user->rights->ficheinter->supprimer) {
+ if (!DolibarrApiAccess::$user->hasRight('ficheinter', 'supprimer')) {
throw new RestException(403);
}
$result = $this->fichinter->fetch($id);
@@ -346,7 +346,7 @@ class Interventions extends DolibarrApi
*/
public function validate($id, $notrigger = 0)
{
- if (!DolibarrApiAccess::$user->rights->ficheinter->creer) {
+ if (!DolibarrApiAccess::$user->hasRight('ficheinter', 'creer')) {
throw new RestException(401, "Insuffisant rights");
}
$result = $this->fichinter->fetch($id);
@@ -382,7 +382,7 @@ class Interventions extends DolibarrApi
*/
public function closeFichinter($id)
{
- if (!DolibarrApiAccess::$user->rights->ficheinter->creer) {
+ if (!DolibarrApiAccess::$user->hasRight('ficheinter', 'creer')) {
throw new RestException(401, "Insuffisant rights");
}
$result = $this->fichinter->fetch($id);
diff --git a/htdocs/fichinter/document.php b/htdocs/fichinter/document.php
index 98f2e077395..c6b12144a5b 100644
--- a/htdocs/fichinter/document.php
+++ b/htdocs/fichinter/document.php
@@ -79,7 +79,7 @@ $object->fetch($id, $ref);
$upload_dir = $conf->ficheinter->dir_output.'/'.dol_sanitizeFileName($object->ref);
$modulepart = 'fichinter';
-$permissiontoadd = $user->rights->ficheinter->creer; // Used by the include of actions_setnotes.inc.php
+$permissiontoadd = $user->hasRight('ficheinter', 'creer'); // Used by the include of actions_setnotes.inc.php
/*
@@ -164,7 +164,7 @@ if ($object->id) {
print dol_get_fiche_end();
$modulepart = 'ficheinter';
- $permtoedit = $user->rights->ficheinter->creer;
+ $permtoedit = $user->hasRight('ficheinter', 'creer');
$param = '&id='.$object->id;
include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
} else {
diff --git a/htdocs/fichinter/list.php b/htdocs/fichinter/list.php
index 20eb6c8e26c..12752dc3c59 100644
--- a/htdocs/fichinter/list.php
+++ b/htdocs/fichinter/list.php
@@ -156,9 +156,9 @@ if ($user->socid) {
}
$result = restrictedArea($user, 'ficheinter', $id, 'fichinter');
-$permissiontoread = $user->rights->ficheinter->lire;
-$permissiontoadd = $user->rights->ficheinter->creer;
-$permissiontodelete = $user->rights->ficheinter->supprimer;
+$permissiontoread = $user->hasRight('ficheinter', 'lire');
+$permissiontoadd = $user->hasRight('ficheinter', 'creer');
+$permissiontodelete = $user->hasRight('ficheinter', 'supprimer');
/*
diff --git a/htdocs/fichinter/note.php b/htdocs/fichinter/note.php
index 471c5c64485..845294ce56a 100644
--- a/htdocs/fichinter/note.php
+++ b/htdocs/fichinter/note.php
@@ -49,7 +49,7 @@ $result = restrictedArea($user, 'ficheinter', $id, 'fichinter');
$object = new Fichinter($db);
$object->fetch($id, $ref);
-$permissionnote = $user->rights->ficheinter->creer; // Used by the include of actions_setnotes.inc.php
+$permissionnote = $user->hasRight('ficheinter', 'creer'); // Used by the include of actions_setnotes.inc.php
/*
* Actions
@@ -84,8 +84,6 @@ if ($id > 0 || !empty($ref)) {
$morehtmlref = '
';
// Ref customer
- //$morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, $user->rights->ficheinter->creer, 'string', '', 0, 1);
- //$morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, $user->rights->ficheinter->creer, 'string', '', null, null, '', 1);
$morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1);
$morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1);
// Thirdparty
diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php
index de2ebd90a55..5d699086ea7 100644
--- a/htdocs/fourn/class/fournisseur.commande.class.php
+++ b/htdocs/fourn/class/fournisseur.commande.class.php
@@ -612,7 +612,6 @@ class CommandeFournisseur extends CommonOrder
*/
public function fetch_lines($only_product = 0)
{
- global $conf;
// phpcs:enable
$this->lines = array();
@@ -753,7 +752,7 @@ class CommandeFournisseur extends CommonOrder
*/
public function valid($user, $idwarehouse = 0, $notrigger = 0)
{
- global $langs, $conf;
+ global $conf;
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
$error = 0;
@@ -888,7 +887,7 @@ class CommandeFournisseur extends CommonOrder
public function LibStatut($status, $mode = 0, $billed = 0)
{
// phpcs:enable
- global $conf, $langs, $hookmanager;
+ global $langs, $hookmanager;
if (empty($this->labelStatus) || empty($this->labelStatusShort)) {
$langs->load('orders');
@@ -1021,7 +1020,7 @@ class CommandeFournisseur extends CommonOrder
*/
public function getNomUrl($withpicto = 0, $option = '', $notooltip = 0, $save_lastsearch_value = -1, $addlinktonotes = 0)
{
- global $langs, $conf, $user, $hookmanager;
+ global $langs, $user, $hookmanager;
$result = '';
$params = [
@@ -1112,7 +1111,7 @@ class CommandeFournisseur extends CommonOrder
*/
public function getNextNumRef($soc)
{
- global $db, $langs, $conf;
+ global $langs, $conf;
$langs->load("orders");
if (getDolGlobalString('COMMANDE_SUPPLIER_ADDON_NUMBER')) {
@@ -3306,7 +3305,7 @@ class CommandeFournisseur extends CommonOrder
*/
public function getInputMethod()
{
- global $db, $langs;
+ global $langs;
if ($this->methode_commande_id > 0) {
$sql = "SELECT rowid, code, libelle as label";
@@ -3435,18 +3434,18 @@ class CommandeFournisseur extends CommonOrder
/**
* Function used to replace a product id with another one.
*
- * @param DoliDB $db Database handler
- * @param int $origin_id Old product id
- * @param int $dest_id New product id
+ * @param DoliDB $dbs Database handler
+ * @param int $origin_id Old product id
+ * @param int $dest_id New product id
* @return bool
*/
- public static function replaceProduct(DoliDB $db, $origin_id, $dest_id)
+ public static function replaceProduct(DoliDB $dbs, $origin_id, $dest_id)
{
$tables = array(
'commande_fournisseurdet'
);
- return CommonObject::commonReplaceProduct($db, $origin_id, $dest_id, $tables);
+ return CommonObject::commonReplaceProduct($dbs, $origin_id, $dest_id, $tables);
}
/**
@@ -3489,6 +3488,8 @@ class CommandeFournisseur extends CommonOrder
{
global $conf, $langs;
+ $langs->load('orders');
+
$text = '';
if ($this->statut == self::STATUS_ORDERSENT || $this->statut == self::STATUS_RECEIVED_PARTIALLY) {
@@ -3518,8 +3519,6 @@ class CommandeFournisseur extends CommonOrder
*/
public function calcAndSetStatusDispatch(User $user, $closeopenorder = 1, $comment = '')
{
- global $conf, $langs;
-
if (isModEnabled("supplier_order")) {
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.dispatch.class.php';
@@ -3817,8 +3816,6 @@ class CommandeFournisseurLigne extends CommonOrderLine
*/
public function fetch($rowid)
{
- global $conf;
-
$sql = 'SELECT cd.rowid, cd.fk_commande, cd.fk_product, cd.product_type, cd.description, cd.qty, cd.tva_tx, cd.special_code,';
$sql .= ' cd.localtax1_tx, cd.localtax2_tx, cd.localtax1_type, cd.localtax2_type, cd.ref as ref_supplier,';
$sql .= ' cd.remise, cd.remise_percent, cd.subprice,';
diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php
index d2b63da001d..273295c149a 100644
--- a/htdocs/fourn/class/fournisseur.facture.class.php
+++ b/htdocs/fourn/class/fournisseur.facture.class.php
@@ -230,7 +230,7 @@ class FactureFournisseur extends CommonInvoice
public $transport_mode_id;
/**
- * @var int VAT reverse charge can be used on the invoice
+ * @var int<0,1> VAT reverse charge can be used on the invoice
*/
public $vat_reverse_charge;
diff --git a/htdocs/fourn/class/fournisseur.product.class.php b/htdocs/fourn/class/fournisseur.product.class.php
index dfbca7311d5..035c088db87 100644
--- a/htdocs/fourn/class/fournisseur.product.class.php
+++ b/htdocs/fourn/class/fournisseur.product.class.php
@@ -412,7 +412,7 @@ class ProductFournisseur extends Product
$qty = price2num($qty, 'MS');
$unitBuyPrice = price2num($buyprice / $qty, 'MU');
- // We can have a puchase ref that need to buy 100 min for a given price and with a packaging of 50.
+ // We can have a purchase ref that need to buy 100 min for a given price and with a packaging of 50.
//$packaging = price2num(((empty($this->packaging) || $this->packaging < $qty) ? $qty : $this->packaging), 'MS');
$packaging = price2num((empty($this->packaging) ? $qty : $this->packaging), 'MS');
diff --git a/htdocs/fourn/facture/paiement.php b/htdocs/fourn/facture/paiement.php
index 1c56799d7f3..56b24d73985 100644
--- a/htdocs/fourn/facture/paiement.php
+++ b/htdocs/fourn/facture/paiement.php
@@ -53,12 +53,12 @@ $cancel = GETPOST('cancel', 'alpha');
$backtopage = GETPOST('backtopage', 'alpha');
$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha');
-$facid = GETPOST('facid', 'int');
-$socid = GETPOST('socid', 'int');
-$accountid = GETPOST('accountid', 'int');
-$day = GETPOST('day', 'int');
-$month = GETPOST('month', 'int');
-$year = GETPOST('year', 'int');
+$facid = GETPOSTINT('facid');
+$socid = GETPOSTINT('socid');
+$accountid = GETPOSTINT('accountid');
+$day = GETPOSTINT('day');
+$month = GETPOSTINT('month');
+$year = GETPOSTINT('year');
$search_ref = GETPOST('search_ref', 'alpha');
$search_account = GETPOST('search_account', 'int');
@@ -67,10 +67,10 @@ $search_amount = GETPOST('search_amount', 'alpha'); // alpha because we must be
$search_company = GETPOST('search_company', 'alpha');
$search_payment_num = GETPOST('search_payment_num', 'alpha');
-$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
+$limit = GETPOSTINT('limit') ? GETPOST('limit') : $conf->liste_limit;
$sortfield = GETPOST('sortfield', 'aZ09comma');
$sortorder = GETPOST('sortorder', 'aZ09comma');
-$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
+$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page");
if (empty($page) || $page == -1) {
$page = 0;
} // If $page is not defined, or '' or -1
@@ -315,10 +315,10 @@ if (empty($reshook)) {
$paiement->multicurrency_amounts = $multicurrency_amounts;
$paiement->multicurrency_code = $multicurrency_code; // Array with all currency of payments dispatching
$paiement->multicurrency_tx = $multicurrency_tx; // Array with all currency tx of payments dispatching
- $paiement->paiementid = GETPOST('paiementid', 'int');
+ $paiement->paiementid = GETPOSTINT('paiementid');
$paiement->num_payment = GETPOST('num_paiement', 'alphanohtml');
$paiement->note_private = GETPOST('comment', 'alpha');
- $paiement->fk_account = GETPOST('accountid', 'int');
+ $paiement->fk_account = GETPOSTINT('accountid');
if (!$error) {
// Create payment and update this->multicurrency_amounts if this->amounts filled or
diff --git a/htdocs/fourn/paiement/list.php b/htdocs/fourn/paiement/list.php
index cd42464d2f3..2112f64f385 100644
--- a/htdocs/fourn/paiement/list.php
+++ b/htdocs/fourn/paiement/list.php
@@ -102,7 +102,7 @@ $arrayfields = array(
's.nom' =>array('label'=>"ThirdParty", 'checked'=>1, 'position'=>30),
'c.libelle' =>array('label'=>"Type", 'checked'=>1, 'position'=>40),
'p.num_paiement' =>array('label'=>"Numero", 'checked'=>1, 'position'=>50, 'tooltip'=>"ChequeOrTransferNumber"),
- 'ba.label' =>array('label'=>"Account", 'checked'=>1, 'position'=>60, 'enable'=>(isModEnabled("banque"))),
+ 'ba.label' =>array('label'=>"BankAccount", 'checked'=>1, 'position'=>60, 'enable'=>(isModEnabled("banque"))),
'p.amount' =>array('label'=>"Amount", 'checked'=>1, 'position'=>70),
);
$arrayfields = dol_sort_array($arrayfields, 'position');
diff --git a/htdocs/ftp/index.php b/htdocs/ftp/index.php
index a015d68976d..b3b8a166cc5 100644
--- a/htdocs/ftp/index.php
+++ b/htdocs/ftp/index.php
@@ -611,13 +611,6 @@ if (!function_exists('ftp_connect')) {
// Actions
- /*
- if ($user->rights->ftp->write && !empty($section))
- {
- $formfile->form_attach_new_file(DOL_URL_ROOT.'/ftp/index.php','',0,$section,1);
- }
- else print ' ';
- */
print ' ';
print '
';
diff --git a/htdocs/holiday/card.php b/htdocs/holiday/card.php
index 5b9c527a019..83828e91488 100644
--- a/htdocs/holiday/card.php
+++ b/htdocs/holiday/card.php
@@ -1623,8 +1623,8 @@ if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add') {
$relativepath = $objref.'/'.$objref.'.pdf';
$filedir = $conf->holiday->dir_output.'/'.$object->element.'/'.$objref;
$urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id;
- $genallowed = ($user->rights->holiday->read && $object->fk_user == $user->id) || !empty($user->rights->holiday->readall); // If you can read, you can build the PDF to read content
- $delallowed = ($user->rights->holiday->write && $object->fk_user == $user->id) || !empty($user->rights->holiday->writeall_advance); // If you can create/edit, you can remove a file on card
+ $genallowed = ($user->hasRight('holiday', 'read') && $object->fk_user == $user->id) || $user->hasRight('holiday', 'readall'); // If you can read, you can build the PDF to read content
+ $delallowed = ($user->hasRight('holiday', 'write') && $object->fk_user == $user->id) || $user->hasRight('holiday', 'writeall_advance'); // If you can create/edit, you can remove a file on card
print $formfile->showdocuments('holiday:Holiday', $object->element.'/'.$objref, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 1, 0, 0, 28, 0, '', '', '', $langs->defaultlang);
}
diff --git a/htdocs/holiday/document.php b/htdocs/holiday/document.php
index 69615a2b9af..c72a42e5631 100644
--- a/htdocs/holiday/document.php
+++ b/htdocs/holiday/document.php
@@ -104,7 +104,7 @@ if ($user->socid) {
}
$result = restrictedArea($user, 'holiday', $object->id, 'holiday');
-$permissiontoadd = $user->rights->holiday->write; // Used by the include of actions_setnotes.inc.php
+$permissiontoadd = $user->hasRight('holiday', 'write'); // Used by the include of actions_setnotes.inc.php
/*
@@ -286,8 +286,8 @@ if ($object->id) {
print dol_get_fiche_end();
- $permissiontoadd = $user->rights->holiday->write;
- $permtoedit = $user->rights->holiday->write;
+ $permissiontoadd = $user->hasRight('holiday', 'write');
+ $permtoedit = $user->hasRight('holiday', 'write');
$param = '&id='.$object->id;
$relativepathwithnofile = dol_sanitizeFileName($object->ref).'/';
$savingdocmask = dol_sanitizeFileName($object->ref).'-__file__';
diff --git a/htdocs/hrm/evaluation_agenda.php b/htdocs/hrm/evaluation_agenda.php
index 44437c1a6fa..6a51a67396a 100644
--- a/htdocs/hrm/evaluation_agenda.php
+++ b/htdocs/hrm/evaluation_agenda.php
@@ -90,8 +90,8 @@ if ($id > 0 || !empty($ref)) {
}
// Permissions
-$permissiontoadd = $user->rights->hrm->evaluation->write; // Used by the include of actions_addupdatedelete.inc.php
-$permissiontoread = $user->rights->hrm->evaluation->read; // Used by the include of actions_addupdatedelete.inc.php
+$permissiontoadd = $user->hasRight('hrm', 'evaluation', 'write'); // Used by the include of actions_addupdatedelete.inc.php
+$permissiontoread = $user->hasRight('hrm', 'evaluation', 'read'); // Used by the include of actions_addupdatedelete.inc.php
// Security check (enable the most restrictive one)
//if ($user->socid > 0) accessforbidden();
diff --git a/htdocs/hrm/evaluation_card.php b/htdocs/hrm/evaluation_card.php
index e7681e75b6c..742b109fc1f 100644
--- a/htdocs/hrm/evaluation_card.php
+++ b/htdocs/hrm/evaluation_card.php
@@ -81,12 +81,12 @@ if (empty($action) && empty($id) && empty($ref)) {
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once.
// Permissions
-$permissiontoread = $user->rights->hrm->evaluation->read;
-$permissiontoadd = $user->rights->hrm->evaluation->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
-$permissiontovalidate = (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->rights->hrm->evaluation_advance->validate) || (!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $permissiontoadd);
-$permissiontoClose = $user->rights->hrm->evaluation->write;
-$permissiontodelete = $user->rights->hrm->evaluation->delete/* || ($permissiontoadd && isset($object->status) && $object->status == $object::STATUS_DRAFT)*/;
-$permissiondellink = $user->rights->hrm->evaluation->write; // Used by the include of actions_dellink.inc.php
+$permissiontoread = $user->hasRight('hrm', 'evaluation', 'read');
+$permissiontoadd = $user->hasRight('hrm', 'evaluation', 'write'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
+$permissiontovalidate = (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('hrm', 'evaluation_advance', 'validate')) || (!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $permissiontoadd);
+$permissiontoClose = $user->hasRight('hrm', 'evaluation', 'write');
+$permissiontodelete = $user->hasRight('hrm', 'evaluation', 'delete')/* || ($permissiontoadd && isset($object->status) && $object->status == $object::STATUS_DRAFT)*/;
+$permissiondellink = $user->hasRight('hrm', 'evaluation', 'write'); // Used by the include of actions_dellink.inc.php
$upload_dir = $conf->hrm->multidir_output[isset($object->entity) ? $object->entity : 1].'/evaluation';
// Security check (enable the most restrictive one)
@@ -691,8 +691,8 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
$relativepath = $objref.'/'.$objref.'.pdf';
$filedir = $conf->hrm->dir_output.'/'.$object->element.'/'.$objref;
$urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id;
- $genallowed = $user->rights->hrm->evaluation->read; // If you can read, you can build the PDF to read content
- $delallowed = $user->rights->hrm->evaluation->write; // If you can create/edit, you can remove a file on card
+ $genallowed = $user->hasRight('hrm', 'evaluation', 'read'); // If you can read, you can build the PDF to read content
+ $delallowed = $user->hasRight('hrm', 'evaluation', 'write'); // If you can create/edit, you can remove a file on card
print $formfile->showdocuments('hrm:Evaluation', $object->element.'/'.$objref, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 1, 0, 0, 28, 0, '', '', '', $langs->defaultlang, '', $object, 0, 'remove_file_comfirm');
}
diff --git a/htdocs/hrm/evaluation_contact.php b/htdocs/hrm/evaluation_contact.php
index 60fa5223d07..d99f76d4588 100644
--- a/htdocs/hrm/evaluation_contact.php
+++ b/htdocs/hrm/evaluation_contact.php
@@ -57,7 +57,7 @@ $extrafields->fetch_name_optionals_label($object->table_element);
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals
// Permissions
-$permission = $user->rights->hrm->evaluation->write;
+$permission = $user->hasRight('hrm', 'evaluation', 'write');
// Security check (enable the most restrictive one)
//if ($user->socid > 0) accessforbidden();
diff --git a/htdocs/hrm/evaluation_document.php b/htdocs/hrm/evaluation_document.php
index 51262f6edf2..4ec3fc93b2e 100644
--- a/htdocs/hrm/evaluation_document.php
+++ b/htdocs/hrm/evaluation_document.php
@@ -81,8 +81,8 @@ if ($id > 0 || !empty($ref)) {
}
// Permissions
-$permissiontoadd = $user->rights->hrm->evaluation->write; // Used by the include of actions_addupdatedelete.inc.php and actions_linkedfiles.inc.php
-$permissiontoread = $user->rights->hrm->evaluation->read;
+$permissiontoadd = $user->hasRight('hrm', 'evaluation', 'write'); // Used by the include of actions_addupdatedelete.inc.php and actions_linkedfiles.inc.php
+$permissiontoread = $user->hasRight('hrm', 'evaluation', 'read');
// Security check (enable the most restrictive one)
//if ($user->socid > 0) accessforbidden();
diff --git a/htdocs/hrm/evaluation_note.php b/htdocs/hrm/evaluation_note.php
index ba0ec02d616..37a8a479af7 100644
--- a/htdocs/hrm/evaluation_note.php
+++ b/htdocs/hrm/evaluation_note.php
@@ -60,8 +60,8 @@ if ($id > 0 || !empty($ref)) {
}
// Permissions
-$permissionnote = $user->rights->hrm->evaluation->write; // Used by the include of actions_setnotes.inc.php
-$permissiontoread = $user->rights->hrm->evaluation->read; // Used by the include of actions_addupdatedelete.inc.php
+$permissionnote = $user->hasRight('hrm', 'evaluation', 'write'); // Used by the include of actions_setnotes.inc.php
+$permissiontoread = $user->hasRight('hrm', 'evaluation', 'read'); // Used by the include of actions_addupdatedelete.inc.php
// Security check (enable the most restrictive one)
//if ($user->socid > 0) accessforbidden();
diff --git a/htdocs/hrm/job_agenda.php b/htdocs/hrm/job_agenda.php
index 671d10c8a74..f13d0e88d8b 100644
--- a/htdocs/hrm/job_agenda.php
+++ b/htdocs/hrm/job_agenda.php
@@ -88,8 +88,8 @@ if ($id > 0 || !empty($ref)) {
}
// Permissions
-$permissiontoread = $user->rights->hrm->all->read;
-$permissiontoadd = $user->rights->hrm->all->write; // Used by the include of actions_addupdatedelete.inc.php
+$permissiontoread = $user->hasRight('hrm', 'all', 'read');
+$permissiontoadd = $user->hasRight('hrm', 'all', 'write'); // Used by the include of actions_addupdatedelete.inc.php
// Security check (enable the most restrictive one)
//if ($user->socid > 0) accessforbidden();
diff --git a/htdocs/hrm/job_card.php b/htdocs/hrm/job_card.php
index 3ca13ca1b77..1cfbc38a80e 100644
--- a/htdocs/hrm/job_card.php
+++ b/htdocs/hrm/job_card.php
@@ -78,9 +78,9 @@ if (empty($action) && empty($id) && empty($ref)) {
include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be include, not include_once.
// Permissions
-$permissiontoread = $user->rights->hrm->all->read;
-$permissiontoadd = $user->rights->hrm->all->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
-$permissiontodelete = $user->rights->hrm->all->delete;
+$permissiontoread = $user->hasRight('hrm', 'all', 'read');
+$permissiontoadd = $user->hasRight('hrm', 'all', 'write'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
+$permissiontodelete = $user->hasRight('hrm', 'all', 'delete');
$upload_dir = $conf->hrm->multidir_output[isset($object->entity) ? $object->entity : 1] . '/job';
// Security check (enable the most restrictive one)
@@ -504,8 +504,8 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
$relativepath = $objref . '/' . $objref . '.pdf';
$filedir = $conf->hrm->dir_output . '/' . $object->element . '/' . $objref;
$urlsource = $_SERVER["PHP_SELF"] . "?id=" . $object->id;
- $genallowed = $user->rights->hrm->job->read; // If you can read, you can build the PDF to read content
- $delallowed = $user->rights->hrm->job->write; // If you can create/edit, you can remove a file on card
+ $genallowed = $user->hasRight('hrm', 'job', 'read'); // If you can read, you can build the PDF to read content
+ $delallowed = $user->hasRight('hrm', 'job', 'write'); // If you can create/edit, you can remove a file on card
print $formfile->showdocuments('hrm:Job', $object->element . '/' . $objref, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 1, 0, 0, 28, 0, '', '', '', $langs->defaultlang);
}
diff --git a/htdocs/hrm/job_document.php b/htdocs/hrm/job_document.php
index b6b1e19412a..3f9ff9a74dc 100644
--- a/htdocs/hrm/job_document.php
+++ b/htdocs/hrm/job_document.php
@@ -80,8 +80,8 @@ if ($id > 0 || !empty($ref)) {
}
// Permissions
-$permissiontoread = $user->rights->hrm->all->read;
-$permissiontoadd = $user->rights->hrm->all->write; // Used by the include of actions_addupdatedelete.inc.php and actions_linkedfiles.inc.php
+$permissiontoread = $user->hasRight('hrm', 'all', 'read');
+$permissiontoadd = $user->hasRight('hrm', 'all', 'write'); // Used by the include of actions_addupdatedelete.inc.php and actions_linkedfiles.inc.php
// Security check (enable the most restrictive one)
//if ($user->socid > 0) accessforbidden();
@@ -158,9 +158,6 @@ if ($object->id) {
print dol_get_fiche_end();
$modulepart = 'hrm';
- //$permissiontoadd = $user->rights->hrm->job->write;
- //$permtoedit = $user->rights->hrm->job->write;
- $permtoedit = $permissiontoadd;
$param = '&id='.$object->id;
//$relativepathwithnofile='job/' . dol_sanitizeFileName($object->id).'/';
diff --git a/htdocs/hrm/job_list.php b/htdocs/hrm/job_list.php
index aa66d55dd4a..182c6030f76 100644
--- a/htdocs/hrm/job_list.php
+++ b/htdocs/hrm/job_list.php
@@ -133,9 +133,9 @@ $object->fields = dol_sort_array($object->fields, 'position');
$arrayfields = dol_sort_array($arrayfields, 'position');
// Permissions
-$permissiontoread = $user->rights->hrm->all->read;
-$permissiontoadd = $user->rights->hrm->all->write;
-$permissiontodelete = $user->rights->hrm->all->delete;
+$permissiontoread = $user->hasRight('hrm', 'all', 'read');
+$permissiontoadd = $user->hasRight('hrm', 'all', 'write');
+$permissiontodelete = $user->hasRight('hrm', 'all', 'delete');
// Security check (enable the most restrictive one)
if ($user->socid > 0) {
diff --git a/htdocs/hrm/job_note.php b/htdocs/hrm/job_note.php
index 2d2b340fee5..61d82ec2781 100644
--- a/htdocs/hrm/job_note.php
+++ b/htdocs/hrm/job_note.php
@@ -59,8 +59,8 @@ if ($id > 0 || !empty($ref)) {
}
// Permissions
-$permissiontoread = $user->rights->hrm->all->read;
-$permissionnote = $user->rights->hrm->all->write; // Used by the include of actions_addupdatedelete.inc.php
+$permissiontoread = $user->hasRight('hrm', 'all', 'read');
+$permissionnote = $user->hasRight('hrm', 'all', 'write'); // Used by the include of actions_addupdatedelete.inc.php
// Security check (enable the most restrictive one)
//if ($user->socid > 0) accessforbidden();
diff --git a/htdocs/hrm/position.php b/htdocs/hrm/position.php
index 7ef6bf1c24c..7b3617c5778 100644
--- a/htdocs/hrm/position.php
+++ b/htdocs/hrm/position.php
@@ -146,9 +146,9 @@ $arrayfields = dol_sort_array($arrayfields, 'position');
include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be include, not include_once.
// Permissions
-$permissiontoread = $user->rights->hrm->all->read;
-$permissiontoadd = $user->rights->hrm->all->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
-$permissiontodelete = $user->rights->hrm->all->delete;
+$permissiontoread = $user->hasRight('hrm', 'all', 'read');
+$permissiontoadd = $user->hasRight('hrm', 'all', 'write'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
+$permissiontodelete = $user->hasRight('hrm', 'all', 'delete');
$upload_dir = $conf->hrm->multidir_output[isset($object->entity) ? $object->entity : 1] . '/position';
// Security check (enable the most restrictive one)
diff --git a/htdocs/hrm/position_agenda.php b/htdocs/hrm/position_agenda.php
index b1534dc9787..232acae98c3 100644
--- a/htdocs/hrm/position_agenda.php
+++ b/htdocs/hrm/position_agenda.php
@@ -91,8 +91,8 @@ if ($id > 0 || !empty($ref)) {
}
// Permissions
-$permissiontoread = $user->rights->hrm->all->read;
-$permissiontoadd = $user->rights->hrm->all->write; // Used by the include of actions_addupdatedelete.inc.php
+$permissiontoread = $user->hasRight('hrm', 'all', 'read');
+$permissiontoadd = $user->hasRight('hrm', 'all', 'write'); // Used by the include of actions_addupdatedelete.inc.php
// Security check (enable the most restrictive one)
//if ($user->socid > 0) accessforbidden();
diff --git a/htdocs/hrm/position_card.php b/htdocs/hrm/position_card.php
index 0dda7f0bea1..dc83d41e0d5 100644
--- a/htdocs/hrm/position_card.php
+++ b/htdocs/hrm/position_card.php
@@ -52,10 +52,10 @@ if ($res < 0) {
}
// Permissions
-$permissiontoread = $user->rights->hrm->all->read;
-$permissiontoadd = $user->rights->hrm->all->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
-$permissiontodelete = $user->rights->hrm->all->delete;
-$permissiondellink = $user->rights->hrm->all->write; // Used by the include of actions_dellink.inc.php
+$permissiontoread = $user->hasRight('hrm', 'all', 'read');
+$permissiontoadd = $user->hasRight('hrm', 'all', 'write'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
+$permissiontodelete = $user->hasRight('hrm', 'all', 'delete');
+$permissiondellink = $user->hasRight('hrm', 'all', 'write'); // Used by the include of actions_dellink.inc.php
$upload_dir = $conf->hrm->multidir_output[isset($object->entity) ? $object->entity : 1] . '/position';
// Security check (enable the most restrictive one)
diff --git a/htdocs/hrm/position_document.php b/htdocs/hrm/position_document.php
index 5de8d3f0e33..d32e56ee93b 100644
--- a/htdocs/hrm/position_document.php
+++ b/htdocs/hrm/position_document.php
@@ -80,8 +80,8 @@ if ($id > 0 || !empty($ref)) {
}
// Permissions
-$permissiontoread = $user->rights->hrm->all->read;
-$permissiontoadd = $user->rights->hrm->all->write; // Used by the include of actions_addupdatedelete.inc.php and actions_linkedfiles.inc.php
+$permissiontoread = $user->hasRight('hrm', 'all', 'read');
+$permissiontoadd = $user->hasRight('hrm', 'all', 'write'); // Used by the include of actions_addupdatedelete.inc.php and actions_linkedfiles.inc.php
// Security check (enable the most restrictive one)
//if ($user->socid > 0) accessforbidden();
diff --git a/htdocs/hrm/position_list.php b/htdocs/hrm/position_list.php
index bb9c888f93a..fd45a8c6f2b 100644
--- a/htdocs/hrm/position_list.php
+++ b/htdocs/hrm/position_list.php
@@ -134,9 +134,9 @@ $object->fields = dol_sort_array($object->fields, 'position');
$arrayfields = dol_sort_array($arrayfields, 'position');
// Permissions
-$permissiontoread = $user->rights->hrm->all->read;
-$permissiontoadd = $user->rights->hrm->all->write;
-$permissiontodelete = $user->rights->hrm->all->delete;
+$permissiontoread = $user->hasRight('hrm', 'all', 'read');
+$permissiontoadd = $user->hasRight('hrm', 'all', 'write');
+$permissiontodelete = $user->hasRight('hrm', 'all', 'delete');
// Security check (enable the most restrictive one)
if ($user->socid > 0) {
diff --git a/htdocs/hrm/position_note.php b/htdocs/hrm/position_note.php
index 7a23d7d7b7d..d7a9efa6cba 100644
--- a/htdocs/hrm/position_note.php
+++ b/htdocs/hrm/position_note.php
@@ -57,8 +57,8 @@ if ($id > 0 || !empty($ref)) {
}
// Permissions
-$permissionnote = $user->rights->hrm->all->write;
-$permissiontoread = $user->rights->hrm->all->read; // Used by the include of actions_addupdatedelete.inc.php
+$permissionnote = $user->hasRight('hrm', 'all', 'write');
+$permissiontoread = $user->hasRight('hrm', 'all', 'read'); // Used by the include of actions_addupdatedelete.inc.php
// Security check (enable the most restrictive one)
//if ($user->socid > 0) accessforbidden();
diff --git a/htdocs/hrm/skill_agenda.php b/htdocs/hrm/skill_agenda.php
index a2899731f8d..e6b5368a782 100644
--- a/htdocs/hrm/skill_agenda.php
+++ b/htdocs/hrm/skill_agenda.php
@@ -90,8 +90,8 @@ if ($id > 0 || !empty($ref)) {
}
// Permissions
-$permissiontoread = $user->rights->hrm->all->read;
-$permissiontoadd = $user->rights->hrm->all->write; // Used by the include of actions_addupdatedelete.inc.php
+$permissiontoread = $user->hasRight('hrm', 'all', 'read');
+$permissiontoadd = $user->hasRight('hrm', 'all', 'write'); // Used by the include of actions_addupdatedelete.inc.php
// Security check (enable the most restrictive one)
//if ($user->socid > 0) accessforbidden();
diff --git a/htdocs/hrm/skill_card.php b/htdocs/hrm/skill_card.php
index 434b6b49979..bd2070a4f71 100644
--- a/htdocs/hrm/skill_card.php
+++ b/htdocs/hrm/skill_card.php
@@ -79,9 +79,9 @@ if (empty($action) && empty($id) && empty($ref)) {
include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be include, not include_once.
// Permissions
-$permissiontoread = $user->rights->hrm->all->read;
-$permissiontoadd = $user->rights->hrm->all->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
-$permissiontodelete = $user->rights->hrm->all->delete;
+$permissiontoread = $user->hasRight('hrm', 'all', 'read');
+$permissiontoadd = $user->hasRight('hrm', 'all', 'write'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
+$permissiontodelete = $user->hasRight('hrm', 'all', 'delete');
$upload_dir = $conf->hrm->multidir_output[isset($object->entity) ? $object->entity : 1] . '/skill';
// Security check (enable the most restrictive one)
diff --git a/htdocs/hrm/skill_document.php b/htdocs/hrm/skill_document.php
index 4cd88ca4578..6c898faced2 100644
--- a/htdocs/hrm/skill_document.php
+++ b/htdocs/hrm/skill_document.php
@@ -80,8 +80,8 @@ if ($id > 0 || !empty($ref)) {
}
// Permissions
-$permissiontoread = $user->rights->hrm->all->read;
-$permissiontoadd = $user->rights->hrm->all->write; // Used by the include of actions_addupdatedelete.inc.php and actions_linkedfiles.inc.php
+$permissiontoread = $user->hasRight('hrm', 'all', 'read');
+$permissiontoadd = $user->hasRight('hrm', 'all', 'write'); // Used by the include of actions_addupdatedelete.inc.php and actions_linkedfiles.inc.php
// Security check (enable the most restrictive one)
//if ($user->socid > 0) accessforbidden();
diff --git a/htdocs/hrm/skill_note.php b/htdocs/hrm/skill_note.php
index 85822772375..645180ec4ec 100644
--- a/htdocs/hrm/skill_note.php
+++ b/htdocs/hrm/skill_note.php
@@ -57,8 +57,8 @@ if ($id > 0 || !empty($ref)) {
}
// Permissions
-$permissionnote = $user->rights->hrm->all->write;
-$permissiontoread = $user->rights->hrm->all->read; // Used by the include of actions_addupdatedelete.inc.php
+$permissionnote = $user->hasRight('hrm', 'all', 'write');
+$permissiontoread = $user->hasRight('hrm', 'all', 'read'); // Used by the include of actions_addupdatedelete.inc.php
// Security check (enable the most restrictive one)
//if ($user->socid > 0) accessforbidden();
diff --git a/htdocs/imports/class/import.class.php b/htdocs/imports/class/import.class.php
index 0687650ce8a..05d8b4bb54b 100644
--- a/htdocs/imports/class/import.class.php
+++ b/htdocs/imports/class/import.class.php
@@ -171,7 +171,7 @@ class Import
}
// Permission
- $this->array_import_perms[$i] = $user->rights->import->run;
+ $this->array_import_perms[$i] = $user->hasRight('import', 'run');
// Icon
$this->array_import_icon[$i] = (isset($module->import_icon[$r]) ? $module->import_icon[$r] : $module->picto);
// Code of dataset export
diff --git a/htdocs/imports/import.php b/htdocs/imports/import.php
index 4eb466dbf76..1f20107db80 100644
--- a/htdocs/imports/import.php
+++ b/htdocs/imports/import.php
@@ -34,7 +34,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/import.lib.php';
// Load translation files required by the page
-$langs->loadLangs(array('exports', 'compta', 'errors'));
+$langs->loadLangs(array('exports', 'compta', 'errors', 'admin'));
// Security check
$result = restrictedArea($user, 'import');
diff --git a/htdocs/install/doctemplates/websites/website_template-corporate/containers/blog-our-company-is-now-on-dolibarr.php b/htdocs/install/doctemplates/websites/website_template-corporate/containers/blog-our-company-is-now-on-dolibarr.php
deleted file mode 100644
index 99c4f10314b..00000000000
--- a/htdocs/install/doctemplates/websites/website_template-corporate/containers/blog-our-company-is-now-on-dolibarr.php
+++ /dev/null
@@ -1,5 +0,0 @@
-ref.'/page180.tpl.php';
-?>
diff --git a/htdocs/install/doctemplates/websites/website_template-corporate/containers/blog-our-new-web-site-has-been-launched.php b/htdocs/install/doctemplates/websites/website_template-corporate/containers/blog-our-new-web-site-has-been-launched.php
deleted file mode 100644
index 248bb708f48..00000000000
--- a/htdocs/install/doctemplates/websites/website_template-corporate/containers/blog-our-new-web-site-has-been-launched.php
+++ /dev/null
@@ -1,5 +0,0 @@
-ref.'/page181.tpl.php';
-?>
diff --git a/htdocs/install/doctemplates/websites/website_template-corporate/containers/blog.php b/htdocs/install/doctemplates/websites/website_template-corporate/containers/blog.php
deleted file mode 100644
index 43a0212d3f6..00000000000
--- a/htdocs/install/doctemplates/websites/website_template-corporate/containers/blog.php
+++ /dev/null
@@ -1,5 +0,0 @@
-ref.'/page179.tpl.php';
-?>
diff --git a/htdocs/install/doctemplates/websites/website_template-corporate/containers/careers.php b/htdocs/install/doctemplates/websites/website_template-corporate/containers/careers.php
deleted file mode 100644
index a2c8a7165a7..00000000000
--- a/htdocs/install/doctemplates/websites/website_template-corporate/containers/careers.php
+++ /dev/null
@@ -1,5 +0,0 @@
-ref.'/page182.tpl.php';
-?>
diff --git a/htdocs/install/doctemplates/websites/website_template-corporate/containers/carriere.php b/htdocs/install/doctemplates/websites/website_template-corporate/containers/carriere.php
deleted file mode 100644
index f32f4818ac4..00000000000
--- a/htdocs/install/doctemplates/websites/website_template-corporate/containers/carriere.php
+++ /dev/null
@@ -1,5 +0,0 @@
-ref.'/page183.tpl.php';
-?>
diff --git a/htdocs/install/doctemplates/websites/website_template-corporate/containers/clients-testimonials.php b/htdocs/install/doctemplates/websites/website_template-corporate/containers/clients-testimonials.php
deleted file mode 100644
index 2c01e32e135..00000000000
--- a/htdocs/install/doctemplates/websites/website_template-corporate/containers/clients-testimonials.php
+++ /dev/null
@@ -1,5 +0,0 @@
-ref.'/page184.tpl.php';
-?>
diff --git a/htdocs/install/doctemplates/websites/website_template-corporate/containers/contact.php b/htdocs/install/doctemplates/websites/website_template-corporate/containers/contact.php
deleted file mode 100644
index 2c9c69905fa..00000000000
--- a/htdocs/install/doctemplates/websites/website_template-corporate/containers/contact.php
+++ /dev/null
@@ -1,5 +0,0 @@
-ref.'/page185.tpl.php';
-?>
diff --git a/htdocs/install/doctemplates/websites/website_template-corporate/containers/faq.php b/htdocs/install/doctemplates/websites/website_template-corporate/containers/faq.php
deleted file mode 100644
index 94f01880f4e..00000000000
--- a/htdocs/install/doctemplates/websites/website_template-corporate/containers/faq.php
+++ /dev/null
@@ -1,5 +0,0 @@
-ref.'/page186.tpl.php';
-?>
diff --git a/htdocs/install/doctemplates/websites/website_template-corporate/containers/footer.php b/htdocs/install/doctemplates/websites/website_template-corporate/containers/footer.php
deleted file mode 100644
index 533ddc027a2..00000000000
--- a/htdocs/install/doctemplates/websites/website_template-corporate/containers/footer.php
+++ /dev/null
@@ -1,5 +0,0 @@
-ref.'/page187.tpl.php';
-?>
diff --git a/htdocs/install/doctemplates/websites/website_template-corporate/containers/header.php b/htdocs/install/doctemplates/websites/website_template-corporate/containers/header.php
deleted file mode 100644
index 831c7ded51a..00000000000
--- a/htdocs/install/doctemplates/websites/website_template-corporate/containers/header.php
+++ /dev/null
@@ -1,5 +0,0 @@
-ref.'/page188.tpl.php';
-?>
diff --git a/htdocs/install/doctemplates/websites/website_template-corporate/containers/home.php b/htdocs/install/doctemplates/websites/website_template-corporate/containers/home.php
deleted file mode 100644
index 86a6639e327..00000000000
--- a/htdocs/install/doctemplates/websites/website_template-corporate/containers/home.php
+++ /dev/null
@@ -1,5 +0,0 @@
-ref.'/page189.tpl.php';
-?>
diff --git a/htdocs/install/doctemplates/websites/website_template-corporate/containers/index.php b/htdocs/install/doctemplates/websites/website_template-corporate/containers/index.php
deleted file mode 100644
index 5ac34065524..00000000000
--- a/htdocs/install/doctemplates/websites/website_template-corporate/containers/index.php
+++ /dev/null
@@ -1,11 +0,0 @@
-
diff --git a/htdocs/install/doctemplates/websites/website_template-corporate/containers/our-team.php b/htdocs/install/doctemplates/websites/website_template-corporate/containers/our-team.php
deleted file mode 100644
index 1afe5d1523d..00000000000
--- a/htdocs/install/doctemplates/websites/website_template-corporate/containers/our-team.php
+++ /dev/null
@@ -1,5 +0,0 @@
-ref.'/page190.tpl.php';
-?>
diff --git a/htdocs/install/doctemplates/websites/website_template-corporate/containers/page179.tpl.php b/htdocs/install/doctemplates/websites/website_template-corporate/containers/page179.tpl.php
deleted file mode 100644
index 7a474b5595e..00000000000
--- a/htdocs/install/doctemplates/websites/website_template-corporate/containers/page179.tpl.php
+++ /dev/null
@@ -1,99 +0,0 @@
-
-
-
-Blog
-
-
-
-
-
-
-
-
-
-use_manifest) { print ''."\n"; } ?>
-
-
-
-
-
-
-
-
-
-
-
-
- Like several thousands of companies, our company (name ?>) has moved all its information system to Dolibarr ERP CRM. More than 20 applications have been replaced by only one, easier to use and fully integrated.
- This is an important step in improving all of our services.
-
-
-
-
-
-
- Screenshot of our new Open Source solution
-
-
-
-
-
-
-
- Our new website, based on Dolibarr CMS, has been launched.
- Now it is modern and directly integrated with the internal management tools of the company. Many new online services will be available for our customers...
-
-
-
-
- They did everything, with almost no time or effort for me. The best part was that I could trust their team to represent our company professionally with our clients.
-
-
-
-
-
-
-
-
-
-
-
- Pierre Curie
-
-
CEO “Cyclonic”
-
-
-
-
-
-30%
-
Expenses
-
-
-
-
-
-
-
- Their course gave me the confidence to implement new techniques in my work. I learn “how” to write – “what” and “why” also became much clearer.
-
-
-
-
-
-
-
-
-
-
-
- Marie Curie
-
-
CTO "Cyclonic"
-
-
-
-
-
+22%
-
Turnover
-
-
-
-
-
-
-
- We were skeptical to work with a consultant to optimize our sales emails, but they were highly recommended by many other startups we knew. They helped us to reach our objective of 20% turnover increase, in 4 months.
-
-
-
-
-
-
-
-
-
-
-
- John Doe
-
-
Sale representative
-
-
-
-
-
+40%
-
Quotes
-
-
-
-
-
-
-
- Their work on our website and Internet marketing has made a significant different to our business. We’ve seen a +40% increase in quote requests from our website.
-
-
* Your customer information (email, phone, business name, first and last name of contact, address, postal code, country and VAT number) are stored when you become a customer. This information allows us to bill you. P>
-
* If you paid using our online service, we also store the last 4 digits of your card. The full details of your credit card is stored by our payment provider Stripe (the world leader in online payment).
-
* You have the option to request the deletion of your data and the above information at any time (except data required y fiscal tracking rules, like your invoices).
-
* The Privacy Policies and GDPR referral contact for our services is: global->MAIN_INFO_GDPR; ?>
-
-
Data Storage and Backups
-
* The storage of collected data (see 'Information collected and used') is done in a database.
-
* We made one backup every week. Only 4 weeks are kept.
-
-
Subcontractor
-
* Our services relies on the following subcontractors and service:
-** The host of computer servers, which is ABC company. These servers are hosted in US. No customer information is communicated to this subcontractor who only provides the hardware and network layer, the installation and operation being carried out by us directly.
-** The online payment service Stripe, which is used, to ensure regular payment of subscription or your invoices paid online.
-
-
Software Protection
-
* Our services runs on Linux Ubuntu systems and software. They benefit from regular security updates when the operating system editor (Ubuntu Canonical) publishes them.
-
* Our services are accessible in HTTPS (HTTP encrypted) only, encrypted with SHA256 certificates.
-
* Our technical platform are protected by various solutions.
-
-
Data theft
-
* In case of suspicion of a theft of the data we have collected (see first point 'Information collected and used'), customers will be informed by email, at email corresponding to their customer account
- Lorem ipsum dolor, sit amet consectetur adipisicing
- elit. Ab fuga nobis omnis alias, aliquid iste cumque
- tempora nim reprehenderit quia itaque debitis,
- nostrum labore rerum reiciendis laboriosam unde,
- tempore corporis.
-
- Lorem ipsum dolor, sit amet consectetur adipisicing
- elit. Ab fuga nobis omnis alias, aliquid iste cumque
- tempora nim reprehenderit quia itaque debitis,
- nostrum labore rerum reiciendis laboriosam unde,
- tempore corporis.
-
-
-
-
-
-
-
-
-
-
Founders
-
-
-
Author One
-
-
-
Author Two
-
-
-
Author Three
-
-
-
Author Four
-
-
-
-
-
About
-
- Lorem ipsum dolor sit amet consectetur adipisicing elit. Veritatis accusantium earum sed odit velit laudantium ex libero quisquam consectetur,
- dolorem vero ipsam perferendis quibusdam itaque omnis a consequatur error repellat.
-
-
-
-
-
-
-
-
Contact us
-
-
Do you have any questions? Please do not hesitate to contact us directly. Our team will come back to you within
- a matter of hours to help you.
- Some quick example text to build on the
- card title and make up the bulk of the
- card's content.
-
-
-
-
-
-
-
-
-
-
-
-
LoremIpsum
-
- Some quick example text to build on the
- card title and make up the bulk of the
- card's content.
-
-
-
-
-
-
-
-
-
-
-
-
LoremIpsum
-
- Some quick example text to build on the
- card title and make up the bulk of the
- card's content.
-
-
-
-
-
-
-
-
-
-
-
-
LoremIpsum
-
- Some quick example text to build on the
- card title and make up the bulk of the
- card's content.
-
-
-
-
-
-
-
-
-
-
-
-
LoremIpsum
-
- Some quick example text to build on the
- card title and make up the bulk of the
- card's content.
-
-
-
-
-
-
-
-
-
-
-
-
LoremIpsum
-
- Some quick example text to build on the
- card title and make up the bulk of the
- card's content.
-
-
-
-
-
-
-
-
-
-
-
-
-
UNLIMITED FOR ALL
-
Lorem, ipsum dolor sit amet consectetur adipisicing elit. Minus molestias voluptatibus voluptatem Lorem ipsum dolor, sit amet consectetur adipisicing elit. Veritatis officia voluptatem incidunt tempore esse porro sequi eveniet eum corrupti quo.
Donec eget ex magna. Interdum et malesuada fames ac ante ipsum primis in faucibus. Pellentesque venenatis dolor imperdiet dolor mattis sagittis. Praesent rutrum sem diam, vitae egestas enim auctor sit amet. Pellentesque leo mauris, consectetur id ipsum sit amet, fergiat. Pellentesque in mi eu massa lacinia malesuada et a elit. Donec urna ex, lacinia in purus ac, pretium pulvinar mauris. Curabitur sapien risus, commodo eget turpis at, elementum convallis fames ac ante ipsum primis in faucibus.
-
Pellentesque venenatis dolor imperdiet dolor mattis sagittis. Praesent rutrum sem diam, vitae egestas enim auctor sit amet.
-
Tempus veroeros
-
Cep risus aliquam gravida cep ut lacus amet. Adipiscing faucibus nunc placerat. Tempus adipiscing turpis non blandit accumsan eget lacinia nunc integer interdum amet aliquam ut orci non col ut ut praesent.
Sed lorem ipsum dolor sit amet nullam consequat feugiat consequat magna
- adipiscing magna etiam amet veroeros. Lorem ipsum dolor tempus sit cursus.
- Tempus nisl et nullam lorem ipsum dolor sit amet aliquam.
Sed lorem amet ipsum dolor et amet nullam consequat a feugiat consequat tempus veroeros sed consequat.
-
-
-
-
Amed sed feugiat
-
Sed lorem amet ipsum dolor et amet nullam consequat a feugiat consequat tempus veroeros sed consequat.
-
-
-
-
Dolor nullam
-
Sed lorem amet ipsum dolor et amet nullam consequat a feugiat consequat tempus veroeros sed consequat.
-
-
-
-
-
-
-
-
-
Ipsum consequat
-
Donec imperdiet consequat consequat. Suspendisse feugiat congue
- posuere. Nulla massa urna, fermentum eget quam aliquet.
-
-
-
-
- 5,120 Etiam
-
-
-
- 8,192 Magna
-
-
-
- 2,048 Tempus
-
-
-
- 4,096 Aliquam
-
-
-
- 1,024 Nullam
-
-
-
Nim elementum nisl et mi a commodo porttitor. Morbi sit amet nisl eu arcu faucibus hendrerit vel a risus. Nim a orci mi, elementum ac arcu sit amet, fermentum pellentesque et purus. Integer maximus varias lorem, sed convallis diam accumsan sed. Etiam porttitor placerat sapien, sed eleifend a enim pulvinar faucibus semper quis ut arcu. Ut non nisl a mollis est efficitur vestibulum. Integer eget purus nec nulla mattis et accumsan ut magna libero. Morbi auctor iaculis porttitor. Sed ut magna ac risus et hendrerit scelerisque. Praesent eleifend lacus in lectus aliquam porta. Cras eu ornare dui curabitur lacinia.
-
-
-
-
-
-
-
Congue imperdiet
-
Donec imperdiet consequat consequat. Suspendisse feugiat congue
- posuere. Nulla massa urna, fermentum eget quam aliquet.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/htdocs/install/doctemplates/websites/website_template-stellar/containers/page24.tpl.php b/htdocs/install/doctemplates/websites/website_template-stellar/containers/page24.tpl.php
deleted file mode 100644
index 3ea7a55dbd5..00000000000
--- a/htdocs/install/doctemplates/websites/website_template-stellar/containers/page24.tpl.php
+++ /dev/null
@@ -1,48 +0,0 @@
-
-
-
-Menu
-
-
-
-
-
-
-
-
-
-use_manifest) { print ''."\n"; } ?>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/htdocs/install/doctemplates/websites/website_template-stellar/containers/page25.tpl.php b/htdocs/install/doctemplates/websites/website_template-stellar/containers/page25.tpl.php
deleted file mode 100644
index ec9e02f4914..00000000000
--- a/htdocs/install/doctemplates/websites/website_template-stellar/containers/page25.tpl.php
+++ /dev/null
@@ -1,44 +0,0 @@
-
-
-
-This is a Blog post
-
-
-
-
-
-
-
-
-
-use_manifest) { print ''."\n"; } ?>
-
-
-
-
-
-
-
-
-
-
-
-
-
- This is a blog post article...
-
-
-
-
-
diff --git a/htdocs/install/doctemplates/websites/website_template-stellar/containers/this-is-a-blog-post.php b/htdocs/install/doctemplates/websites/website_template-stellar/containers/this-is-a-blog-post.php
deleted file mode 100644
index 0b70a249b2c..00000000000
--- a/htdocs/install/doctemplates/websites/website_template-stellar/containers/this-is-a-blog-post.php
+++ /dev/null
@@ -1,4 +0,0 @@
-ref.'/page25.tpl.php';
diff --git a/htdocs/install/mysql/migration/19.0.0-20.0.0.sql b/htdocs/install/mysql/migration/19.0.0-20.0.0.sql
index 335c493c6cf..233ffab3b55 100644
--- a/htdocs/install/mysql/migration/19.0.0-20.0.0.sql
+++ b/htdocs/install/mysql/migration/19.0.0-20.0.0.sql
@@ -212,6 +212,10 @@ ALTER TABLE llx_knowledgemanagement_knowledgerecord MODIFY COLUMN answer longtex
-- Rename const to add customer categories on not customer/prospect third-party if enabled
UPDATE llx_const SET name = 'THIRDPARTY_CAN_HAVE_CUSTOMER_CATEGORY_EVEN_IF_NOT_CUSTOMER_PROSPECT' WHERE name = 'THIRDPARTY_CAN_HAVE_CATEGORY_EVEN_IF_NOT_CUSTOMER_PROSPECT_SUPPLIER';
+ALTER TABLE llx_fichinter ADD COLUMN signed integer DEFAULT NULL AFTER duree;
+
+ALTER TABLE llx_mailing ADD COLUMN messtype varchar(16) DEFAULT 'email' after rowid;
+
ALTER TABLE llx_ticket ADD COLUMN model_pdf varchar(255);
ALTER TABLE llx_ticket ADD COLUMN last_main_doc varchar(255);
ALTER TABLE llx_ticket ADD COLUMN extraparams varchar(255);
diff --git a/htdocs/install/mysql/tables/llx_fichinter.sql b/htdocs/install/mysql/tables/llx_fichinter.sql
index b9f9008f202..9e5d932b21a 100644
--- a/htdocs/install/mysql/tables/llx_fichinter.sql
+++ b/htdocs/install/mysql/tables/llx_fichinter.sql
@@ -39,6 +39,7 @@ create table llx_fichinter
datee date, -- date de fin d'intervention
datet date, -- date de terminaison de l'intervention
duree real, -- duree totale de l'intervention
+ signed integer DEFAULT NULL, -- signed status
description text,
note_private text,
note_public text,
diff --git a/htdocs/install/mysql/tables/llx_mailing-mailing.sql b/htdocs/install/mysql/tables/llx_mailing-mailing.sql
index 809054cc879..eb03b17853b 100644
--- a/htdocs/install/mysql/tables/llx_mailing-mailing.sql
+++ b/htdocs/install/mysql/tables/llx_mailing-mailing.sql
@@ -18,15 +18,10 @@
-- ========================================================================
--- draft : 0
--- valid : 1
--- approved : 2
--- sent : 3
-
create table llx_mailing
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
- statut smallint DEFAULT 0, --
+ messtype varchar(16) DEFAULT 'email', -- 'email' or 'sms' or ...
titre varchar(128), -- Ref of mailing
entity integer DEFAULT 1 NOT NULL, -- multi company id
sujet varchar(128), -- Sujet of mailing
@@ -34,9 +29,9 @@ create table llx_mailing
bgcolor varchar(8), -- Backgroud color of mailing
bgimage varchar(255), -- Backgroud image of mailing
evenunsubscribe smallint DEFAULT 0, -- If 1, email will be send event if recipient has opt-out to emailings
- cible varchar(60),
+ cible varchar(60), -- ???
nbemail integer,
- email_from varchar(160), -- Email address of sender
+ email_from varchar(160), -- Email address or Phone of sender
name_from varchar(128), -- Name to show of sender
email_replyto varchar(160), -- Email address for reply
email_errorsto varchar(160), -- Email addresse for errors
@@ -50,11 +45,12 @@ create table llx_mailing
fk_user_modif integer, -- user of last modification
fk_user_valid integer, -- user validator
fk_user_appro integer, -- not used
- extraparams varchar(255), -- for stock other parameters with json format
+ extraparams varchar(255), -- to stock other parameters with json format
joined_file1 varchar(255),
joined_file2 varchar(255),
joined_file3 varchar(255),
joined_file4 varchar(255),
+ statut smallint DEFAULT 0, -- status (draft:0, valid: 1, approved: 2, sent: 3)
note_private text,
note_public text
)ENGINE=innodb;
diff --git a/htdocs/install/mysql/tables/llx_product.sql b/htdocs/install/mysql/tables/llx_product.sql
index 0dd84d550f5..ad7160f2dab 100644
--- a/htdocs/install/mysql/tables/llx_product.sql
+++ b/htdocs/install/mysql/tables/llx_product.sql
@@ -108,7 +108,7 @@ create table llx_product
price_autogen tinyint DEFAULT 0,
fk_project integer DEFAULT NULL, -- Used when product was generated by a project or is specific to a project
mandatory_period tinyint DEFAULT 0, -- is used to signal to the user that the start and end dates are mandatory for this type of product the fk_product_type == 1 (service) (non-blocking action)
-
+ last_main_doc varchar(255),
fk_default_bom integer DEFAULT NULL,
fk_default_workstation integer DEFAULT NULL
)ENGINE=innodb;
diff --git a/htdocs/install/mysql/tables/llx_societe.sql b/htdocs/install/mysql/tables/llx_societe.sql
index 639874b6231..111f4d8753c 100644
--- a/htdocs/install/mysql/tables/llx_societe.sql
+++ b/htdocs/install/mysql/tables/llx_societe.sql
@@ -43,13 +43,13 @@ create table llx_societe
address varchar(255), -- company address
zip varchar(25), -- zipcode
town varchar(50), -- town
- fk_departement integer DEFAULT 0, --
- fk_pays integer DEFAULT 0, --
+ fk_departement integer DEFAULT 0, -- state
+ fk_pays integer DEFAULT 0, -- country
fk_account integer DEFAULT 0, -- default bank account
phone varchar(20), -- phone number
fax varchar(20), -- fax number
- url varchar(255), --
- email varchar(128), --
+ url varchar(255), -- web site
+ email varchar(128), -- main email
socialnetworks text DEFAULT NULL, -- json with socialnetworks
diff --git a/htdocs/install/mysql/tables/llx_ticket-ticket.sql b/htdocs/install/mysql/tables/llx_ticket-ticket.sql
index 4006046449d..c249f6780b3 100644
--- a/htdocs/install/mysql/tables/llx_ticket-ticket.sql
+++ b/htdocs/install/mysql/tables/llx_ticket-ticket.sql
@@ -49,5 +49,8 @@ CREATE TABLE llx_ticket
last_main_doc varchar(255), -- relative filepath+filename of last main generated document
extraparams varchar(255), -- to save other parameters with json format
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+ model_pdf varchar(255),
+ last_main_doc varchar(255), -- relative filepath+filename of last main generated document
+ extraparams varchar(255), -- to save other parameters with json format
import_key varchar(14)
)ENGINE=innodb;
diff --git a/htdocs/intracommreport/card.php b/htdocs/intracommreport/card.php
index c234f22c7e4..358385af8f7 100644
--- a/htdocs/intracommreport/card.php
+++ b/htdocs/intracommreport/card.php
@@ -78,9 +78,9 @@ $hookmanager->initHooks(array('intracommcard', 'globalcard'));
$error = 0;
// Permissions
-$permissiontoread = $user->rights->intracommreport->read;
-$permissiontoadd = $user->rights->intracommreport->write;
-$permissiontodelete = $user->rights->intracommreport->delete;
+$permissiontoread = $user->hasRight('intracommreport', 'read');
+$permissiontoadd = $user->hasRight('intracommreport', 'write');
+$permissiontodelete = $user->hasRight('intracommreport', 'delete');
// Security check (enable the most restrictive one)
//if ($user->socid > 0) accessforbidden();
diff --git a/htdocs/intracommreport/list.php b/htdocs/intracommreport/list.php
index ecf2ed66019..a3947ba03bc 100644
--- a/htdocs/intracommreport/list.php
+++ b/htdocs/intracommreport/list.php
@@ -153,8 +153,8 @@ if ($search_type == '0') {
$result = restrictedArea($user, 'produit|service', '', '', '', '', '', 0);
}
-$permissiontoread = $user->rights->intracommreport->read;
-$permissiontodelete = $user->rights->intracommreport->delete;
+$permissiontoread = $user->hasRight('intracommreport', 'read');
+$permissiontodelete = $user->hasRight('intracommreport', 'delete');
/*
diff --git a/htdocs/knowledgemanagement/class/api_knowledgemanagement.class.php b/htdocs/knowledgemanagement/class/api_knowledgemanagement.class.php
index ceae56fd3fd..6f12ceadf7d 100644
--- a/htdocs/knowledgemanagement/class/api_knowledgemanagement.class.php
+++ b/htdocs/knowledgemanagement/class/api_knowledgemanagement.class.php
@@ -101,7 +101,7 @@ class KnowledgeManagement extends DolibarrApi
*/
public function getCategories($id, $sortfield = "s.rowid", $sortorder = 'ASC', $limit = 0, $page = 0)
{
- if (!DolibarrApiAccess::$user->rights->categorie->lire) {
+ if (!DolibarrApiAccess::$user->hasRight('categorie', 'lire')) {
throw new RestException(403);
}
@@ -149,7 +149,7 @@ class KnowledgeManagement extends DolibarrApi
// If the internal user must only see his customers, force searching by him
$search_sale = 0;
- if ($restrictonsocid && !DolibarrApiAccess::$user->rights->societe->client->voir && !$socid) {
+ if ($restrictonsocid && !DolibarrApiAccess::$user->hasRight('societe', 'client', 'voir') && !$socid) {
$search_sale = DolibarrApiAccess::$user->id;
}
diff --git a/htdocs/knowledgemanagement/core/modules/knowledgemanagement/mod_knowledgerecord_advanced.php b/htdocs/knowledgemanagement/core/modules/knowledgemanagement/mod_knowledgerecord_advanced.php
index fc22678a87a..0c1b043f006 100644
--- a/htdocs/knowledgemanagement/core/modules/knowledgemanagement/mod_knowledgerecord_advanced.php
+++ b/htdocs/knowledgemanagement/core/modules/knowledgemanagement/mod_knowledgerecord_advanced.php
@@ -123,7 +123,7 @@ class mod_knowledgerecord_advanced extends ModeleNumRefKnowledgeRecord
* Return next free value
*
* @param Object $object Object we need next value for
- * @return string Value if KO, <0 if KO
+ * @return string|0 Next value if OK, 0 if KO
*/
public function getNextValue($object)
{
diff --git a/htdocs/knowledgemanagement/core/modules/knowledgemanagement/mod_knowledgerecord_standard.php b/htdocs/knowledgemanagement/core/modules/knowledgemanagement/mod_knowledgerecord_standard.php
index 20ba2817501..3d509d7d25c 100644
--- a/htdocs/knowledgemanagement/core/modules/knowledgemanagement/mod_knowledgerecord_standard.php
+++ b/htdocs/knowledgemanagement/core/modules/knowledgemanagement/mod_knowledgerecord_standard.php
@@ -117,7 +117,7 @@ class mod_knowledgerecord_standard extends ModeleNumRefKnowledgeRecord
* Return next free value
*
* @param Object $object Object we need next value for
- * @return string Value if KO, <0 if KO
+ * @return string|-1 Next value if OK, -1 if KO
*/
public function getNextValue($object)
{
diff --git a/htdocs/knowledgemanagement/knowledgerecord_document.php b/htdocs/knowledgemanagement/knowledgerecord_document.php
index f83bcd883e0..75780701b36 100644
--- a/htdocs/knowledgemanagement/knowledgerecord_document.php
+++ b/htdocs/knowledgemanagement/knowledgerecord_document.php
@@ -183,10 +183,6 @@ if ($object->id) {
print dol_get_fiche_end();
$modulepart = 'knowledgemanagement';
- //$permission = $user->hasRight('knowledgemanagement', 'knowledgerecord', 'write');
- $permission = 1;
- //$permtoedit = $user->hasRight('knowledgemanagement', 'knowledgerecord', 'write');
- $permtoedit = 1;
$param = '&id='.$object->id;
//$relativepathwithnofile='knowledgerecord/' . dol_sanitizeFileName($object->id).'/';
diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang
index 068dc7eab7e..efe0ffc9246 100644
--- a/htdocs/langs/en_US/admin.lang
+++ b/htdocs/langs/en_US/admin.lang
@@ -149,7 +149,6 @@ MaxNbOfLinesForBoxes=Max. number of lines for widgets
AllWidgetsWereEnabled=All available widgets are enabled
WidgetAvailable=Widget available
PositionByDefault=Default order
-Position=Position
MenusDesc=Menu managers set content of the two menu bars (horizontal and vertical).
MenusEditorDesc=The menu editor allows you to define custom menu entries. Use it carefully to avoid instability and permanently unreachable menu entries. Some modules add menu entries (in menu All mostly). If you remove some of these entries by mistake, you can restore them disabling and reenabling the module.
MenuForUsers=Menu for users
@@ -220,7 +219,6 @@ ModulesMarketPlaces=Find external app/modules
ModulesDevelopYourModule=Develop your own app/modules
ModulesDevelopDesc=You may also develop your own module or find a partner to develop one for you.
DOLISTOREdescriptionLong=Instead of switching on www.dolistore.com web site to find an external module, you can use this embedded tool that will perform the search on the external market place for you (may be slow, need an internet access)...
-NewModule=New module
FreeModule=Free
CompatibleUpTo=Compatible with version %s
NotCompatible=This module does not seem compatible with your Dolibarr %s (Min %s - Max %s).
@@ -304,7 +302,7 @@ MAIN_DISABLE_ALL_MAILS=Disable all email sending (for test purposes or demos)
MAIN_MAIL_FORCE_SENDTO=Send all emails to (instead of real recipients, for test purposes)
MAIN_MAIL_ENABLED_USER_DEST_SELECT=Suggest emails of employees (if defined) into the list of predefined recipient when writing a new email
MAIN_MAIL_NO_WITH_TO_SELECTED=Do not select a default recipient even if there is only 1 possible choice
-MAIN_MAIL_SENDMODE=Email sending method
+MAIN_MAIL_SENDMODE=Sending method
MAIN_MAIL_SMTPS_ID=SMTP ID (if sending server requires authentication)
MAIN_MAIL_SMTPS_PW=SMTP Password (if sending server requires authentication)
MAIN_MAIL_EMAIL_TLS=Use TLS (SSL) encryption
@@ -435,6 +433,7 @@ MassConvert=Launch bulk conversion
PriceFormatInCurrentLanguage=Price Format In Current Language
String=String
String1Line=String (1 line)
+Text=Text
TextLong=Long text
TextLongNLines=Long text (n lines)
HtmlText=Html text
@@ -1209,7 +1208,6 @@ EnableMultilangInterface=Enable multilanguage support for customer or vendor rel
EnableShowLogo=Show the company logo in the menu
CompanyInfo=Company/Organization
CompanyIds=Company/Organization identities
-CompanyName=Name
CompanyAddress=Address
CompanyZip=Zip
CompanyTown=Town
@@ -1748,8 +1746,6 @@ BarcodeDescQRCODE=Barcode of type QR code
GenbarcodeLocation=Bar code generation command line tool (used by internal engine for some bar code types). Must be compatible with "genbarcode". For example: /usr/local/bin/genbarcode
BarcodeInternalEngine=Internal engine
BarCodeNumberManager=Manager to auto define barcode numbers
-##### Prelevements #####
-WithdrawalsSetup=Setup of module Direct Debit payments
##### ExternalRSS #####
ExternalRSSSetup=External RSS imports setup
NewRSS=New RSS Feed
@@ -2333,7 +2329,6 @@ ExportUseLowMemoryModeHelp=Use the low memory mode to generate the dump file (co
ModuleWebhookName = Webhook
ModuleWebhookDesc = Interface to catch dolibarr triggers and send data of the event to an URL
WebhookSetup = Webhook setup
-Settings = Settings
WebhookSetupPage = Webhook setup page
ShowQuickAddLink=Show a button to quickly add an element in top right menu
ShowSearchAreaInTopMenu=Show the search area in the top menu
diff --git a/htdocs/langs/en_US/agenda.lang b/htdocs/langs/en_US/agenda.lang
index e0faafd5984..70ce8809858 100644
--- a/htdocs/langs/en_US/agenda.lang
+++ b/htdocs/langs/en_US/agenda.lang
@@ -8,8 +8,6 @@ LocalAgenda=Default calendar
ActionsOwnedBy=Event owned by
ActionsOwnedByShort=Owner
AffectedTo=Assigned to
-Event=Event
-Events=Events
EventsNb=Number of events
ListOfActions=List of events
EventReports=Event reports
@@ -190,10 +188,8 @@ MenuBookcalIndex=Online appointment
BookcalLabelAvailabilityHelp=Label of the availability range. For example: General availability Availability during christmas holidays
DurationOfRange=Duration of ranges
BookCalSetup = Online appointment setup
-Settings = Settings
BookCalSetupPage = Online appointment setup page
BOOKCAL_PUBLIC_INTERFACE_TOPIC = Interface title
-About = About
BookCalAbout = About BookCal
BookCalAboutPage = BookCal about page
Calendars=Calendars
diff --git a/htdocs/langs/en_US/banks.lang b/htdocs/langs/en_US/banks.lang
index c6970765e9c..a7ff18831ab 100644
--- a/htdocs/langs/en_US/banks.lang
+++ b/htdocs/langs/en_US/banks.lang
@@ -67,7 +67,6 @@ AccountsArea=Accounts area
AccountCard=Account card
DeleteAccount=Delete account
ConfirmDeleteAccount=Are you sure you want to delete this account?
-Account=Account
BankTransactionByCategories=Bank entries by categories
BankTransactionForCategory=Bank entries for category %s
RemoveFromRubrique=Remove link with category
diff --git a/htdocs/langs/en_US/blockedlog.lang b/htdocs/langs/en_US/blockedlog.lang
index cb66945f888..06ccc6b6b37 100644
--- a/htdocs/langs/en_US/blockedlog.lang
+++ b/htdocs/langs/en_US/blockedlog.lang
@@ -1,5 +1,4 @@
BlockedLog=Unalterable Logs
-Field=Field
BlockedLogDesc=This module tracks some events into an unalterable log (that you can't modify once recorded) into a block chain, in real time. This module provides compatibility with requirements of laws of some countries (like France with the law Finance 2016 - Norme NF525).
Fingerprints=Archived events and fingerprints
FingerprintsDesc=This is the tool to browse or extract the unalterable logs. Unalterable logs are generated and archived locally into a dedicated table, in real time when you record a business event. You can use this tool to export this archive and save it into an external support (some countries, like France, ask that you do it every year). Note that, there is no feature to purge this log and every change tried to be done directly into this log (by a hacker for example) will be reported with a non-valid fingerprint. If you really need to purge this table because you used your application for a demo/test purpose and want to clean your data to start your production, you can ask your reseller or integrator to reset your database (all your data will be removed).
@@ -13,7 +12,6 @@ OkCheckFingerprintValidity=Archived log record is valid. The data on this line w
OkCheckFingerprintValidityButChainIsKo=Archived log seems valid compared to previous one but the chain was corrupted previously.
AddedByAuthority=Stored into remote authority
NotAddedByAuthorityYet=Not yet stored into remote authority
-ShowDetails=Show stored details
BlockedLogBillDownload=Customer invoice download
BlockedLogBillPreview=Customer invoice preview
BlockedlogInfoDialog=Log Details
diff --git a/htdocs/langs/en_US/cashdesk.lang b/htdocs/langs/en_US/cashdesk.lang
index dba0ab25634..49053c063e7 100644
--- a/htdocs/langs/en_US/cashdesk.lang
+++ b/htdocs/langs/en_US/cashdesk.lang
@@ -90,7 +90,6 @@ ColorTheme=Color theme
Colorful=Colorful
HeadBar=Head Bar
SortProductField=Field for sorting products
-Browser=Browser
BrowserMethodDescription=Simple and easy receipt printing. Only a few parameters to configure the receipt. Print via browser.
TakeposConnectorMethodDescription=External module with extra features. Possibility to print from the cloud.
PrintMethod=Print method
diff --git a/htdocs/langs/en_US/categories.lang b/htdocs/langs/en_US/categories.lang
index 5471c4afad0..8a4d3783d64 100644
--- a/htdocs/langs/en_US/categories.lang
+++ b/htdocs/langs/en_US/categories.lang
@@ -103,4 +103,3 @@ WebsitePagesCategoriesArea=Page-Container Categories
KnowledgemanagementsCategoriesArea=KM article Categories
UseOrOperatorForCategories=Use 'OR' operator for categories
AddObjectIntoCategory=Assign to the category
-Position=Position
diff --git a/htdocs/langs/en_US/cron.lang b/htdocs/langs/en_US/cron.lang
index 52de5a48b82..b40a7df0318 100644
--- a/htdocs/langs/en_US/cron.lang
+++ b/htdocs/langs/en_US/cron.lang
@@ -1,6 +1,5 @@
# Dolibarr language file - Source file is en_US - cron
-# About page
-# Right
+# Permissions
Permission23101 = Read Scheduled job
Permission23102 = Create/update Scheduled job
Permission23103 = Delete Scheduled job
diff --git a/htdocs/langs/en_US/datapolicy.lang b/htdocs/langs/en_US/datapolicy.lang
index 6b4413f812b..4f3f3682ab1 100644
--- a/htdocs/langs/en_US/datapolicy.lang
+++ b/htdocs/langs/en_US/datapolicy.lang
@@ -23,7 +23,7 @@ Module4100Desc = Module to manage Data Privacy (Conformity with the GDPR)
#
datapolicySetup = Module Data Privacy Policy Setup
Deletion = Deletion of data
-datapolicySetupPage = Depending of laws of your countries (Example Article 5 of the GDPR), personal data must be kept for a period not exceeding that necessary for the purposes for which they were collected, except for archival purposes. The deletion will be done automatically after a certain duration without event (the duration which you will have indicated below).
+datapolicySetupPage = Depending on the laws of your countries (Example Article 5 of the GDPR), personal data must be kept for a period not exceeding the duration the data is needed for the purpose for which it was collected, except for archival purposes. The deletion will be done automatically after a certain duration without events (the duration which you will have indicated below).
NB_MONTHS = %s months
ONE_YEAR = 1 year
NB_YEARS = %s years
@@ -40,25 +40,25 @@ DATAPOLICY_CONTACT_FOURNISSEUR = Supplier
DATAPOLICY_ADHERENT = Member
DATAPOLICY_Tooltip_SETUP = Type of contact - Indicate your choices for each type.
DATAPOLICYMail = Emails Setup
-DATAPOLICYSUBJECTMAIL = Subject of email
+DATAPOLICYSUBJECTMAIL = Subject of the email
DATAPOLICYCONTENTMAIL = Content of the email
DATAPOLICYSUBSITUTION = You can use the following variables in your email (LINKACCEPT allows to create a link recording the agreement of the person, LINKREFUSED makes it possible to record the refusal of the person):
DATAPOLICYACCEPT = Message after agreement
-DATAPOLICYREFUSE = Message after desagreement
+DATAPOLICYREFUSE = Message after disagreement
SendAgreementText = You can send a GDPR email to all your relevant contacts (who have not yet received an email and for which you have not registered anything about their GDPR agreement). To do this, use the following button.
SendAgreement = Send emails
AllAgreementSend = All emails have been sent
-TXTLINKDATAPOLICYACCEPT = Text for the link "agreement"
-TXTLINKDATAPOLICYREFUSE = Text for the link "desagreement"
+TXTLINKDATAPOLICYACCEPT = Text for the link "agreement"
+TXTLINKDATAPOLICYREFUSE = Text for the link "disagreement"
#
# Extrafields
#
DATAPOLICY_BLOCKCHECKBOX = GDPR : Processing of personal data
-DATAPOLICY_consentement = Consent obtained for the processing of personal data
-DATAPOLICY_opposition_traitement = Opposes the processing of his personal data
-DATAPOLICY_opposition_prospection = Opposes the processing of his personal data for the purposes of prospecting
+DATAPOLICY_consentement = Consent obtained for the processing of personal data
+DATAPOLICY_opposition_traitement = Opposes to the processing of his personal data
+DATAPOLICY_opposition_prospection = Opposes to the processing of his personal data for the purposes of prospecting
#
# Popup
@@ -68,7 +68,7 @@ DATAPOLICY_POPUP_ANONYME_TEXTE = You can not delete this contact from Dolibarr b
#
# Button for portability
-#
+#
DATAPOLICY_PORTABILITE = Portability GDPR
DATAPOLICY_PORTABILITE_TITLE = Export of personal data
DATAPOLICY_PORTABILITE_CONFIRMATION = You want to export the personal data of this contact. Are you sure ?
@@ -78,12 +78,11 @@ DATAPOLICY_PORTABILITE_CONFIRMATION = You want to export the personal data of th
#
ANONYMISER_AT = Anonymised the %s
-DATAPOLICY_date = Date of agreement/desagreement GDPR
-DATAPOLICY_send = Date sending agreement email
+DATAPOLICY_date = Date of agreement/disagreement GDPR
+DATAPOLICY_send = Date agreement email sent
DATAPOLICY_SEND = Send GDPR email
MailSent = Email has been sent
# ERROR
-ErrorSubjectIsRequired = Error : The subject of email is required. Indicate it in the module setup
-=Due to a technical problem, we were unable to register your choice. We apologize for that. Contact us to send us your choice.
-NUMBER_MONTH_BEFORE_DELETION = Number of month before deletion
+=Due to a technical problem, we were unable to register your choice. We apologize for that. Contact us to notify us your choice.
+NUMBER_MONTH_BEFORE_DELETION = Number of months before deletion
diff --git a/htdocs/langs/en_US/donations.lang b/htdocs/langs/en_US/donations.lang
index 2f97f9ae818..e60a65efb46 100644
--- a/htdocs/langs/en_US/donations.lang
+++ b/htdocs/langs/en_US/donations.lang
@@ -31,6 +31,7 @@ DONATION_ART200=Show article 200 from CGI if you are concerned
DONATION_ART238=Show article 238 from CGI if you are concerned
DONATION_ART978=Show article 978 from CGI if you are concerned
DonationPayment=Donation payment
+DonationPayments=Donation payments
DonationValidated=Donation %s validated
DonationUseThirdparties=Use the address of an existing thirdparty as the address of the donor
DonationsStatistics=Donation's statistics
diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang
index d3ec7e33148..71b2dccb2bf 100644
--- a/htdocs/langs/en_US/errors.lang
+++ b/htdocs/langs/en_US/errors.lang
@@ -325,6 +325,7 @@ ErrorSVGFilesNotAllowedAsLinksWithout=SVG files are not allowed as external link
ErrorTypeMenu=Impossible to add another menu for the same module on the navbar, not handle yet
ErrorObjectNotFound = The object %s is not found, please check your url
ErrorCountryCodeMustBe2Char=Country code must be a 2 character string
+ErrorABatchShouldNotContainsSpaces=A lot or serial number should not contains spaces
ErrorTableExist=Table %s already exist
ErrorDictionaryNotFound=Dictionary %s not found
@@ -406,5 +407,7 @@ ErrorTooManyAttempts= Too many attempts, please try again later
TotalAmountEmpty=Total Amount Empty
FailedToFoundTheConversionRateForInvoice=Failed to found the conversion rate for invoice
-ThisIdNotDefined=$this->id not defined
-OperNotDefined=Oper not defined
+ThisIdNotDefined=Id not defined
+OperNotDefined=Payment method not defined
+ErrorThisContactXIsAlreadyDefinedAsThisType=%s is already defined as contact for this type.
+ErrorThisGroupIsAlreadyDefinedAsThisType=The contacts with this group are already defined as contact for this type.
diff --git a/htdocs/langs/en_US/eventorganization.lang b/htdocs/langs/en_US/eventorganization.lang
index 30c3f5d6b59..8cfd9f6f981 100644
--- a/htdocs/langs/en_US/eventorganization.lang
+++ b/htdocs/langs/en_US/eventorganization.lang
@@ -34,7 +34,6 @@ PaymentEvent=Payment of event
NewRegistration=Registration
EventOrganizationSetup=Event Organization setup
EventOrganization=Event organization
-Settings=Settings
EventOrganizationSetupPage = Event Organization setup page
EVENTORGANIZATION_TASK_LABEL = Label of tasks to create automatically when project is validated
EVENTORGANIZATION_TASK_LABELTooltip = When you validate an event to organize, some tasks can be automatically created in the project
For example: Send Call for Conferences Send Call for Booths Validate suggestions of Conferences Validate application for Booths Open subscriptions to the event for attendees Send a remind of the event to speakers Send a remind of the event to Booth hosters Send a remind of the event to attendees
diff --git a/htdocs/langs/en_US/exports.lang b/htdocs/langs/en_US/exports.lang
index 94ca852beca..29311b3b466 100644
--- a/htdocs/langs/en_US/exports.lang
+++ b/htdocs/langs/en_US/exports.lang
@@ -62,7 +62,6 @@ ChooseFileToImport=Upload file then click on the %s icon to select file as sourc
SourceFileFormat=Source file format
FieldsInSourceFile=Fields in source file
FieldsInTargetDatabase=Target fields in Dolibarr database (bold=mandatory)
-Field=Field
NoFields=No fields
MoveField=Move field column number %s
ExampleOfImportFile=Example_of_import_file
diff --git a/htdocs/langs/en_US/knowledgemanagement.lang b/htdocs/langs/en_US/knowledgemanagement.lang
index acf1bd62f11..e0d1fabecfc 100644
--- a/htdocs/langs/en_US/knowledgemanagement.lang
+++ b/htdocs/langs/en_US/knowledgemanagement.lang
@@ -26,14 +26,12 @@ ModuleKnowledgeManagementDesc=Manage a Knowledge Management (KM) or Help-Desk ba
# Admin page
#
KnowledgeManagementSetup = Knowledge Management System setup
-Settings = Settings
KnowledgeManagementSetupPage = Knowledge Management System setup page
#
# About page
#
-About = About
KnowledgeManagementAbout = About Knowledge Management
KnowledgeManagementAboutPage = Knowledge Management about page
diff --git a/htdocs/langs/en_US/mails.lang b/htdocs/langs/en_US/mails.lang
index 38901ccf3a3..704b4553dcc 100644
--- a/htdocs/langs/en_US/mails.lang
+++ b/htdocs/langs/en_US/mails.lang
@@ -9,6 +9,7 @@ MailRecipients=Recipients
MailRecipient=Recipient
MailTitle=Description
MailFrom=From
+PhoneFrom=From
MailErrorsTo=Errors to
MailReply=Reply to
MailTo=To
@@ -32,7 +33,7 @@ DeleteMailing=Delete emailing
DeleteAMailing=Delete an emailing
PreviewMailing=Preview emailing
CreateMailing=Create emailing
-TestMailing=Test email
+TestMailing=Test
ValidMailing=Valid emailing
MailingStatusDraft=Draft
MailingStatusValidated=Validated
@@ -52,6 +53,7 @@ ConfirmValidMailing=Are you sure you want to validate this emailing?
ConfirmResetMailing=Warning, by re-initializing emailing %s, you will allow the re-sending this email in a bulk mailing. Are you sure you want to do this?
ConfirmDeleteMailing=Are you sure you want to delete this emailing?
NbOfUniqueEMails=No. of unique emails
+NbOfUniquePhones=No. of unique phones
NbOfEMails=No. of EMails
TotalNbOfDistinctRecipients=Number of distinct recipients
NoTargetYet=No recipients defined yet (Go on tab 'Recipients')
@@ -187,6 +189,6 @@ EvenUnsubscribe=Include opt-out emails
EvenUnsubscribeDesc=Include opt-out emails when you select emails as targets. Useful for mandatory service emails for example.
XEmailsDoneYActionsDone=%s emails pre-qualified, %s emails successfully processed (for %s record/actions done)
helpWithAi=Generate message from AI
-YouCanMakeSomeInstructionForEmail=You Can Make Some Instruction For your Email (Exemple: generate image in email template...)
+YouCanMakeSomeInstructionForEmail=You can make some instructions for your Email (Example: generate image in email template...)
ModelTemplate=Email template
-YouCanChooseAModelForYouMailContent= You can shoose one of models or generate one with Ai
\ No newline at end of file
+YouCanChooseAModelForYouMailContent= You can choose one of template models or generate one with AI
diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang
index f7a4127ac5e..e94b0281eb3 100644
--- a/htdocs/langs/en_US/main.lang
+++ b/htdocs/langs/en_US/main.lang
@@ -963,6 +963,7 @@ AutomaticallyCalculated=Automatically calculated
TitleSetToDraft=Go back to draft
ConfirmSetToDraft=Are you sure you want to go back to Draft status?
ImportId=Import id
+Event=Event
Events=Events
EMailTemplates=Email templates
FileNotShared=File not shared to external public
@@ -1180,7 +1181,6 @@ ConfirmAffectUserQuestion=Are you sure you want to assign users to the %s select
ConfirmSetSupervisorQuestion=Are you sure you want to set supervisor to the %s selected record(s)?
ConfirmUpdatePriceQuestion=Are you sure you want to update the price of the %s selected record(s)?
CategTypeNotFound=No tag type found for type of records
-Rate=Rate
SupervisorNotFound=Supervisor not found
CopiedToClipboard=Copied to clipboard
InformationOnLinkToContract=This amount is only the total of all the lines of the contract. No notion of time is taken into consideration.
@@ -1213,6 +1213,7 @@ CanceledHidden=Canceled hidden
CanceledShown=Canceled shown
Terminate=Terminate
Terminated=Terminated
+Position=Position
AddLineOnPosition=Add line on position (at the end if empty)
ConfirmAllocateCommercial=Assign sales representative confirmation
ConfirmAllocateCommercialQuestion=Are you sure you want to assign the %s selected record(s)?
@@ -1263,3 +1264,4 @@ ConfirmMassReverseQuestion=Are you sure you want to reverse the %s selected reco
ElementType=Element type
ElementId=Element Id
Encrypted=Encrypted
+Settings=Settings
diff --git a/htdocs/langs/en_US/members.lang b/htdocs/langs/en_US/members.lang
index 34148bf11e2..05946edce75 100644
--- a/htdocs/langs/en_US/members.lang
+++ b/htdocs/langs/en_US/members.lang
@@ -124,10 +124,6 @@ ExportDataset_member_1=Members and contributions
ImportDataset_member_1=Members
LastMembersModified=Latest %s modified members
LastSubscriptionsModified=Latest %s modified contributions
-String=String
-Text=Text
-Int=Int
-DateAndTime=Date and time
PublicMemberCard=Public member card
SubscriptionNotRecorded=Contribution not recorded
AddSubscription=Create contribution
@@ -243,4 +239,10 @@ MemberLastname=Member lastname
MemberCodeDesc=Member Code, unique for all members
MemberSubscriptionStartFirstDayOf=The start date of a membership corresponds to the first day of a
MemberSubscriptionStartAfter=Minimum period before the entry into force of the start date of a subscription except renewals (example +3m = +3 months, -5d = -5 days, +1Y = +1 year)
-SubscriptionLinkedToConciliatedTransaction=Membership is linked to a conciliated transaction so this modification is not allowed.
\ No newline at end of file
+SubscriptionLinkedToConciliatedTransaction=Membership is linked to a conciliated transaction so this modification is not allowed.
+ConfirmMassSubsriptionCreation=Confirm subscription creation
+ConfirmMassSubsriptionCreationQuestion=Are you sure you want to create the %s selected subscription(s)?
+XSubsriptionCreated=%s subscription(s) created
+XSubsriptionErrors=%s subscription(s) where in error
+CreateSubscription=Create subscription
+WarningNoComplementaryActionDone=No Complementary action on recording will be executed with this massaction
\ No newline at end of file
diff --git a/htdocs/langs/en_US/multicurrency.lang b/htdocs/langs/en_US/multicurrency.lang
index 866a83a32ed..e73eae58d42 100644
--- a/htdocs/langs/en_US/multicurrency.lang
+++ b/htdocs/langs/en_US/multicurrency.lang
@@ -16,7 +16,6 @@ CurrenciesUsed_help_to_add=Add the different currencies and rates you need to us
rate=rate
MulticurrencyReceived=Received, original currency
MulticurrencyRemainderToTake=Remaining amount, original currency
-MulticurrencyPaymentAmount=Payment amount, original currency
AmountToOthercurrency=Amount To (in currency of receiving account)
CurrencyRateSyncSucceed=Currency rate synchronization done successfully
MULTICURRENCY_USE_CURRENCY_ON_DOCUMENT=Use the currency of the document for online payments
diff --git a/htdocs/langs/en_US/orders.lang b/htdocs/langs/en_US/orders.lang
index 662348b6977..acee379edad 100644
--- a/htdocs/langs/en_US/orders.lang
+++ b/htdocs/langs/en_US/orders.lang
@@ -130,7 +130,7 @@ DispatchSupplierOrder=Receiving purchase order %s
FirstApprovalAlreadyDone=First approval already done
SecondApprovalAlreadyDone=Second approval already done
SupplierOrderReceivedInDolibarr=Purchase Order %s received %s
-SupplierOrderSubmitedInDolibarr=Purchase Order %s submitted
+SupplierOrderSubmitedInDolibarr=Purchase Order %s submitted (%s)
SupplierOrderClassifiedBilled=Purchase Order %s set billed
OtherOrders=Other orders
SupplierOrderValidatedAndApproved=Supplier order is validated and approved : %s
diff --git a/htdocs/langs/en_US/recruitment.lang b/htdocs/langs/en_US/recruitment.lang
index 50085bd578f..fcbf87e49f4 100644
--- a/htdocs/langs/en_US/recruitment.lang
+++ b/htdocs/langs/en_US/recruitment.lang
@@ -26,7 +26,6 @@ ModuleRecruitmentDesc = Manage and follow recruitment campaigns for new job posi
# Admin page
#
RecruitmentSetup = Recruitment setup
-Settings = Settings
RecruitmentSetupPage = Enter here the setup of main options for the recruitment module
RecruitmentArea=Recruitement area
PublicInterfaceRecruitmentDesc=Public pages of jobs are public URLs to show and answer to open jobs. There is one different link for each open job, found on each job record.
@@ -35,7 +34,6 @@ EnablePublicRecruitmentPages=Enable public pages of open jobs
#
# About page
#
-About = About
RecruitmentAbout = About Recruitment
RecruitmentAboutPage = Recruitment about page
NbOfEmployeesExpected=Expected nb of employees
diff --git a/htdocs/langs/en_US/stocks.lang b/htdocs/langs/en_US/stocks.lang
index 929374d21f0..70a25ea5e27 100644
--- a/htdocs/langs/en_US/stocks.lang
+++ b/htdocs/langs/en_US/stocks.lang
@@ -314,7 +314,6 @@ StockStransferIncrementedShort=Stocks transferred
StockStransferIncrementedShortCancel=Increase of destination warehouses canceled
StockTransferNoBatchForProduct=Product %s doesn't use batch, clear batch on line and retry
StockTransferSetup = Stocks Transfer module configuration
-Settings=Settings
StockTransferSetupPage = Configuration page for stocks transfer module
StockTransferRightRead=Read stocks transfers
StockTransferRightCreateUpdate=Create/Update stocks transfers
diff --git a/htdocs/langs/en_US/suppliers.lang b/htdocs/langs/en_US/suppliers.lang
index 08895194016..770a143c231 100644
--- a/htdocs/langs/en_US/suppliers.lang
+++ b/htdocs/langs/en_US/suppliers.lang
@@ -8,7 +8,6 @@ NewSupplierInvoice = New vendor invoice
History=History
ListOfSuppliers=List of vendors
ShowSupplier=Show vendor
-OrderDate=Order date
BuyingPriceMin=Best buying price
BuyingPriceMinShort=Best buying price
TotalBuyingPriceMinShort=Total of subproducts buying prices
diff --git a/htdocs/langs/en_US/website.lang b/htdocs/langs/en_US/website.lang
index 779e63b23d2..45cb1781e5c 100644
--- a/htdocs/langs/en_US/website.lang
+++ b/htdocs/langs/en_US/website.lang
@@ -157,7 +157,6 @@ Booking=Booking
Reservation=Reservation
PagesViewedPreviousMonth=Pages viewed (previous month)
PagesViewedTotal=Pages viewed (total)
-Visibility=Visibility
Everyone=Everyone
AssignedContacts=Assigned contacts
WebsiteTypeLabel=Type of Web site
@@ -170,7 +169,6 @@ ModuleWebPortalDesc=A ready to use native web portal for customers, suppliers, p
WebPortalDescription=Public web portal module for membership and partnership
WebPortalSetup=WebPortal setup
WebPortalCSS=Web portal CSS
-Settings=Settings
WebPortalSetupPage=WebPortal setup page
WEBPORTAL_TITLE=Brand name on header of public page
UserAccountForWebPortalAreInThirdPartyTabHelp=Users accounts for WebPortal can be set on each third party card in Website accounts tab
@@ -231,3 +229,9 @@ WebPortalErrorFetchLoggedThirdParty=Error when loading third-party (Id : %s)
WebPortalErrorFetchLoggedMember=Error when loading member (Id : %s)
WebPortalErrorFetchLoggedPartnership=Error when loading partnership (Third-party Id : %s, Member Id : %s)
ExportIntoGIT=Export into sources
+WebPortalMember=Membership
+WebPortalOrder=Sale Order
+WebPortalPartnership=Partnership
+WebPortalPropal=Proposal
+WebPortalGroupMenuAdmin=Administration
+WebPortalGroupMenuTechnical=System
\ No newline at end of file
diff --git a/htdocs/langs/fr_FR/donations.lang b/htdocs/langs/fr_FR/donations.lang
index 4cf3f4ca493..617877bcf73 100644
--- a/htdocs/langs/fr_FR/donations.lang
+++ b/htdocs/langs/fr_FR/donations.lang
@@ -33,8 +33,6 @@ DONATION_ART978=Afficher article 978 du CGI si vous êtes concernés
DonationPayment=Paiement du don
DonationValidated=Don %s validé
-DonationsReglement= Règlements reçus pour les dons
-
DonationUseThirdparties=Utiliser un tiers existant comme coordonnées du donateur
DonationsStatistics=Statistiques des dons
diff --git a/htdocs/loan/card.php b/htdocs/loan/card.php
index d29665eef9b..981d805e52b 100644
--- a/htdocs/loan/card.php
+++ b/htdocs/loan/card.php
@@ -291,11 +291,11 @@ if ($action == 'create') {
// Bank account
if (isModEnabled("banque")) {
- print '
'.$langs->trans("Account").'
';
+ print '
'.$langs->trans("BankAccount").'
';
$form->select_comptes(GETPOST("accountid"), "accountid", 0, "courant=1", 1); // Show list of bank account with courant
print '
';
}
diff --git a/htdocs/loan/document.php b/htdocs/loan/document.php
index 6aa24247afe..56bf59b10cc 100644
--- a/htdocs/loan/document.php
+++ b/htdocs/loan/document.php
@@ -72,7 +72,7 @@ if ($id > 0) {
$upload_dir = $conf->loan->dir_output.'/'.dol_sanitizeFileName($object->ref);
$modulepart = 'loan';
-$permissiontoadd = $user->rights->loan->write; // Used by the include of actions_addupdatedelete.inc.php and actions_linkedfiles.inc.php
+$permissiontoadd = $user->hasRight('loan', 'write'); // Used by the include of actions_addupdatedelete.inc.php and actions_linkedfiles.inc.php
/*
@@ -164,8 +164,8 @@ if ($object->id) {
print dol_get_fiche_end();
$modulepart = 'loan';
- $permissiontoadd = $user->rights->loan->write;
- $permtoedit = $user->rights->loan->write;
+ $permissiontoadd = $user->hasRight('loan', 'write');
+ $permtoedit = $user->hasRight('loan', 'write');
$param = '&id='.$object->id;
include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
} else {
diff --git a/htdocs/loan/note.php b/htdocs/loan/note.php
index 09a85f6aab0..ff5938a63c7 100644
--- a/htdocs/loan/note.php
+++ b/htdocs/loan/note.php
@@ -51,7 +51,7 @@ if ($id > 0) {
$object->fetch($id);
}
-$permissionnote = $user->rights->loan->write; // Used by the include of actions_setnotes.inc.php
+$permissionnote = $user->hasRight('loan', 'write'); // Used by the include of actions_setnotes.inc.php
/*
@@ -135,7 +135,7 @@ if ($id > 0) {
print '';
$cssclass = 'titlefield';
- $permission = $user->rights->loan->write; // Used by the include of notes.tpl.php
+ $permission = $user->hasRight('loan', 'write'); // Used by the include of notes.tpl.php
include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php';
print dol_get_fiche_end();
diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php
index f531b40b56f..a677af39f57 100644
--- a/htdocs/main.inc.php
+++ b/htdocs/main.inc.php
@@ -1790,7 +1790,7 @@ function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arr
// Displays title
$appli = constant('DOL_APPLICATION_TITLE');
if (getDolGlobalString('MAIN_APPLICATION_TITLE')) {
- $appli = $conf->global->MAIN_APPLICATION_TITLE;
+ $appli = getDolGlobalString('MAIN_APPLICATION_TITLE');
}
print '';
@@ -1858,7 +1858,7 @@ function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arr
print ''."\n";
$jquerytheme = 'base';
if (getDolGlobalString('MAIN_USE_JQUERY_THEME')) {
- $jquerytheme = $conf->global->MAIN_USE_JQUERY_THEME;
+ $jquerytheme = getDolGlobalString('MAIN_USE_JQUERY_THEME');
}
if (constant('JS_JQUERY_UI')) {
print ''."\n"; // Forced JQuery
@@ -2168,7 +2168,7 @@ function top_menu($head, $title = '', $target = '', $disablejs = 0, $disablehead
// Define link to login card
$appli = constant('DOL_APPLICATION_TITLE');
if (getDolGlobalString('MAIN_APPLICATION_TITLE')) {
- $appli = $conf->global->MAIN_APPLICATION_TITLE;
+ $appli = getDolGlobalString('MAIN_APPLICATION_TITLE');
if (preg_match('/\d\.\d/', $appli)) {
if (!preg_match('/'.preg_quote(DOL_VERSION).'/', $appli)) {
$appli .= " (".DOL_VERSION.")"; // If new title contains a version that is different than core
@@ -2525,7 +2525,7 @@ function top_menu_user($hideloginname = 0, $urllogout = '')
// Define version to show
$appli = constant('DOL_APPLICATION_TITLE');
if (getDolGlobalString('MAIN_APPLICATION_TITLE')) {
- $appli = $conf->global->MAIN_APPLICATION_TITLE;
+ $appli = getDolGlobalString('MAIN_APPLICATION_TITLE');
if (preg_match('/\d\.\d/', $appli)) {
if (!preg_match('/'.preg_quote(DOL_VERSION).'/', $appli)) {
$appli .= " (".DOL_VERSION.")"; // If new title contains a version that is different than core
@@ -3170,7 +3170,7 @@ function left_menu($menu_array_before, $helppagename = '', $notused = '', $menu_
}
$selected = -1;
if (!getDolGlobalString('MAIN_USE_TOP_MENU_SEARCH_DROPDOWN')) {
- // Select into select2 is awfull on smartphone. TODO Is this still true with select2 v4 ?
+ // Select with select2 is awful on smartphone. TODO Is this still true with select2 v4 ?
if ($conf->browser->layout == 'phone') {
$conf->global->MAIN_USE_OLD_SEARCH_FORM = 1;
}
@@ -3281,7 +3281,7 @@ function left_menu($menu_array_before, $helppagename = '', $notused = '', $menu_
$appli = constant('DOL_APPLICATION_TITLE');
if (getDolGlobalString('MAIN_APPLICATION_TITLE')) {
- $appli = $conf->global->MAIN_APPLICATION_TITLE; $doliurl = '';
+ $appli = getDolGlobalString('MAIN_APPLICATION_TITLE'); $doliurl = '';
if (preg_match('/\d\.\d/', $appli)) {
if (!preg_match('/'.preg_quote(DOL_VERSION).'/', $appli)) {
$appli .= " (".DOL_VERSION.")"; // If new title contains a version that is different than core
@@ -3347,7 +3347,7 @@ function left_menu($menu_array_before, $helppagename = '', $notused = '', $menu_
$bugbaseurl .= urlencode("\n");
$bugbaseurl .= urlencode("## Report\n");
} elseif (getDolGlobalString('MAIN_BUGTRACK_ENABLELINK')) {
- $bugbaseurl = $conf->global->MAIN_BUGTRACK_ENABLELINK;
+ $bugbaseurl = getDolGlobalString('MAIN_BUGTRACK_ENABLELINK');
} else {
$bugbaseurl = "";
}
@@ -3415,7 +3415,7 @@ function main_area($title = '')
print $hookmanager->resPrint;
if (getDolGlobalString('MAIN_ONLY_LOGIN_ALLOWED')) {
- print info_admin($langs->trans("WarningYouAreInMaintenanceMode", $conf->global->MAIN_ONLY_LOGIN_ALLOWED), 0, 0, 1, 'warning maintenancemode');
+ print info_admin($langs->trans("WarningYouAreInMaintenanceMode", getDolGlobalString('MAIN_ONLY_LOGIN_ALLOWED')), 0, 0, 1, 'warning maintenancemode');
}
// Permit to add user company information on each printed document by setting SHOW_SOCINFO_ON_PRINT
diff --git a/htdocs/modulebuilder/template/README.md b/htdocs/modulebuilder/template/README.md
index 30f081abd78..d6e49e154b7 100644
--- a/htdocs/modulebuilder/template/README.md
+++ b/htdocs/modulebuilder/template/README.md
@@ -1,4 +1,4 @@
-# MYMODULE FOR [DOLIBARR ERP CRM](https://www.dolibarr.org)
+# MYMODULE FOR [DOLIBARR ERP & CRM](https://www.dolibarr.org)
## Features
@@ -12,7 +12,7 @@ Other external modules are available on [Dolistore.com](https://www.dolistore.co
## Translations
-Translations can be completed manually by editing files into directories *langs*.
+Translations can be completed manually by editing files in the module directories under `langs`.